2024-01-11 07:14:34 +00:00
|
|
|
import { Plugin } from '@nocobase/client';
|
2023-12-23 07:16:41 +00:00
|
|
|
import { generateNTemplate } from '../locale';
|
|
|
|
import { CalendarV2 } from './calendar';
|
2024-01-11 14:05:18 +00:00
|
|
|
import { CalendarCollectionTemplate } from './collection-templates/calendar';
|
2023-12-23 07:16:41 +00:00
|
|
|
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() {
|
2024-01-11 14:05:18 +00:00
|
|
|
this.app.collectionManager.addCollectionTemplates([CalendarCollectionTemplate]);
|
2023-12-23 07:16:41 +00:00
|
|
|
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;
|