Skip to content

Commit

Permalink
mdd-update-svg-angular
Browse files Browse the repository at this point in the history
mdd-update-svg-angular
  • Loading branch information
mddifilippo89 committed Dec 12, 2023
1 parent e511e9e commit 836c873
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 30 deletions.
17 changes: 17 additions & 0 deletions code-gen-library/ToolbarCustomIconOnInit/Angular.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//begin imports
import { IgxToolbarComponent, IgxToolActionLabelComponent, IgxToolActionComponent, IgxToolCommandEventArgs } from 'igniteui-angular-layouts';
//end imports


export class ToolbarCustomIconOnInit {

//begin eventHandler
public toolbarCustomIconOnInit(): void {

const icon = '<svg width="28px" height="28px" stroke="none" viewBox="0 0 3.5 3.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--gis" preserveAspectRatio="xMidYMid meet"><path d="M0.436 0.178a0.073 0.073 0 0 0 -0.062 0.036L0.01 0.846a0.073 0.073 0 0 0 0.063 0.109h0.729a0.073 0.073 0 0 0 0.063 -0.109L0.501 0.214a0.073 0.073 0 0 0 -0.064 -0.036zm0.001 0.219 0.238 0.413H0.199zM1.4 0.507v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245zM0.073 1.388A0.073 0.073 0 0 0 0 1.461v0.583a0.073 0.073 0 0 0 0.073 0.073h0.729A0.073 0.073 0 0 0 0.875 2.045V1.461a0.073 0.073 0 0 0 -0.073 -0.073zm0.073 0.146h0.583v0.438H0.146zM1.4 1.674v0.245h0.945v-0.245zm1.19 0v0.245h0.91v-0.245zM0.438 2.447c-0.241 0 -0.438 0.197 -0.438 0.438 0 0.241 0.197 0.438 0.438 0.438s0.438 -0.197 0.438 -0.438c0 -0.241 -0.197 -0.438 -0.438 -0.438zm0 0.146a0.291 0.291 0 0 1 0.292 0.292 0.291 0.291 0 0 1 -0.292 0.292 0.291 0.291 0 0 1 -0.292 -0.292A0.291 0.291 0 0 1 0.438 2.593zM1.4 2.842v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245z" fill="#000000" fill-rule="evenodd"/></svg>';
this.toolbar.registerIconFromText("CustomCollection", "CustomIcon", icon);

}
//end eventHandler

}
7 changes: 1 addition & 6 deletions code-gen-library/ToolbarCustomIconOnInit/React.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
//begin imports
import { IgrToolbarComponent, IgrToolActionLabelComponent, IgrToolActionComponent, IgrToolCommandEventArgs } from 'igniteui-react-layouts';
import { CodeGenHelper, SvgIconRegistry } from 'igniteui-react-core';
//end imports


