@exmg/exm-form-drawer 1.2.8 → 1.2.9

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.
@@ -82,7 +82,7 @@ export declare class ExmFormDrawerBase extends ExmgElement {
82
82
  /**
83
83
  * Method should be overriden to render form content
84
84
  */
85
- protected renderFormContent(): import("lit-html").TemplateResult<1> | undefined;
85
+ protected renderFormContent(): import("lit").TemplateResult<1> | undefined;
86
86
  protected handleDrawerOpenedChanged(event: CustomEvent): void;
87
- protected render(): import("lit-html").TemplateResult<1>;
87
+ protected render(): import("lit").TemplateResult<1>;
88
88
  }
@@ -0,0 +1,57 @@
1
+ import type { StoryObj } from '@storybook/web-components-vite';
2
+ import { ExmFormDrawer } from './exm-form-drawer.js';
3
+ import { LitElement } from 'lit';
4
+ import './exm-form-drawer.js';
5
+ import '@material/web/button/filled-button.js';
6
+ import '@material/web/textfield/filled-text-field.js';
7
+ export declare class DemoFormDrawer extends LitElement {
8
+ args: any;
9
+ open: boolean;
10
+ handleOpenClick(): void;
11
+ handleDrawerChanged({ detail }: CustomEvent): void;
12
+ render(): import("lit").TemplateResult<1>;
13
+ }
14
+ type ExmFormDrawerExtended = ExmFormDrawer & {
15
+ submitBtnTitle: string;
16
+ cancelBtnTitle: string;
17
+ };
18
+ type Story = StoryObj<ExmFormDrawerExtended>;
19
+ declare const meta: {
20
+ title: string;
21
+ tags: string[];
22
+ argTypes: {
23
+ submitBtnTitle: {
24
+ control: "text";
25
+ };
26
+ cancelBtnTitle: {
27
+ control: "text";
28
+ };
29
+ hideCancelButton: {
30
+ control: "boolean";
31
+ };
32
+ showResetButton: {
33
+ control: "boolean";
34
+ };
35
+ keepOpenedOnSubmitSuccess: {
36
+ control: "boolean";
37
+ };
38
+ noCancelOnOutsideClick: {
39
+ control: "boolean";
40
+ };
41
+ noResetOnClose: {
42
+ control: "boolean";
43
+ };
44
+ submitting: {
45
+ control: "boolean";
46
+ };
47
+ errorMessage: {
48
+ control: "text";
49
+ };
50
+ disableSubmitButton: {
51
+ control: "boolean";
52
+ };
53
+ };
54
+ excludeStories: string[];
55
+ };
56
+ export default meta;
57
+ export declare const FormDrawer: Story;
@@ -0,0 +1,88 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement, property, state } from 'lit/decorators.js';
3
+ import { html, LitElement } from 'lit';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import './exm-form-drawer.js';
6
+ import '@material/web/button/filled-button.js';
7
+ import '@material/web/textfield/filled-text-field.js';
8
+ let DemoFormDrawer = class DemoFormDrawer extends LitElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.args = {};
12
+ this.open = false;
13
+ }
14
+ handleOpenClick() {
15
+ this.open = true;
16
+ }
17
+ handleDrawerChanged({ detail }) {
18
+ this.open = detail.value;
19
+ }
20
+ render() {
21
+ return html `
22
+ <md-filled-button @click=${this.handleOpenClick}>Open</md-filled-button>
23
+ <exm-form-drawer
24
+ ?opened="${this.open}"
25
+ submit-btn-title=${ifDefined(this.args.submitBtnTitle)}
26
+ cancel-btn-title=${ifDefined(this.args.cancelBtnTitle)}
27
+ ?hide-cancel-button=${this.args.hideCancelButton}
28
+ ?show-reset-button=${this.args.showResetButton}
29
+ ?keep-opened-on-submit-success=${this.args.keepOpenedOnSubmitSuccess}
30
+ ?no-cancel-on-outside-click=${this.args.noCancelOnOutsideClick}
31
+ ?no-reset-on-close=${this.args.noResetOnClose}
32
+ ?submitting=${this.args.submitting}
33
+ errorMessage=${this.args.errorMessage}
34
+ disable-submit-button=${this.args.disableSubmitButton}
35
+ @exm-drawer-opened-changed=${this.handleDrawerChanged}
36
+ >
37
+ <form>
38
+ <div class="row">
39
+ <md-filled-text-field
40
+ name="firstname"
41
+ dialogFocus
42
+ label="First Name"
43
+ required
44
+ supporting-text="supporting text"
45
+ ></md-filled-text-field>
46
+ <md-filled-text-field name="lastname" label="Last Name"></md-filled-text-field>
47
+ </div>
48
+ </form>
49
+ </exm-form-drawer>
50
+ `;
51
+ }
52
+ };
53
+ __decorate([
54
+ property()
55
+ ], DemoFormDrawer.prototype, "args", void 0);
56
+ __decorate([
57
+ state()
58
+ ], DemoFormDrawer.prototype, "open", void 0);
59
+ DemoFormDrawer = __decorate([
60
+ customElement('demo-form-drawer')
61
+ ], DemoFormDrawer);
62
+ export { DemoFormDrawer };
63
+ const drawerTemplate = (args) => html `
64
+ <demo-form-drawer .args="${args}"></demo-form-drawer>
65
+ `;
66
+ const meta = {
67
+ title: 'Packages/Form Drawer',
68
+ tags: ['autodocs'],
69
+ argTypes: {
70
+ submitBtnTitle: { control: 'text' },
71
+ cancelBtnTitle: { control: 'text' },
72
+ hideCancelButton: { control: 'boolean' },
73
+ showResetButton: { control: 'boolean' },
74
+ keepOpenedOnSubmitSuccess: { control: 'boolean' },
75
+ noCancelOnOutsideClick: { control: 'boolean' },
76
+ noResetOnClose: { control: 'boolean' },
77
+ submitting: { control: 'boolean' },
78
+ errorMessage: { control: 'text' },
79
+ disableSubmitButton: { control: 'boolean' },
80
+ },
81
+ excludeStories: ['formInputs'],
82
+ };
83
+ export default meta;
84
+ export const FormDrawer = {
85
+ render: drawerTemplate,
86
+ args: {},
87
+ };
88
+ //# sourceMappingURL=exm-form-drawer.stories.js.map
package/README.md CHANGED
@@ -85,7 +85,7 @@ Provides form functionality to drawer:
85
85
  | `--mdc-theme-primary` | _None_ |
