mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
* feat: init * fix: mobile layout * feat: more code * feat: improve navigate bar * fix: mobile title * feat: improve code * fix: add settings and initailzer * fix: settings * fix: tabbar items settings * feat: tabbar initializer * fix: api * fix: styles * feat: navbar * feat: navigate bar tabs initializer * feat: navigate bar tab settings * feat: navigation bar actions * fix: bug * fix: bug * fix: bug * fix: tabbar active * fix: bug * fix: mobile login and layout * fix: update version * fix: build error * feat: plugin settings support link * fix: add mobile meta * fix: desktop mode * fix: remove old code and change collection name and mobile path * fix: tabbar and tabs initialer layout * fix: initializer style * fix: adjust schema position * fix: mobile style * fix: delete relation resource and home page bug * fix: support multi app * fix: not found page * fix: js bridge * fix: bug * fix: navigation bar schema flat * fix: navigation bar action style * fix: change version * fix: mobile meta and real mobile test * refactor: folder and name * fix: navigation bar sticky and zIndex * fix: full mobile schema * fix: mobile readme and package.json * fix: e2e bug * fix: bug * fix: tabbar style on productino * fix: bug * fix: rename MobileTabBar.Page * fix: support tabbar sort * fix: support page tabs sort * fix: i18n * fix: settings utils import bug * docs: api doc * fix: qrcode refresh * test: unit tests * fix: bug * fix: unit test * fix: build bug * fix: e2e test * fix: overflow scroll * fix: bug * fix: scroll and overflow * fix: bug * fix: e2e expect await * fix: e2e bug * fix: bug * fix: change name * fix: add more e2e * fix: page header * fix: tab support icon * fix: bug * fix: bug * fix: docs * fix(T-4811): scroll bar too long * fix(T-4810): desktop mode * fix: e2e * fix(T-4812): title empty * fix: unit test * feat: hide Open mode option in mobile mode * feat: change default value of Open mode on mobile * feat: add OpenModeProvider * feat: support page mode * fix: fix build * test: update unit tests * chore: remove pro-plugins * fix: bug * fix(T-4812): title is required * fix: bug * fix: bug * fix: bug * fix: bug * refactor: remove z-index * refactor: make better for subpages * fix: drag bug * fix: bug * fix: theme bug * fix(T-4859): create tab bar title empty * fix(T-4857): action too long * fix: e2e bug * fix: remove comment * fix: bug * fix: theme bug * fix: should provider modal component * fix: bug --------- Co-authored-by: chenos <chenlinxh@gmail.com> Co-authored-by: Zeke Zhang <958414905@qq.com>
86 lines
3.3 KiB
TypeScript
86 lines
3.3 KiB
TypeScript
/**
|
|
* This file is part of the NocoBase (R) project.
|
|
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
* Authors: NocoBase Team.
|
|
*
|
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
*/
|
|
|
|
import { Plugin } from '@nocobase/client';
|
|
import { generateNTemplate } from '../locale';
|
|
import { CalendarV2 } from './calendar';
|
|
import { calendarBlockSettings } from './calendar/Calender.Settings';
|
|
import { CalendarCollectionTemplate } from './collection-templates/calendar';
|
|
import { useCalendarBlockDecoratorProps } from './hooks/useCalendarBlockDecoratorProps';
|
|
import { CalendarBlockProvider, useCalendarBlockProps } from './schema-initializer/CalendarBlockProvider';
|
|
import {
|
|
CalendarActionInitializers_deprecated,
|
|
CalendarFormActionInitializers,
|
|
calendarActionInitializers,
|
|
deleteEventActionInitializer,
|
|
} from './schema-initializer/initializers';
|
|
import {
|
|
CalendarBlockInitializer,
|
|
RecordAssociationCalendarBlockInitializer,
|
|
useCreateAssociationCalendarBlock,
|
|
useCreateCalendarBlock,
|
|
} from './schema-initializer/items';
|
|
|
|
export class PluginCalendarClient extends Plugin {
|
|
async load() {
|
|
this.app.dataSourceManager.addCollectionTemplates([CalendarCollectionTemplate]);
|
|
this.app.schemaInitializerManager.addItem('page:addBlock', 'dataBlocks.calendar', {
|
|
title: generateNTemplate('Calendar'),
|
|
Component: 'CalendarBlockInitializer',
|
|
});
|
|
this.app.schemaInitializerManager.addItem('mobile:addBlock', 'dataBlocks.calendar', {
|
|
title: generateNTemplate('Calendar'),
|
|
Component: 'CalendarBlockInitializer',
|
|
});
|
|
this.app.schemaInitializerManager.addItem('popup:common:addBlock', 'dataBlocks.calendar', {
|
|
title: generateNTemplate('Calendar'),
|
|
Component: 'CalendarBlockInitializer',
|
|
useComponentProps() {
|
|
const { createAssociationCalendarBlock } = useCreateAssociationCalendarBlock();
|
|
const { createCalendarBlock } = useCreateCalendarBlock();
|
|
|
|
return {
|
|
onlyCurrentDataSource: true,
|
|
filterCollections({ associationField }) {
|
|
if (associationField) {
|
|
return ['hasMany', 'belongsToMany'].includes(associationField.type);
|
|
}
|
|
return false;
|
|
},
|
|
createBlockSchema: ({ item, fromOthersInPopup }) => {
|
|
if (fromOthersInPopup) {
|
|
return createCalendarBlock({ item });
|
|
}
|
|
createAssociationCalendarBlock({ item });
|
|
},
|
|
showAssociationFields: true,
|
|
hideSearch: true,
|
|
};
|
|
},
|
|
});
|
|
|
|
this.app.addComponents({
|
|
CalendarBlockProvider,
|
|
CalendarBlockInitializer: CalendarBlockInitializer as any,
|
|
RecordAssociationCalendarBlockInitializer,
|
|
CalendarV2,
|
|
});
|
|
this.app.addScopes({ useCalendarBlockProps, useCalendarBlockDecoratorProps });
|
|
this.schemaSettingsManager.add(calendarBlockSettings);
|
|
this.app.schemaInitializerManager.add(CalendarActionInitializers_deprecated);
|
|
this.app.schemaInitializerManager.add(calendarActionInitializers);
|
|
this.app.schemaInitializerManager.add(CalendarFormActionInitializers);
|
|
this.app.schemaInitializerManager
|
|
.get('details:configureActions')
|
|
.add('enableActions.deleteEvent', deleteEventActionInitializer);
|
|
}
|
|
}
|
|
|
|
export default PluginCalendarClient;
|