ion-avatar.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*!
  2. * (C) Ionic http://ionicframework.com - MIT License
  3. */
  4. import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
  5. import { b as getIonMode } from './ionic-global.js';
  6. const avatarIosCss = ":host{border-radius:var(--border-radius);display:block}::slotted(ion-img),::slotted(img){border-radius:var(--border-radius);width:100%;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden}:host{--border-radius:50%;width:48px;height:48px}";
  7. const IonAvatarIosStyle0 = avatarIosCss;
  8. const avatarMdCss = ":host{border-radius:var(--border-radius);display:block}::slotted(ion-img),::slotted(img){border-radius:var(--border-radius);width:100%;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden}:host{--border-radius:50%;width:64px;height:64px}";
  9. const IonAvatarMdStyle0 = avatarMdCss;
  10. const Avatar = /*@__PURE__*/ proxyCustomElement(class Avatar extends HTMLElement {
  11. constructor() {
  12. super();
  13. this.__registerHost();
  14. this.__attachShadow();
  15. }
  16. render() {
  17. return (h(Host, { key: '998217066084f966bf5d356fed85bcbd451f675a', class: getIonMode(this) }, h("slot", { key: '1a6f7c9d4dc6a875f86b5b3cda6d59cb39587f22' })));
  18. }
  19. static get style() { return {
  20. ios: IonAvatarIosStyle0,
  21. md: IonAvatarMdStyle0
  22. }; }
  23. }, [33, "ion-avatar"]);
  24. function defineCustomElement$1() {
  25. if (typeof customElements === "undefined") {
  26. return;
  27. }
  28. const components = ["ion-avatar"];
  29. components.forEach(tagName => { switch (tagName) {
  30. case "ion-avatar":
  31. if (!customElements.get(tagName)) {
  32. customElements.define(tagName, Avatar);
  33. }
  34. break;
  35. } });
  36. }
  37. const IonAvatar = Avatar;
  38. const defineCustomElement = defineCustomElement$1;
  39. export { IonAvatar, defineCustomElement };