2022-08-30 01:59:57 +08:00
|
|
|
<div
|
|
|
|
id="dialog-holder"
|
|
|
|
class="dialog-container {{this.dialog.class}}"
|
|
|
|
aria-labelledby={{this.dialog.titleElementId}}
|
|
|
|
aria-hidden="true"
|
|
|
|
>
|
|
|
|
<div class="dialog-overlay" data-a11y-dialog-hide></div>
|
|
|
|
|
|
|
|
{{#if this.dialog.type}}
|
|
|
|
<div class="dialog-content" role="document">
|
|
|
|
{{#if this.dialog.title}}
|
|
|
|
<div class="dialog-header">
|
|
|
|
<h3 id={{this.dialog.titleElementId}}>{{this.dialog.title}}</h3>
|
|
|
|
<DButton
|
|
|
|
@icon="times"
|
|
|
|
@action={{action this.dialog.cancel}}
|
|
|
|
@class="btn-flat dialog-close close"
|
|
|
|
@title="modal.close"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2023-02-14 02:03:31 +08:00
|
|
|
{{#if (or this.dialog.message this.dialog.bodyComponent)}}
|
2022-08-30 01:59:57 +08:00
|
|
|
<div class="dialog-body">
|
2023-02-14 02:03:31 +08:00
|
|
|
{{#if this.dialog.bodyComponent}}
|
|
|
|
<this.dialog.bodyComponent
|
|
|
|
@model={{this.dialog.bodyComponentModel}}
|
2022-12-08 06:41:22 +08:00
|
|
|
/>
|
2023-02-14 02:03:31 +08:00
|
|
|
{{else if this.dialog.message}}
|
|
|
|
<p>{{this.dialog.message}}</p>
|
2022-12-08 06:41:22 +08:00
|
|
|
{{/if}}
|
2022-08-30 01:59:57 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if (notEq this.dialog.type "notice")}}
|
|
|
|
<div class="dialog-footer">
|
|
|
|
{{#each this.dialog.buttons as |button|}}
|
|
|
|
<DButton
|
|
|
|
@icon={{button.icon}}
|
|
|
|
@class={{button.class}}
|
|
|
|
@action={{action "handleButtonAction" button}}
|
|
|
|
@translatedLabel={{button.label}}
|
|
|
|
/>
|
|
|
|
{{else}}
|
2022-12-08 06:41:22 +08:00
|
|
|
<DButton
|
|
|
|
@class={{this.dialog.confirmButtonClass}}
|
|
|
|
@disabled={{this.dialog.confirmButtonDisabled}}
|
|
|
|
@action={{this.dialog.didConfirmWrapped}}
|
|
|
|
@icon={{this.dialog.confirmButtonIcon}}
|
|
|
|
@label={{this.dialog.confirmButtonLabel}}
|
|
|
|
/>
|
2022-08-30 01:59:57 +08:00
|
|
|
{{#if this.dialog.shouldDisplayCancel}}
|
2022-12-08 06:41:22 +08:00
|
|
|
<DButton
|
|
|
|
@class={{this.dialog.cancelButtonClass}}
|
|
|
|
@action={{this.dialog.cancel}}
|
|
|
|
@label={{this.dialog.cancelButtonLabel}}
|
|
|
|
/>
|
2022-08-30 01:59:57 +08:00
|
|
|
{{/if}}
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|