@exmg/exm-form-drawer 1.1.13 → 1.1.14

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.
@@ -1,3 +1,4 @@
1
+ import { PropertyValues } from 'lit';
1
2
  import '@exmg/exm-drawer/exm-drawer.js';
2
3
  import '@exmg/exm-button/exm-filled-button.js';
3
4
  import '@material/web/button/text-button.js';
@@ -53,6 +54,7 @@ export declare class ExmFormDrawerBase extends ExmgElement {
53
54
  * @param {CustomEvent} e
54
55
  */
55
56
  doAction?(formData: unknown): Promise<void> | void;
57
+ protected firstUpdated(_changedProperties: PropertyValues): void;
56
58
  private handleSubmitFinished;
57
59
  /**
58
60
  * Method should be overriden to render form content
@@ -70,6 +70,15 @@ export class ExmFormDrawerBase extends ExmgElement {
70
70
  const form = this.exmForm.getForm();
71
71
  form.reset();
72
72
  }
73
+ firstUpdated(_changedProperties) {
74
+ var _a;
75
+ if (!this.exmForm && !this.doAction) {
76
+ return;
77
+ }
78
+ // By default form doAction is undefined, TS does not like that
79
+ // @ts-ignore
80
+ this.exmForm.doAction = (_a = this.doAction) === null || _a === void 0 ? void 0 : _a.bind(this);
81
+ }
73
82
  handleSubmitFinished({ detail }) {
74
83
  if (detail.success && !this.keepOpenedOnSubmitSuccess) {
75
84
  this.opened = false;
@@ -5,6 +5,7 @@ import { ExmFormDrawerBase } from './exm-form-drawer-base.js';
5
5
  import { formStyles } from '@exmg/exm-form';
6
6
  let ExmFormDrawer = class ExmFormDrawer extends ExmFormDrawerBase {
7
7
  firstUpdated() {
8
+ super.firstUpdated(new Map());
8
9
  if (!this.exmForm) {
9
10
  return;
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exmg/exm-form-drawer",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@exmg/exm-drawer": "^1.1.13",
35
- "@exmg/exm-form": "^1.1.13"
34
+ "@exmg/exm-drawer": "^1.1.14",
35
+ "@exmg/exm-form": "^1.1.14"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "lit": "^3.2.1",
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "f482775e785f3e1fe8dde56cf7614428ff9a7e80"
45
+ "gitHead": "b9c43c753dfb8a1f43c7a978335f066d199591d7"
46
46
  }