-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13815 from anlampe/toolbar-accept-documented-temp…
…late-names Toolbar: Accept documented template names #13814
- Loading branch information
Showing
5 changed files
with
147 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { MenuItem } from 'primeng/api'; | ||
import { Code } from '../../domain/code'; | ||
|
||
@Component({ | ||
selector: 'template-doc', | ||
template: ` <section class="py-3"> | ||
<app-docsectiontext [title]="title" [id]="id"> | ||
<p>Content can also be placed using the <i>start</i>, <i>center</i> and <i>end</i> templates.</p> | ||
</app-docsectiontext> | ||
<div class="card"> | ||
<p-toolbar> | ||
<ng-template pTemplate="start"> | ||
<p-button label="New" icon="pi pi-plus" class="mr-2"></p-button> | ||
<p-button label="Upload" icon="pi pi-upload" styleClass="p-button-success"></p-button> | ||
<i class="p-toolbar-separator pi pi-bars mr-2" style="vertical-align: middle"></i> | ||
<p-splitButton label="Save" icon="pi pi-check" [model]="items" styleClass="p-button-warning"></p-splitButton> | ||
</ng-template> | ||
<ng-template pTemplate="center"> | ||
<span class="text-primary font-semibold text-xl">Center</span> | ||
</ng-template> | ||
<ng-template pTemplate="end"> | ||
<p-button icon="pi pi-search" class="mr-2"></p-button> | ||
<p-button icon="pi pi-calendar" styleClass="p-button-success mr-2"></p-button> | ||
<p-button icon="pi pi-times" styleClass="p-button-danger"></p-button> | ||
</ng-template> | ||
</p-toolbar> | ||
</div> | ||
<app-code [code]="code" selector="toolbar-template-demo"></app-code> | ||
</section>` | ||
}) | ||
export class TemplateDoc implements OnInit { | ||
@Input() id: string; | ||
|
||
@Input() title: string; | ||
|
||
items: MenuItem[] | undefined; | ||
|
||
ngOnInit() { | ||
this.items = [ | ||
{ | ||
label: 'Update', | ||
icon: 'pi pi-refresh' | ||
}, | ||
{ | ||
label: 'Delete', | ||
icon: 'pi pi-times' | ||
}, | ||
{ | ||
label: 'Angular', | ||
icon: 'pi pi-external-link', | ||
url: 'http://angular.io' | ||
}, | ||
{ | ||
label: 'Router', | ||
icon: 'pi pi-upload', | ||
routerLink: '/fileupload' | ||
} | ||
]; | ||
} | ||
|
||
code: Code = { | ||
basic: ` | ||
<p-toolbar> | ||
<ng-template pTemplate="start"> | ||
<p-button label="New" icon="pi pi-plus" class="mr-2"></p-button> | ||
<p-button label="Upload" icon="pi pi-upload" styleClass="p-button-success"></p-button> | ||
<i class="p-toolbar-separator pi pi-bars mr-2" style="vertical-align: middle"></i> | ||
<p-splitButton label="Save" icon="pi pi-check" [model]="items" styleClass="p-button-warning"></p-splitButton> | ||
</ng-template> | ||
<ng-template pTemplate="center"> | ||
<span class="text-primary font-semibold text-xl">Center</span> | ||
</ng-template> | ||
<ng-template pTemplate="end"> | ||
<p-button icon="pi pi-search" class="mr-2"></p-button> | ||
<p-button icon="pi pi-calendar" styleClass="p-button-success mr-2"></p-button> | ||
<p-button icon="pi pi-times" styleClass="p-button-danger"></p-button> | ||
</ng-template> | ||
</p-toolbar>`, | ||
|
||
html: ` | ||
<ng-template class="card"> | ||
<p-toolbar> | ||
<ng-template pTemplate="start"> | ||
<p-button label="New" icon="pi pi-plus" class="mr-2"></p-button> | ||
<p-button label="Upload" icon="pi pi-upload" styleClass="p-button-success"></p-button> | ||
<i class="p-toolbar-separator pi pi-bars mr-2" style="vertical-align: middle"></i> | ||
<p-splitButton label="Save" icon="pi pi-check" [model]="items" styleClass="p-button-warning"></p-splitButton> | ||
</ng-template> | ||
<ng-template pTemplate="center"> | ||
<span class="text-primary font-semibold text-xl">Center</span> | ||
</ng-template> | ||
<ng-template pTemplate="end"> | ||
<p-button icon="pi pi-search" class="mr-2"></p-button> | ||
<p-button icon="pi pi-calendar" styleClass="p-button-success mr-2"></p-button> | ||
<p-button icon="pi pi-times" styleClass="p-button-danger"></p-button> | ||
</ng-template> | ||
</p-toolbar> | ||
</div>`, | ||
|
||
typescript: ` | ||
import { Component, OnInit } from '@angular/core'; | ||
import { MenuItem } from 'primeng/api'; | ||
@Component({ | ||
selector: 'toolbar-template-demo', | ||
templateUrl: './toolbar-template-demo.html' | ||
}) | ||
export class ToolbarTemplateDemo implements OnInit { | ||
items: MenuItem[] | undefined; | ||
ngOnInit() { | ||
this.items = [ | ||
{ | ||
label: 'Update', | ||
icon: 'pi pi-refresh' | ||
}, | ||
{ | ||
label: 'Delete', | ||
icon: 'pi pi-times' | ||
}, | ||
{ | ||
label: 'Angular', | ||
icon: 'pi pi-external-link', | ||
url: 'http://angular.io' | ||
}, | ||
{ | ||
label: 'Router', | ||
icon: 'pi pi-upload', | ||
routerLink: '/fileupload' | ||
} | ||
]; | ||
} | ||
}` | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32ee09b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
primeng-ssr-test – ./
primeng-ssr-test-git-master-primeng-test.vercel.app
primeng-ssr-test.vercel.app
primeng-ssr-test-primeng-test.vercel.app