86
86
  | `--mdc-theme-on-surface` | _None_ |
87
87
  | `--mdc-theme-surface` | _None_ |
88
- | `--exm-form-drawer-header-separator-color` | Color of header seperator of form |
88
+ | `--exm-form-drawer-header-separator-color` | Color of header separator of form |
89
89
  | `--exm-drawer-max-width` | Max width of drawer |
90
90
 
91
91
  #### Notes about drawer form
@@ -82,7 +82,7 @@ export declare class ExmFormDrawerBase extends ExmgElement {
82
82
  /**
83
83
  * Method should be overriden to render form content
84
84
  */
85
- protected renderFormContent(): import("lit-html").TemplateResult<1> | undefined;
85
+ protected renderFormContent(): import("lit").TemplateResult<1> | undefined;
86
86
  protected handleDrawerOpenedChanged(event: CustomEvent): void;
87
- protected render(): import("lit-html").TemplateResult<1>;
87
+ protected render(): import("lit").TemplateResult<1>;
88
88
  }
@@ -1,4 +1,4 @@
1
- import { __decorate } from 'tslib';
1
+ import { __decorate } from './node_modules/.bun/@rollup_plugin-typescript@12.3.0_8b7a8dd02ef2c96b/node_modules/tslib/tslib.es6.js';
2
2
  import { html } from 'lit';
3
3
  import { property, query } from 'lit/decorators.js';
4
4
  import '@exmg/exm-drawer/exm-drawer.js';
@@ -1,4 +1,4 @@
1
- import { __decorate } from 'tslib';
1
+ import { __decorate } from './node_modules/.bun/@rollup_plugin-typescript@12.3.0_8b7a8dd02ef2c96b/node_modules/tslib/tslib.es6.js';
2
2
  import { customElement } from 'lit/decorators.js';
3
3
  import { style } from './styles/exm-form-drawer-styles-css.js';
4
4
  import { ExmFormDrawerBase } from './exm-form-drawer-base.js';
@@ -0,0 +1,57 @@
1
+ import type { StoryObj } from '@storybook/web-components-vite';
2
+ import { ExmFormDrawer } from './exm-form-drawer.js';
3
+ import { LitElement } from 'lit';
4
+ import './exm-form-drawer.js';
5
+ import '@material/web/button/filled-button.js';
6
+ import '@material/web/textfield/filled-text-field.js';
7
+ export declare class DemoFormDrawer extends LitElement {
8
+ args: any;
9
+ open: boolean;
10
+ handleOpenClick(): void;
11
+ handleDrawerChanged({ detail }: CustomEvent): void;
12
+ render(): import("lit").TemplateResult<1>;
13
+ }
14
+ type ExmFormDrawerExtended = ExmFormDrawer & {
15
+ submitBtnTitle: string;
16
+ cancelBtnTitle: string;
17
+ };
18
+ type Story = StoryObj<ExmFormDrawerExtended>;
19
+ declare const meta: {
20
+ title: string;
21
+ tags: string[];
22
+ argTypes: {
23
+ submitBtnTitle: {
24
+ control: "text";
25
+ };
26
+ cancelBtnTitle: {
27
+ control: "text";
28
+ };
29
+ hideCancelButton: {
30
+ control: "boolean";
31
+ };
32
+ showResetButton: {
33
+ control: "boolean";
34
+ };
35
+ keepOpenedOnSubmitSuccess: {
36
+ control: "boolean";
37
+ };
38
+ noCancelOnOutsideClick: {
39
+ control: "boolean";
40
+ };
41
+ noResetOnClose: {
42
+ control: "boolean";
43
+ };
44
+ submitting: {
45
+ control: "boolean";
46
+ };
47
+ errorMessage: {
48
+ control: "text";
49
+ };
50
+ disableSubmitButton: {
51
+ control: "boolean";
52
+ };
53
+ };
54
+ excludeStories: string[];
55
+ };
56
+ export default meta;
57
+ export declare const FormDrawer: Story;
@@ -0,0 +1,31 @@
1
+ /******************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
16
+
17
+
18
+ function __decorate(decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ 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;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ }
24
+
25
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
26
+ var e = new Error(message);
27
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
28
+ };
29
+
30
+ export { __decorate };
31
+ //# sourceMappingURL=tslib.es6.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exmg/exm-form-drawer",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
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.2.8",
35
- "@exmg/exm-form": "^1.2.8"
34
+ "@exmg/exm-drawer": "^1.2.9",
35
+ "@exmg/exm-form": "^1.2.9"
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": "e1496408e91a3861a0eb532a05ebae18320ac591"
45
+ "gitHead": "c27c4ffabda0c6a509df58537017af65719d1e57"
46
46
  }