[init] init version
This commit is contained in:
125
src/app/app.shared.ts
Normal file
125
src/app/app.shared.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
// ANGULAR
|
||||
import { LOCALE_ID, NgModule } from "@angular/core";
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
||||
|
||||
// MATERIAL
|
||||
import { MatTableModule } from "@angular/material/table";
|
||||
import { MatPaginatorModule } from "@angular/material/paginator";
|
||||
import { MatSortModule } from "@angular/material/sort";
|
||||
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
|
||||
import { MatCardModule } from "@angular/material/card";
|
||||
import { MatDatepickerModule } from "@angular/material/datepicker";
|
||||
import { MatNativeDateModule, MatRippleModule } from "@angular/material/core";
|
||||
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
||||
import { MatButtonToggleModule } from "@angular/material/button-toggle";
|
||||
import { MatGridListModule } from "@angular/material/grid-list";
|
||||
import { MatExpansionModule } from "@angular/material/expansion";
|
||||
import { MatAutocompleteModule } from "@angular/material/autocomplete";
|
||||
import { MatButtonModule } from "@angular/material/button";
|
||||
import { MatInputModule } from "@angular/material/input";
|
||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldDefaultOptions, MatFormFieldModule } from "@angular/material/form-field";
|
||||
import { MatTooltipModule } from "@angular/material/tooltip";
|
||||
import { MatCheckboxModule } from "@angular/material/checkbox";
|
||||
import { MatSelectModule } from "@angular/material/select";
|
||||
import { MatIconModule } from "@angular/material/icon";
|
||||
import { MatMenuModule } from "@angular/material/menu";
|
||||
import { MatTabsModule } from "@angular/material/tabs";
|
||||
import { MatRadioModule } from "@angular/material/radio";
|
||||
import { MatDialogModule } from "@angular/material/dialog";
|
||||
import { MatDividerModule } from "@angular/material/divider";
|
||||
import { MatListModule } from "@angular/material/list";
|
||||
import { MatSlideToggleModule } from "@angular/material/slide-toggle";
|
||||
|
||||
// Module
|
||||
import { NgSelectModule } from "@ng-select/ng-select";
|
||||
|
||||
// UTIL
|
||||
import { DateDiff, DateFormat, ToDateObjPipe } from "./utils/pipe";
|
||||
import { CanDirective } from "./utils/can.directive";
|
||||
import { AllowRoleDirective } from "./utils/allow-role.directives";
|
||||
import { CurrencyInputMaskDirective } from "./@common/utils/CurrencyInputMask";
|
||||
import { NumberOnlyDirective } from "./@common/utils/NumberOnlyDirective";
|
||||
|
||||
|
||||
const MAT = [
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatInputModule,
|
||||
MatRippleModule,
|
||||
MatFormFieldModule,
|
||||
MatTooltipModule,
|
||||
MatSelectModule,
|
||||
MatCheckboxModule,
|
||||
MatIconModule,
|
||||
MatMenuModule,
|
||||
MatTabsModule,
|
||||
MatRadioModule,
|
||||
MatDialogModule,
|
||||
MatInputModule,
|
||||
MatTableModule,
|
||||
MatPaginatorModule,
|
||||
MatSortModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatCardModule,
|
||||
MatDatepickerModule,
|
||||
MatNativeDateModule,
|
||||
MatRippleModule,
|
||||
MatProgressBarModule,
|
||||
MatRadioModule,
|
||||
MatButtonToggleModule,
|
||||
MatGridListModule,
|
||||
MatExpansionModule,
|
||||
MatDialogModule,
|
||||
MatIconModule,
|
||||
MatListModule,
|
||||
MatDividerModule,
|
||||
MatSlideToggleModule,
|
||||
];
|
||||
|
||||
const appearance: MatFormFieldDefaultOptions = {
|
||||
appearance: 'outline'
|
||||
};
|
||||
|
||||
const BASE_MODULES = [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule
|
||||
];
|
||||
|
||||
const MODULES = [
|
||||
MatAutocompleteModule,
|
||||
NgSelectModule,
|
||||
...MAT
|
||||
];
|
||||
|
||||
|
||||
const COMPONENTS = [
|
||||
AllowRoleDirective,
|
||||
CanDirective,
|
||||
];
|
||||
|
||||
const PIPES = [
|
||||
ToDateObjPipe,
|
||||
DateFormat,
|
||||
DateDiff,
|
||||
CurrencyInputMaskDirective,
|
||||
NumberOnlyDirective
|
||||
];
|
||||
|
||||
const PROVIDERS: any = [
|
||||
{
|
||||
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||
useValue: appearance
|
||||
},
|
||||
{ provide: LOCALE_ID, useValue: "en-GB" }
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [...BASE_MODULES, ...MODULES],
|
||||
exports: [...BASE_MODULES, ...MODULES, ...COMPONENTS, ...PIPES],
|
||||
declarations: [...COMPONENTS, ...PIPES],
|
||||
providers: [...PROVIDERS],
|
||||
})
|
||||
export class AppSharedModule {
|
||||
}
|
||||
Reference in New Issue
Block a user