UNPKG

4.2 kBJavaScriptView Raw
1import * as i0 from '@angular/core';
2import { Version, PLATFORM_ID, NgModule, Inject } from '@angular/core';
3import { LAYOUT_CONFIG, DEFAULT_CONFIG, BREAKPOINT, SERVER_TOKEN } from '@angular/flex-layout/core';
4export * from '@angular/flex-layout/core';
5import { ExtendedModule } from '@angular/flex-layout/extended';
6export * from '@angular/flex-layout/extended';
7import { FlexModule } from '@angular/flex-layout/flex';
8export * from '@angular/flex-layout/flex';
9import { GridModule } from '@angular/flex-layout/grid';
10export * from '@angular/flex-layout/grid';
11import { isPlatformServer } from '@angular/common';
12
13/**
14 * @license
15 * Copyright Google LLC All Rights Reserved.
16 *
17 * Use of this source code is governed by an MIT-style license that can be
18 * found in the LICENSE file at https://angular.io/license
19 */
20/** Current version of Angular Flex-Layout. */
21const VERSION = new Version('14.0.0-beta.40');
22
23/**
24 * @license
25 * Copyright Google LLC All Rights Reserved.
26 *
27 * Use of this source code is governed by an MIT-style license that can be
28 * found in the LICENSE file at https://angular.io/license
29 */
30/**
31 * FlexLayoutModule -- the main import for all utilities in the Angular Layout library
32 * * Will automatically provide Flex, Grid, and Extended modules for use in the application
33 * * Can be configured using the static withConfig method, options viewable on the Wiki's
34 * Configuration page
35 */
36class FlexLayoutModule {
37 constructor(serverModuleLoaded, platformId) {
38 if (isPlatformServer(platformId) && !serverModuleLoaded) {
39 console.warn('Warning: Flex Layout loaded on the server without FlexLayoutServerModule');
40 }
41 }
42 /**
43 * Initialize the FlexLayoutModule with a set of config options,
44 * which sets the corresponding tokens accordingly
45 */
46 static withConfig(configOptions,
47 // tslint:disable-next-line:max-line-length
48 breakpoints = []) {
49 return {
50 ngModule: FlexLayoutModule,
51 providers: configOptions.serverLoaded ?
52 [
53 { provide: LAYOUT_CONFIG, useValue: { ...DEFAULT_CONFIG, ...configOptions } },
54 { provide: BREAKPOINT, useValue: breakpoints, multi: true },
55 { provide: SERVER_TOKEN, useValue: true },
56 ] : [
57 { provide: LAYOUT_CONFIG, useValue: { ...DEFAULT_CONFIG, ...configOptions } },
58 { provide: BREAKPOINT, useValue: breakpoints, multi: true },
59 ]
60 };
61 }
62}
63FlexLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FlexLayoutModule, deps: [{ token: SERVER_TOKEN }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.NgModule });
64FlexLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: FlexLayoutModule, imports: [FlexModule, ExtendedModule, GridModule], exports: [FlexModule, ExtendedModule, GridModule] });
65FlexLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FlexLayoutModule, imports: [FlexModule, ExtendedModule, GridModule, FlexModule, ExtendedModule, GridModule] });
66i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FlexLayoutModule, decorators: [{
67 type: NgModule,
68 args: [{
69 imports: [FlexModule, ExtendedModule, GridModule],
70 exports: [FlexModule, ExtendedModule, GridModule]
71 }]
72 }], ctorParameters: function () { return [{ type: undefined, decorators: [{
73 type: Inject,
74 args: [SERVER_TOKEN]
75 }] }, { type: Object, decorators: [{
76 type: Inject,
77 args: [PLATFORM_ID]
78 }] }]; } });
79
80/**
81 * @license
82 * Copyright Google LLC All Rights Reserved.
83 *
84 * Use of this source code is governed by an MIT-style license that can be
85 * found in the LICENSE file at https://angular.io/license
86 */
87
88/**
89 * Generated bundle index. Do not edit.
90 */
91
92export { FlexLayoutModule, VERSION };
93//# sourceMappingURL=angular-flex-layout.mjs.map