@beppla/tapas-ui 1.0.70 → 1.0.71
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/commonjs/Alert/Alert.js +67 -46
- package/commonjs/Alert/Alert.js.map +1 -2
- package/commonjs/AnimatedNavItem/AnimatedNavItem.js +0 -71
- package/commonjs/AnimatedNavItem/AnimatedNavItem.js.map +0 -1
- package/commonjs/AnimatedNavItem/index.js +9 -15
- package/commonjs/BarChart/BarChart.js.map +2 -1
- package/commonjs/Button/Button.js +78 -96
- package/commonjs/Button/Button.js.map +2 -1
- package/commonjs/Button/ButtonGroup.js.map +2 -1
- package/commonjs/Calendar/Calendar.base.js +190 -162
- package/commonjs/Calendar/Calendar.base.js.map +2 -1
- package/commonjs/Calendar/Calendar.js +102 -86
- package/commonjs/Calendar/Calendar.js.map +1 -2
- package/commonjs/Calendar/DaySelector.js +113 -115
- package/commonjs/Calendar/DaySelector.js.map +1 -2
- package/commonjs/Calendar/TimeSelector.js +223 -274
- package/commonjs/Calendar/WeekDaySelector.js.map +1 -2
- package/commonjs/Calendar/helper.js +68 -68
- package/commonjs/Calendar/helper.js.map +1 -2
- package/commonjs/Calendar/types.js +11 -11
- package/commonjs/Calendar/types.js.map +2 -1
- package/commonjs/Card/Card.js +158 -231
- package/commonjs/Card/Card.js.map +1 -1
- package/commonjs/CheckBox/CheckBoxItem.js +36 -86
- package/commonjs/CheckBox/CheckBoxItem.js.map +1 -1
- package/commonjs/CheckBox/GroupCheckBox.js +67 -80
- package/commonjs/CheckBox/GroupCheckBox.js.map +2 -1
- package/commonjs/DashboardCard/DashboardCard.js +94 -74
- package/commonjs/DashboardCard/DashboardCard.js.map +1 -1
- package/commonjs/DataCell/DataCell.js +235 -289
- package/commonjs/DataCell/DataCell.js.map +1 -2
- package/commonjs/DataCell/index.js.map +2 -1
- package/commonjs/DataTable/DataTable.js +144 -70
- package/commonjs/DataTable/DataTable.js.map +1 -2
- package/commonjs/DataTable/index.js.map +1 -2
- package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js +244 -242
- package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js.map +1 -1
- package/commonjs/DraggableFlatList/DraggableFlatList.js +1 -1
- package/commonjs/Dropdown/Dropdown.js +461 -493
- package/commonjs/Dropdown/Dropdown.js.map +1 -2
- package/commonjs/Dropdown/InputDropdown.js +114 -123
- package/commonjs/ExternalLink/ExternalLink.js +58 -50
- package/commonjs/ExternalLink/ExternalLink.js.map +1 -2
- package/commonjs/Gantt/helper.js.map +1 -2
- package/commonjs/Grid/Grid.base.js +401 -336
- package/commonjs/Grid/Grid.base.js.map +2 -1
- package/commonjs/Grid/VariableSizeGrid.js +113 -120
- package/commonjs/Grid/VariableSizeGrid.js.map +1 -2
- package/commonjs/Grid/helper.js +16 -11
- package/commonjs/Header/Header.js +177 -166
- package/commonjs/Header/Header.js.map +1 -2
- package/commonjs/HelloWave/HelloWave.js +53 -46
- package/commonjs/HelloWave/HelloWave.js.map +2 -1
- package/commonjs/Icons/TapasIcon.js +100 -99
- package/commonjs/Icons/TapasIcon.js.map +2 -1
- package/commonjs/Icons/TapasIconExpo.js +94 -101
- package/commonjs/Icons/smartFontLoader.js +222 -266
- package/commonjs/Icons/smartFontLoader.js.map +1 -2
- package/commonjs/Image/Image.js +106 -96
- package/commonjs/Image/Image.js.map +1 -2
- package/commonjs/Image/PreviewImg.js.map +2 -1
- package/commonjs/Layout/DrawerContext.js +35 -49
- package/commonjs/Layout/DrawerContext.js.map +2 -1
- package/commonjs/Layout/Layout.js.map +1 -2
- package/commonjs/Layout/ToastContext.js +46 -34
- package/commonjs/Layout/ToastContext.js.map +1 -2
- package/commonjs/Layout/index.js +38 -34
- package/commonjs/Layout/index.js.map +1 -2
- package/commonjs/LineChart/index.js +3 -4
- package/commonjs/ListItem/ListItem.js +108 -80
- package/commonjs/ListItem/ListItem.js.map +1 -2
- package/commonjs/MultiSelector/MultiSelector.js +225 -250
- package/commonjs/MultiSelector/MultiSelector.js.map +1 -2
- package/commonjs/Navigation/Navigation.js +117 -114
- package/commonjs/Navigation/Navigation.js.map +1 -2
- package/commonjs/Notification/Notification.js +66 -135
- package/commonjs/Notification/Notification.js.map +1 -1
- package/commonjs/Notification/index.js.map +1 -2
- package/commonjs/NumericInput/NumericInput.js +85 -71
- package/commonjs/NumericInput/NumericInput.js.map +1 -2
- package/commonjs/Overlay/Overlay.js +45 -24
- package/commonjs/Overlay/Overlay.js.map +1 -1
- package/commonjs/Popover/Popover.js +137 -112
- package/commonjs/Popover/Popover.js.map +2 -1
- package/commonjs/Progress/Progress.js +48 -54
- package/commonjs/Progress/Progress.js.map +2 -1
- package/commonjs/Quantity/Quantity.js +70 -0
- package/commonjs/Quantity/Quantity.js.map +1 -0
- package/commonjs/RadioButton/RadioButton.js +94 -46
- package/commonjs/RadioButton/RadioButton.js.map +1 -1
- package/commonjs/ReasonModal/index.js +14 -9
- package/commonjs/ReasonModal/index.js.map +2 -1
- package/commonjs/SheetTitle/SheetTitle.js +34 -31
- package/commonjs/SheetTitle/SheetTitle.js.map +1 -1
- package/commonjs/Shell/Shell.js +92 -84
- package/commonjs/Shell/Shell.js.map +1 -2
- package/commonjs/Shell/styles.js +3 -3
- package/commonjs/Shell/styles.js.map +2 -1
- package/commonjs/Shell/types.js.map +2 -1
- package/commonjs/StatisticCard/StatisticCard.js +47 -41
- package/commonjs/Status/Status.js +35 -31
- package/commonjs/Status/Status.js.map +2 -1
- package/commonjs/Steps/Steps.js +40 -41
- package/commonjs/Steps/Steps.js.map +1 -1
- package/commonjs/TabTitle/TabTitle.js +54 -48
- package/commonjs/TabTitle/index.js +1 -0
- package/commonjs/TabTitle/index.js.map +1 -0
- package/commonjs/Tag/Tag.js +88 -34
- package/commonjs/Tag/Tag.js.map +1 -1
- package/commonjs/Task/Task.js +112 -201
- package/commonjs/Task/Task.js.map +1 -2
- package/commonjs/Task/type.js +4 -4
- package/commonjs/Text/Text.js +96 -56
- package/commonjs/Text/Text.js.map +1 -1
- package/commonjs/Theme/ThemeProvider.js +16 -18
- package/commonjs/Timeline/Timeline.js +0 -23
- package/commonjs/Timeline/Timeline.js.map +0 -1
- package/commonjs/Toast/Toast.js +83 -62
- package/commonjs/Toast/Toast.js.map +1 -2
- package/commonjs/UserSwitcher/index.js +8 -14
- package/commonjs/UserSwitcher/index.js.map +1 -2
- package/commonjs/common.js +5 -4
- package/commonjs/common.js.map +2 -1
- package/commonjs/index.js +336 -426
- package/module/AnimatedNavItem/AnimatedNavItem.js +124 -159
- package/module/AnimatedNavItem/index.js +3 -7
- package/module/AnimatedNavItem/index.js.map +2 -1
- package/module/BarChart/index.js.map +1 -2
- package/module/Button/Button.js +71 -80
- package/module/Button/Button.js.map +2 -1
- package/module/Button/ButtonGroup.js +129 -120
- package/module/Button/ButtonGroup.js.map +2 -1
- package/module/Calendar/Calendar.base.js +226 -149
- package/module/Calendar/Calendar.base.js.map +2 -1
- package/module/Calendar/Calendar.js +76 -80
- package/module/Calendar/Calendar.js.map +1 -2
- package/module/Calendar/ConcreteTimeSelector.js.map +1 -2
- package/module/Calendar/CustomRange.js.map +2 -1
- package/module/Calendar/DaySelector.js +95 -118
- package/module/Calendar/TimeSelector.js.map +2 -1
- package/module/Calendar/WeekDaySelector.js.map +1 -2
- package/module/Calendar/helper.js +74 -74
- package/module/Calendar/helper.js.map +2 -1
- package/module/Calendar/local.js +7 -7
- package/module/Calendar/local.js.map +1 -2
- package/module/Calendar/types.js +13 -13
- package/module/CheckBox/CheckBox.js +93 -89
- package/module/CheckBox/CheckBox.js.map +1 -2
- package/module/CheckBox/CheckBoxItem.js +69 -84
- package/module/CheckBox/CheckBoxItem.js.map +1 -1
- package/module/CheckBox/GroupCheckBox.js +66 -76
- package/module/CheckBox/GroupCheckBox.js.map +1 -2
- package/module/CircularProgress/CircularProgress.js +22 -0
- package/module/CircularProgress/CircularProgress.js.map +1 -0
- package/module/Collapsible/Collapsible.js +54 -64
- package/module/Collapsible/Collapsible.js.map +1 -2
- package/module/DataCell/DataCell.js +311 -224
- package/module/DataCell/index.js +4 -3
- package/module/DataCell/index.js.map +1 -2
- package/module/DataTable/index.js +2 -4
- package/module/DataTable/index.js.map +2 -1
- package/module/DeviceSelectionModal/DeviceSelectionModal.js +178 -241
- package/module/DeviceSelectionModal/DeviceSelectionModal.js.map +1 -2
- package/module/DraggableFlatList/DraggableFlatList.js +0 -9
- package/module/DraggableFlatList/DraggableFlatList.js.map +0 -1
- package/module/Drawer/Drawer.js +167 -139
- package/module/Drawer/Drawer.js.map +2 -1
- package/module/Dropdown/CustomDropdown.js +56 -0
- package/module/Dropdown/CustomDropdown.js.map +1 -0
- package/module/Dropdown/InputDropdown.js +116 -134
- package/module/Dropdown/InputDropdown.js.map +1 -2
- package/module/ExternalLink/ExternalLink.js +150 -0
- package/module/ExternalLink/ExternalLink.js.map +1 -0
- package/module/Gantt/Accessories.js +183 -124
- package/module/Gantt/Gantt.js +139 -152
- package/module/Gantt/Gantt.js.map +1 -2
- package/module/Gantt/types.js +4 -8
- package/module/Gantt/types.js.map +2 -1
- package/module/Grid/FixedSizeGrid.js +86 -80
- package/module/Grid/FixedSizeGrid.js.map +2 -1
- package/module/Grid/Grid.base.js +401 -339
- package/module/Grid/Grid.base.js.map +2 -1
- package/module/Grid/StaticFixedSizeGrid.js +192 -255
- package/module/Grid/VariableSizeGrid.js +121 -118
- package/module/Grid/VariableSizeGrid.js.map +2 -1
- package/module/Grid/helper.js.map +1 -2
- package/module/Grid/timer.js +14 -16
- package/module/Grid/timer.js.map +2 -1
- package/module/Header/Header.js +167 -183
- package/module/Header/Header.js.map +1 -2
- package/module/IconText/IconText.js +63 -88
- package/module/IconText/IconText.js.map +1 -2
- package/module/Icons/TapasIcon.js +120 -96
- package/module/Icons/TapasIcon.js.map +2 -1
- package/module/Icons/TapasIconExpo.js +78 -98
- package/module/Icons/TapasIconExpo.js.map +1 -2
- package/module/Icons/fontLoader.js +213 -182
- package/module/Icons/index.js +9 -10
- package/module/Icons/smartFontLoader.js.map +1 -2
- package/module/Layout/Layout.js +100 -100
- package/module/Layout/ToastContext.js +27 -15
- package/module/Layout/ToastContext.js.map +2 -1
- package/module/Layout/index.js.map +1 -2
- package/module/LineChart/LineChart.js +121 -157
- package/module/LineChart/LineChart.js.map +2 -1
- package/module/MultiSelector/MultiSelector.js.map +1 -2
- package/module/Notification/Notification.js +101 -105
- package/module/Notification/Notification.js.map +1 -2
- package/module/Notification/index.js +2 -3
- package/module/Notification/index.js.map +2 -1
- package/module/NumericInput/NumericInput.js +0 -54
- package/module/Pagination/Pagination.js +72 -0
- package/module/Pagination/Pagination.js.map +1 -0
- package/module/PieChart/PieChart.js +76 -101
- package/module/PieChart/index.js.map +0 -1
- package/module/Popover/Popover.js +97 -125
- package/module/Popover/Popover.js.map +1 -1
- package/module/Progress/Progress.js +51 -57
- package/module/Progress/Progress.js.map +1 -2
- package/module/Quantity/Quantity.js +112 -129
- package/module/Quantity/Quantity.js.map +1 -2
- package/module/Quantity/index.js +3 -2
- package/module/Quantity/index.js.map +1 -2
- package/module/ReasonModal/ReasonModal.js.map +2 -1
- package/module/ReasonModal/index.js +5 -3
- package/module/ReasonModal/index.js.map +1 -2
- package/module/ScanButton/ScanButton.js +77 -53
- package/module/ScanButton/ScanButton.js.map +2 -1
- package/module/SearchInput/SearchInput.js +83 -93
- package/module/SearchInput/SearchInput.js.map +1 -2
- package/module/SheetTitle/SheetTitle.js +29 -39
- package/module/SheetTitle/SheetTitle.js.map +2 -1
- package/module/Shell/Shell.js +92 -79
- package/module/Shell/Shell.js.map +2 -1
- package/module/Shell/styles.js +8 -8
- package/module/Shell/styles.js.map +2 -1
- package/module/Shell/types.js +4 -2
- package/module/Shell/types.js.map +1 -2
- package/module/StatisticCard/StatisticCard.js +48 -79
- package/module/StatisticCard/StatisticCard.js.map +1 -2
- package/module/Status/Status.js.map +0 -1
- package/module/Steps/Steps.js +36 -41
- package/module/Steps/Steps.js.map +1 -2
- package/module/TabTitle/TabTitle.js.map +2 -1
- package/module/TableColumnHeader/TableColumnHeader.js +126 -153
- package/module/TableColumnHeader/index.js +8 -3
- package/module/TableColumnHeader/index.js.map +1 -2
- package/module/Tag/Tag.js +72 -87
- package/module/Tag/Tag.js.map +1 -2
- package/module/Task/Task.js +207 -113
- package/module/Task/Task.js.map +2 -1
- package/module/Task/type.js +8 -4
- package/module/Task/type.js.map +2 -1
- package/module/Text/Text.js +70 -80
- package/module/Text/Text.js.map +2 -1
- package/module/Theme/ThemeProvider.js.map +1 -2
- package/module/Toast/Toast.js +66 -77
- package/module/Toast/Toast.js.map +1 -2
- package/module/UserSwitcher/UserSwitcher.js +130 -171
- package/module/UserSwitcher/UserSwitcher.js.map +1 -2
- package/module/index.js +120 -131
- package/module/index.js.map +2 -1
- package/package.json +1 -1
|
@@ -1,42 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, Text, Pressable } from "react-native";
|
|
3
|
+
import { DateUnit } from "./types";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { GanttContext } from "./Gantt";
|
|
6
|
+
import { Avatar } from "@rneui/themed";
|
|
7
|
+
import { calculateItemWidth, calculateTimeOffsetForTimeLine, calculateTimeOffsetInCell, defaultColumnHeaderHeight, defaultColumnWidth, defaultRowHeight, generateColumnTitle } from "./helper";
|
|
2
8
|
|
|
3
|
-
var __assign = this && this.__assign || function () {
|
|
4
|
-
__assign = Object.assign || function (t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
14
|
-
return mod && mod.__esModule ? mod : {
|
|
15
|
-
"default": mod
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", {
|
|
19
|
-
value: true
|
|
20
|
-
});
|
|
21
|
-
exports.TimeLineText = exports.Timeline = exports.GanttCellRender = exports.ColumnHeaderCellRnder = exports.ColumnHeaderCon = exports.GanttItemWrapper = exports.useGanttContext = void 0;
|
|
22
|
-
var react_1 = __importDefault(require("react"));
|
|
23
|
-
var react_native_1 = require("react-native");
|
|
24
|
-
var types_1 = require("./types");
|
|
25
|
-
var react_2 = require("react");
|
|
26
|
-
var Gantt_1 = require("./Gantt");
|
|
27
|
-
var themed_1 = require("@rneui/themed");
|
|
28
|
-
var helper_1 = require("./helper");
|
|
29
9
|
/**
|
|
30
10
|
* 甘特Context
|
|
31
11
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
12
|
+
export const useGanttContext = () => {
|
|
13
|
+
const context = useContext(GanttContext);
|
|
34
14
|
if (!context) {
|
|
35
15
|
throw new Error("useGanttContext must be used within a GanttProvider");
|
|
36
16
|
}
|
|
37
17
|
return context;
|
|
38
18
|
};
|
|
39
|
-
|
|
19
|
+
|
|
40
20
|
/**
|
|
41
21
|
* 甘特Grid中的单元格容器模板
|
|
42
22
|
* @param data - 附带循环模板数据
|
|
@@ -44,17 +24,19 @@ exports.useGanttContext = useGanttContext;
|
|
|
44
24
|
* @param rowIndex - 行索引
|
|
45
25
|
* @param style - 模板样式(含模板在grid中对左,对上坐标)
|
|
46
26
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
27
|
+
export const GanttItemWrapper = ({
|
|
28
|
+
data,
|
|
29
|
+
columnIndex,
|
|
30
|
+
rowIndex,
|
|
31
|
+
style
|
|
32
|
+
}) => {
|
|
33
|
+
const {
|
|
34
|
+
ItemRenderer,
|
|
35
|
+
cardRender,
|
|
36
|
+
rangeVal,
|
|
37
|
+
attachPressCard
|
|
38
|
+
} = data;
|
|
39
|
+
return /*#__PURE__*/React.createElement(ItemRenderer, {
|
|
58
40
|
columnIndex: columnIndex,
|
|
59
41
|
rowIndex: rowIndex,
|
|
60
42
|
rowHeight: data.rowHeight,
|
|
@@ -68,27 +50,27 @@ var GanttItemWrapper = function (_a) {
|
|
|
68
50
|
startDate: data.startDate,
|
|
69
51
|
endDate: data.endDate,
|
|
70
52
|
unit: data.unit,
|
|
71
|
-
style:
|
|
53
|
+
style: {
|
|
54
|
+
...style,
|
|
72
55
|
overflow: "hidden",
|
|
73
|
-
top: style.top + (data.headersRender ?
|
|
74
|
-
}
|
|
56
|
+
top: style.top + (data.headersRender ? data.columnHeaderHeight ?? defaultColumnHeaderHeight : 0)
|
|
57
|
+
}
|
|
75
58
|
});
|
|
76
59
|
};
|
|
77
|
-
|
|
60
|
+
|
|
78
61
|
/**
|
|
79
62
|
* 列头模板容器
|
|
80
63
|
* @param children - 子元素
|
|
81
64
|
* @param style - 模板样式(含模板在grid中对左,对上坐标)
|
|
82
65
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
exports.ColumnHeaderCon = ColumnHeaderCon;
|
|
66
|
+
export const ColumnHeaderCon = ({
|
|
67
|
+
style,
|
|
68
|
+
children
|
|
69
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "sticky",
|
|
71
|
+
style: style
|
|
72
|
+
}, children);
|
|
73
|
+
|
|
92
74
|
/**
|
|
93
75
|
* 列头单元格模板
|
|
94
76
|
* @param theme - 皮肤主题
|
|
@@ -96,91 +78,168 @@ exports.ColumnHeaderCon = ColumnHeaderCon;
|
|
|
96
78
|
* @param rowIndex - 行索引
|
|
97
79
|
* @param style - 模板样式(含模板在grid中对左,对上坐标)
|
|
98
80
|
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
columnWidth: columnWidth
|
|
135
|
-
}));
|
|
136
|
-
};
|
|
137
|
-
exports.ColumnHeaderCellRnder = ColumnHeaderCellRnder;
|
|
81
|
+
export const ColumnHeaderCellRnder = ({
|
|
82
|
+
columnIndex,
|
|
83
|
+
curColumnIndex,
|
|
84
|
+
curColumnText,
|
|
85
|
+
currentTime = new Date(),
|
|
86
|
+
columnWidth = 165,
|
|
87
|
+
startDate,
|
|
88
|
+
unit = DateUnit.HELF,
|
|
89
|
+
style,
|
|
90
|
+
theme
|
|
91
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "column-headers",
|
|
93
|
+
style: {
|
|
94
|
+
...style,
|
|
95
|
+
overflow: "visible"
|
|
96
|
+
}
|
|
97
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
98
|
+
style: {
|
|
99
|
+
position: "absolute",
|
|
100
|
+
left: columnIndex === 0 ? 0 : -20,
|
|
101
|
+
width: 40,
|
|
102
|
+
textAlign: "center",
|
|
103
|
+
fontSize: theme?.fonts.sizeS ?? 12,
|
|
104
|
+
lineHeight: "24px",
|
|
105
|
+
fontWeight: 400,
|
|
106
|
+
color: theme?.colorTextPlaceholder ?? "rgba(0,0,0,.26)"
|
|
107
|
+
}
|
|
108
|
+
}, columnIndex !== undefined && startDate ? generateColumnTitle(unit, columnIndex, startDate) : "N/A"), curColumnIndex === columnIndex && /*#__PURE__*/React.createElement(TimeLineText, {
|
|
109
|
+
theme: theme,
|
|
110
|
+
text: curColumnText ?? "N/A",
|
|
111
|
+
date: currentTime,
|
|
112
|
+
unit: unit,
|
|
113
|
+
columnWidth: columnWidth
|
|
114
|
+
}));
|
|
115
|
+
|
|
138
116
|
/**
|
|
139
117
|
* 甘特Grid单元格模板(无内容只是背景占位)
|
|
140
118
|
* @param style - 模板样式(含模板在grid中对左,对上坐标)
|
|
141
119
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
ItemRenderer = _a.ItemRenderer;
|
|
160
|
-
var renderItem = false;
|
|
161
|
-
var itemInfo;
|
|
162
|
-
var itemLeft = 0;
|
|
163
|
-
var itemWidth = 0;
|
|
120
|
+
export const GanttCellRender = ({
|
|
121
|
+
style,
|
|
122
|
+
curColumnIndex,
|
|
123
|
+
columnIndex = -1,
|
|
124
|
+
rowIndex = -1,
|
|
125
|
+
columnWidth = defaultColumnWidth,
|
|
126
|
+
rowHeight = defaultRowHeight,
|
|
127
|
+
theme,
|
|
128
|
+
rangeVal,
|
|
129
|
+
attachPressCard,
|
|
130
|
+
unit = DateUnit.HELF,
|
|
131
|
+
ItemRenderer
|
|
132
|
+
}) => {
|
|
133
|
+
let renderItem = false;
|
|
134
|
+
let itemInfo;
|
|
135
|
+
let itemLeft = 0;
|
|
136
|
+
let itemWidth = 0;
|
|
164
137
|
if (ItemRenderer) {
|
|
165
|
-
|
|
138
|
+
const {
|
|
139
|
+
gridDataMap
|
|
140
|
+
} = useGanttContext();
|
|
166
141
|
if (rowIndex >= 0 && columnIndex >= 0) {
|
|
167
|
-
itemInfo =
|
|
142
|
+
itemInfo = gridDataMap.get(rowIndex)?.get(columnIndex);
|
|
168
143
|
if (itemInfo) {
|
|
169
144
|
renderItem = true;
|
|
170
|
-
itemLeft =
|
|
171
|
-
itemWidth =
|
|
145
|
+
itemLeft = calculateTimeOffsetInCell(unit, columnWidth, itemInfo.startTime);
|
|
146
|
+
itemWidth = calculateItemWidth(unit, columnWidth, itemInfo.startTime, itemInfo.endTime);
|
|
172
147
|
}
|
|
173
148
|
}
|
|
174
149
|
}
|
|
175
|
-
|
|
176
|
-
return
|
|
177
|
-
key:
|
|
178
|
-
style:
|
|
150
|
+
const goRenderCard = ItemRenderer && renderItem && itemInfo && (rangeVal && (!rangeVal[0] || itemInfo.startTime >= rangeVal[0]) && (!rangeVal[1] || itemInfo.endTime <= rangeVal[1]) || !rangeVal);
|
|
151
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
key: `Gantt-cell-${rowIndex}-${columnIndex}`,
|
|
153
|
+
style: {
|
|
154
|
+
...style,
|
|
179
155
|
display: "flex",
|
|
180
156
|
whiteSpace: "nowrap",
|
|
181
157
|
borderLeft: "1px solid rgba(0, 0, 0, 0.12)",
|
|
182
158
|
overflow: "visible",
|
|
183
|
-
backgroundColor: (columnIndex
|
|
159
|
+
backgroundColor: (columnIndex ?? 0) < (curColumnIndex ?? 0) ? theme?.grey5 ?? "rgba(0, 0, 0, 0.04)" : "initial"
|
|
160
|
+
}
|
|
161
|
+
}, goRenderCard && itemInfo && /*#__PURE__*/React.createElement(Pressable, {
|
|
162
|
+
style: {
|
|
163
|
+
position: "absolute",
|
|
164
|
+
display: "flex",
|
|
165
|
+
flexDirection: "column",
|
|
166
|
+
left: itemLeft,
|
|
167
|
+
width: itemWidth || 0,
|
|
168
|
+
height: rowHeight - 8,
|
|
169
|
+
overflow: "hidden",
|
|
170
|
+
zIndex: 2
|
|
171
|
+
},
|
|
172
|
+
key: `Gantt-cell-inner-${rowIndex}-${columnIndex}`,
|
|
173
|
+
onPress: () => attachPressCard?.({
|
|
174
|
+
columnIndex,
|
|
175
|
+
rowIndex,
|
|
176
|
+
dataIndex: itemInfo.taskIndex
|
|
177
|
+
})
|
|
178
|
+
}, /*#__PURE__*/React.createElement(ItemRenderer, {
|
|
179
|
+
columnIndex: columnIndex,
|
|
180
|
+
rowIndex: rowIndex,
|
|
181
|
+
dataIndex: itemInfo.taskIndex
|
|
182
|
+
})));
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* 甘特Grid根据最小时间单位显示的当前时间线
|
|
187
|
+
* @param text - 时间线具体值
|
|
188
|
+
* @param style - 样式
|
|
189
|
+
* @param theme - 皮肤主题
|
|
190
|
+
*/
|
|
191
|
+
export const Timeline = /*#__PURE__*/React.forwardRef(({
|
|
192
|
+
style
|
|
193
|
+
}, ref) => {
|
|
194
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
195
|
+
style: style,
|
|
196
|
+
ref: ref
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 甘特Grid根据最小时间单位显示的当前时间线 显示的文本组件 (含在列头)
|
|
202
|
+
* @param text - 时间线具体值
|
|
203
|
+
* @param unit - 当前时间最小单位
|
|
204
|
+
* @param date - 当前时间
|
|
205
|
+
* @param columnWidth - 列宽
|
|
206
|
+
* @param theme - 皮肤主题
|
|
207
|
+
*/
|
|
208
|
+
export const TimeLineText = ({
|
|
209
|
+
theme,
|
|
210
|
+
text,
|
|
211
|
+
unit,
|
|
212
|
+
date,
|
|
213
|
+
columnWidth
|
|
214
|
+
}) => /*#__PURE__*/React.createElement(View, {
|
|
215
|
+
style: {
|
|
216
|
+
position: "absolute",
|
|
217
|
+
display: "flex",
|
|
218
|
+
flexDirection: "column",
|
|
219
|
+
width: 40,
|
|
220
|
+
height: 24,
|
|
221
|
+
bottom: -2.25,
|
|
222
|
+
left: calculateTimeOffsetForTimeLine(unit, columnWidth, date) - 20
|
|
223
|
+
}
|
|
224
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
225
|
+
style: {
|
|
226
|
+
color: theme?.colorTextAccent ?? "#F55523",
|
|
227
|
+
fontSize: 12,
|
|
228
|
+
width: 40,
|
|
229
|
+
height: 18,
|
|
230
|
+
lineHeight: 18,
|
|
231
|
+
fontWeight: "bold",
|
|
232
|
+
textAlign: "center"
|
|
233
|
+
}
|
|
234
|
+
}, text), /*#__PURE__*/React.createElement(Avatar, {
|
|
235
|
+
size: 7,
|
|
236
|
+
rounded: true,
|
|
237
|
+
containerStyle: {
|
|
238
|
+
alignSelf: "center",
|
|
239
|
+
backgroundColor: theme?.colorTextAccent ?? "#F55523"
|
|
240
|
+
}
|
|
241
|
+
}));
|
|
242
|
+
//# sourceMappingURL=Accessories.js.mapurColumnIndex !== null && curColumnIndex !== void 0 ? curColumnIndex : 0) ? (_c = theme === null || theme === void 0 ? void 0 : theme.grey5) !== null && _c !== void 0 ? _c : "rgba(0, 0, 0, 0.04)" : "initial"
|
|
184
243
|
})
|
|
185
244
|
}, goRenderCard && itemInfo && react_1.default.createElement(react_native_1.Pressable, {
|
|
186
245
|
style: {
|
package/module/Gantt/Gantt.js
CHANGED
|
@@ -1,159 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { createContext, useRef, useMemo, useCallback, useEffect, useState } from "react";
|
|
3
|
-
import { withTheme } from "@rneui/themed";
|
|
4
|
-
import VariableSizeGrid from "../Grid/VariableSizeGrid";
|
|
5
|
-
import { DateUnit } from "./types";
|
|
6
|
-
import { calculateCurrentColumnIndex, calculateRoundedColumnCount, calculateTotalRows, defaultColumnHeaderHeight, defaultColumnWidth, defaultRowHeight, getDefualtDateTimeRange, scrollToCurrentTime } from "./helper";
|
|
7
|
-
import { ColumnHeaderCon, GanttCellRender, GanttItemWrapper } from "./Accessories";
|
|
8
|
-
import InnerElementType from "./GanttInnerElementType";
|
|
9
|
-
const GanttContext = /*#__PURE__*/createContext(undefined);
|
|
10
|
-
GanttContext.displayName = "GanttContext";
|
|
11
|
-
export { GanttContext };
|
|
12
|
-
const Gantt = ({
|
|
13
|
-
children,
|
|
14
|
-
data,
|
|
15
|
-
style,
|
|
16
|
-
columnWidth: columnWidthSet,
|
|
17
|
-
columnHeaderHeight = defaultColumnHeaderHeight,
|
|
18
|
-
columnHeaderBackgroundColor,
|
|
19
|
-
columnHeaderBorder,
|
|
20
|
-
rowHeight: rowHeightSet,
|
|
21
|
-
range,
|
|
22
|
-
attachPressCard,
|
|
23
|
-
attachSwitchDay,
|
|
24
|
-
unit,
|
|
25
|
-
...rest
|
|
26
|
-
}) => {
|
|
27
|
-
const [scrollLeft, setScrollLeft] = useState(0);
|
|
28
|
-
const gridRef = useRef(null);
|
|
29
|
-
const headerRef = useRef(null);
|
|
30
|
-
const timeLineRef = useRef(null);
|
|
31
|
-
const rowHeight = rowHeightSet ? rowHeightSet + 8 : defaultRowHeight;
|
|
32
|
-
const columnWidth = columnWidthSet ?? defaultColumnWidth;
|
|
33
|
-
const rangeVal = range?.map(str => new Date(str)) ?? getDefualtDateTimeRange();
|
|
34
|
-
const {
|
|
35
|
-
roundedColumnCount: columnCount,
|
|
36
|
-
startDate,
|
|
37
|
-
endDate
|
|
38
|
-
} = calculateRoundedColumnCount(rangeVal, unit ?? DateUnit.HELF);
|
|
39
|
-
const {
|
|
40
|
-
totalRows: rowCount,
|
|
41
|
-
gridData
|
|
42
|
-
} = calculateTotalRows(unit ?? DateUnit.HELF, data, Math.ceil(rest.height / rowHeight), rangeVal);
|
|
43
|
-
const now = data?.[0]?.now ? new Date(data?.[0]?.now) : new Date();
|
|
44
|
-
const [curDate, setCurDate] = useState();
|
|
45
|
-
const [rangeStart, rangeEnd] = rangeVal;
|
|
46
|
-
const curColumnIndex = calculateCurrentColumnIndex(unit ?? DateUnit.HELF, rangeVal, now >= rangeStart && now <= rangeEnd ? now : new Date(`${rangeStart.getFullYear()}-${`${rangeStart.getMonth() + 1}`.padStart(2, "0")}-${`${rangeStart.getDate()}`.padStart(2, "0")}T${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`));
|
|
47
|
-
const contextValue = useMemo(() => ({
|
|
48
|
-
ItemRenderer: children,
|
|
49
|
-
headerRef,
|
|
50
|
-
gridRef,
|
|
51
|
-
timeLineRef,
|
|
52
|
-
columnHeaderHeight,
|
|
53
|
-
columnHeaderBackgroundColor,
|
|
54
|
-
headersRender: ColumnHeaderCon,
|
|
55
|
-
columnHeaderBorder,
|
|
56
|
-
columnWidth,
|
|
57
|
-
width: rest.width || 0,
|
|
58
|
-
height: rest.height,
|
|
59
|
-
startDate,
|
|
60
|
-
endDate,
|
|
61
|
-
rangeVal,
|
|
62
|
-
gridDataMap: gridData,
|
|
63
|
-
columnCount,
|
|
64
|
-
rowHeight,
|
|
65
|
-
rowCount,
|
|
66
|
-
now: data?.[0]?.now ? new Date(data?.[0]?.now) : new Date(),
|
|
67
|
-
theme: rest.theme
|
|
68
|
-
}), [children, ColumnHeaderCon, columnHeaderBorder, columnWidth, rest.width, rowHeight, rest.theme]);
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (curDate) {
|
|
71
|
-
attachSwitchDay?.(curDate);
|
|
72
|
-
}
|
|
73
|
-
}, [curDate]);
|
|
74
|
-
|
|
75
|
-
// 同步header与主体grid的scroll状态
|
|
76
|
-
const handleScroll = useCallback(event => {
|
|
77
|
-
if (scrollLeft !== event.scrollLeft) {
|
|
78
|
-
headerRef.current?.scrollTo(event);
|
|
79
|
-
}
|
|
80
|
-
setScrollLeft(event.scrollLeft);
|
|
81
|
-
|
|
82
|
-
// 计算当前显示屏据中位置列索引
|
|
83
|
-
const middlePosition = scrollLeft + rest.width / 2;
|
|
84
|
-
const columnWidth = columnWidthSet ?? defaultColumnWidth;
|
|
85
|
-
const columnIndex = Math.floor(middlePosition / columnWidth);
|
|
86
|
-
// 根据列索引计算列对应时间
|
|
87
|
-
const date = new Date(startDate.getTime() + columnIndex * (unit ?? DateUnit.HELF));
|
|
88
|
-
const dateVal = new Date(`${date.getFullYear()}-${`${date.getMonth() + 1}`.padStart(2, "0")}-${`${date.getDate()}`.padStart(2, "0")}`);
|
|
89
|
-
// 如果产生天,月,年变化触发日期切换
|
|
90
|
-
if (curDate && (curDate.getFullYear() !== dateVal.getFullYear() || curDate.getMonth() !== dateVal.getMonth() || curDate.getDate() !== dateVal.getDate())) {
|
|
91
|
-
setCurDate(dateVal);
|
|
92
|
-
}
|
|
93
|
-
}, [scrollLeft, unit]);
|
|
1
|
+
"use strict";
|
|
94
2
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (!curDate) {
|
|
101
|
-
setCurDate(new Date(`${date.getFullYear()}-${`${date.getMonth() + 1}`.padStart(2, "0")}-${`${date.getDate()}`.padStart(2, "0")}`));
|
|
3
|
+
var __assign = this && this.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
102
8
|
}
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return m[k];
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
Object.defineProperty(o, k2, desc);
|
|
25
|
+
} : function (o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
});
|
|
29
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
value: v
|
|
33
|
+
});
|
|
34
|
+
} : function (o, v) {
|
|
35
|
+
o["default"] = v;
|
|
36
|
+
});
|
|
37
|
+
var __importStar = this && this.__importStar || function () {
|
|
38
|
+
var ownKeys = function (o) {
|
|
39
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
+
var ar = [];
|
|
41
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
return ownKeys(o);
|
|
45
|
+
};
|
|
46
|
+
return function (mod) {
|
|
47
|
+
if (mod && mod.__esModule) return mod;
|
|
48
|
+
var result = {};
|
|
49
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
+
__setModuleDefault(result, mod);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
}();
|
|
54
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
55
|
+
var t = {};
|
|
56
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
57
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
58
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
59
|
+
}
|
|
60
|
+
return t;
|
|
61
|
+
};
|
|
62
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
63
|
+
return mod && mod.__esModule ? mod : {
|
|
64
|
+
"default": mod
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
Object.defineProperty(exports, "__esModule", {
|
|
68
|
+
value: true
|
|
69
|
+
});
|
|
70
|
+
exports.GanttContext = void 0;
|
|
71
|
+
var react_1 = __importStar(require("react"));
|
|
72
|
+
var themed_1 = require("@rneui/themed");
|
|
73
|
+
var VariableSizeGrid_1 = __importDefault(require("../Grid/VariableSizeGrid"));
|
|
74
|
+
var types_1 = require("./types");
|
|
75
|
+
var helper_1 = require("./helper");
|
|
76
|
+
var Accessories_1 = require("./Accessories");
|
|
77
|
+
var GanttInnerElementType_1 = __importDefault(require("./GanttInnerElementType"));
|
|
78
|
+
var GanttContext = (0, react_1.createContext)(undefined);
|
|
79
|
+
exports.GanttContext = GanttContext;
|
|
80
|
+
GanttContext.displayName = "GanttContext";
|
|
81
|
+
var Gantt = function (_a) {
|
|
82
|
+
var _b, _c, _d, _e, _f;
|
|
83
|
+
var children = _a.children,
|
|
84
|
+
data = _a.data,
|
|
85
|
+
style = _a.style,
|
|
86
|
+
columnWidthSet = _a.columnWidth,
|
|
87
|
+
_g = _a.columnHeaderHeight,
|
|
88
|
+
columnHeaderHeight = _g === void 0 ? helper_1.defaultColumnHeaderHeight : _g,
|
|
89
|
+
columnHeaderBackgroundColor = _a.columnHeaderBackgroundColor,
|
|
90
|
+
columnHeaderBorder = _a.columnHeaderBorder,
|
|
91
|
+
rowHeightSet = _a.rowHeight,
|
|
92
|
+
range = _a.range,
|
|
93
|
+
attachPressCard = _a.attachPressCard,
|
|
94
|
+
attachSwitchDay = _a.attachSwitchDay,
|
|
95
|
+
unit = _a.unit,
|
|
96
|
+
rest = __rest(_a, ["children", "data", "style", "columnWidth", "columnHeaderHeight", "columnHeaderBackgroundColor", "columnHeaderBorder", "rowHeight", "range", "attachPressCard", "attachSwitchDay", "unit"]);
|
|
97
|
+
var _h = (0, react_1.useState)(0),
|
|
98
|
+
scrollLeft = _h[0],
|
|
99
|
+
setScrollLeft = _h[1];
|
|
100
|
+
var gridRef = (0, react_1.useRef)(null);
|
|
101
|
+
var headerRef = (0, react_1.useRef)(null);
|
|
102
|
+
var timeLineRef = (0, react_1.useRef)(null);
|
|
103
|
+
var rowHeight = rowHeightSet ? rowHeightSet + 8 : helper_1.defaultRowHeight;
|
|
104
|
+
var columnWidth = columnWidthSet !== null && columnWidthSet !== void 0 ? columnWidthSet : helper_1.defaultColumnWidth;
|
|
105
|
+
var rangeVal = (_b = range === null || range === void 0 ? void 0 : range.map(function (str) {
|
|
106
|
+
return new Date(str);
|
|
107
|
+
})) !== null && _b !== void 0 ? _b : (0, helper_1.getDefualtDateTimeRange)();
|
|
108
|
+
var _j = (0, helper_1.calculateRoundedColumnCount)(rangeVal, unit !== null && unit !== void 0 ? unit : types_1.DateUnit.HELF),
|
|
109
|
+
columnCount = _j.roundedColumnCount,
|
|
110
|
+
startDate = _j.startDate,
|
|
111
|
+
endDate = _j.endDate;
|
|
112
|
+
var _k = (0, helper_1.calculateTotalRows)(unit !== null && unit !== void 0 ? unit : types_1.DateUnit.HELF, data, Math.ceil(rest.height / rowHeight), rangeVal),
|
|
113
|
+
rowCount = _k.totalRows,
|
|
114
|
+
gridData = _k.gridData;
|
|
115
|
+
var now = ((_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.now) ? new Date((_d = data === null || data === void 0 ? void 0 : data[0]) === null || _d === void 0 ? void 0 : _d.now) : new Date();
|
|
116
|
+
var _l = (0, react_1.useState)(),
|
|
117
|
+
curDate = _l[0],
|
|
118
|
+
setCurDate = _l[1];
|
|
119
|
+
var rangeStart = rangeVal[0],
|
|
120
|
+
rangeEnd = rangeVal[1];
|
|
121
|
+
var curColumnIndex = (0, helper_1.calculateCurrentColumnIndex)(unit !== null && unit !== void 0 ? unit : types_1.DateUnit.HELF, rangeVal, now >= rangeStart && now <= rangeEnd ? now : new Date("".concat(rangeStart.getFullYear(), "-").concat("".concat(rangeStart.getMonth() + 1).padStart(2, "0"), "-").concat("".concat(rangeStart.getDate()).padStart(2, "0"), "T").concat(now.getHours(), ":").concat(now.getMinutes(), ":").concat(now.getSeconds())));
|
|
122
|
+
var contextValue = (0, react_1.useMemo)(function () {
|
|
123
|
+
var _a, _b;
|
|
124
|
+
return {
|
|
125
|
+
ItemRenderer: children,
|
|
126
|
+
headerRef: headerRef,
|
|
127
|
+
gridRef: gridRef,
|
|
128
|
+
timeLineRef: timeLineRef,
|
|
129
|
+
columnHeaderHeight: columnHeaderHeight,
|
|
130
|
+
columnHeaderBackgroundColor: columnHeaderBackgroundColor,
|
|
131
|
+
headersRender: Accessories_1.ColumnHeaderCon,
|
|
132
|
+
columnHeaderBorder: columnHeaderBorder,
|
|
133
|
+
columnWidth: columnWidth,
|
|
113
134
|
width: rest.width || 0,
|
|
114
135
|
height: rest.height,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
width: rest.width || 0 // Ensure a valid number for width
|
|
124
|
-
,
|
|
125
|
-
height: Math.min(rowCount * rowHeight + columnHeaderHeight, rest.height),
|
|
126
|
-
rowHeight: () => rowHeight,
|
|
127
|
-
columnCount: columnCount,
|
|
128
|
-
rowCount: rowCount,
|
|
129
|
-
columnWidth: () => defaultColumnWidth,
|
|
130
|
-
style: {
|
|
131
|
-
...style,
|
|
132
|
-
backgroundColor: rest.theme.background ?? "#F9F2E8",
|
|
133
|
-
scrollbarWidth: "none",
|
|
134
|
-
msOverflowStyle: "none"
|
|
135
|
-
},
|
|
136
|
-
itemData: {
|
|
137
|
-
ItemRenderer: GanttCellRender,
|
|
138
|
-
headersRender: ColumnHeaderCon,
|
|
139
|
-
attachPressCard,
|
|
140
|
-
cardRender: children,
|
|
141
|
-
columnHeaderHeight,
|
|
142
|
-
curColumnIndex,
|
|
143
|
-
unit,
|
|
144
|
-
rangeVal,
|
|
145
|
-
rowHeight
|
|
146
|
-
}
|
|
147
|
-
}), GanttItemWrapper)));
|
|
148
|
-
};
|
|
149
|
-
const TapasGantt = ({
|
|
150
|
-
children,
|
|
151
|
-
...rest
|
|
152
|
-
}) => /*#__PURE__*/React.createElement(Gantt, _extends({}, rest, {
|
|
153
|
-
innerElementType: InnerElementType
|
|
154
|
-
}), children);
|
|
155
|
-
export default withTheme(TapasGantt);
|
|
156
|
-
//# sourceMappingURL=Gantt.js.map void 0 : data[0]) === null || _b === void 0 ? void 0 : _b.now) : new Date(),
|
|
136
|
+
startDate: startDate,
|
|
137
|
+
endDate: endDate,
|
|
138
|
+
rangeVal: rangeVal,
|
|
139
|
+
gridDataMap: gridData,
|
|
140
|
+
columnCount: columnCount,
|
|
141
|
+
rowHeight: rowHeight,
|
|
142
|
+
rowCount: rowCount,
|
|
143
|
+
now: ((_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.now) ? new Date((_b = data === null || data === void 0 ? void 0 : data[0]) === null || _b === void 0 ? void 0 : _b.now) : new Date(),
|
|
157
144
|
theme: rest.theme
|
|
158
145
|
};
|
|
159
146
|
}, [children, Accessories_1.ColumnHeaderCon, columnHeaderBorder, columnWidth, rest.width, rowHeight, rest.theme]);
|