How to use ng-devui - 8 common examples

To help you get started, we’ve selected a few ng-devui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DevCloudFE / ng-devui / devui / data-table / data-table-cell.component.ts View on Github external
onFinishCellEdit($event?: Event) {
    if (this.editModel !== 'cell') {
      return;
    }
    this.ngZone.run(() => {
      this.isCellEdit = false;
    });

    // tslint:disable-next-line:no-unused-expression
    this.documentClickSubscription && this.unSubscription(this.documentClickSubscription);
    // tslint:disable-next-line:no-unused-expression
    this.cellEditorClickSubscription && this.unSubscription(this.cellEditorClickSubscription);
    stopPropagationIfExist($event);

    this.dt.onCellEditEnd({
      rowIndex: this.rowIndex,
      colIndex: this.colIndex,
      column: this.column,
      rowItem: this.rowItem,
      cellComponent: this,
      rowComponent: this.rowComponent
    });
  }
github DevCloudFE / ng-devui / devui / data-table / tmpl / data-table-tmpls.component.ts View on Github external
stopPropagation($event: Event) {
    stopPropagationIfExist($event);
  }
github DevCloudFE / ng-devui / devui / datepicker / datepicker.directive.ts View on Github external
constructor(private elementRef: ElementRef, private viewContainerRef: ViewContainerRef,
              private componentFactoryResolver: ComponentFactoryResolver, private renderer2: Renderer2,
              private injector: Injector, private devUIConfig: DevUIConfig, private i18n: I18nService,
              private builder: AnimationBuilder) {
    this._dateConfig = devUIConfig[`datePicker${i18n.getLangSuffix()}`];
    this.dateConverter = devUIConfig[`datePicker${i18n.getLangSuffix()}`].dateConverter || new DefaultDateConverter();
    this.selectedDate = null;
    const factory = this.componentFactoryResolver.resolveComponentFactory(DatepickerComponent);
    this.cmpRef = this.viewContainerRef.createComponent(factory, this.viewContainerRef.length, this.injector);
    this.i18n.getMessage().subscribe((lang) => {
      const langSuffix = lang === 'zh-CN' ? 'CN' : 'EN';
      this._dateConfig = devUIConfig[`datePicker${langSuffix}`];
    });
  }
github DevCloudFE / ng-devui / devui / datepicker / datepicker.component.ts View on Github external
constructor(
    protected elementRef: ElementRef,
    protected renderer2: Renderer2,
    protected devUIConfig: DevUIConfig,
    protected changeDetectorRef: ChangeDetectorRef,
    protected i18n: I18nService
  ) {
    this._dateConfig = this.devUIConfig[`datePicker${i18n.getLangSuffix()}`];
    this.dateConverter = this.devUIConfig[`datePicker${i18n.getLangSuffix()}`].dateConverter || new DefaultDateConverter();
    this.renderer2.setStyle(this.elementRef.nativeElement, 'display', 'inline-block');
  }
github DevCloudFE / ng-devui / devui / common / date-pipe.ts View on Github external
transform(date: any, pattern: any): any {
    if (!date) {
      return;
    }
    return formatDate(date, pattern);
  }
}
github DevCloudFE / ng-devui / devui / data-table / tmpl / data-table-column-tmpl.component.ts View on Github external
date(item) {
    let pattern;
    if (this.extraOptions && this.extraOptions.dateFormat) {
      pattern = this.extraOptions.dateFormat;
    } else {
      pattern = this.extraOptions && this.extraOptions.showTime ?
      this.devUIConfig.datePickerCN.format.time : this.devUIConfig.datePickerCN.format.date;
    }

    return item ? formatDate(new Date(item), pattern) : '';
  }
  emitFilterData(filterData) {
github DevCloudFE / ng-devui / src / app / component / app-content.module.ts View on Github external
{name: 'typescript', func: typescript},
    {name: 'scss', func: scss},
    {name: 'html', func: xml}
  ];
}

@NgModule({
  declarations: [
    ExamplePanelComponent,
    AppContentComponent,
    GetStartedComponent
  ],
  imports: [
    AccordionModule,
    CommonModule,
    DevUIModule.forRoot(),
    RouterModule.forChild([
      {
          path: '',
          component: AppContentComponent,
          data: {},
          children: routesConfig
      },
    ]),
  ]
})
export class AppContentModule {
  constructor() {}
}
github DevCloudFE / ng-devui / src / app / app.module.ts View on Github external
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { AppComponent } from './app.component';

import { DevUIModule } from 'ng-devui/devui.module';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    DevUIModule.forRoot(),
    RouterModule.forRoot(
      [
        {
          path: '',
          redirectTo: 'components',
          pathMatch: 'full'
        },
        {
          path: 'components',
          loadChildren: './component/app-content.module#AppContentModule'
        },
        {
          path: '**',
          redirectTo: 'components'
        }
      ]