@fluid-topics/ft-modal 1.3.45 → 1.3.46

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.
@@ -11,7 +11,7 @@ import { DesignSystemSize } from "@fluid-topics/design-system-variables";
11
11
  import { FtDsModalBodyTypography } from "./ftds-modal.properties";
12
12
  import { FtIcons } from "@fluid-topics/ft-icon";
13
13
  import { property, query } from "lit/decorators.js";
14
- import { FtTypography } from "@fluid-topics/ft-typography";
14
+ import { FtdsTypography } from "@fluid-topics/ft-typography";
15
15
  import { FtdsButton } from "@fluid-topics/ft-button";
16
16
  class FtdsModalConfirm extends FtLitElement {
17
17
  constructor() {
@@ -26,24 +26,24 @@ class FtdsModalConfirm extends FtLitElement {
26
26
  <ftds-modal
27
27
  heading="${this.heading}"
28
28
  size="${DesignSystemSize.small}"
29
- @close="${this.onCancel}"
29
+ @close=${this.onCancel}
30
30
  >
31
- <ft-typography variant="${FtDsModalBodyTypography}">
31
+ <ftds-typography variant="${FtDsModalBodyTypography}">
32
32
  ${this.text}
33
- </ft-typography>
33
+ </ftds-typography>
34
34
  <ftds-button slot="actions"
35
35
  tertiary
36
36
  autofocus
37
37
  family="${DesignSystemFamily.neutral}"
38
38
  size="${DesignSystemSize.large}"
39
39
  icon="${this.cancelIcon}"
40
- @click="${this.onCancel}">
40
+ @click=${this.onCancel}>
41
41
  ${this.cancelText}
42
42
  </ftds-button>
43
43
  <ftds-button slot="actions"
44
44
  primary
45
45
  size="${DesignSystemSize.large}"
46
- @click="${this.onConfirm}"
46
+ @click=${this.onConfirm}
47
47
  icon="${this.confirmIcon}">
48
48
  ${this.confirmText}
49
49
  </ftds-button>
@@ -71,7 +71,7 @@ class FtdsModalConfirm extends FtLitElement {
71
71
  }
72
72
  FtdsModalConfirm.elementDefinitions = {
73
73
  "ftds-modal": FtdsModal,
74
- "ft-typography": FtTypography,
74
+ "ftds-typography": FtdsTypography,
75
75
  "ftds-button": FtdsButton,
76
76
  };
77
77
  __decorate([
@@ -1,3 +1,4 @@
1
+ import { PropertyValues } from "lit";
1
2
  import { ElementDefinitionsMap, FtdsBase } from "@fluid-topics/ft-wc-utils";
2
3
  import { FtdsModalProperties } from "./ftds-modal.properties";
3
4
  import { DesignSystemSize } from "@fluid-topics/design-system-variables";
@@ -7,10 +8,12 @@ export declare class FtdsModal extends FtdsModal_base implements FtdsModalProper
7
8
  static styles: import("lit").CSSResult[];
8
9
  heading: string;
9
10
  icon?: string;
11
+ dialogOpen?: boolean;
10
12
  private dialog;
11
13
  size: DesignSystemSize;
12
14
  constructor();
13
15
  protected render(): import("lit-html").TemplateResult<1>;
16
+ protected contentAvailableCallback(props: PropertyValues): void;
14
17
  open(): void;
15
18
  close(): void;
16
19
  disconnectedCallback(): void;
@@ -12,7 +12,7 @@ import { designSystemStyle } from "./ftds-modal.styles";
12
12
  import { FtdsButton } from "@fluid-topics/ft-button";
13
13
  import { DesignSystemSize } from "@fluid-topics/design-system-variables";
14
14
  import { FtIcon, FtIcons } from "@fluid-topics/ft-icon";
15
- import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
15
+ import { FtdsTypography, FtdsTypographyVariants } from "@fluid-topics/ft-typography";
16
16
  import { withI18n } from "@fluid-topics/ft-i18n";
17
17
  import { defaultModalMessages, modal } from "./FtDsModalMessages";
18
18
  class FtdsModalCloseEvent extends Event {
@@ -30,28 +30,28 @@ class FtdsModal extends withI18n(FtdsBase) {
30
30
  render() {
31
31
  const classes = {
32
32
  "ftds-modal": true,
33
- ...this.getDesignSystemBaseClasses()
33
+ ...this.getDesignSystemBaseClasses(),
34
34
  };
35
35
  return html `
36
36
  <div class="${classMap(classes)}" part="container">
37
37
  <dialog part="dialog"
38
- @close="${() => this.dispatchEvent(new FtdsModalCloseEvent())}">
39
- <div part="overlay" @click="${this.onOverlayClick}"></div>
38
+ @close=${() => this.dispatchEvent(new FtdsModalCloseEvent())}>
39
+ <div part="overlay" @click=${this.onOverlayClick}></div>
40
40
  <div part="inner-container">
41
41
  <div part="header">
42
42
  ${this.icon ? html `
43
- <ft-icon part="icon" value="${this.icon}"/>
43
+ <ft-icon part="icon" value="${this.icon}"></ft-icon>
44
44
  ` : nothing}
45
- <ft-typography part="heading" variant="${FtTypographyVariants.body1semibold}">
45
+ <ftds-typography part="heading" variant="${FtdsTypographyVariants.body1semibold}">
46
46
  ${this.heading}
47
- </ft-typography>
47
+ </ftds-typography>
48
48
  <ftds-button part="closing-button"
49
49
  size="${DesignSystemSize.large}"
50
50
  icon="${FtIcons.CLOSE}"
51
51
  tertiary
52
52
  family="${DesignSystemFamily.neutral}"
53
53
  label="${modal.messages.closeModal()}"
54
- @click="${this.close}">
54
+ @click=${this.close}>
55
55
  </ftds-button>
56
56
  </div>
57
57
  <div part="body">
@@ -67,11 +67,22 @@ class FtdsModal extends withI18n(FtdsBase) {
67
67
  </div>
68
68
  `;
69
69
  }
70
+ contentAvailableCallback(props) {
71
+ super.contentAvailableCallback(props);
72
+ if (props.has("dialogOpen")) {
73
+ if (this.dialogOpen) {
74
+ this.dialog.showModal();
75
+ }
76
+ else {
77
+ this.dialog.close();
78
+ }
79
+ }
80
+ }
70
81
  open() {
71
- this.dialog.showModal();
82
+ this.dialogOpen = true;
72
83
  }
73
84
  close() {
74
- this.dialog.close();
85
+ this.dialogOpen = false;
75
86
  }
76
87
  disconnectedCallback() {
77
88
  super.disconnectedCallback();
@@ -83,17 +94,23 @@ class FtdsModal extends withI18n(FtdsBase) {
83
94
  }
84
95
  FtdsModal.elementDefinitions = {
85
96
  "ftds-button": FtdsButton,
86
- "ft-typography": FtTypography,
97
+ "ftds-typography": FtdsTypography,
87
98
  "ft-icon": FtIcon,
88
99
  };
89
100
  FtdsModal.styles = designSystemStyle;
90
101
  __decorate([
91
- property({ type: String })
102
+ property()
92
103
  ], FtdsModal.prototype, "heading", void 0);
93
104
  __decorate([
94
- property({ type: String })
105
+ property()
95
106
  ], FtdsModal.prototype, "icon", void 0);
107
+ __decorate([
108
+ property({ type: Boolean, reflect: true })
109
+ ], FtdsModal.prototype, "dialogOpen", void 0);
96
110
  __decorate([
97
111
  query("dialog")
98
112
  ], FtdsModal.prototype, "dialog", void 0);
113
+ __decorate([
114
+ property()
115
+ ], FtdsModal.prototype, "size", void 0);
99
116
  export { FtdsModal };
@@ -1,7 +1,7 @@
1
- import { FtTypographyVariants } from "@fluid-topics/ft-typography";
1
+ import { FtdsTypographyVariants } from "@fluid-topics/ft-typography";
2
2
  import { FtdsBaseInterface } from "@fluid-topics/ft-wc-utils";
3
3
  export interface FtdsModalProperties extends FtdsBaseInterface {
4
4
  heading: string;
5
5
  icon?: string;
6
6
  }
7
- export declare const FtDsModalBodyTypography = FtTypographyVariants.body2regular;
7
+ export declare const FtDsModalBodyTypography = FtdsTypographyVariants.body2regular;
@@ -1,2 +1,2 @@
1
- import { FtTypographyVariants } from "@fluid-topics/ft-typography";
2
- export const FtDsModalBodyTypography = FtTypographyVariants.body2regular;
1
+ import { FtdsTypographyVariants } from "@fluid-topics/ft-typography";
2
+ export const FtDsModalBodyTypography = FtdsTypographyVariants.body2regular;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-modal",
3
- "version": "1.3.45",
3
+ "version": "1.3.46",
4
4
  "description": "Modal for Design System V2",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "1.3.45",
22
+ "@fluid-topics/ft-wc-utils": "1.3.46",
23
23
  "lit": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-topics/ft-wc-test-utils": "1.3.45"
26
+ "@fluid-topics/ft-wc-test-utils": "1.3.46"
27
27
  },
28
- "gitHead": "3fd3d1375535575f012653afcbcb81dc3c25b7c7"
28
+ "gitHead": "d6cf25d6ed0dead8c7aff4f94a493c35d12f1392"
29
29
  }