export class ToolbarCustomIconOnInit {

//begin eventHandler
public toolbarCustomIconOnInit(): void {
var toolActionLabel1 = CodeGenHelper.getDescription<IgrToolActionLabelComponent>("content");
// var svgIcon = CodeGenHelper.getDescription<SvgIconRegistry>("content");

console.log("test2");
const icon = '<svg width="28px" height="28px" stroke="none" viewBox="0 0 3.5 3.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--gis" preserveAspectRatio="xMidYMid meet"><path d="M0.436 0.178a0.073 0.073 0 0 0 -0.062 0.036L0.01 0.846a0.073 0.073 0 0 0 0.063 0.109h0.729a0.073 0.073 0 0 0 0.063 -0.109L0.501 0.214a0.073 0.073 0 0 0 -0.064 -0.036zm0.001 0.219 0.238 0.413H0.199zM1.4 0.507v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245zM0.073 1.388A0.073 0.073 0 0 0 0 1.461v0.583a0.073 0.073 0 0 0 0.073 0.073h0.729A0.073 0.073 0 0 0 0.875 2.045V1.461a0.073 0.073 0 0 0 -0.073 -0.073zm0.073 0.146h0.583v0.438H0.146zM1.4 1.674v0.245h0.945v-0.245zm1.19 0v0.245h0.91v-0.245zM0.438 2.447c-0.241 0 -0.438 0.197 -0.438 0.438 0 0.241 0.197 0.438 0.438 0.438s0.438 -0.197 0.438 -0.438c0 -0.241 -0.197 -0.438 -0.438 -0.438zm0 0.146a0.291 0.291 0 0 1 0.292 0.292 0.291 0.291 0 0 1 -0.292 0.292 0.291 0.291 0 0 1 -0.292 -0.292A0.291 0.291 0 0 1 0.438 2.593zM1.4 2.842v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245z" fill="#000000" fill-rule="evenodd"/></svg>';
SvgIconRegistry.instance.addSvgPathString("CustomLegendCollection", "CustomLegendIcon", icon);

this.toolbar.registerIconFromText("CustomCollection", "CustomIcon", icon);

}
//end eventHandler
Expand Down
5 changes: 2 additions & 3 deletions code-gen-library/ToolbarCustomIconOnInit/WebComponents.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
//begin imports
import { IgcToolbarComponent, IgcToolActionLabelComponent, IgcToolActionComponent, IgcToolCommandEventArgs } from 'igniteui-webcomponents-layouts';
import { CodeGenHelper } from 'igniteui-webcomponents-core';
//end imports


export class ToolbarCustomIconOnInit {

//begin eventHandler
public toolbarCustomIconOnInit(): void {
var toolActionLabel1 = CodeGenHelper.getDescription<IgcToolActionLabelComponent>("content");


const icon = '<svg width="28px" height="28px" stroke="none" viewBox="0 0 3.5 3.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--gis" preserveAspectRatio="xMidYMid meet"><path d="M0.436 0.178a0.073 0.073 0 0 0 -0.062 0.036L0.01 0.846a0.073 0.073 0 0 0 0.063 0.109h0.729a0.073 0.073 0 0 0 0.063 -0.109L0.501 0.214a0.073 0.073 0 0 0 -0.064 -0.036zm0.001 0.219 0.238 0.413H0.199zM1.4 0.507v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245zM0.073 1.388A0.073 0.073 0 0 0 0 1.461v0.583a0.073 0.073 0 0 0 0.073 0.073h0.729A0.073 0.073 0 0 0 0.875 2.045V1.461a0.073 0.073 0 0 0 -0.073 -0.073zm0.073 0.146h0.583v0.438H0.146zM1.4 1.674v0.245h0.945v-0.245zm1.19 0v0.245h0.91v-0.245zM0.438 2.447c-0.241 0 -0.438 0.197 -0.438 0.438 0 0.241 0.197 0.438 0.438 0.438s0.438 -0.197 0.438 -0.438c0 -0.241 -0.197 -0.438 -0.438 -0.438zm0 0.146a0.291 0.291 0 0 1 0.292 0.292 0.291 0.291 0 0 1 -0.292 0.292 0.291 0.291 0 0 1 -0.292 -0.292A0.291 0.291 0 0 1 0.438 2.593zM1.4 2.842v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245z" fill="#000000" fill-rule="evenodd"/></svg>';
this.toolbar.registerIconFromText("CustomCollection", "CustomIcon", icon);

}
//end eventHandler

Expand Down
17 changes: 17 additions & 0 deletions code-gen-library/ToolbarCustomIconOnViewInit/Angular.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//begin imports
import { IgxToolbarComponent, IgxToolActionLabelComponent, IgxToolActionComponent, IgxToolCommandEventArgs } from 'igniteui-angular-layouts';
//end imports


export class ToolbarCustomIconOnViewInit {

//begin eventHandler
public toolbarCustomIconOnViewInit(): void {

const icon = '<svg width="28px" height="28px" stroke="none" viewBox="0 0 3.5 3.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--gis" preserveAspectRatio="xMidYMid meet"><path d="M0.436 0.178a0.073 0.073 0 0 0 -0.062 0.036L0.01 0.846a0.073 0.073 0 0 0 0.063 0.109h0.729a0.073 0.073 0 0 0 0.063 -0.109L0.501 0.214a0.073 0.073 0 0 0 -0.064 -0.036zm0.001 0.219 0.238 0.413H0.199zM1.4 0.507v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245zM0.073 1.388A0.073 0.073 0 0 0 0 1.461v0.583a0.073 0.073 0 0 0 0.073 0.073h0.729A0.073 0.073 0 0 0 0.875 2.045V1.461a0.073 0.073 0 0 0 -0.073 -0.073zm0.073 0.146h0.583v0.438H0.146zM1.4 1.674v0.245h0.945v-0.245zm1.19 0v0.245h0.91v-0.245zM0.438 2.447c-0.241 0 -0.438 0.197 -0.438 0.438 0 0.241 0.197 0.438 0.438 0.438s0.438 -0.197 0.438 -0.438c0 -0.241 -0.197 -0.438 -0.438 -0.438zm0 0.146a0.291 0.291 0 0 1 0.292 0.292 0.291 0.291 0 0 1 -0.292 0.292 0.291 0.291 0 0 1 -0.292 -0.292A0.291 0.291 0 0 1 0.438 2.593zM1.4 2.842v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245z" fill="#000000" fill-rule="evenodd"/></svg>';
this.toolbar.registerIconFromText("CustomCollection", "CustomIcon", icon);

}
//end eventHandler

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//begin imports
import { IgcToolbarComponent, IgcToolActionLabelComponent, IgcToolActionComponent, IgcToolCommandEventArgs } from 'igniteui-webcomponents-layouts';
import { CodeGenHelper } from 'igniteui-webcomponents-core';
//end imports


Expand All @@ -11,6 +10,7 @@ export class ToolbarCustomIconOnViewInit {

const icon = '<svg width="28px" height="28px" stroke="none" viewBox="0 0 3.5 3.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--gis" preserveAspectRatio="xMidYMid meet"><path d="M0.436 0.178a0.073 0.073 0 0 0 -0.062 0.036L0.01 0.846a0.073 0.073 0 0 0 0.063 0.109h0.729a0.073 0.073 0 0 0 0.063 -0.109L0.501 0.214a0.073 0.073 0 0 0 -0.064 -0.036zm0.001 0.219 0.238 0.413H0.199zM1.4 0.507v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245zM0.073 1.388A0.073 0.073 0 0 0 0 1.461v0.583a0.073 0.073 0 0 0 0.073 0.073h0.729A0.073 0.073 0 0 0 0.875 2.045V1.461a0.073 0.073 0 0 0 -0.073 -0.073zm0.073 0.146h0.583v0.438H0.146zM1.4 1.674v0.245h0.945v-0.245zm1.19 0v0.245h0.91v-0.245zM0.438 2.447c-0.241 0 -0.438 0.197 -0.438 0.438 0 0.241 0.197 0.438 0.438 0.438s0.438 -0.197 0.438 -0.438c0 -0.241 -0.197 -0.438 -0.438 -0.438zm0 0.146a0.291 0.291 0 0 1 0.292 0.292 0.291 0.291 0 0 1 -0.292 0.292 0.291 0.291 0 0 1 -0.292 -0.292A0.291 0.291 0 0 1 0.438 2.593zM1.4 2.842v0.245h0.525v-0.245zm0.77 0v0.245h1.33v-0.245z" fill="#000000" fill-rule="evenodd"/></svg>';
this.toolbar.registerIconFromText("CustomCollection", "CustomIcon", icon);

}
//end eventHandler

Expand Down
36 changes: 16 additions & 20 deletions editor-templates/Angular/main-template/src/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,30 @@ defineAllComponents();
templateUrl: "./app.component.html",
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent
//ifdef onViewInit
implements AfterViewInit
//endifdef onViewInit
{

public constructor(private _detector: ChangeDetectorRef) {
//insert onInit
//end onInit
}

//ifdef onViewInit
public ngAfterViewInit(): void {
//insert onViewInit
//end onViewInit
}
//endifdef onViewInit

export class AppComponent implements AfterViewInit
{
//insert bindingFields
//end bindingFields

//insert vmProperties
//end vmProperties

//insert descriptionRegister
//end descriptionRegister

//insert eventHandlers

public constructor(private _detector: ChangeDetectorRef)
{
//insert onInit
//end onInit
}

public ngAfterViewInit(): void
{
//insert onViewInit
//end onViewInit
}

//insert eventHandlers
//end eventHandlers
}

0 comments on commit 836c873

Please sign in to comment.