Skip to content

Commit

Permalink
feat(live-editing): changing generators for new format
Browse files Browse the repository at this point in the history
  • Loading branch information
ChronosSF committed Dec 12, 2024
1 parent cb2ee79 commit 1953c0a
Show file tree
Hide file tree
Showing 69 changed files with 901 additions and 4,198 deletions.
23 changes: 5 additions & 18 deletions live-editing/configs/AccordionConfigGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
IgxSwitchModule,
IgxIconModule
} from 'igniteui-angular';
import { AppModuleConfig, Config, IConfigGenerator } from 'igniteui-live-editing';
import { AppModuleConfig, Config, IConfigGenerator } from 'igniteui-live-editing'
import { BaseAppConfig } from './BaseConfig';

export class AccordionConfigGenerator implements IConfigGenerator {

Expand All @@ -16,33 +17,19 @@ export class AccordionConfigGenerator implements IConfigGenerator {

configs.push(new Config({
component: 'AccordionSample1Component',
appModuleConfig: new AppModuleConfig({
imports: ['AccordionSample1Component', 'IgxAccordionModule', 'IgxSwitchModule'],
ngDeclarations: ['AccordionSample1Component'],
ngImports: ['IgxAccordionModule', 'IgxSwitchModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: '/layouts/accordion/'
}));

configs.push(new Config({
component: 'AccordionSample2Component',
appModuleConfig: new AppModuleConfig({
imports: ['AccordionSample2Component', 'IgxAccordionModule', 'IgxSwitchModule'],
ngDeclarations: ['AccordionSample2Component'],
ngImports: ['IgxAccordionModule', 'IgxSwitchModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: '/layouts/accordion/'
}));

configs.push(new Config({
component: 'AccordionSample3Component',
appModuleConfig: new AppModuleConfig({
imports: ['IgxCheckboxModule', 'IgxSliderModule',
'IgxRadioModule', 'IgxTimePickerModule', 'AccordionSample3Component', 'IgxAccordionModule', 'IgxIconModule'],
ngDeclarations: ['AccordionSample3Component'],
ngImports: ['IgxCheckboxModule', 'IgxSliderModule',
'IgxRadioModule', 'IgxTimePickerModule', 'IgxAccordionModule', 'IgxIconModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: '/layouts/accordion/'
}));

Expand Down
33 changes: 12 additions & 21 deletions live-editing/configs/ActionStripConfigGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/* eslint-disable max-len */
import {IgxActionStripModule,
IgxRippleModule,
IgxButtonModule,
IgxIconModule,
IgxButtonGroupModule} from 'igniteui-angular';
import {AppModuleConfig, Config, IConfigGenerator} from 'igniteui-live-editing';
import {
IgxActionStripModule,
IgxRippleModule,
IgxButtonModule,
IgxIconModule,
IgxButtonGroupModule
} from 'igniteui-angular';
import { AppModuleConfig, Config, IConfigGenerator } from 'igniteui-live-editing'
import { BaseAppConfig } from './BaseConfig';
export class ActionStripConfigGenerator implements IConfigGenerator {


Expand All @@ -13,31 +16,19 @@ export class ActionStripConfigGenerator implements IConfigGenerator {

configs.push(new Config({
component: 'ActionStripParagraphComponent',
appModuleConfig: new AppModuleConfig({
imports: ['IgxActionStripModule', 'ActionStripParagraphComponent', 'IgxRippleModule', 'IgxButtonGroupModule', 'IgxButtonModule', 'IgxIconModule'],
ngDeclarations: ['ActionStripParagraphComponent'],
ngImports: ['IgxActionStripModule', 'IgxRippleModule', 'IgxButtonGroupModule', 'IgxButtonModule', 'IgxIconModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: '/menus/action-strip/'
}));

configs.push(new Config({
component: 'ActionStripParagraphMenuComponent',
appModuleConfig: new AppModuleConfig({
imports: ['IgxActionStripModule', 'ActionStripParagraphMenuComponent', 'IgxRippleModule', 'IgxButtonModule', 'IgxIconModule'],
ngDeclarations: ['ActionStripParagraphMenuComponent'],
ngImports: ['IgxActionStripModule', 'IgxRippleModule', 'IgxButtonModule', 'IgxIconModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: '/menus/action-strip/'
}));

configs.push(new Config({
component: 'ActionStripStylingComponent',
appModuleConfig: new AppModuleConfig({
imports: ['IgxActionStripModule', 'ActionStripStylingComponent', 'IgxRippleModule', 'IgxButtonModule', 'IgxIconModule'],
ngDeclarations: ['ActionStripStylingComponent'],
ngImports: ['IgxActionStripModule', 'IgxRippleModule', 'IgxButtonModule', 'IgxIconModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: '/menus/action-strip/'
}));

Expand Down
75 changes: 29 additions & 46 deletions live-editing/configs/AutocompleteConfigGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,32 @@
import {IgxAutocompleteModule,
import {
IgxAutocompleteModule,
IgxDropDownModule,
IgxInputGroupModule} from 'igniteui-angular';

import { Config, IConfigGenerator, AppModuleConfig } from 'igniteui-live-editing';

export class AutocompleteConfigGenerator implements IConfigGenerator {
public additionalImports = {
AutocompletePipeStartsWith: '../../src/app/data-entries/autocomplete/autocomplete/autocomplete.component',
AutocompletePipeStartsWith2: '../../src/app/data-entries/autocomplete/movie/movie.component'

IgxInputGroupModule
} from 'igniteui-angular';

import { Config, IConfigGenerator, AppModuleConfig } from 'igniteui-live-editing'
import { BaseAppConfig } from './BaseConfig';

export class AutocompleteConfigGenerator implements IConfigGenerator {
public additionalImports = {
AutocompletePipeStartsWith: '../../src/app/data-entries/autocomplete/autocomplete/autocomplete.component',
AutocompletePipeStartsWith2: '../../src/app/data-entries/autocomplete/movie/movie.component'
};
public generateConfigs(): Config[] {
const configs = new Array<Config>();

configs.push(new Config({
appModuleConfig: new AppModuleConfig({
imports: ['IgxAutocompleteModule', 'IgxDropDownModule', 'IgxInputGroupModule',
'AutocompleteBasicComponent', 'AutocompletePipeStartsWith'],
ngDeclarations: ['AutocompleteBasicComponent', 'AutocompletePipeStartsWith'],
ngImports: ['IgxAutocompleteModule', 'IgxDropDownModule', 'IgxInputGroupModule']
}),
component: 'AutocompleteBasicComponent',
shortenComponentPathBy: "/data-entries/autocomplete/"
}));

configs.push(new Config({
appModuleConfig: new AppModuleConfig({
imports: [
'IgxAutocompleteModule',
'IgxDropDownModule',
'IgxInputGroupModule',
'MovieComponent',
'AutocompletePipeStartsWith2'
],
ngDeclarations: ['MovieComponent', 'AutocompletePipeStartsWith2'],
ngImports: [
'IgxAutocompleteModule',
'IgxDropDownModule',
'IgxInputGroupModule'
]
}),
component: 'MovieComponent'
}));

return configs;
}

public generateConfigs(): Config[] {
const configs = new Array<Config>();

configs.push(new Config({
appConfig: BaseAppConfig,
component: 'AutocompleteBasicComponent',
shortenComponentPathBy: "/data-entries/autocomplete/"
}));

configs.push(new Config({
appConfig: BaseAppConfig,
component: 'MovieComponent'
}));

return configs;
}
}
23 changes: 6 additions & 17 deletions live-editing/configs/AvatarConfigGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {IgxAvatarModule} from 'igniteui-angular';
import {AppModuleConfig, Config, IConfigGenerator} from 'igniteui-live-editing'
import { IgxAvatarModule } from 'igniteui-angular';
import { AppModuleConfig, Config, IConfigGenerator } from 'igniteui-live-editing'
import { BaseAppConfig } from './BaseConfig';
export class AvatarConfigGenerator implements IConfigGenerator {


Expand All @@ -8,31 +9,19 @@ export class AvatarConfigGenerator implements IConfigGenerator {

configs.push(new Config({
component: 'AvatarSample3Component',
appModuleConfig: new AppModuleConfig({
imports: ['IgxAvatarModule', 'AvatarSample3Component'],
ngDeclarations: ['AvatarSample3Component'],
ngImports: ['IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/layouts/avatar/"
}));

configs.push(new Config({
component: 'AvatarStylingSampleComponent',
appModuleConfig: new AppModuleConfig({
imports: ['IgxAvatarModule', 'AvatarStylingSampleComponent'],
ngDeclarations: ['AvatarStylingSampleComponent'],
ngImports: ['IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/layouts/avatar/"
}));

configs.push(new Config({
component: 'AvatarCSSVariablesComponent',
appModuleConfig: new AppModuleConfig({
imports: ['IgxAvatarModule', 'AvatarCSSVariablesComponent'],
ngDeclarations: ['AvatarCSSVariablesComponent'],
ngImports: ['IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/layouts/avatar/"
}));

Expand Down
35 changes: 11 additions & 24 deletions live-editing/configs/BadgeConfigGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {IgxAvatarModule,
IgxBadgeModule,
IgxListModule} from 'igniteui-angular';
import { Config, IConfigGenerator, AppModuleConfig } from 'igniteui-live-editing';
import {
IgxAvatarModule,
IgxBadgeModule,
IgxListModule
} from 'igniteui-angular';
import { Config, IConfigGenerator, AppModuleConfig } from 'igniteui-live-editing'
import { BaseAppConfig } from './BaseConfig';
export class BadgeConfigGenerator implements IConfigGenerator {


Expand All @@ -12,46 +15,30 @@ export class BadgeConfigGenerator implements IConfigGenerator {
configs.push(new Config({
component: 'BadgeIconComponent',
additionalFiles: ["src/app/data-display/badge/model/member.model.ts"],
appModuleConfig: new AppModuleConfig({
imports: ['IgxBadgeModule', 'IgxAvatarModule', 'BadgeIconComponent'],
ngDeclarations: ['BadgeIconComponent'],
ngImports: ['IgxBadgeModule', 'IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/data-display/badge/"
}));

// badge sample 2
configs.push(new Config({
component: 'BadgeSample2Component',
additionalFiles: ["src/app/data-display/badge/model/member.model.ts"],
appModuleConfig: new AppModuleConfig({
imports: ['IgxBadgeModule', 'IgxAvatarModule', 'BadgeSample2Component'],
ngDeclarations: ['BadgeSample2Component'],
ngImports: ['IgxBadgeModule', 'IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/data-display/badge/"
}));

// badge sample 3
configs.push(new Config({
component: 'BadgeSample3Component',
additionalFiles: ["src/app/data-display/badge/model/member.model.ts"],
appModuleConfig: new AppModuleConfig({
imports: ['IgxBadgeModule', 'IgxListModule', 'IgxAvatarModule', 'BadgeSample3Component'],
ngDeclarations: ['BadgeSample3Component'],
ngImports: ['IgxBadgeModule', 'IgxListModule', 'IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/data-display/badge/"
}));

configs.push(new Config({
component: 'BadgeStylingSampleComponent',
additionalFiles: ["src/app/data-display/badge/model/member.model.ts"],
appModuleConfig: new AppModuleConfig({
imports: ['IgxBadgeModule', 'IgxListModule', 'IgxAvatarModule', 'BadgeStylingSampleComponent'],
ngDeclarations: ['BadgeStylingSampleComponent'],
ngImports: ['IgxBadgeModule', 'IgxListModule', 'IgxAvatarModule']
}),
appConfig: BaseAppConfig,
shortenComponentPathBy: "/data-display/badge/"
}));

Expand Down
Loading

0 comments on commit 1953c0a

Please sign in to comment.