@nocobase/plugin-calendar 2.1.0-beta.12 → 2.1.0-beta.14

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.
@@ -0,0 +1,68 @@
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
+ import { CollectionBlockModel } from '@nocobase/client';
10
+ import { MultiRecordResource } from '@nocobase/flow-engine';
11
+ import React from 'react';
12
+ type CalendarCollectionField = {
13
+ name: string;
14
+ title?: string;
15
+ interface?: string;
16
+ type?: string;
17
+ uiSchema?: {
18
+ title?: string;
19
+ type?: string;
20
+ };
21
+ };
22
+ export declare class CalendarBlockModel extends CollectionBlockModel {
23
+ static scene: import("@nocobase/client").BlockSceneType;
24
+ customModelClasses: {
25
+ CollectionActionGroupModel: string;
26
+ };
27
+ static filterCollection(collection: any): boolean;
28
+ get calendarPlugin(): any;
29
+ getTitleInterfaces(): string[];
30
+ getColorInterfaces(): string[];
31
+ getDateFieldTypes(): any[];
32
+ getCollectionFields(): CalendarCollectionField[];
33
+ getTitleFieldOptions(): {
34
+ label: string;
35
+ value: string;
36
+ }[];
37
+ getColorFieldOptions(): {
38
+ label: string;
39
+ value: string;
40
+ }[];
41
+ getDateFieldOptions(): {
42
+ label: string;
43
+ value: string;
44
+ }[];
45
+ getDefaultTitleFieldName(): any;
46
+ getDefaultStartFieldName(): string;
47
+ getDefaultEndFieldName(): string;
48
+ getDefaultView(): any;
49
+ getEventOpenMode(): "dialog" | "drawer" | "embed";
50
+ getWeekStart(): 1 | 0;
51
+ getFieldNames(): {
52
+ id: string;
53
+ title: any;
54
+ start: any;
55
+ end: any;
56
+ colorFieldName: any;
57
+ };
58
+ createResource(): MultiRecordResource<unknown>;
59
+ renderComponent(): React.JSX.Element;
60
+ getQuickCreateAction(): any;
61
+ getEventViewAction(): any;
62
+ getPopupActionUid(actionKey: 'quickCreateAction' | 'eventViewAction'): string;
63
+ syncPopupActionOpenMode(action: any): Promise<void>;
64
+ ensurePopupAction(actionKey: 'quickCreateAction' | 'eventViewAction'): Promise<any>;
65
+ openQuickCreate(slotInfo: any): Promise<void>;
66
+ openEvent(record: any): Promise<void>;
67
+ }
68
+ export {};
@@ -0,0 +1,47 @@
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
+ import { ActionModel, CollectionActionGroupModel } from '@nocobase/client';
10
+ import React from 'react';
11
+ export declare class CalendarCollectionActionGroupModel extends CollectionActionGroupModel {
12
+ }
13
+ export declare class CalendarTodayActionModel extends ActionModel {
14
+ static scene: "collection";
15
+ defaultProps: {
16
+ type: "default";
17
+ title: string;
18
+ };
19
+ render(): React.JSX.Element;
20
+ }
21
+ export declare class CalendarNavActionModel extends ActionModel {
22
+ static scene: "collection";
23
+ enableEditTooltip: boolean;
24
+ enableEditTitle: boolean;
25
+ enableEditIcon: boolean;
26
+ enableEditType: boolean;
27
+ enableEditDanger: boolean;
28
+ render(): React.JSX.Element;
29
+ }
30
+ export declare class CalendarTitleActionModel extends ActionModel {
31
+ static scene: "collection";
32
+ enableEditTooltip: boolean;
33
+ enableEditTitle: boolean;
34
+ enableEditIcon: boolean;
35
+ enableEditType: boolean;
36
+ enableEditDanger: boolean;
37
+ render(): React.JSX.Element;
38
+ }
39
+ export declare class CalendarViewSelectActionModel extends ActionModel {
40
+ static scene: "collection";
41
+ enableEditTooltip: boolean;
42
+ enableEditTitle: boolean;
43
+ enableEditIcon: boolean;
44
+ enableEditType: boolean;
45
+ enableEditDanger: boolean;
46
+ render(): React.JSX.Element;
47
+ }
@@ -0,0 +1,23 @@
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
+ import { AddNewActionModel, ViewActionModel } from '@nocobase/client';
10
+ export declare const createCalendarQuickCreateActionOptions: (uid?: string) => {
11
+ uid: string;
12
+ use: string;
13
+ };
14
+ export declare const createCalendarEventViewActionOptions: (uid?: string) => {
15
+ uid: string;
16
+ use: string;
17
+ };
18
+ export declare class CalendarQuickCreateActionModel extends AddNewActionModel {
19
+ defaultPopupTitle: string;
20
+ }
21
+ export declare class CalendarEventViewActionModel extends ViewActionModel {
22
+ defaultPopupTitle: string;
23
+ }
@@ -0,0 +1,44 @@
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
+ import React from 'react';
10
+ import { View } from 'react-big-calendar';
11
+ interface Event {
12
+ id: string;
13
+ colorFieldValue: string;
14
+ title: string;
15
+ rawTitle?: string;
16
+ start: Date;
17
+ end: Date;
18
+ }
19
+ type CalendarBlockProps = {
20
+ actionBar?: React.ReactNode;
21
+ collection: any;
22
+ dataSource: any[];
23
+ defaultView?: View;
24
+ fieldNames: {
25
+ colorFieldName: string;
26
+ start: string;
27
+ end: string;
28
+ id: string;
29
+ title: string;
30
+ };
31
+ getBackgroundColor?: (value: string) => string | null;
32
+ getFontColor?: (value: string) => string | null;
33
+ onSelectEvent?: (payload: {
34
+ event: Event;
35
+ record: any;
36
+ }) => void;
37
+ onSelectSlot?: (payload: any) => void;
38
+ rangeLoadEnabled?: boolean;
39
+ resource?: any;
40
+ showLunar?: boolean;
41
+ weekStart?: number;
42
+ };
43
+ export declare const CalendarBlock: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<CalendarBlockProps>>;
44
+ export {};
@@ -0,0 +1,21 @@
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
+ import React from 'react';
10
+ type CalendarHeaderProps = {
11
+ date: Date;
12
+ label: string;
13
+ drilldownView?: string;
14
+ onDrillDown?: () => void;
15
+ showLunar?: boolean;
16
+ type?: 'week' | 'month';
17
+ localizer?: any;
18
+ locale?: string;
19
+ };
20
+ export declare const CalendarHeader: ({ date, label, drilldownView, onDrillDown, showLunar, type, localizer, locale, }: CalendarHeaderProps) => React.JSX.Element;
21
+ export {};
@@ -0,0 +1,20 @@
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
+ import React from 'react';
10
+ type CalendarToolbarProps = {
11
+ date: Date;
12
+ label: string;
13
+ onNavigate: (action: string) => void;
14
+ onView: (view: string) => void;
15
+ view: string;
16
+ views: string[];
17
+ showLunar?: boolean;
18
+ };
19
+ export declare const CalendarToolbar: ({ date, label, onNavigate, onView, view, views, showLunar }: CalendarToolbarProps) => React.JSX.Element;
20
+ export {};
@@ -0,0 +1,22 @@
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
+ import React from 'react';
10
+ import type { View } from 'react-big-calendar';
11
+ export type CalendarNavigationAction = 'TODAY' | 'PREV' | 'NEXT';
12
+ export type CalendarViewContextValue = {
13
+ date: Date;
14
+ label: string;
15
+ navigate: (action: CalendarNavigationAction) => void;
16
+ showLunar?: boolean;
17
+ view: View;
18
+ views: View[];
19
+ setView: (view: View) => void;
20
+ };
21
+ export declare const CalendarViewProvider: React.Provider<CalendarViewContextValue>;
22
+ export declare const useCalendarViewContext: () => CalendarViewContextValue;
@@ -0,0 +1,12 @@
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
+ export * from './CalendarBlock';
10
+ export * from './CalendarHeader';
11
+ export * from './CalendarToolbar';
12
+ export * from './CalendarViewContext';
@@ -0,0 +1,10 @@
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
+ declare const _default: (props?: any) => import("@nocobase/client/es/schema-component/antd/__builtins__").UseComponentStyleResult;
10
+ export default _default;
@@ -0,0 +1,11 @@
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
+ export * from './CalendarBlockModel';
10
+ export * from './actions/CalendarActionModels';
11
+ export * from './actions/CalendarPopupModels';
@@ -0,0 +1,44 @@
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
+ import dayjs from 'dayjs';
10
+ export declare const CALENDAR_RANGE_FILTER_GROUP = "__calendar_view_range__";
11
+ export type CalendarVisibleRange = {
12
+ start: Date;
13
+ end: Date;
14
+ };
15
+ export declare const normalizeCalendarFieldPath: (fieldPath?: string | string[]) => string;
16
+ export declare const parseCalendarWeekStart: (weekStart?: number | string) => 1 | 0;
17
+ export declare const getCalendarVisibleRange: (value: Date | string, view?: 'month' | 'week' | 'day' | string, weekStart?: number | string) => CalendarVisibleRange;
18
+ export declare const formatDate: (date: dayjs.Dayjs) => string;
19
+ export declare const createCalendarRangeFilter: (fieldNames: {
20
+ start?: string | string[];
21
+ end?: string | string[];
22
+ }, range: CalendarVisibleRange) => {
23
+ [x: string]: {
24
+ $gte: string;
25
+ $lte: string;
26
+ };
27
+ } | {
28
+ $or: ({
29
+ [x: string]: {
30
+ $gte: string;
31
+ $lte: string;
32
+ };
33
+ } | {
34
+ $and: ({
35
+ [x: string]: {
36
+ $lte: string;
37
+ };
38
+ } | {
39
+ [x: string]: {
40
+ $gte: string;
41
+ };
42
+ })[];
43
+ })[];
44
+ };
@@ -8,16 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-beta.12",
11
+ "@nocobase/client": "2.1.0-beta.14",
12
12
  "react": "18.2.0",
