mirror of
https://github.com/nocobase/nocobase
synced 2024-11-17 09:25:54 +00:00
29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
import { Plugin } from '@nocobase/client';
|
|
import { generateNTemplate } from '../locale';
|
|
import { CalendarV2 } from './calendar';
|
|
import { CalendarCollectionTemplate } from './collection-templates/calendar';
|
|
import { CalendarBlockProvider, useCalendarBlockProps } from './schema-initializer/CalendarBlockProvider';
|
|
import { CalendarActionInitializers, CalendarFormActionInitializers } from './schema-initializer/initializers';
|
|
import { CalendarBlockInitializer, RecordAssociationCalendarBlockInitializer } from './schema-initializer/items';
|
|
|
|
export class PluginCalendarClient extends Plugin {
|
|
async load() {
|
|
this.app.dataSourceManager.addCollectionTemplates([CalendarCollectionTemplate]);
|
|
this.app.schemaInitializerManager.addItem('BlockInitializers', 'dataBlocks.calendar', {
|
|
title: generateNTemplate('Calendar'),
|
|
Component: 'CalendarBlockInitializer',
|
|
});
|
|
this.app.addComponents({
|
|
CalendarBlockProvider,
|
|
CalendarBlockInitializer,
|
|
RecordAssociationCalendarBlockInitializer,
|
|
CalendarV2,
|
|
});
|
|
this.app.addScopes({ useCalendarBlockProps });
|
|
this.app.schemaInitializerManager.add(CalendarActionInitializers);
|
|
this.app.schemaInitializerManager.add(CalendarFormActionInitializers);
|
|
}
|
|
}
|
|
|
|
export default PluginCalendarClient;
|