@fluid-topics/ft-modal 1.3.54 → 1.3.55

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.
@@ -14,6 +14,7 @@ export declare class FtModal extends FtModal_base implements FtModalProperties {
14
14
  size: DesignSystemSize;
15
15
  constructor();
16
16
  protected render(): import("lit-html").TemplateResult<1>;
17
+ private renderCloseButton;
17
18
  protected onTriggerClick(e: MouseEvent): void;
18
19
  protected elementToFocusOnClose?: HTMLElement;
19
20
  private intersectionObserver;
package/build/ft-modal.js CHANGED
@@ -60,19 +60,15 @@ class FtModal extends withI18n(FtdsBase) {
60
60
  <div part="overlay" @click=${this.onOverlayClick}></div>
61
61
  <div part="inner-container" class="${classMap(drawerClasses)}">
62
62
  <div part="header">
63
+ ${when(this.drawer, () => this.renderCloseButton())}
63
64
  ${when(!!this.icon && !this.drawer, () => html `
64
65
  <ft-icon part="icon" value="${this.icon}"></ft-icon>
65
66
  `)}
66
67
  <ft-typography id="heading" part="heading" role="heading" variant="${FtTypographyVariants.title}">
67
68
  ${this.heading}
68
69
  </ft-typography>
69
- <ft-button part="closing-button"
70
- icon="${FtIcons.CLOSE}"
71
- tertiary
72
- label="${modal.messages.closeModal()}"
73
- tooltipPosition="left"
74
- @click=${this.close}>
75
- </ft-button>
70
+ <slot name="header-actions"></slot>
71
+ ${when(!this.drawer, () => this.renderCloseButton())}
76
72
  </div>
77
73
  <div part="body">
78
74
  <div part="content">
@@ -87,6 +83,15 @@ class FtModal extends withI18n(FtdsBase) {
87
83
  </div>
88
84
  `;
89
85
  }
86
+ renderCloseButton() {
87
+ return html `
88
+ <ft-button part="closing-button"
89
+ icon="${FtIcons.CLOSE}"
90
+ tertiary
91
+ label="${modal.messages.closeModal()}"
92
+ tooltipPosition="left"
93
+ @click=${this.close}></ft-button>`;
94
+ }
90
95
  onTriggerClick(e) {
91
96
  this.open(e.target);
92
97
  }