-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/message-bar): add animation complete event (#1688)
Co-authored-by: Lukas Maurer <lukas.maurer@siemens.com>
- Loading branch information
1 parent
de4f68d
commit 5a12c6a
Showing
27 changed files
with
420 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@siemens/ix-angular': minor | ||
'@siemens/ix': minor | ||
'@siemens/ix-vue': minor | ||
--- | ||
|
||
`ix-message-bar`: Event `closedChange` can now be prevented via `event.preventDefault()`. | ||
An additional event is added to get notified after the close animation of the `ix-message-bar` is finished. |
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
24 changes: 24 additions & 0 deletions
24
packages/angular-test-app/src/preview-examples/message-bar-removal.html
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,24 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2025 Siemens AG | ||
SPDX-License-Identifier: MIT | ||
This source code is licensed under the MIT license found in the | ||
LICENSE file in the root directory of this source tree. | ||
--> | ||
|
||
<div class="message-bar"> | ||
<ix-message-bar | ||
*ngIf="messageBarVisible" | ||
(closeAnimationCompleted)="handleCloseAnimationCompleted()" | ||
> | ||
Message text | ||
</ix-message-bar> | ||
|
||
<ix-button | ||
*ngIf="!messageBarVisible" | ||
(click)="handleShowMessage()" | ||
> | ||
Show message bar | ||
</ix-button> | ||
</div> |
27 changes: 27 additions & 0 deletions
27
packages/angular-test-app/src/preview-examples/message-bar-removal.ts
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,27 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-message-bar-single-removal', | ||
templateUrl: './message-bar-removal.html', | ||
styleUrls: ['./message-bar.css'] | ||
}) | ||
export default class MessageBarRemoval { | ||
messageBarVisible = true; | ||
|
||
handleCloseAnimationCompleted() { | ||
this.messageBarVisible = false; | ||
} | ||
|
||
handleShowMessage() { | ||
this.messageBarVisible = true; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/angular-test-app/src/preview-examples/message-bar.html
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,19 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2025 Siemens AG | ||
SPDX-License-Identifier: MIT | ||
This source code is licensed under the MIT license found in the | ||
LICENSE file in the root directory of this source tree. | ||
--> | ||
|
||
<div class="message-bar"> | ||
<ix-message-bar dismissible="false">Message text</ix-message-bar> | ||
<ix-message-bar dismissible="false" type="warning">Message text</ix-message-bar> | ||
<ix-message-bar dismissible="false" type="danger"> | ||
<div class="d-flex align-items-center justify-content-between"> | ||
Message text | ||
<ix-button>Action</ix-button> | ||
</div> | ||
</ix-message-bar> | ||
</div> |
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
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
36 changes: 36 additions & 0 deletions
36
packages/documentation/docs/controls/_message_bar_code.mdx
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,36 @@ | ||
import Props from './../auto-generated/ix-message-bar/props.md'; | ||
import Events from './../auto-generated/ix-message-bar/events.md'; | ||
import Playground from '@site/src/components/PlaygroundV3'; | ||
|
||
## Development | ||
|
||
### Examples | ||
|
||
#### Basic | ||
The message bar Web Component only provides the visual appearance of the message bar. | ||
To fully utilize the message bar, you need to implement a mechanism to remove it from the DOM when it is no longer needed. | ||
This typically involves handling the close event and updating the state of your application to reflect the removal of the message bar. | ||
|
||
<Playground | ||
name="message-bar" | ||
height="14rem" | ||
> | ||
</Playground> | ||
|
||
#### Dismissible | ||
|
||
<Playground | ||
name="message-bar-removal" | ||
height="14rem" | ||
> | ||
</Playground> | ||
|
||
## API | ||
|
||
### Properties | ||
|
||
<Props /> | ||
|
||
### Events | ||
|
||
<Events /> |
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,5 @@ | ||
import DocsCode from './\_message_bar_code.mdx'; | ||
|
||
# Message bar | ||
|
||
<DocsCode /> |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.