|
| 1 | +import {IgxButtonGroupModule, |
| 2 | + IgxButtonModule, |
| 3 | + IgxIconButtonDirective, |
| 4 | + IgxIconModule, |
| 5 | + IgxRippleModule} from 'igniteui-angular'; |
| 6 | +import {AppModuleConfig, Config, IConfigGenerator} from 'igniteui-live-editing' |
| 7 | +export class IconButtonConfigGenerator implements IConfigGenerator { |
| 8 | + public generateConfigs(): Config[] { |
| 9 | + const configs = new Array<Config>(); |
| 10 | + |
| 11 | + // icon button overview |
| 12 | + configs.push(new Config({ |
| 13 | + component: 'IconButtonOverviewComponent', |
| 14 | + appModuleConfig: new AppModuleConfig({ |
| 15 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'IconButtonOverviewComponent'], |
| 16 | + ngDeclarations: ['IconButtonOverviewComponent'], |
| 17 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 18 | + }), |
| 19 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 20 | + })); |
| 21 | + |
| 22 | + // flat icon button |
| 23 | + configs.push(new Config({ |
| 24 | + component: 'FlatIconButtonComponent', |
| 25 | + appModuleConfig: new AppModuleConfig({ |
| 26 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'FlatIconButtonComponent'], |
| 27 | + ngDeclarations: ['FlatIconButtonComponent'], |
| 28 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 29 | + }), |
| 30 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 31 | + })); |
| 32 | + |
| 33 | + // contained icon button |
| 34 | + configs.push(new Config({ |
| 35 | + component: 'ContainedIconButtonComponent', |
| 36 | + appModuleConfig: new AppModuleConfig({ |
| 37 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'ContainedIconButtonComponent'], |
| 38 | + ngDeclarations: ['ContainedIconButtonComponent'], |
| 39 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 40 | + }), |
| 41 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 42 | + })); |
| 43 | + |
| 44 | + // outlined icon button |
| 45 | + configs.push(new Config({ |
| 46 | + component: 'OutlinedIconButtonComponent', |
| 47 | + appModuleConfig: new AppModuleConfig({ |
| 48 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'OutlinedIconButtonComponent'], |
| 49 | + ngDeclarations: ['OutlinedIconButtonComponent'], |
| 50 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 51 | + }), |
| 52 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 53 | + })); |
| 54 | + |
| 55 | + // disabled icon button |
| 56 | + configs.push(new Config({ |
| 57 | + component: 'DisabledIconButtonComponent', |
| 58 | + appModuleConfig: new AppModuleConfig({ |
| 59 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'DisabledIconButtonComponent'], |
| 60 | + ngDeclarations: ['DisabledIconButtonComponent'], |
| 61 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 62 | + }), |
| 63 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 64 | + })); |
| 65 | + |
| 66 | + // SVG icon button |
| 67 | + configs.push(new Config({ |
| 68 | + component: 'SVGIconButtonComponent', |
| 69 | + appModuleConfig: new AppModuleConfig({ |
| 70 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'SVGIconButtonComponent'], |
| 71 | + ngDeclarations: ['SVGIconButtonComponent'], |
| 72 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 73 | + }), |
| 74 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 75 | + })); |
| 76 | + |
| 77 | + // icon button styling |
| 78 | + configs.push(new Config({ |
| 79 | + component: 'IconButtonStylingComponent', |
| 80 | + appModuleConfig: new AppModuleConfig({ |
| 81 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'IconButtonStylingComponent'], |
| 82 | + ngDeclarations: ['IconButtonStylingComponent'], |
| 83 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 84 | + }), |
| 85 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 86 | + })); |
| 87 | + |
| 88 | + // icon button size |
| 89 | + configs.push(new Config({ |
| 90 | + component: 'IconButtonSizeComponent', |
| 91 | + appModuleConfig: new AppModuleConfig({ |
| 92 | + imports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective', 'IconButtonSizeComponent'], |
| 93 | + ngDeclarations: ['IconButtonSizeComponent'], |
| 94 | + ngImports: ['IgxButtonModule', 'IgxIconModule', 'IgxRippleModule', 'IgxIconButtonDirective'] |
| 95 | + }), |
| 96 | + shortenComponentPathBy: "/data-entries/icon-button/" |
| 97 | + })); |
| 98 | + |
| 99 | + return configs; |
| 100 | + } |
| 101 | +} |
0 commit comments