mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
feat(action-sheet, loading, modal, picker, popover): pass HTML attributes to host element (#23929)
This commit is contained in:
@ -2,7 +2,7 @@ import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Meth
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { AnimationBuilder, OverlayEventDetail, OverlayInterface, SpinnerTypes } from '../../interface';
|
||||
import { AnimationBuilder, LoadingAttributes, OverlayEventDetail, OverlayInterface, SpinnerTypes } from '../../interface';
|
||||
import { BACKDROP, dismiss, eventMethod, prepareOverlay, present } from '../../utils/overlays';
|
||||
import { IonicSafeString, sanitizeDOMString } from '../../utils/sanitization';
|
||||
import { getClassMap } from '../../utils/theme';
|
||||
@ -92,6 +92,11 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
*/
|
||||
@Prop() animated = true;
|
||||
|
||||
/**
|
||||
* Additional attributes to pass to the loader.
|
||||
*/
|
||||
@Prop() htmlAttributes?: LoadingAttributes;
|
||||
|
||||
/**
|
||||
* Emitted after the loading has presented.
|
||||
*/
|
||||
@ -179,15 +184,16 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { message, spinner } = this;
|
||||
const { message, spinner, htmlAttributes } = this;
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
onIonBackdropTap={this.onBackdropTap}
|
||||
tabindex="-1"
|
||||
{...htmlAttributes as any}
|
||||
style={{
|
||||
zIndex: `${40000 + this.overlayIndex}`
|
||||
}}
|
||||
onIonBackdropTap={this.onBackdropTap}
|
||||
class={{
|
||||
...getClassMap(this.cssClass),
|
||||
[mode]: true,
|
||||
|
||||
Reference in New Issue
Block a user