@fluid-topics/ft-modal 1.3.29 → 1.3.31

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.
@@ -6,6 +6,7 @@ export declare class FtModal extends FtModal_base implements FtModalProperties {
6
6
  static elementDefinitions: ElementDefinitionsMap;
7
7
  static styles: import("lit").CSSResult;
8
8
  buttonLabel: string;
9
+ buttonIcon?: string;
9
10
  heading: string;
10
11
  icon?: string;
11
12
  private button;
package/build/ft-modal.js CHANGED
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { html } from "lit";
7
+ import { html, nothing } from "lit";
8
8
  import { property, query } from "lit/decorators.js";
9
9
  import { FtdsBase } from "@fluid-topics/ft-wc-utils";
10
10
  import { classMap } from "lit/directives/class-map.js";
@@ -16,6 +16,7 @@ import { modal } from "./FtDsModalMessages";
16
16
  import { FtButton } from "@fluid-topics/ft-button";
17
17
  import { ftmodalStyles } from "./ft-modal.styles";
18
18
  import { when } from "lit/directives/when.js";
19
+ import { ifDefined } from "lit/directives/if-defined.js";
19
20
  import { defaultFtModalMessages, ftModalContext } from "./FtModalMessages";
20
21
  class FtModalCloseEvent extends Event {
21
22
  constructor() {
@@ -36,7 +37,9 @@ class FtModal extends withI18n(FtdsBase) {
36
37
  };
37
38
  return html `
38
39
  <div class="${classMap(classes)}" part="container">
39
- <ft-button part="button" @click=${this.open} ariaHasPopup="dialog">${this.buttonLabel}</ft-button>
40
+ <ft-button part="button" icon="${ifDefined(this.buttonIcon)}" label="${this.buttonLabel}" @click=${this.open} ariaHasPopup="dialog">
41
+ ${when(this.buttonIcon, () => nothing, () => this.buttonLabel)}
42
+ </ft-button>
40
43
  <dialog part="dialog" aria-labelledby="heading" @close=${this.onClose}>
41
44
  <div part="overlay" @click=${this.onOverlayClick}></div>
42
45
  <div part="inner-container">
@@ -95,6 +98,9 @@ FtModal.styles = ftmodalStyles;
95
98
  __decorate([
96
99
  property()
97
100
  ], FtModal.prototype, "buttonLabel", void 0);
101
+ __decorate([
102
+ property()
103
+ ], FtModal.prototype, "buttonIcon", void 0);
98
104
  __decorate([
99
105
  property()
100
106
  ], FtModal.prototype, "heading", void 0);