13
13
  "react-i18next": "11.18.6",
14
- "@nocobase/server": "2.1.0-beta.12",
15
- "@nocobase/test": "2.1.0-beta.12",
14
+ "@nocobase/server": "2.1.0-beta.14",
15
+ "@nocobase/test": "2.1.0-beta.14",
16
16
  "@ant-design/icons": "5.6.1",
17
17
  "@formily/react": "2.3.7",
18
18
  "dayjs": "1.11.13",
19
- "lodash": "4.17.21",
20
- "@nocobase/flow-engine": "2.1.0-beta.12",
19
+ "lodash": "4.18.1",
20
+ "@nocobase/flow-engine": "2.1.0-beta.14",
21
21
  "antd": "5.24.2",
22
22
  "react-dom": "18.2.0",
23
23
  "antd-style": "3.7.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-calendar",
3
- "version": "2.1.0-beta.12",
3
+ "version": "2.1.0-beta.14",
4
4
  "displayName": "Calendar",
5
5
  "displayName.ru-RU": "Календарь",
6
6
  "displayName.zh-CN": "日历",
@@ -39,7 +39,7 @@
39
39
  "url": "git+https://github.com/nocobase/nocobase.git",
40
40
  "directory": "packages/plugins/calendar"
41
41
  },
42
- "gitHead": "25cee9643f42f850afc4adc33c55a56850ac730d",
42
+ "gitHead": "cd55c9a14596d834c30c83a82c38f1f719f7aac4",
43
43
  "keywords": [
44
44
  "Collections",
45
45
  "Blocks"