/*
 * @Author: your name
 * @Date: 2021-12-01 15:07:23
 * @LastEditTime: 2021-12-13 10:37:39
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \tms-obc-web\src\app\shared\widget\st-widget.module.ts
 */
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { STWidgetRegistry } from '@delon/abc/st';
import { DelonFormModule, WidgetRegistry } from '@delon/form';
import { AddressModule, EditorModule, FileManagerModule } from '@shared';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { NzStepsModule } from 'ng-zorro-antd/steps';
import { NgxTinymceModule } from 'ngx-tinymce';

// import { STWidgetRegistry } from '@delon/abc/st';
import { SharedModule } from '../shared.module';
import { AddressWidget } from './address/address.widget';
import { STCurrencyCHYWidget } from './currency-cny/curreny-cny.widget';
import { DictSelectWidget } from './dict-select/dict-select.widget';
import { EditorWidget } from './editor/editor.widget';
import { SLFromToSearchWidget } from './from-to-search/from-to-search.widget';
import { EAFromToWidget } from './from-to/from-to.widget';
import { ImgWidget } from './img/img.widget';
import { NounWidget } from './noun/noun.widget';
import { PropertyValuesWidget } from './property-values/property-values.widget';
import { SpecValuesWidget } from './spec-values/spec-values.widget';
import { TinymceWidget } from './tinymce/tinymce.widget';

export const STWIDGET_COMPONENTS = [
  EditorWidget,
  ImgWidget,
  AddressWidget,
  TinymceWidget,
  NounWidget,
  EAFromToWidget,
  SpecValuesWidget,
  PropertyValuesWidget,
  SLFromToSearchWidget,
  DictSelectWidget,
  STCurrencyCHYWidget
];

@NgModule({
  declarations: STWIDGET_COMPONENTS,
  imports: [
    CommonModule,
    FormsModule,
    DelonFormModule.forRoot(),
    AddressModule,
    EditorModule,
    FileManagerModule,
    NzDividerModule,
    NzStepsModule,
    NzButtonModule,
    NzInputModule,
    NzDatePickerModule,
    NzInputNumberModule,
    NgxTinymceModule,
    SharedModule
  ],
  exports: [...STWIDGET_COMPONENTS],
  entryComponents: STWIDGET_COMPONENTS
})
export class STWidgetModule {
  constructor(widgetRegistry: WidgetRegistry, sTWidgetRegistry: STWidgetRegistry) {
    widgetRegistry.register(EditorWidget.KEY, EditorWidget);
    widgetRegistry.register(ImgWidget.KEY, ImgWidget);
    widgetRegistry.register(AddressWidget.KEY, AddressWidget);
    widgetRegistry.register(TinymceWidget.KEY, TinymceWidget);
    widgetRegistry.register(NounWidget.KEY, NounWidget);
    widgetRegistry.register(EAFromToWidget.KEY, EAFromToWidget);
    widgetRegistry.register(SpecValuesWidget.KEY, SpecValuesWidget);
    widgetRegistry.register(PropertyValuesWidget.KEY, PropertyValuesWidget);
    widgetRegistry.register(SLFromToSearchWidget.KEY, SLFromToSearchWidget);
    widgetRegistry.register(DictSelectWidget.KEY, DictSelectWidget);


    sTWidgetRegistry.register(STCurrencyCHYWidget.KEY, STCurrencyCHYWidget);
  }
}
