@nocobase/client 0.15.0-alpha.3 → 0.15.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +69 -68
- package/lib/index.js +67 -66
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -88,7 +88,7 @@ import * as ahooks from "ahooks";
|
|
|
88
88
|
import { useSetState, useRequest as useRequest$1, useBoolean, useEventListener, useCookieState, useMemoizedFn, useDebounce, useSessionStorageState } from "ahooks";
|
|
89
89
|
import cloneDeep from "lodash/cloneDeep";
|
|
90
90
|
import * as nocobaseClientUtils from "@nocobase/utils/client";
|
|
91
|
-
import { isPlainObject, error, getDefaultFormat, str2moment, toGmt, toLocal, dayjs as dayjs$1, getValuesByPath, flatten, unflatten as unflatten$1, forEach, nextTick, isURL, parse, isPortalInBody, isString as isString$1, uid as uid$
|
|
91
|
+
import { isPlainObject, error, getDefaultFormat, str2moment, toGmt, toLocal, dayjs as dayjs$1, getValuesByPath, flatten, unflatten as unflatten$1, forEach, nextTick, isURL, parse, isPortalInBody, isString as isString$1, uid as uid$1, toFixedByStep } from "@nocobase/utils/client";
|
|
92
92
|
import deepmerge from "deepmerge";
|
|
93
93
|
import uniq$1 from "lodash/uniq";
|
|
94
94
|
import template from "lodash/template";
|
|
@@ -109,7 +109,7 @@ import * as formilyReactiveReact from "@formily/reactive-react";
|
|
|
109
109
|
import { observer as observer$1 } from "@formily/reactive-react";
|
|
110
110
|
import { ErrorBoundary, useErrorBoundary } from "react-error-boundary";
|
|
111
111
|
import * as antIcons from "@ant-design/icons";
|
|
112
|
-
import antIcons__default, { createFromIconfontCN, CopyOutlined, HighlightOutlined, CloseCircleOutlined, PlusOutlined, DragOutlined, MenuOutlined, DownOutlined, CloseCircleFilled, CloseOutlined, LoadingOutlined, DownloadOutlined as DownloadOutlined$1, DeleteOutlined, SearchOutlined, TableOutlined, FormOutlined, OrderedListOutlined, EditOutlined, LeftOutlined, RightOutlined, CheckOutlined, InboxOutlined, RightSquareOutlined, SyncOutlined, ExclamationCircleFilled, ApiOutlined, SettingOutlined, ReadOutlined, ReloadOutlined } from "@ant-design/icons";
|
|
112
|
+
import antIcons__default, { createFromIconfontCN, CopyOutlined, HighlightOutlined, CloseCircleOutlined, PlusOutlined, DragOutlined, MenuOutlined, DownOutlined, CloseCircleFilled, CloseOutlined, LoadingOutlined, DownloadOutlined as DownloadOutlined$1, DeleteOutlined, SearchOutlined, TableOutlined, FormOutlined, OrderedListOutlined, EditOutlined, LeftOutlined, RightOutlined, CheckOutlined, InboxOutlined, RightSquareOutlined, SyncOutlined, ExclamationCircleFilled, ApiOutlined, SettingOutlined, ReadOutlined, ReloadOutlined, DisconnectOutlined } from "@ant-design/icons";
|
|
113
113
|
import * as i18next from "i18next";
|
|
114
114
|
import i18next__default from "i18next";
|
|
115
115
|
import * as antdCssinjs from "@ant-design/cssinjs";
|
|
@@ -162,11 +162,10 @@ import ReactDragListView from "react-drag-listview";
|
|
|
162
162
|
import { spliceArrayState, exchangeArrayState } from "@formily/core/esm/shared/internals";
|
|
163
163
|
import useAntdInputStyle from "antd/es/input/style";
|
|
164
164
|
import sanitizeHTML from "sanitize-html";
|
|
165
|
-
import { uid as uid$1 } from "@nocobase/utils";
|
|
166
165
|
import LRUCache from "lru-cache";
|
|
167
166
|
import { parseExpression } from "cron-parser";
|
|
168
|
-
import { eq } from "date-arithmetic";
|
|
169
167
|
import { dayjsLocalizer, Calendar as Calendar$2 } from "react-big-calendar";
|
|
168
|
+
import * as dates from "react-big-calendar/lib/utils/dates";
|
|
170
169
|
import solarLunar from "solarlunar-es";
|
|
171
170
|
import { Navigate as Navigate$1 } from "react-big-calendar/dist/react-big-calendar.esm";
|
|
172
171
|
import { useAttach as useAttach$1 } from "@formily/react/esm/hooks/useAttach";
|
|
@@ -19839,16 +19838,17 @@ const useTableBlockProps = () => {
|
|
|
19839
19838
|
const globalSort = (_c = (_b = (_a = fieldSchema.parent) == null ? void 0 : _a["x-decorator-props"]) == null ? void 0 : _b["params"]) == null ? void 0 : _c["sort"];
|
|
19840
19839
|
const { getDataBlocks } = useFilterBlock();
|
|
19841
19840
|
useEffect(() => {
|
|
19842
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m, _n;
|
|
19841
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m, _n, _o, _p;
|
|
19843
19842
|
if (!((_a2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _a2.loading)) {
|
|
19844
19843
|
field.value = [];
|
|
19845
19844
|
field.value = (_c2 = (_b2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _b2.data) == null ? void 0 : _c2.data;
|
|
19845
|
+
field.setInitialValue((_e2 = (_d2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _d2.data) == null ? void 0 : _e2.data);
|
|
19846
19846
|
field.data = field.data || {};
|
|
19847
|
-
field.data.selectedRowKeys = (
|
|
19847
|
+
field.data.selectedRowKeys = (_g2 = (_f2 = ctx == null ? void 0 : ctx.field) == null ? void 0 : _f2.data) == null ? void 0 : _g2.selectedRowKeys;
|
|
19848
19848
|
field.componentProps.pagination = field.componentProps.pagination || {};
|
|
19849
|
-
field.componentProps.pagination.pageSize = (
|
|
19850
|
-
field.componentProps.pagination.total = (
|
|
19851
|
-
field.componentProps.pagination.current = (
|
|
19849
|
+
field.componentProps.pagination.pageSize = (_j = (_i2 = (_h2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _h2.data) == null ? void 0 : _i2.meta) == null ? void 0 : _j.pageSize;
|
|
19850
|
+
field.componentProps.pagination.total = (_m = (_l = (_k = ctx == null ? void 0 : ctx.service) == null ? void 0 : _k.data) == null ? void 0 : _l.meta) == null ? void 0 : _m.count;
|
|
19851
|
+
field.componentProps.pagination.current = (_p = (_o = (_n = ctx == null ? void 0 : ctx.service) == null ? void 0 : _n.data) == null ? void 0 : _o.meta) == null ? void 0 : _p.page;
|
|
19852
19852
|
}
|
|
19853
19853
|
}, [(_d = ctx == null ? void 0 : ctx.service) == null ? void 0 : _d.loading]);
|
|
19854
19854
|
return {
|
|
@@ -37233,10 +37233,10 @@ const Calendar$1 = observer(
|
|
|
37233
37233
|
agendaDateFormat: "M-DD",
|
|
37234
37234
|
dayHeaderFormat: "YYYY-M-DD",
|
|
37235
37235
|
dayRangeHeaderFormat: ({ start, end }, culture, local) => {
|
|
37236
|
-
if (eq(start, end, "month")) {
|
|
37237
|
-
return local.format(start, "
|
|
37236
|
+
if (dates.eq(start, end, "month")) {
|
|
37237
|
+
return local.format(start, "YYYY-M", culture);
|
|
37238
37238
|
}
|
|
37239
|
-
return `${local.format(start, "
|
|
37239
|
+
return `${local.format(start, "YYYY-M", culture)} - ${local.format(end, "YYYY-M", culture)}`;
|
|
37240
37240
|
}
|
|
37241
37241
|
},
|
|
37242
37242
|
components: components2,
|
|
@@ -37710,7 +37710,7 @@ function useOptions$2({ filter, isTableOid }) {
|
|
|
37710
37710
|
const field = useField();
|
|
37711
37711
|
const ctx = useContext(FilterContext$2);
|
|
37712
37712
|
const collection2 = useCollection();
|
|
37713
|
-
const targetCollection = isTableOid && (((_a = ctx == null ? void 0 : ctx.field) == null ? void 0 : _a.collectionName) || collection2.name);
|
|
37713
|
+
const targetCollection = isTableOid && (((_a = ctx == null ? void 0 : ctx.field) == null ? void 0 : _a.collectionName) || ctx.collectionName || collection2.name);
|
|
37714
37714
|
const inheritCollections = useSelfAndChildrenCollections(targetCollection);
|
|
37715
37715
|
const { collections = [] } = useCollectionManager();
|
|
37716
37716
|
const currentCollections = (field == null ? void 0 : field.dataSource) ? collections.filter((v) => {
|
|
@@ -39224,12 +39224,12 @@ const G2Plot = observer(
|
|
|
39224
39224
|
);
|
|
39225
39225
|
G2Plot.Designer = G2PlotDesigner;
|
|
39226
39226
|
G2Plot.plots = plots;
|
|
39227
|
-
const convertToBarTasks = (tasks,
|
|
39227
|
+
const convertToBarTasks = (tasks, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
|
|
39228
39228
|
let barTasks = tasks.map((t, i) => {
|
|
39229
39229
|
return convertToBarTask(
|
|
39230
39230
|
t,
|
|
39231
39231
|
i,
|
|
39232
|
-
|
|
39232
|
+
dates2,
|
|
39233
39233
|
columnWidth,
|
|
39234
39234
|
rowHeight,
|
|
39235
39235
|
taskHeight,
|
|
@@ -39259,14 +39259,14 @@ const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, bar
|
|
|
39259
39259
|
});
|
|
39260
39260
|
return barTasks;
|
|
39261
39261
|
};
|
|
39262
|
-
const convertToBarTask = (task, index2,
|
|
39262
|
+
const convertToBarTask = (task, index2, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
|
|
39263
39263
|
let barTask;
|
|
39264
39264
|
switch (task.type) {
|
|
39265
39265
|
case "milestone":
|
|
39266
39266
|
barTask = convertToMilestone(
|
|
39267
39267
|
task,
|
|
39268
39268
|
index2,
|
|
39269
|
-
|
|
39269
|
+
dates2,
|
|
39270
39270
|
columnWidth,
|
|
39271
39271
|
rowHeight,
|
|
39272
39272
|
taskHeight,
|
|
@@ -39280,7 +39280,7 @@ const convertToBarTask = (task, index2, dates, columnWidth, rowHeight, taskHeigh
|
|
|
39280
39280
|
barTask = convertToBar(
|
|
39281
39281
|
task,
|
|
39282
39282
|
index2,
|
|
39283
|
-
|
|
39283
|
+
dates2,
|
|
39284
39284
|
columnWidth,
|
|
39285
39285
|
rowHeight,
|
|
39286
39286
|
taskHeight * 0.5,
|
|
@@ -39297,7 +39297,7 @@ const convertToBarTask = (task, index2, dates, columnWidth, rowHeight, taskHeigh
|
|
|
39297
39297
|
barTask = convertToBar(
|
|
39298
39298
|
task,
|
|
39299
39299
|
index2,
|
|
39300
|
-
|
|
39300
|
+
dates2,
|
|
39301
39301
|
columnWidth,
|
|
39302
39302
|
rowHeight,
|
|
39303
39303
|
taskHeight,
|
|
@@ -39313,15 +39313,15 @@ const convertToBarTask = (task, index2, dates, columnWidth, rowHeight, taskHeigh
|
|
|
39313
39313
|
}
|
|
39314
39314
|
return barTask;
|
|
39315
39315
|
};
|
|
39316
|
-
const convertToBar = (task, index2,
|
|
39316
|
+
const convertToBar = (task, index2, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor) => {
|
|
39317
39317
|
let x1;
|
|
39318
39318
|
let x2;
|
|
39319
39319
|
if (rtl) {
|
|
39320
|
-
x2 = taskXCoordinateRTL(task.start,
|
|
39321
|
-
x1 = taskXCoordinateRTL(task.end,
|
|
39320
|
+
x2 = taskXCoordinateRTL(task.start, dates2, columnWidth);
|
|
39321
|
+
x1 = taskXCoordinateRTL(task.end, dates2, columnWidth);
|
|
39322
39322
|
} else {
|
|
39323
|
-
x1 = taskXCoordinate(task.start,
|
|
39324
|
-
x2 = taskXCoordinate(task.end,
|
|
39323
|
+
x1 = taskXCoordinate(task.start, dates2, columnWidth);
|
|
39324
|
+
x2 = taskXCoordinate(task.end, dates2, columnWidth);
|
|
39325
39325
|
}
|
|
39326
39326
|
let typeInternal = task.type;
|
|
39327
39327
|
if (typeInternal === "task" && x2 - x1 < handleWidth * 2) {
|
|
@@ -39353,8 +39353,8 @@ const convertToBar = (task, index2, dates, columnWidth, rowHeight, taskHeight, b
|
|
|
39353
39353
|
styles
|
|
39354
39354
|
});
|
|
39355
39355
|
};
|
|
39356
|
-
const convertToMilestone = (task, index2,
|
|
39357
|
-
const x = taskXCoordinate(task.start,
|
|
39356
|
+
const convertToMilestone = (task, index2, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
|
|
39357
|
+
const x = taskXCoordinate(task.start, dates2, columnWidth);
|
|
39358
39358
|
const y = taskYCoordinate(index2, rowHeight, taskHeight);
|
|
39359
39359
|
const x1 = x - taskHeight * 0.5;
|
|
39360
39360
|
const x2 = x + taskHeight * 0.5;
|
|
@@ -39383,16 +39383,16 @@ const convertToMilestone = (task, index2, dates, columnWidth, rowHeight, taskHei
|
|
|
39383
39383
|
styles
|
|
39384
39384
|
});
|
|
39385
39385
|
};
|
|
39386
|
-
const taskXCoordinate = (xDate,
|
|
39386
|
+
const taskXCoordinate = (xDate, dates2, columnWidth) => {
|
|
39387
39387
|
var _a, _b, _c;
|
|
39388
|
-
const index2 =
|
|
39389
|
-
const remainderMillis = (xDate == null ? void 0 : xDate.getTime()) - ((_a =
|
|
39390
|
-
const percentOfInterval = remainderMillis / (((_b =
|
|
39388
|
+
const index2 = dates2.findIndex((d) => (d == null ? void 0 : d.getTime()) >= (xDate == null ? void 0 : xDate.getTime())) - 1;
|
|
39389
|
+
const remainderMillis = (xDate == null ? void 0 : xDate.getTime()) - ((_a = dates2[index2]) == null ? void 0 : _a.getTime());
|
|
39390
|
+
const percentOfInterval = remainderMillis / (((_b = dates2[index2 + 1]) == null ? void 0 : _b.getTime()) - ((_c = dates2[index2]) == null ? void 0 : _c.getTime()));
|
|
39391
39391
|
const x = index2 * columnWidth + percentOfInterval * columnWidth;
|
|
39392
39392
|
return isNaN(x) ? 0 : x;
|
|
39393
39393
|
};
|
|
39394
|
-
const taskXCoordinateRTL = (xDate,
|
|
39395
|
-
let x = taskXCoordinate(xDate,
|
|
39394
|
+
const taskXCoordinateRTL = (xDate, dates2, columnWidth) => {
|
|
39395
|
+
let x = taskXCoordinate(xDate, dates2, columnWidth);
|
|
39396
39396
|
x += columnWidth;
|
|
39397
39397
|
return isNaN(x) ? 0 : x;
|
|
39398
39398
|
};
|
|
@@ -39705,7 +39705,7 @@ const ganttDateRange = (tasks, viewMode, preStepsCount) => {
|
|
|
39705
39705
|
};
|
|
39706
39706
|
const seedDates = (startDate, endDate, viewMode) => {
|
|
39707
39707
|
let currentDate = new Date(startDate);
|
|
39708
|
-
const
|
|
39708
|
+
const dates2 = [currentDate];
|
|
39709
39709
|
while (currentDate < endDate) {
|
|
39710
39710
|
switch (viewMode) {
|
|
39711
39711
|
case ViewMode.Year:
|
|
@@ -39733,9 +39733,9 @@ const seedDates = (startDate, endDate, viewMode) => {
|
|
|
39733
39733
|
currentDate = addToDate(currentDate, 1, "hour");
|
|
39734
39734
|
break;
|
|
39735
39735
|
}
|
|
39736
|
-
|
|
39736
|
+
dates2.push(currentDate);
|
|
39737
39737
|
}
|
|
39738
|
-
return
|
|
39738
|
+
return dates2;
|
|
39739
39739
|
};
|
|
39740
39740
|
const getLocaleMonth = (date2, locale2) => {
|
|
39741
39741
|
let bottomValue = getCachedDateTimeFormat(locale2, {
|
|
@@ -40286,11 +40286,11 @@ const Calendar = ({
|
|
|
40286
40286
|
const bottomValues2 = [];
|
|
40287
40287
|
let weeksCount = 1;
|
|
40288
40288
|
const topDefaultHeight = headerHeight * 0.5;
|
|
40289
|
-
const
|
|
40290
|
-
for (let i =
|
|
40291
|
-
const date2 =
|
|
40289
|
+
const dates2 = dateSetup.dates;
|
|
40290
|
+
for (let i = dates2.length - 1; i >= 0; i--) {
|
|
40291
|
+
const date2 = dates2[i];
|
|
40292
40292
|
let topValue = "";
|
|
40293
|
-
if (i === 0 || date2.getMonth() !==
|
|
40293
|
+
if (i === 0 || date2.getMonth() !== dates2[i - 1].getMonth()) {
|
|
40294
40294
|
topValue = `${getLocaleMonth(date2, locale2)}, ${date2.getFullYear()}`;
|
|
40295
40295
|
}
|
|
40296
40296
|
const bottomValue = `W${getWeekNumberISO8601(date2)}`;
|
|
@@ -40307,7 +40307,7 @@ const Calendar = ({
|
|
|
40307
40307
|
)
|
|
40308
40308
|
);
|
|
40309
40309
|
if (topValue) {
|
|
40310
|
-
if (i !==
|
|
40310
|
+
if (i !== dates2.length - 1) {
|
|
40311
40311
|
topValues2.push(
|
|
40312
40312
|
/* @__PURE__ */ jsx(
|
|
40313
40313
|
TopPartOfCalendar,
|
|
@@ -40333,9 +40333,9 @@ const Calendar = ({
|
|
|
40333
40333
|
const topValues2 = [];
|
|
40334
40334
|
const bottomValues2 = [];
|
|
40335
40335
|
const topDefaultHeight = headerHeight * 0.5;
|
|
40336
|
-
const
|
|
40337
|
-
for (let i = 0; i <
|
|
40338
|
-
const date2 =
|
|
40336
|
+
const dates2 = dateSetup.dates;
|
|
40337
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
40338
|
+
const date2 = dates2[i];
|
|
40339
40339
|
const bottomValue = `${date2.getDate().toString()}`;
|
|
40340
40340
|
bottomValues2.push(
|
|
40341
40341
|
/* @__PURE__ */ jsx(
|
|
@@ -40349,7 +40349,7 @@ const Calendar = ({
|
|
|
40349
40349
|
date2.getTime()
|
|
40350
40350
|
)
|
|
40351
40351
|
);
|
|
40352
|
-
if (i + 1 !==
|
|
40352
|
+
if (i + 1 !== dates2.length && date2.getMonth() !== dates2[i + 1].getMonth()) {
|
|
40353
40353
|
const topValue = getLocaleMonth(date2, locale2);
|
|
40354
40354
|
topValues2.push(
|
|
40355
40355
|
/* @__PURE__ */ jsx(
|
|
@@ -40374,9 +40374,9 @@ const Calendar = ({
|
|
|
40374
40374
|
const bottomValues2 = [];
|
|
40375
40375
|
const ticks = viewMode === ViewMode.HalfDay ? 2 : 4;
|
|
40376
40376
|
const topDefaultHeight = headerHeight * 0.5;
|
|
40377
|
-
const
|
|
40378
|
-
for (let i = 0; i <
|
|
40379
|
-
const date2 =
|
|
40377
|
+
const dates2 = dateSetup.dates;
|
|
40378
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
40379
|
+
const date2 = dates2[i];
|
|
40380
40380
|
const bottomValue = getCachedDateTimeFormat(locale2, {
|
|
40381
40381
|
hour: "numeric"
|
|
40382
40382
|
}).format(date2).replace("时", "");
|
|
@@ -40393,7 +40393,7 @@ const Calendar = ({
|
|
|
40393
40393
|
date2.getTime()
|
|
40394
40394
|
)
|
|
40395
40395
|
);
|
|
40396
|
-
if (i === 0 || date2.getDate() !==
|
|
40396
|
+
if (i === 0 || date2.getDate() !== dates2[i - 1].getDate()) {
|
|
40397
40397
|
const topValue = `${getLocalDayOfWeek(date2, locale2, "short")}, ${date2.getDate()} ${getLocaleMonth(
|
|
40398
40398
|
date2,
|
|
40399
40399
|
locale2
|
|
@@ -40421,9 +40421,9 @@ const Calendar = ({
|
|
|
40421
40421
|
const topValues2 = [];
|
|
40422
40422
|
const bottomValues2 = [];
|
|
40423
40423
|
const topDefaultHeight = headerHeight * 0.5;
|
|
40424
|
-
const
|
|
40425
|
-
for (let i = 0; i <
|
|
40426
|
-
const date2 =
|
|
40424
|
+
const dates2 = dateSetup.dates;
|
|
40425
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
40426
|
+
const date2 = dates2[i];
|
|
40427
40427
|
const bottomValue = (_a = getCachedDateTimeFormat(locale2, {
|
|
40428
40428
|
hour: "numeric"
|
|
40429
40429
|
}).format(date2)) == null ? void 0 : _a.replace("时", "");
|
|
@@ -40440,8 +40440,8 @@ const Calendar = ({
|
|
|
40440
40440
|
date2.getTime()
|
|
40441
40441
|
)
|
|
40442
40442
|
);
|
|
40443
|
-
if (i !== 0 && date2.getDate() !==
|
|
40444
|
-
const displayDate =
|
|
40443
|
+
if (i !== 0 && date2.getDate() !== dates2[i - 1].getDate()) {
|
|
40444
|
+
const displayDate = dates2[i - 1];
|
|
40445
40445
|
const topValue = `${getLocalDayOfWeek(displayDate, locale2, "long")}, ${displayDate.getDate()} ${getLocaleMonth(
|
|
40446
40446
|
displayDate,
|
|
40447
40447
|
locale2
|
|
@@ -40530,10 +40530,10 @@ const useStyles$b = genStyleHook("nb-grid-body", (token) => {
|
|
|
40530
40530
|
}
|
|
40531
40531
|
};
|
|
40532
40532
|
});
|
|
40533
|
-
const empty = [{ id: uid$
|
|
40533
|
+
const empty = [{ id: uid$1() }, { id: uid$1() }, { id: uid$1() }];
|
|
40534
40534
|
const GridBody = ({
|
|
40535
40535
|
tasks,
|
|
40536
|
-
dates,
|
|
40536
|
+
dates: dates2,
|
|
40537
40537
|
rowHeight,
|
|
40538
40538
|
svgWidth,
|
|
40539
40539
|
columnWidth,
|
|
@@ -40581,14 +40581,14 @@ const GridBody = ({
|
|
|
40581
40581
|
let tickX = 0;
|
|
40582
40582
|
const ticks = [];
|
|
40583
40583
|
let today = /* @__PURE__ */ jsx("rect", {});
|
|
40584
|
-
for (let i = 0; i <
|
|
40585
|
-
const date2 =
|
|
40584
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
40585
|
+
const date2 = dates2[i];
|
|
40586
40586
|
ticks.push(/* @__PURE__ */ jsx("line", { x1: tickX, y1: 0, x2: tickX, y2: y, className: cx("gridTick") }, date2.getTime()));
|
|
40587
|
-
if (i + 1 !==
|
|
40588
|
-
i !== 0 && i + 1 ===
|
|
40587
|
+
if (i + 1 !== dates2.length && date2.getTime() < now.getTime() && dates2[i + 1].getTime() >= now.getTime() || // if current date is last
|
|
40588
|
+
i !== 0 && i + 1 === dates2.length && date2.getTime() < now.getTime() && addToDate(date2, date2.getTime() - dates2[i - 1].getTime(), "millisecond").getTime() >= now.getTime()) {
|
|
40589
40589
|
today = /* @__PURE__ */ jsx("rect", { x: tickX, y: 0, width: columnWidth, height: y, fill: todayColor });
|
|
40590
40590
|
}
|
|
40591
|
-
if (rtl && i + 1 !==
|
|
40591
|
+
if (rtl && i + 1 !== dates2.length && date2.getTime() >= now.getTime() && dates2[i + 1].getTime() < now.getTime()) {
|
|
40592
40592
|
today = /* @__PURE__ */ jsx("rect", { x: tickX + columnWidth, y: 0, width: columnWidth, height: y, fill: todayColor });
|
|
40593
40593
|
}
|
|
40594
40594
|
tickX += columnWidth;
|
|
@@ -41055,7 +41055,7 @@ let lastAction = null;
|
|
|
41055
41055
|
let lastStart = null;
|
|
41056
41056
|
const TaskGanttContent = ({
|
|
41057
41057
|
tasks,
|
|
41058
|
-
dates,
|
|
41058
|
+
dates: dates2,
|
|
41059
41059
|
ganttEvent,
|
|
41060
41060
|
selectedTask,
|
|
41061
41061
|
rowHeight,
|
|
@@ -41084,10 +41084,10 @@ const TaskGanttContent = ({
|
|
|
41084
41084
|
const [isMoving, setIsMoving] = useState(false);
|
|
41085
41085
|
useEffect(() => {
|
|
41086
41086
|
var _a2, _b, _c, _d;
|
|
41087
|
-
const dateDelta = ((_a2 =
|
|
41087
|
+
const dateDelta = ((_a2 = dates2[1]) == null ? void 0 : _a2.getTime()) - ((_b = dates2[0]) == null ? void 0 : _b.getTime()) - ((_c = dates2[1]) == null ? void 0 : _c.getTimezoneOffset()) * 60 * 1e3 + ((_d = dates2[0]) == null ? void 0 : _d.getTimezoneOffset()) * 60 * 1e3;
|
|
41088
41088
|
const newXStep = timeStep * columnWidth / dateDelta;
|
|
41089
41089
|
setXStep(newXStep);
|
|
41090
|
-
}, [columnWidth,
|
|
41090
|
+
}, [columnWidth, dates2, timeStep]);
|
|
41091
41091
|
useEffect(() => {
|
|
41092
41092
|
const handleMouseMove = (event) => __async(void 0, null, function* () {
|
|
41093
41093
|
var _a2;
|
|
@@ -41502,9 +41502,9 @@ const Gantt = (props) => {
|
|
|
41502
41502
|
]);
|
|
41503
41503
|
useEffect(() => {
|
|
41504
41504
|
if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate == null ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
|
|
41505
|
-
const
|
|
41506
|
-
const index2 =
|
|
41507
|
-
(d, i) => viewDate.valueOf() >= d.valueOf() && i + 1 !==
|
|
41505
|
+
const dates2 = dateSetup.dates;
|
|
41506
|
+
const index2 = dates2.findIndex(
|
|
41507
|
+
(d, i) => viewDate.valueOf() >= d.valueOf() && i + 1 !== dates2.length && viewDate.valueOf() < dates2[i + 1].valueOf()
|
|
41508
41508
|
);
|
|
41509
41509
|
if (index2 === -1) {
|
|
41510
41510
|
return;
|
|
@@ -65891,8 +65891,9 @@ const getProps = (app) => {
|
|
|
65891
65891
|
if (app.ws.serverDown) {
|
|
65892
65892
|
return {
|
|
65893
65893
|
status: "error",
|
|
65894
|
-
|
|
65895
|
-
|
|
65894
|
+
icon: /* @__PURE__ */ jsx(DisconnectOutlined, {}),
|
|
65895
|
+
title: "You're offline",
|
|
65896
|
+
subTitle: "Please check the server status or network connection status"
|
|
65896
65897
|
};
|
|
65897
65898
|
}
|
|
65898
65899
|
if (!app.error) {
|
package/lib/index.js
CHANGED
|
@@ -752,11 +752,10 @@ var import_react_drag_listview = __toESM(require("react-drag-listview"));
|
|
|
752
752
|
var import_internals = require("@formily/core/esm/shared/internals");
|
|
753
753
|
var import_style3 = __toESM(require("antd/es/input/style"));
|
|
754
754
|
var import_sanitize_html = __toESM(require("sanitize-html"));
|
|
755
|
-
var import_utils = require("@nocobase/utils");
|
|
756
755
|
var import_lru_cache = __toESM(require("lru-cache"));
|
|
757
756
|
var import_cron_parser = require("cron-parser");
|
|
758
|
-
var import_date_arithmetic = require("date-arithmetic");
|
|
759
757
|
var import_react_big_calendar = require("react-big-calendar");
|
|
758
|
+
var dates = __toESM(require("react-big-calendar/lib/utils/dates"));
|
|
760
759
|
var import_solarlunar_es = __toESM(require("solarlunar-es"));
|
|
761
760
|
var import_react_big_calendar2 = require("react-big-calendar/dist/react-big-calendar.esm");
|
|
762
761
|
var import_useAttach = require("@formily/react/esm/hooks/useAttach");
|
|
@@ -20489,16 +20488,17 @@ const useTableBlockProps = () => {
|
|
|
20489
20488
|
const globalSort = (_c = (_b = (_a = fieldSchema.parent) == null ? void 0 : _a["x-decorator-props"]) == null ? void 0 : _b["params"]) == null ? void 0 : _c["sort"];
|
|
20490
20489
|
const { getDataBlocks } = useFilterBlock();
|
|
20491
20490
|
(0, import_react2.useEffect)(() => {
|
|
20492
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m, _n;
|
|
20491
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m, _n, _o, _p;
|
|
20493
20492
|
if (!((_a2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _a2.loading)) {
|
|
20494
20493
|
field.value = [];
|
|
20495
20494
|
field.value = (_c2 = (_b2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _b2.data) == null ? void 0 : _c2.data;
|
|
20495
|
+
field.setInitialValue((_e2 = (_d2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _d2.data) == null ? void 0 : _e2.data);
|
|
20496
20496
|
field.data = field.data || {};
|
|
20497
|
-
field.data.selectedRowKeys = (
|
|
20497
|
+
field.data.selectedRowKeys = (_g2 = (_f2 = ctx == null ? void 0 : ctx.field) == null ? void 0 : _f2.data) == null ? void 0 : _g2.selectedRowKeys;
|
|
20498
20498
|
field.componentProps.pagination = field.componentProps.pagination || {};
|
|
20499
|
-
field.componentProps.pagination.pageSize = (
|
|
20500
|
-
field.componentProps.pagination.total = (
|
|
20501
|
-
field.componentProps.pagination.current = (
|
|
20499
|
+
field.componentProps.pagination.pageSize = (_j = (_i2 = (_h2 = ctx == null ? void 0 : ctx.service) == null ? void 0 : _h2.data) == null ? void 0 : _i2.meta) == null ? void 0 : _j.pageSize;
|
|
20500
|
+
field.componentProps.pagination.total = (_m = (_l = (_k = ctx == null ? void 0 : ctx.service) == null ? void 0 : _k.data) == null ? void 0 : _l.meta) == null ? void 0 : _m.count;
|
|
20501
|
+
field.componentProps.pagination.current = (_p = (_o = (_n = ctx == null ? void 0 : ctx.service) == null ? void 0 : _n.data) == null ? void 0 : _o.meta) == null ? void 0 : _p.page;
|
|
20502
20502
|
}
|
|
20503
20503
|
}, [(_d = ctx == null ? void 0 : ctx.service) == null ? void 0 : _d.loading]);
|
|
20504
20504
|
return {
|
|
@@ -37883,10 +37883,10 @@ const Calendar$1 = (0, import_react.observer)(
|
|
|
37883
37883
|
agendaDateFormat: "M-DD",
|
|
37884
37884
|
dayHeaderFormat: "YYYY-M-DD",
|
|
37885
37885
|
dayRangeHeaderFormat: ({ start, end }, culture, local) => {
|
|
37886
|
-
if (
|
|
37887
|
-
return local.format(start, "
|
|
37886
|
+
if (dates.eq(start, end, "month")) {
|
|
37887
|
+
return local.format(start, "YYYY-M", culture);
|
|
37888
37888
|
}
|
|
37889
|
-
return `${local.format(start, "
|
|
37889
|
+
return `${local.format(start, "YYYY-M", culture)} - ${local.format(end, "YYYY-M", culture)}`;
|
|
37890
37890
|
}
|
|
37891
37891
|
},
|
|
37892
37892
|
components: components2,
|
|
@@ -38360,7 +38360,7 @@ function useOptions$2({ filter, isTableOid }) {
|
|
|
38360
38360
|
const field = (0, import_react.useField)();
|
|
38361
38361
|
const ctx = (0, import_react2.useContext)(FilterContext$2);
|
|
38362
38362
|
const collection2 = useCollection();
|
|
38363
|
-
const targetCollection = isTableOid && (((_a = ctx == null ? void 0 : ctx.field) == null ? void 0 : _a.collectionName) || collection2.name);
|
|
38363
|
+
const targetCollection = isTableOid && (((_a = ctx == null ? void 0 : ctx.field) == null ? void 0 : _a.collectionName) || ctx.collectionName || collection2.name);
|
|
38364
38364
|
const inheritCollections = useSelfAndChildrenCollections(targetCollection);
|
|
38365
38365
|
const { collections = [] } = useCollectionManager();
|
|
38366
38366
|
const currentCollections = (field == null ? void 0 : field.dataSource) ? collections.filter((v) => {
|
|
@@ -38826,7 +38826,7 @@ function replaceVariables(_0, _1) {
|
|
|
38826
38826
|
}
|
|
38827
38827
|
const waitForParsing = (_a = value.match(REGEX_OF_VARIABLE)) == null ? void 0 : _a.map((item) => __async(this, null, function* () {
|
|
38828
38828
|
const result = yield variables.parseVariable(item, localVariables);
|
|
38829
|
-
const id2 = `_${(0,
|
|
38829
|
+
const id2 = `_${(0, import_client.uid)()}`;
|
|
38830
38830
|
scope[id2] = result;
|
|
38831
38831
|
store[item] = id2;
|
|
38832
38832
|
return result;
|
|
@@ -39874,12 +39874,12 @@ const G2Plot = (0, import_react.observer)(
|
|
|
39874
39874
|
);
|
|
39875
39875
|
G2Plot.Designer = G2PlotDesigner;
|
|
39876
39876
|
G2Plot.plots = plots;
|
|
39877
|
-
const convertToBarTasks = (tasks,
|
|
39877
|
+
const convertToBarTasks = (tasks, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
|
|
39878
39878
|
let barTasks = tasks.map((t, i) => {
|
|
39879
39879
|
return convertToBarTask(
|
|
39880
39880
|
t,
|
|
39881
39881
|
i,
|
|
39882
|
-
|
|
39882
|
+
dates2,
|
|
39883
39883
|
columnWidth,
|
|
39884
39884
|
rowHeight,
|
|
39885
39885
|
taskHeight,
|
|
@@ -39909,14 +39909,14 @@ const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, bar
|
|
|
39909
39909
|
});
|
|
39910
39910
|
return barTasks;
|
|
39911
39911
|
};
|
|
39912
|
-
const convertToBarTask = (task, index2,
|
|
39912
|
+
const convertToBarTask = (task, index2, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
|
|
39913
39913
|
let barTask;
|
|
39914
39914
|
switch (task.type) {
|
|
39915
39915
|
case "milestone":
|
|
39916
39916
|
barTask = convertToMilestone(
|
|
39917
39917
|
task,
|
|
39918
39918
|
index2,
|
|
39919
|
-
|
|
39919
|
+
dates2,
|
|
39920
39920
|
columnWidth,
|
|
39921
39921
|
rowHeight,
|
|
39922
39922
|
taskHeight,
|
|
@@ -39930,7 +39930,7 @@ const convertToBarTask = (task, index2, dates, columnWidth, rowHeight, taskHeigh
|
|
|
39930
39930
|
barTask = convertToBar(
|
|
39931
39931
|
task,
|
|
39932
39932
|
index2,
|
|
39933
|
-
|
|
39933
|
+
dates2,
|
|
39934
39934
|
columnWidth,
|
|
39935
39935
|
rowHeight,
|
|
39936
39936
|
taskHeight * 0.5,
|
|
@@ -39947,7 +39947,7 @@ const convertToBarTask = (task, index2, dates, columnWidth, rowHeight, taskHeigh
|
|
|
39947
39947
|
barTask = convertToBar(
|
|
39948
39948
|
task,
|
|
39949
39949
|
index2,
|
|
39950
|
-
|
|
39950
|
+
dates2,
|
|
39951
39951
|
columnWidth,
|
|
39952
39952
|
rowHeight,
|
|
39953
39953
|
taskHeight,
|
|
@@ -39963,15 +39963,15 @@ const convertToBarTask = (task, index2, dates, columnWidth, rowHeight, taskHeigh
|
|
|
39963
39963
|
}
|
|
39964
39964
|
return barTask;
|
|
39965
39965
|
};
|
|
39966
|
-
const convertToBar = (task, index2,
|
|
39966
|
+
const convertToBar = (task, index2, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor) => {
|
|
39967
39967
|
let x1;
|
|
39968
39968
|
let x2;
|
|
39969
39969
|
if (rtl) {
|
|
39970
|
-
x2 = taskXCoordinateRTL(task.start,
|
|
39971
|
-
x1 = taskXCoordinateRTL(task.end,
|
|
39970
|
+
x2 = taskXCoordinateRTL(task.start, dates2, columnWidth);
|
|
39971
|
+
x1 = taskXCoordinateRTL(task.end, dates2, columnWidth);
|
|
39972
39972
|
} else {
|
|
39973
|
-
x1 = taskXCoordinate(task.start,
|
|
39974
|
-
x2 = taskXCoordinate(task.end,
|
|
39973
|
+
x1 = taskXCoordinate(task.start, dates2, columnWidth);
|
|
39974
|
+
x2 = taskXCoordinate(task.end, dates2, columnWidth);
|
|
39975
39975
|
}
|
|
39976
39976
|
let typeInternal = task.type;
|
|
39977
39977
|
if (typeInternal === "task" && x2 - x1 < handleWidth * 2) {
|
|
@@ -40003,8 +40003,8 @@ const convertToBar = (task, index2, dates, columnWidth, rowHeight, taskHeight, b
|
|
|
40003
40003
|
styles
|
|
40004
40004
|
});
|
|
40005
40005
|
};
|
|
40006
|
-
const convertToMilestone = (task, index2,
|
|
40007
|
-
const x = taskXCoordinate(task.start,
|
|
40006
|
+
const convertToMilestone = (task, index2, dates2, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
|
|
40007
|
+
const x = taskXCoordinate(task.start, dates2, columnWidth);
|
|
40008
40008
|
const y = taskYCoordinate(index2, rowHeight, taskHeight);
|
|
40009
40009
|
const x1 = x - taskHeight * 0.5;
|
|
40010
40010
|
const x2 = x + taskHeight * 0.5;
|
|
@@ -40033,16 +40033,16 @@ const convertToMilestone = (task, index2, dates, columnWidth, rowHeight, taskHei
|
|
|
40033
40033
|
styles
|
|
40034
40034
|
});
|
|
40035
40035
|
};
|
|
40036
|
-
const taskXCoordinate = (xDate,
|
|
40036
|
+
const taskXCoordinate = (xDate, dates2, columnWidth) => {
|
|
40037
40037
|
var _a, _b, _c;
|
|
40038
|
-
const index2 =
|
|
40039
|
-
const remainderMillis = (xDate == null ? void 0 : xDate.getTime()) - ((_a =
|
|
40040
|
-
const percentOfInterval = remainderMillis / (((_b =
|
|
40038
|
+
const index2 = dates2.findIndex((d) => (d == null ? void 0 : d.getTime()) >= (xDate == null ? void 0 : xDate.getTime())) - 1;
|
|
40039
|
+
const remainderMillis = (xDate == null ? void 0 : xDate.getTime()) - ((_a = dates2[index2]) == null ? void 0 : _a.getTime());
|
|
40040
|
+
const percentOfInterval = remainderMillis / (((_b = dates2[index2 + 1]) == null ? void 0 : _b.getTime()) - ((_c = dates2[index2]) == null ? void 0 : _c.getTime()));
|
|
40041
40041
|
const x = index2 * columnWidth + percentOfInterval * columnWidth;
|
|
40042
40042
|
return isNaN(x) ? 0 : x;
|
|
40043
40043
|
};
|
|
40044
|
-
const taskXCoordinateRTL = (xDate,
|
|
40045
|
-
let x = taskXCoordinate(xDate,
|
|
40044
|
+
const taskXCoordinateRTL = (xDate, dates2, columnWidth) => {
|
|
40045
|
+
let x = taskXCoordinate(xDate, dates2, columnWidth);
|
|
40046
40046
|
x += columnWidth;
|
|
40047
40047
|
return isNaN(x) ? 0 : x;
|
|
40048
40048
|
};
|
|
@@ -40355,7 +40355,7 @@ const ganttDateRange = (tasks, viewMode, preStepsCount) => {
|
|
|
40355
40355
|
};
|
|
40356
40356
|
const seedDates = (startDate, endDate, viewMode) => {
|
|
40357
40357
|
let currentDate = new Date(startDate);
|
|
40358
|
-
const
|
|
40358
|
+
const dates2 = [currentDate];
|
|
40359
40359
|
while (currentDate < endDate) {
|
|
40360
40360
|
switch (viewMode) {
|
|
40361
40361
|
case ViewMode.Year:
|
|
@@ -40383,9 +40383,9 @@ const seedDates = (startDate, endDate, viewMode) => {
|
|
|
40383
40383
|
currentDate = addToDate(currentDate, 1, "hour");
|
|
40384
40384
|
break;
|
|
40385
40385
|
}
|
|
40386
|
-
|
|
40386
|
+
dates2.push(currentDate);
|
|
40387
40387
|
}
|
|
40388
|
-
return
|
|
40388
|
+
return dates2;
|
|
40389
40389
|
};
|
|
40390
40390
|
const getLocaleMonth = (date2, locale2) => {
|
|
40391
40391
|
let bottomValue = getCachedDateTimeFormat(locale2, {
|
|
@@ -40936,11 +40936,11 @@ const Calendar = ({
|
|
|
40936
40936
|
const bottomValues2 = [];
|
|
40937
40937
|
let weeksCount = 1;
|
|
40938
40938
|
const topDefaultHeight = headerHeight * 0.5;
|
|
40939
|
-
const
|
|
40940
|
-
for (let i =
|
|
40941
|
-
const date2 =
|
|
40939
|
+
const dates2 = dateSetup.dates;
|
|
40940
|
+
for (let i = dates2.length - 1; i >= 0; i--) {
|
|
40941
|
+
const date2 = dates2[i];
|
|
40942
40942
|
let topValue = "";
|
|
40943
|
-
if (i === 0 || date2.getMonth() !==
|
|
40943
|
+
if (i === 0 || date2.getMonth() !== dates2[i - 1].getMonth()) {
|
|
40944
40944
|
topValue = `${getLocaleMonth(date2, locale2)}, ${date2.getFullYear()}`;
|
|
40945
40945
|
}
|
|
40946
40946
|
const bottomValue = `W${getWeekNumberISO8601(date2)}`;
|
|
@@ -40957,7 +40957,7 @@ const Calendar = ({
|
|
|
40957
40957
|
)
|
|
40958
40958
|
);
|
|
40959
40959
|
if (topValue) {
|
|
40960
|
-
if (i !==
|
|
40960
|
+
if (i !== dates2.length - 1) {
|
|
40961
40961
|
topValues2.push(
|
|
40962
40962
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40963
40963
|
TopPartOfCalendar,
|
|
@@ -40983,9 +40983,9 @@ const Calendar = ({
|
|
|
40983
40983
|
const topValues2 = [];
|
|
40984
40984
|
const bottomValues2 = [];
|
|
40985
40985
|
const topDefaultHeight = headerHeight * 0.5;
|
|
40986
|
-
const
|
|
40987
|
-
for (let i = 0; i <
|
|
40988
|
-
const date2 =
|
|
40986
|
+
const dates2 = dateSetup.dates;
|
|
40987
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
40988
|
+
const date2 = dates2[i];
|
|
40989
40989
|
const bottomValue = `${date2.getDate().toString()}`;
|
|
40990
40990
|
bottomValues2.push(
|
|
40991
40991
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -40999,7 +40999,7 @@ const Calendar = ({
|
|
|
40999
40999
|
date2.getTime()
|
|
41000
41000
|
)
|
|
41001
41001
|
);
|
|
41002
|
-
if (i + 1 !==
|
|
41002
|
+
if (i + 1 !== dates2.length && date2.getMonth() !== dates2[i + 1].getMonth()) {
|
|
41003
41003
|
const topValue = getLocaleMonth(date2, locale2);
|
|
41004
41004
|
topValues2.push(
|
|
41005
41005
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -41024,9 +41024,9 @@ const Calendar = ({
|
|
|
41024
41024
|
const bottomValues2 = [];
|
|
41025
41025
|
const ticks = viewMode === ViewMode.HalfDay ? 2 : 4;
|
|
41026
41026
|
const topDefaultHeight = headerHeight * 0.5;
|
|
41027
|
-
const
|
|
41028
|
-
for (let i = 0; i <
|
|
41029
|
-
const date2 =
|
|
41027
|
+
const dates2 = dateSetup.dates;
|
|
41028
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
41029
|
+
const date2 = dates2[i];
|
|
41030
41030
|
const bottomValue = getCachedDateTimeFormat(locale2, {
|
|
41031
41031
|
hour: "numeric"
|
|
41032
41032
|
}).format(date2).replace("时", "");
|
|
@@ -41043,7 +41043,7 @@ const Calendar = ({
|
|
|
41043
41043
|
date2.getTime()
|
|
41044
41044
|
)
|
|
41045
41045
|
);
|
|
41046
|
-
if (i === 0 || date2.getDate() !==
|
|
41046
|
+
if (i === 0 || date2.getDate() !== dates2[i - 1].getDate()) {
|
|
41047
41047
|
const topValue = `${getLocalDayOfWeek(date2, locale2, "short")}, ${date2.getDate()} ${getLocaleMonth(
|
|
41048
41048
|
date2,
|
|
41049
41049
|
locale2
|
|
@@ -41071,9 +41071,9 @@ const Calendar = ({
|
|
|
41071
41071
|
const topValues2 = [];
|
|
41072
41072
|
const bottomValues2 = [];
|
|
41073
41073
|
const topDefaultHeight = headerHeight * 0.5;
|
|
41074
|
-
const
|
|
41075
|
-
for (let i = 0; i <
|
|
41076
|
-
const date2 =
|
|
41074
|
+
const dates2 = dateSetup.dates;
|
|
41075
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
41076
|
+
const date2 = dates2[i];
|
|
41077
41077
|
const bottomValue = (_a = getCachedDateTimeFormat(locale2, {
|
|
41078
41078
|
hour: "numeric"
|
|
41079
41079
|
}).format(date2)) == null ? void 0 : _a.replace("时", "");
|
|
@@ -41090,8 +41090,8 @@ const Calendar = ({
|
|
|
41090
41090
|
date2.getTime()
|
|
41091
41091
|
)
|
|
41092
41092
|
);
|
|
41093
|
-
if (i !== 0 && date2.getDate() !==
|
|
41094
|
-
const displayDate =
|
|
41093
|
+
if (i !== 0 && date2.getDate() !== dates2[i - 1].getDate()) {
|
|
41094
|
+
const displayDate = dates2[i - 1];
|
|
41095
41095
|
const topValue = `${getLocalDayOfWeek(displayDate, locale2, "long")}, ${displayDate.getDate()} ${getLocaleMonth(
|
|
41096
41096
|
displayDate,
|
|
41097
41097
|
locale2
|
|
@@ -41183,7 +41183,7 @@ const useStyles$b = genStyleHook("nb-grid-body", (token) => {
|
|
|
41183
41183
|
const empty = [{ id: (0, import_client.uid)() }, { id: (0, import_client.uid)() }, { id: (0, import_client.uid)() }];
|
|
41184
41184
|
const GridBody = ({
|
|
41185
41185
|
tasks,
|
|
41186
|
-
dates,
|
|
41186
|
+
dates: dates2,
|
|
41187
41187
|
rowHeight,
|
|
41188
41188
|
svgWidth,
|
|
41189
41189
|
columnWidth,
|
|
@@ -41231,14 +41231,14 @@ const GridBody = ({
|
|
|
41231
41231
|
let tickX = 0;
|
|
41232
41232
|
const ticks = [];
|
|
41233
41233
|
let today = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {});
|
|
41234
|
-
for (let i = 0; i <
|
|
41235
|
-
const date2 =
|
|
41234
|
+
for (let i = 0; i < dates2.length; i++) {
|
|
41235
|
+
const date2 = dates2[i];
|
|
41236
41236
|
ticks.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: tickX, y1: 0, x2: tickX, y2: y, className: (0, import_css.cx)("gridTick") }, date2.getTime()));
|
|
41237
|
-
if (i + 1 !==
|
|
41238
|
-
i !== 0 && i + 1 ===
|
|
41237
|
+
if (i + 1 !== dates2.length && date2.getTime() < now.getTime() && dates2[i + 1].getTime() >= now.getTime() || // if current date is last
|
|
41238
|
+
i !== 0 && i + 1 === dates2.length && date2.getTime() < now.getTime() && addToDate(date2, date2.getTime() - dates2[i - 1].getTime(), "millisecond").getTime() >= now.getTime()) {
|
|
41239
41239
|
today = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: tickX, y: 0, width: columnWidth, height: y, fill: todayColor });
|
|
41240
41240
|
}
|
|
41241
|
-
if (rtl && i + 1 !==
|
|
41241
|
+
if (rtl && i + 1 !== dates2.length && date2.getTime() >= now.getTime() && dates2[i + 1].getTime() < now.getTime()) {
|
|
41242
41242
|
today = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: tickX + columnWidth, y: 0, width: columnWidth, height: y, fill: todayColor });
|
|
41243
41243
|
}
|
|
41244
41244
|
tickX += columnWidth;
|
|
@@ -41705,7 +41705,7 @@ let lastAction = null;
|
|
|
41705
41705
|
let lastStart = null;
|
|
41706
41706
|
const TaskGanttContent = ({
|
|
41707
41707
|
tasks,
|
|
41708
|
-
dates,
|
|
41708
|
+
dates: dates2,
|
|
41709
41709
|
ganttEvent,
|
|
41710
41710
|
selectedTask,
|
|
41711
41711
|
rowHeight,
|
|
@@ -41734,10 +41734,10 @@ const TaskGanttContent = ({
|
|
|
41734
41734
|
const [isMoving, setIsMoving] = (0, import_react2.useState)(false);
|
|
41735
41735
|
(0, import_react2.useEffect)(() => {
|
|
41736
41736
|
var _a2, _b, _c, _d;
|
|
41737
|
-
const dateDelta = ((_a2 =
|
|
41737
|
+
const dateDelta = ((_a2 = dates2[1]) == null ? void 0 : _a2.getTime()) - ((_b = dates2[0]) == null ? void 0 : _b.getTime()) - ((_c = dates2[1]) == null ? void 0 : _c.getTimezoneOffset()) * 60 * 1e3 + ((_d = dates2[0]) == null ? void 0 : _d.getTimezoneOffset()) * 60 * 1e3;
|
|
41738
41738
|
const newXStep = timeStep * columnWidth / dateDelta;
|
|
41739
41739
|
setXStep(newXStep);
|
|
41740
|
-
}, [columnWidth,
|
|
41740
|
+
}, [columnWidth, dates2, timeStep]);
|
|
41741
41741
|
(0, import_react2.useEffect)(() => {
|
|
41742
41742
|
const handleMouseMove = (event) => __async(void 0, null, function* () {
|
|
41743
41743
|
var _a2;
|
|
@@ -42152,9 +42152,9 @@ const Gantt = (props) => {
|
|
|
42152
42152
|
]);
|
|
42153
42153
|
(0, import_react2.useEffect)(() => {
|
|
42154
42154
|
if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate == null ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
|
|
42155
|
-
const
|
|
42156
|
-
const index2 =
|
|
42157
|
-
(d, i) => viewDate.valueOf() >= d.valueOf() && i + 1 !==
|
|
42155
|
+
const dates2 = dateSetup.dates;
|
|
42156
|
+
const index2 = dates2.findIndex(
|
|
42157
|
+
(d, i) => viewDate.valueOf() >= d.valueOf() && i + 1 !== dates2.length && viewDate.valueOf() < dates2[i + 1].valueOf()
|
|
42158
42158
|
);
|
|
42159
42159
|
if (index2 === -1) {
|
|
42160
42160
|
return;
|
|
@@ -66540,8 +66540,9 @@ const getProps = (app) => {
|
|
|
66540
66540
|
if (app.ws.serverDown) {
|
|
66541
66541
|
return {
|
|
66542
66542
|
status: "error",
|
|
66543
|
-
|
|
66544
|
-
|
|
66543
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DisconnectOutlined, {}),
|
|
66544
|
+
title: "You're offline",
|
|
66545
|
+
subTitle: "Please check the server status or network connection status"
|
|
66545
66546
|
};
|
|
66546
66547
|
}
|
|
66547
66548
|
if (!app.error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/client",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@formily/reactive-react": "^2.2.27",
|
|
26
26
|
"@formily/shared": "^2.2.27",
|
|
27
27
|
"@formily/validator": "^2.2.27",
|
|
28
|
-
"@nocobase/evaluators": "0.15.0-alpha.
|
|
29
|
-
"@nocobase/sdk": "0.15.0-alpha.
|
|
30
|
-
"@nocobase/utils": "0.15.0-alpha.
|
|
28
|
+
"@nocobase/evaluators": "0.15.0-alpha.4",
|
|
29
|
+
"@nocobase/sdk": "0.15.0-alpha.4",
|
|
30
|
+
"@nocobase/utils": "0.15.0-alpha.4",
|
|
31
31
|
"@types/requirejs": "^2.1.34",
|
|
32
32
|
"ahooks": "^3.7.2",
|
|
33
33
|
"antd": "^5.8.6",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"dumi": "^2.2.0",
|
|
77
77
|
"dumi-theme-nocobase": "^0.2.14"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "380045c660ea0432f3e8fd7cf01c3cfe7275db34"
|
|
80
80
|
}
|