Skip to content

Commit 8ac6037

Browse files
committed
Prepare release and update examples
1 parent ff3ee23 commit 8ac6037

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

projects/mantic-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mantic-ui/angular",
3-
"version": "19.2.0",
3+
"version": "19.3.0",
44
"description": "mantic UI for Angular",
55
"keywords": [
66
"mantic-ui",

src/app/examples/notification/notification.component.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
<m-example-code [code]="exampleComponent" [languages]="['ts']" />
2424
<m-example-code [code]="exampleComponentTs" [languages]="['ts']" label="custom-notification.component.ts" />
2525
</m-example>
26+
<m-example header="Hide a message" description="Use code to hide a message">
27+
<m-flex>
28+
@if (manualNotification) {
29+
<m-button (click)="hideManual()">Hide</m-button>
30+
} @else {
31+
<m-button (click)="showManual()">Show</m-button>
32+
}
33+
</m-flex>
34+
<m-example-code [code]="exampleManual" [languages]="['ts']" />
35+
</m-example>
2636
</m-tab>
2737
</m-tab-group>
2838

src/app/examples/notification/notification.component.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CommonModule } from '@angular/common';
22
import { Component, inject } from '@angular/core';
3-
import { AsyncAction, ButtonComponent, FlexComponent, NotificationService, TabComponent, TabGroupComponent } from '@mantic-ui/angular';
3+
import { AsyncAction, ButtonComponent, FlexComponent, NotificationRef, NotificationService, TabComponent, TabGroupComponent } from '@mantic-ui/angular';
44
import { ExampleCodeComponent, ExampleComponent } from '@mantic-ui/angular-doc';
55
import { HeaderComponent } from '../../components/header/header.component';
66
import { CustomNotificationComponent } from './custom-notification/custom-notification.component';
@@ -56,6 +56,7 @@ export class DemoComponent {
5656
this.asyncAction = undefined;
5757
}
5858
}`;
59+
protected manualNotification: NotificationRef | undefined;
5960

6061
protected showError(): void {
6162
this.notificationService.error('Error Text');
@@ -112,4 +113,27 @@ export class CustomNotificationComponent {
112113
alert('You clicked the button!');
113114
}
114115
}`;
116+
117+
public showManual(): void {
118+
this.manualNotification = this.notificationService.error('A error that can be closed manually by click on the hide button');
119+
}
120+
121+
public hideManual(): void {
122+
this.manualNotification?.close();
123+
this.manualNotification = undefined;
124+
}
125+
126+
public exampleManual = `import { NotificationService, NotificationRef } from '@mantic-ui/angular';
127+
128+
notificationService = inject(NotificationService);
129+
manualNotification: NotificationRef | undefined;
130+
131+
showManual(): void {
132+
this.manualNotification = this.notificationService.error('A error...');
133+
}
134+
135+
hideManual(): void {
136+
this.manualNotification?.close();
137+
this.manualNotification = undefined;
138+
}';`;
115139
}

0 commit comments

Comments
 (0)