inviton-powerduck 0.0.177 → 0.0.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
1
2
|
import type { ModalOnBeforeShownArgs, ModalOnShownArgs } from './modal-utils';
|
|
2
3
|
import { Modal as BootstrapModal } from 'bootstrap';
|
|
3
4
|
import { Prop, toNative } from 'vue-facing-decorator';
|
|
@@ -60,6 +61,7 @@ declare global {
|
|
|
60
61
|
export class ModalConfig {
|
|
61
62
|
static defaultPortalTarget = 'body';
|
|
62
63
|
static defaultMobileMode = ModalMobileMode.BottomSheetModal;
|
|
64
|
+
static renderModalHeaderIcon: (icon: ModalHeaderIcon) => VNode = null;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
@Component
|
|
@@ -281,6 +283,7 @@ class ModalComponent extends TsxComponent<ModalArgs> implements ModalArgs {
|
|
|
281
283
|
</div>
|
|
282
284
|
|
|
283
285
|
<LoadingIndicator visible={this.blocked} />
|
|
286
|
+
|
|
284
287
|
<div class={`modal-header${this.icon == null ? '' : ' modal-has-headericon'}`}>
|
|
285
288
|
{this.icon != null && <div class="modal-header-icon">{this.renderModalHeaderIcon()}</div>}
|
|
286
289
|
|
|
@@ -300,6 +303,10 @@ class ModalComponent extends TsxComponent<ModalArgs> implements ModalArgs {
|
|
|
300
303
|
}
|
|
301
304
|
|
|
302
305
|
renderModalHeaderIcon() {
|
|
306
|
+
if (ModalConfig.renderModalHeaderIcon != null) {
|
|
307
|
+
return ModalConfig.renderModalHeaderIcon(this.icon);
|
|
308
|
+
}
|
|
309
|
+
|
|
303
310
|
if (this.icon == ModalHeaderIcon.Warning) {
|
|
304
311
|
return <ModalIconWarning visible={true} />;
|
|
305
312
|
} else if (this.icon == ModalHeaderIcon.Success) {
|