@nocobase/plugin-gantt 2.1.0-beta.38 → 2.1.0-beta.40
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/client/index.js +1 -1
- package/dist/client-v2/793.629d4cd39664b681.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/client-v2/locale.d.ts +6 -0
- package/dist/client-v2/models/GanttBlockModel.d.ts +1 -1
- package/dist/client-v2/models/components/GanttBlock.helpers.d.ts +8 -0
- package/dist/client-v2/models/components/GanttBlock.styles.d.ts +2 -1
- package/dist/client-v2/models/components/GanttBlock.tree.d.ts +9 -6
- package/dist/{shared → client-v2/shared}/components/grid/style.d.ts +4 -3
- package/dist/{shared → client-v2/shared}/components/other/horizontal-scroll.d.ts +1 -1
- package/dist/externalVersion.js +6 -6
- package/dist/locale/en-US.json +4 -1
- package/dist/locale/zh-CN.json +4 -1
- package/package.json +2 -2
- package/dist/client-v2/143.1a8cf1cd5ce17b64.js +0 -10
- package/dist/node_modules/@ctrl/tinycolor/LICENSE +0 -7
- package/dist/node_modules/@ctrl/tinycolor/dist/bundles/tinycolor.umd.min.js +0 -2
- package/dist/node_modules/@ctrl/tinycolor/dist/conversion.d.ts +0 -61
- package/dist/node_modules/@ctrl/tinycolor/dist/conversion.js +0 -250
- package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.d.ts +0 -4
- package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.js +0 -157
- package/dist/node_modules/@ctrl/tinycolor/dist/format-input.d.ts +0 -37
- package/dist/node_modules/@ctrl/tinycolor/dist/format-input.js +0 -189
- package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.d.ts +0 -14
- package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.js +0 -30
- package/dist/node_modules/@ctrl/tinycolor/dist/index.d.ts +0 -207
- package/dist/node_modules/@ctrl/tinycolor/dist/index.js +0 -512
- package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.d.ts +0 -46
- package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.js +0 -2
- package/dist/node_modules/@ctrl/tinycolor/dist/module/conversion.js +0 -235
- package/dist/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +0 -154
- package/dist/node_modules/@ctrl/tinycolor/dist/module/format-input.js +0 -183
- package/dist/node_modules/@ctrl/tinycolor/dist/module/from-ratio.js +0 -25
- package/dist/node_modules/@ctrl/tinycolor/dist/module/index.js +0 -508
- package/dist/node_modules/@ctrl/tinycolor/dist/module/interfaces.js +0 -1
- package/dist/node_modules/@ctrl/tinycolor/dist/module/public_api.js +0 -12
- package/dist/node_modules/@ctrl/tinycolor/dist/module/random.js +0 -278
- package/dist/node_modules/@ctrl/tinycolor/dist/module/readability.js +0 -80
- package/dist/node_modules/@ctrl/tinycolor/dist/module/to-ms-filter.js +0 -16
- package/dist/node_modules/@ctrl/tinycolor/dist/module/umd_api.js +0 -20
- package/dist/node_modules/@ctrl/tinycolor/dist/module/util.js +0 -82
- package/dist/node_modules/@ctrl/tinycolor/dist/public_api.d.ts +0 -11
- package/dist/node_modules/@ctrl/tinycolor/dist/public_api.js +0 -1
- package/dist/node_modules/@ctrl/tinycolor/dist/random.d.ts +0 -24
- package/dist/node_modules/@ctrl/tinycolor/dist/random.js +0 -282
- package/dist/node_modules/@ctrl/tinycolor/dist/readability.d.ts +0 -46
- package/dist/node_modules/@ctrl/tinycolor/dist/readability.js +0 -86
- package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.d.ts +0 -5
- package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js +0 -20
- package/dist/node_modules/@ctrl/tinycolor/dist/umd_api.d.ts +0 -23
- package/dist/node_modules/@ctrl/tinycolor/dist/umd_api.js +0 -22
- package/dist/node_modules/@ctrl/tinycolor/dist/util.d.ts +0 -36
- package/dist/node_modules/@ctrl/tinycolor/dist/util.js +0 -92
- package/dist/node_modules/@ctrl/tinycolor/package.json +0 -1
- package/dist/shared/components/calendar/calendar.js +0 -417
- package/dist/shared/components/calendar/style.js +0 -79
- package/dist/shared/components/calendar/top-part-of-calendar.js +0 -57
- package/dist/shared/components/gantt/style.js +0 -74
- package/dist/shared/components/gantt/task-gantt-content.js +0 -337
- package/dist/shared/components/gantt/task-gantt.js +0 -128
- package/dist/shared/components/grid/grid-body.js +0 -114
- package/dist/shared/components/grid/grid.js +0 -50
- package/dist/shared/components/grid/style.js +0 -54
- package/dist/shared/components/other/arrow.js +0 -90
- package/dist/shared/components/other/horizontal-scroll.js +0 -64
- package/dist/shared/components/other/style.js +0 -125
- package/dist/shared/components/other/tooltip.js +0 -137
- package/dist/shared/components/other/vertical-scroll.js +0 -74
- package/dist/shared/components/task-item/bar/bar-date-handle.js +0 -62
- package/dist/shared/components/task-item/bar/bar-display.js +0 -98
- package/dist/shared/components/task-item/bar/bar-progress-handle.js +0 -49
- package/dist/shared/components/task-item/bar/bar-small.js +0 -85
- package/dist/shared/components/task-item/bar/bar.js +0 -113
- package/dist/shared/components/task-item/bar/style.js +0 -58
- package/dist/shared/components/task-item/milestone/milestone.js +0 -72
- package/dist/shared/components/task-item/milestone/style.js +0 -45
- package/dist/shared/components/task-item/project/project.js +0 -77
- package/dist/shared/components/task-item/project/style.js +0 -51
- package/dist/shared/components/task-item/style.js +0 -74
- package/dist/shared/components/task-item/task-item.js +0 -132
- package/dist/shared/helpers/bar-helper.js +0 -415
- package/dist/shared/helpers/date-helper.js +0 -231
- package/dist/shared/helpers/other-helper.js +0 -97
- package/dist/shared/types/bar-task.js +0 -24
- package/dist/shared/types/date-setup.js +0 -24
- package/dist/shared/types/gantt-task-actions.js +0 -24
- package/dist/shared/types/public-types.js +0 -46
- /package/dist/{shared → client-v2/shared}/components/calendar/calendar.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/calendar/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/calendar/top-part-of-calendar.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/gantt/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/gantt/task-gantt-content.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/gantt/task-gantt.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/grid/grid-body.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/grid/grid.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/other/arrow.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/other/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/other/tooltip.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/other/vertical-scroll.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-date-handle.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-display.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-progress-handle.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar-small.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/bar/bar.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/bar/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/milestone/milestone.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/milestone/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/project/project.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/project/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/style.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/components/task-item/task-item.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/helpers/bar-helper.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/helpers/date-helper.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/helpers/other-helper.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/types/bar-task.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/types/date-setup.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/types/gantt-task-actions.d.ts +0 -0
- /package/dist/{shared → client-v2/shared}/types/public-types.d.ts +0 -0
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var calendar_exports = {};
|
|
38
|
-
__export(calendar_exports, {
|
|
39
|
-
Calendar: () => Calendar
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(calendar_exports);
|
|
42
|
-
var import_css = require("@emotion/css");
|
|
43
|
-
var import_react = __toESM(require("react"));
|
|
44
|
-
var import_date_helper = require("../../helpers/date-helper");
|
|
45
|
-
var import_public_types = require("../../types/public-types");
|
|
46
|
-
var import_style = __toESM(require("./style"));
|
|
47
|
-
var import_top_part_of_calendar = require("./top-part-of-calendar");
|
|
48
|
-
const Calendar = ({
|
|
49
|
-
dateSetup,
|
|
50
|
-
locale,
|
|
51
|
-
viewMode,
|
|
52
|
-
rtl,
|
|
53
|
-
headerHeight,
|
|
54
|
-
columnWidth,
|
|
55
|
-
fontFamily,
|
|
56
|
-
fontSize
|
|
57
|
-
}) => {
|
|
58
|
-
const { styles } = (0, import_style.default)();
|
|
59
|
-
const getCalendarValuesForYear = () => {
|
|
60
|
-
const topValues2 = [];
|
|
61
|
-
const bottomValues2 = [];
|
|
62
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
63
|
-
for (let i = 0; i < dateSetup.dates.length; i++) {
|
|
64
|
-
const date = dateSetup.dates[i];
|
|
65
|
-
const bottomValue = date.getFullYear();
|
|
66
|
-
bottomValues2.push(
|
|
67
|
-
/* @__PURE__ */ import_react.default.createElement("text", { key: date.getTime(), y: headerHeight * 0.8, x: columnWidth * i + columnWidth * 0.5 }, bottomValue)
|
|
68
|
-
);
|
|
69
|
-
if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
|
|
70
|
-
const topValue = date.getFullYear().toString();
|
|
71
|
-
let xText;
|
|
72
|
-
if (rtl) {
|
|
73
|
-
xText = (6 + i + date.getFullYear() + 1) * columnWidth;
|
|
74
|
-
} else {
|
|
75
|
-
xText = (6 + i - date.getFullYear()) * columnWidth;
|
|
76
|
-
}
|
|
77
|
-
topValues2.push(
|
|
78
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
79
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
80
|
-
{
|
|
81
|
-
key: topValue,
|
|
82
|
-
value: topValue,
|
|
83
|
-
x1Line: columnWidth * i,
|
|
84
|
-
y1Line: 0,
|
|
85
|
-
y2Line: headerHeight,
|
|
86
|
-
xText,
|
|
87
|
-
yText: topDefaultHeight * 0.9
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return [topValues2, bottomValues2];
|
|
94
|
-
};
|
|
95
|
-
const getCalendarValuesForQuarterYear = () => {
|
|
96
|
-
const topValues2 = [];
|
|
97
|
-
const bottomValues2 = [];
|
|
98
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
99
|
-
for (let i = 0; i < dateSetup.dates.length; i++) {
|
|
100
|
-
const date = dateSetup.dates[i];
|
|
101
|
-
const quarter = "Q" + Math.floor((date.getMonth() + 3) / 3);
|
|
102
|
-
bottomValues2.push(
|
|
103
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
104
|
-
"text",
|
|
105
|
-
{
|
|
106
|
-
key: date.getTime(),
|
|
107
|
-
y: headerHeight * 0.8,
|
|
108
|
-
x: columnWidth * i + columnWidth * 0.5,
|
|
109
|
-
className: styles.calendarBottomText
|
|
110
|
-
},
|
|
111
|
-
quarter
|
|
112
|
-
)
|
|
113
|
-
);
|
|
114
|
-
if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
|
|
115
|
-
const topValue = date.getFullYear().toString();
|
|
116
|
-
let xText;
|
|
117
|
-
if (rtl) {
|
|
118
|
-
xText = (6 + i + date.getMonth() + 1) * columnWidth;
|
|
119
|
-
} else {
|
|
120
|
-
xText = (6 + i - date.getMonth()) * columnWidth;
|
|
121
|
-
}
|
|
122
|
-
topValues2.push(
|
|
123
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
124
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
125
|
-
{
|
|
126
|
-
key: topValue,
|
|
127
|
-
value: topValue,
|
|
128
|
-
x1Line: columnWidth * i,
|
|
129
|
-
y1Line: 0,
|
|
130
|
-
y2Line: topDefaultHeight,
|
|
131
|
-
xText: Math.abs(xText) - 200,
|
|
132
|
-
yText: topDefaultHeight * 0.9
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return [topValues2, bottomValues2];
|
|
139
|
-
};
|
|
140
|
-
const getCalendarValuesForMonth = () => {
|
|
141
|
-
const topValues2 = [];
|
|
142
|
-
const bottomValues2 = [];
|
|
143
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
144
|
-
for (let i = 0; i < dateSetup.dates.length; i++) {
|
|
145
|
-
const date = dateSetup.dates[i];
|
|
146
|
-
const bottomValue = (0, import_date_helper.getLocaleMonth)(date, locale);
|
|
147
|
-
bottomValues2.push(
|
|
148
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
149
|
-
"text",
|
|
150
|
-
{
|
|
151
|
-
key: bottomValue + date.getFullYear(),
|
|
152
|
-
y: headerHeight * 0.8,
|
|
153
|
-
x: columnWidth * i + columnWidth * 0.5,
|
|
154
|
-
className: styles.calendarBottomText
|
|
155
|
-
},
|
|
156
|
-
bottomValue
|
|
157
|
-
)
|
|
158
|
-
);
|
|
159
|
-
if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
|
|
160
|
-
const topValue = date.getFullYear().toString();
|
|
161
|
-
let xText;
|
|
162
|
-
if (rtl) {
|
|
163
|
-
xText = (6 + i + date.getMonth() + 1) * columnWidth;
|
|
164
|
-
} else {
|
|
165
|
-
xText = (6 + i - date.getMonth()) * columnWidth;
|
|
166
|
-
}
|
|
167
|
-
topValues2.push(
|
|
168
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
169
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
170
|
-
{
|
|
171
|
-
key: topValue,
|
|
172
|
-
value: topValue,
|
|
173
|
-
x1Line: columnWidth * i,
|
|
174
|
-
y1Line: 0,
|
|
175
|
-
y2Line: topDefaultHeight,
|
|
176
|
-
xText,
|
|
177
|
-
yText: topDefaultHeight * 0.9
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return [topValues2, bottomValues2];
|
|
184
|
-
};
|
|
185
|
-
const getCalendarValuesForWeek = () => {
|
|
186
|
-
const topValues2 = [];
|
|
187
|
-
const bottomValues2 = [];
|
|
188
|
-
let weeksCount = 1;
|
|
189
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
190
|
-
const dates = dateSetup.dates;
|
|
191
|
-
for (let i = dates.length - 1; i >= 0; i--) {
|
|
192
|
-
const date = dates[i];
|
|
193
|
-
let topValue = "";
|
|
194
|
-
if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
|
|
195
|
-
topValue = `${(0, import_date_helper.getLocaleMonth)(date, locale)}, ${date.getFullYear()}`;
|
|
196
|
-
}
|
|
197
|
-
const bottomValue = `W${(0, import_date_helper.getWeekNumberISO8601)(date)}`;
|
|
198
|
-
bottomValues2.push(
|
|
199
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
200
|
-
"text",
|
|
201
|
-
{
|
|
202
|
-
key: date.getTime(),
|
|
203
|
-
y: headerHeight * 0.8,
|
|
204
|
-
x: columnWidth * (i + +rtl),
|
|
205
|
-
className: styles.calendarBottomText
|
|
206
|
-
},
|
|
207
|
-
bottomValue
|
|
208
|
-
)
|
|
209
|
-
);
|
|
210
|
-
if (topValue) {
|
|
211
|
-
if (i !== dates.length - 1) {
|
|
212
|
-
topValues2.push(
|
|
213
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
214
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
215
|
-
{
|
|
216
|
-
key: topValue,
|
|
217
|
-
value: topValue,
|
|
218
|
-
x1Line: columnWidth * i + weeksCount * columnWidth,
|
|
219
|
-
y1Line: 0,
|
|
220
|
-
y2Line: topDefaultHeight,
|
|
221
|
-
xText: columnWidth * i + columnWidth * weeksCount * 0.5,
|
|
222
|
-
yText: topDefaultHeight * 0.9
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
weeksCount = 0;
|
|
228
|
-
}
|
|
229
|
-
weeksCount++;
|
|
230
|
-
}
|
|
231
|
-
return [topValues2, bottomValues2];
|
|
232
|
-
};
|
|
233
|
-
const getCalendarValuesForDay = () => {
|
|
234
|
-
const topValues2 = [];
|
|
235
|
-
const bottomValues2 = [];
|
|
236
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
237
|
-
const dates = dateSetup.dates;
|
|
238
|
-
for (let i = 0; i < dates.length; i++) {
|
|
239
|
-
const date = dates[i];
|
|
240
|
-
const bottomValue = `${date.getDate().toString()}`;
|
|
241
|
-
bottomValues2.push(
|
|
242
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
243
|
-
"text",
|
|
244
|
-
{
|
|
245
|
-
key: date.getTime(),
|
|
246
|
-
y: headerHeight * 0.8,
|
|
247
|
-
x: columnWidth * i + columnWidth * 0.5,
|
|
248
|
-
className: (0, import_css.cx)("calendarBottomText")
|
|
249
|
-
},
|
|
250
|
-
bottomValue
|
|
251
|
-
)
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
let monthStartIndex = 0;
|
|
255
|
-
for (let i = 0; i < dates.length; i++) {
|
|
256
|
-
const isLastDate = i + 1 === dates.length;
|
|
257
|
-
const isMonthEnd = !isLastDate && dates[i].getMonth() !== dates[i + 1].getMonth();
|
|
258
|
-
if (!isLastDate && !isMonthEnd) {
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
const monthDate = dates[monthStartIndex];
|
|
262
|
-
const monthEndIndex = isMonthEnd ? i + 1 : dates.length;
|
|
263
|
-
const topValue = (0, import_date_helper.getLocaleMonth)(monthDate, locale);
|
|
264
|
-
topValues2.push(
|
|
265
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
266
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
267
|
-
{
|
|
268
|
-
key: `${topValue}-${monthDate.getFullYear()}-${monthStartIndex}`,
|
|
269
|
-
value: topValue,
|
|
270
|
-
x1Line: columnWidth * monthStartIndex,
|
|
271
|
-
y1Line: 0,
|
|
272
|
-
y2Line: topDefaultHeight,
|
|
273
|
-
xText: columnWidth * (monthStartIndex + (monthEndIndex - monthStartIndex) * 0.5),
|
|
274
|
-
yText: topDefaultHeight * 0.9
|
|
275
|
-
}
|
|
276
|
-
)
|
|
277
|
-
);
|
|
278
|
-
monthStartIndex = i + 1;
|
|
279
|
-
}
|
|
280
|
-
return [topValues2, bottomValues2];
|
|
281
|
-
};
|
|
282
|
-
const getCalendarValuesForPartOfDay = () => {
|
|
283
|
-
const topValues2 = [];
|
|
284
|
-
const bottomValues2 = [];
|
|
285
|
-
const ticks = viewMode === import_public_types.ViewMode.HalfDay ? 2 : 4;
|
|
286
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
287
|
-
const dates = dateSetup.dates;
|
|
288
|
-
for (let i = 0; i < dates.length; i++) {
|
|
289
|
-
const date = dates[i];
|
|
290
|
-
const bottomValue = (0, import_date_helper.getCachedDateTimeFormat)(locale, {
|
|
291
|
-
hour: "numeric"
|
|
292
|
-
}).format(date).replace("\u65F6", "");
|
|
293
|
-
bottomValues2.push(
|
|
294
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
295
|
-
"text",
|
|
296
|
-
{
|
|
297
|
-
key: date.getTime(),
|
|
298
|
-
y: headerHeight * 0.8,
|
|
299
|
-
x: columnWidth * (i + +rtl),
|
|
300
|
-
className: (0, import_css.cx)("calendarBottomText"),
|
|
301
|
-
fontFamily
|
|
302
|
-
},
|
|
303
|
-
bottomValue
|
|
304
|
-
)
|
|
305
|
-
);
|
|
306
|
-
if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
|
|
307
|
-
const topValue = `${(0, import_date_helper.getLocalDayOfWeek)(date, locale, "short")}, ${date.getDate()} ${(0, import_date_helper.getLocaleMonth)(
|
|
308
|
-
date,
|
|
309
|
-
locale
|
|
310
|
-
)}`;
|
|
311
|
-
topValues2.push(
|
|
312
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
313
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
314
|
-
{
|
|
315
|
-
key: topValue + date.getFullYear(),
|
|
316
|
-
value: topValue,
|
|
317
|
-
x1Line: columnWidth * i + ticks * columnWidth,
|
|
318
|
-
y1Line: 0,
|
|
319
|
-
y2Line: topDefaultHeight,
|
|
320
|
-
xText: columnWidth * i + ticks * columnWidth * 0.5,
|
|
321
|
-
yText: topDefaultHeight * 0.9
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return [topValues2, bottomValues2];
|
|
328
|
-
};
|
|
329
|
-
const getCalendarValuesForHour = () => {
|
|
330
|
-
var _a;
|
|
331
|
-
const topValues2 = [];
|
|
332
|
-
const bottomValues2 = [];
|
|
333
|
-
const topDefaultHeight = headerHeight * 0.5;
|
|
334
|
-
const dates = dateSetup.dates;
|
|
335
|
-
for (let i = 0; i < dates.length; i++) {
|
|
336
|
-
const date = dates[i];
|
|
337
|
-
const bottomValue = (_a = (0, import_date_helper.getCachedDateTimeFormat)(locale, {
|
|
338
|
-
hour: "numeric"
|
|
339
|
-
}).format(date)) == null ? void 0 : _a.replace("\u65F6", "");
|
|
340
|
-
bottomValues2.push(
|
|
341
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
342
|
-
"text",
|
|
343
|
-
{
|
|
344
|
-
key: date.getTime(),
|
|
345
|
-
y: headerHeight * 0.8,
|
|
346
|
-
x: columnWidth * (i + +rtl),
|
|
347
|
-
className: (0, import_css.cx)("calendarBottomText"),
|
|
348
|
-
fontFamily
|
|
349
|
-
},
|
|
350
|
-
bottomValue
|
|
351
|
-
)
|
|
352
|
-
);
|
|
353
|
-
if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
|
|
354
|
-
const displayDate = dates[i - 1];
|
|
355
|
-
const topValue = `${(0, import_date_helper.getLocalDayOfWeek)(displayDate, locale, "long")}, ${displayDate.getDate()} ${(0, import_date_helper.getLocaleMonth)(
|
|
356
|
-
displayDate,
|
|
357
|
-
locale
|
|
358
|
-
)}`;
|
|
359
|
-
const topPosition = (date.getHours() - 24) / 2;
|
|
360
|
-
topValues2.push(
|
|
361
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
362
|
-
import_top_part_of_calendar.TopPartOfCalendar,
|
|
363
|
-
{
|
|
364
|
-
key: topValue + displayDate.getFullYear(),
|
|
365
|
-
value: topValue,
|
|
366
|
-
x1Line: columnWidth * i,
|
|
367
|
-
y1Line: 0,
|
|
368
|
-
y2Line: topDefaultHeight,
|
|
369
|
-
xText: columnWidth * (i + topPosition),
|
|
370
|
-
yText: topDefaultHeight * 0.9
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
return [topValues2, bottomValues2];
|
|
377
|
-
};
|
|
378
|
-
let topValues = [];
|
|
379
|
-
let bottomValues = [];
|
|
380
|
-
switch (dateSetup.viewMode) {
|
|
381
|
-
case import_public_types.ViewMode.Year:
|
|
382
|
-
[topValues, bottomValues] = getCalendarValuesForYear();
|
|
383
|
-
break;
|
|
384
|
-
case import_public_types.ViewMode.QuarterYear:
|
|
385
|
-
[topValues, bottomValues] = getCalendarValuesForQuarterYear();
|
|
386
|
-
break;
|
|
387
|
-
case import_public_types.ViewMode.Month:
|
|
388
|
-
[topValues, bottomValues] = getCalendarValuesForMonth();
|
|
389
|
-
break;
|
|
390
|
-
case import_public_types.ViewMode.Week:
|
|
391
|
-
[topValues, bottomValues] = getCalendarValuesForWeek();
|
|
392
|
-
break;
|
|
393
|
-
case import_public_types.ViewMode.Day:
|
|
394
|
-
[topValues, bottomValues] = getCalendarValuesForDay();
|
|
395
|
-
break;
|
|
396
|
-
case import_public_types.ViewMode.QuarterDay:
|
|
397
|
-
case import_public_types.ViewMode.HalfDay:
|
|
398
|
-
[topValues, bottomValues] = getCalendarValuesForPartOfDay();
|
|
399
|
-
break;
|
|
400
|
-
case import_public_types.ViewMode.Hour:
|
|
401
|
-
[topValues, bottomValues] = getCalendarValuesForHour();
|
|
402
|
-
}
|
|
403
|
-
return /* @__PURE__ */ import_react.default.createElement("g", { className: styles.nbGanttCalendar, fontSize, fontFamily }, /* @__PURE__ */ import_react.default.createElement(
|
|
404
|
-
"rect",
|
|
405
|
-
{
|
|
406
|
-
x: 0,
|
|
407
|
-
y: 0,
|
|
408
|
-
width: columnWidth * dateSetup.dates.length,
|
|
409
|
-
height: headerHeight,
|
|
410
|
-
className: styles.calendarheader
|
|
411
|
-
}
|
|
412
|
-
), bottomValues, " ", topValues);
|
|
413
|
-
};
|
|
414
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
415
|
-
0 && (module.exports = {
|
|
416
|
-
Calendar
|
|
417
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var style_exports = {};
|
|
28
|
-
__export(style_exports, {
|
|
29
|
-
default: () => style_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(style_exports);
|
|
32
|
-
var import_tinycolor = require("@ctrl/tinycolor");
|
|
33
|
-
var import_antd_style = require("antd-style");
|
|
34
|
-
const useStyles = (0, import_antd_style.createStyles)(({ token, css }) => {
|
|
35
|
-
const colorFillAlterSolid = new import_tinycolor.TinyColor(token.colorFillAlter).onBackground(token.colorBgContainer).toHexShortString();
|
|
36
|
-
return {
|
|
37
|
-
calendarheader: css`
|
|
38
|
-
color: ${token.colorText};
|
|
39
|
-
fill: ${colorFillAlterSolid};
|
|
40
|
-
stroke-width: 1.4;
|
|
41
|
-
background: ${colorFillAlterSolid};
|
|
42
|
-
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
43
|
-
`,
|
|
44
|
-
calendarBottomText: css`
|
|
45
|
-
font-size: 12px;
|
|
46
|
-
font-weight: 400;
|
|
47
|
-
fill: ${token.colorTextSecondary};
|
|
48
|
-
text-anchor: middle;
|
|
49
|
-
user-select: none;
|
|
50
|
-
pointer-events: none;
|
|
51
|
-
`,
|
|
52
|
-
nbGanttCalendar: css`
|
|
53
|
-
.calendarBottomText,
|
|
54
|
-
.calendarbottomtext {
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
font-weight: 400;
|
|
57
|
-
fill: ${token.colorTextSecondary};
|
|
58
|
-
text-anchor: middle;
|
|
59
|
-
user-select: none;
|
|
60
|
-
pointer-events: none;
|
|
61
|
-
}
|
|
62
|
-
.calendarTopTick,
|
|
63
|
-
.calendartoptick {
|
|
64
|
-
stroke: ${token.colorBorderSecondary};
|
|
65
|
-
stroke-width: 0;
|
|
66
|
-
}
|
|
67
|
-
.calendarTopText,
|
|
68
|
-
.calendartoptext {
|
|
69
|
-
font-size: ${token.fontSize}px;
|
|
70
|
-
font-weight: 600;
|
|
71
|
-
fill: ${token.colorText};
|
|
72
|
-
text-anchor: middle;
|
|
73
|
-
user-select: none;
|
|
74
|
-
pointer-events: none;
|
|
75
|
-
}
|
|
76
|
-
`
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
var style_default = useStyles;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var top_part_of_calendar_exports = {};
|
|
38
|
-
__export(top_part_of_calendar_exports, {
|
|
39
|
-
TopPartOfCalendar: () => TopPartOfCalendar
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(top_part_of_calendar_exports);
|
|
42
|
-
var import_css = require("@emotion/css");
|
|
43
|
-
var import_react = __toESM(require("react"));
|
|
44
|
-
const TopPartOfCalendar = ({
|
|
45
|
-
value,
|
|
46
|
-
x1Line,
|
|
47
|
-
y1Line,
|
|
48
|
-
y2Line,
|
|
49
|
-
xText,
|
|
50
|
-
yText
|
|
51
|
-
}) => {
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement("g", { className: "calendarTop" }, /* @__PURE__ */ import_react.default.createElement("line", { x1: x1Line, y1: y1Line, x2: x1Line, y2: y2Line, className: (0, import_css.cx)("calendarTopTick"), key: value + "line" }), /* @__PURE__ */ import_react.default.createElement("text", { key: value + "text", y: yText, x: xText, className: (0, import_css.cx)("calendarTopText") }, value));
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
TopPartOfCalendar
|
|
57
|
-
});
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var style_exports = {};
|
|
28
|
-
__export(style_exports, {
|
|
29
|
-
default: () => style_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(style_exports);
|
|
32
|
-
var import_antd_style = require("antd-style");
|
|
33
|
-
const useStyles = (0, import_antd_style.createStyles)(({ token, css }) => {
|
|
34
|
-
return {
|
|
35
|
-
ganttverticalcontainer: css`
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
font-size: 0;
|
|
38
|
-
margin: 0;
|
|
39
|
-
padding: 0;
|
|
40
|
-
width: 100%;
|
|
41
|
-
border-left: 2px solid ${token.colorBorderSecondary};
|
|
42
|
-
overflow-x: hidden;
|
|
43
|
-
.ganttHeader {
|
|
44
|
-
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
45
|
-
font-weight: normal;
|
|
46
|
-
}
|
|
47
|
-
.ganttBody {
|
|
48
|
-
border-bottom: 1px solid ${token.colorBorderSecondary};
|
|
49
|
-
}
|
|
50
|
-
`,
|
|
51
|
-
horizontalcontainer: css`
|
|
52
|
-
margin: 0;
|
|
53
|
-
padding: 0;
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
`,
|
|
56
|
-
wrapper: css`
|
|
57
|
-
display: flex;
|
|
58
|
-
padding: 0;
|
|
59
|
-
margin: 0;
|
|
60
|
-
list-style: none;
|
|
61
|
-
outline: none;
|
|
62
|
-
position: relative;
|
|
63
|
-
.gantt-horizontal-scoll {
|
|
64
|
-
display: none;
|
|
65
|
-
}
|
|
66
|
-
&:hover {
|
|
67
|
-
.gantt-horizontal-scoll {
|
|
68
|
-
display: block;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
`
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
var style_default = useStyles;
|