-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: (Core) add semantic icons to Message box and remove the close bu…
…tton
- Loading branch information
1 parent
356b3bb
commit 6b86a29
Showing
18 changed files
with
959 additions
and
497 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
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
30 changes: 0 additions & 30 deletions
30
libs/core/src/lib/message-box/message-box-close-icon/message-box-close-icon.component.ts
This file was deleted.
Oops, something went wrong.
5 changes: 1 addition & 4 deletions
5
libs/core/src/lib/message-box/message-box-default/message-box-default.component.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
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
12 changes: 6 additions & 6 deletions
12
.../message-box-close-icon.component.spec.ts → ...ssage-box-semantic-icon.component.spec.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
61 changes: 61 additions & 0 deletions
61
...core/src/lib/message-box/message-box-semantic-icon/message-box-semantic-icon.component.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,61 @@ | ||
import { ChangeDetectionStrategy, Component, Input, Optional } from '@angular/core'; | ||
import { | ||
MESSAGE_BOX_CONFIGURABLE_ELEMENT, | ||
MessageBoxConfig, | ||
MessageBoxConfigurableElement | ||
} from '../utils/message-box-config.class'; | ||
|
||
/** | ||
* Message box element representing the semantic icon in the message box header. | ||
* | ||
* ```html | ||
* <fd-message-box-semantic-icon></fd-message-box-semantic-icon> | ||
* ``` | ||
*/ | ||
@Component({ | ||
selector: 'fd-message-box-semantic-icon', | ||
template: `<i [ngClass]="'sap-icon--' + this._semanticIcon" role="presentation"></i>`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
providers: [ | ||
{ provide: MESSAGE_BOX_CONFIGURABLE_ELEMENT, useExisting: MessageBoxSemanticIconComponent, multi: true } | ||
] | ||
}) | ||
export class MessageBoxSemanticIconComponent implements MessageBoxConfigurableElement { | ||
/** Custom semantic icon */ | ||
@Input() | ||
glyph: string; | ||
|
||
/** @hidden */ | ||
constructor(@Optional() public messageBoxConfig: MessageBoxConfig) { | ||
this.messageBoxConfig = this.messageBoxConfig || {}; | ||
} | ||
|
||
/** @hidden */ | ||
get _showSemanticIcon(): boolean { | ||
return this.messageBoxConfig.showSemanticIcon; | ||
} | ||
|
||
/** @hidden */ | ||
get _semanticIcon(): string { | ||
if (this.glyph) { | ||
return this.glyph; | ||
} | ||
if (this.messageBoxConfig.customSemanticIcon) { | ||
return this.messageBoxConfig.customSemanticIcon; | ||
} | ||
switch (this.messageBoxConfig.type) { | ||
case 'error': | ||
return 'message-error'; | ||
case 'success': | ||
return 'message-success'; | ||
case 'warning': | ||
return 'message-warning'; | ||
case 'information': | ||
return 'message-information'; | ||
case 'confirmation': | ||
return 'question-mark'; | ||
default: | ||
return ''; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.