@exmg/exm-form-drawer 1.0.13 → 1.0.15

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.
package/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export { ExmDrawer } from './src/exm-drawer.js';
2
1
  export { ExmFormDrawer } from './src/exm-form-drawer.js';
3
2
  export { ExmFormDrawerBase } from './src/exm-form-drawer-base.js';
4
- export { style as drawerStyles } from './src/styles/exm-drawer-styles-css.js';
5
3
  export { style as formDrawerStyles } from './src/styles/exm-form-drawer-styles-css.js';
package/index.js CHANGED
@@ -1,6 +1,4 @@
1
- export { ExmDrawer } from './src/exm-drawer.js';
2
1
  export { ExmFormDrawer } from './src/exm-form-drawer.js';
3
2
  export { ExmFormDrawerBase } from './src/exm-form-drawer-base.js';
4
- export { style as drawerStyles } from './src/styles/exm-drawer-styles-css.js';
5
3
  export { style as formDrawerStyles } from './src/styles/exm-form-drawer-styles-css.js';
6
4
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exmg/exm-form-drawer",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -30,11 +30,9 @@
30
30
  },
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@exmg/exm-button": "^1.0.3",
34
- "@exmg/exm-form": "^1.0.8",
33
+ "@exmg/exm-drawer": "^1.0.1",
34
+ "@exmg/exm-form": "^1.0.10",
35
35
  "@material/typography": "^14.0.0",
36
- "@polymer/neon-animation": "^3.0.1",
37
- "@polymer/paper-dialog": "^3.0.1",
38
36
  "lit": "^3.0.0",
39
37
  "tslib": "^2.6.2"
40
38
  },
@@ -47,5 +45,5 @@
47
45
  "publishConfig": {
48
46
  "access": "public"
49
47
  },
50
- "gitHead": "a446e21753fb94b2f8995796b0cd905e82c45ed1"
48
+ "gitHead": "5747be50ecb7c46ed349c74a6e8d66895d835455"
51
49
  }
@@ -1,7 +1,4 @@
1
1
  import { LitElement } from 'lit';
2
- import '@polymer/neon-animation/animations/slide-from-right-animation.js';
3
- import '@polymer/neon-animation/animations/slide-right-animation.js';
4
- import '@polymer/paper-dialog/paper-dialog.js';
5
2
  export declare class ExmDrawer extends LitElement {
6
3
  /**
7
4
  * The opened state of the drawer
@@ -18,9 +15,28 @@ export declare class ExmDrawer extends LitElement {
18
15
  * @type {'lock' | 'refit' | 'cancel' | undefined}
19
16
  */
20
17
  scrollAction?: 'lock' | 'refit' | 'cancel' | undefined;
21
- handleOpenedChanged(e: CustomEvent): void;
18
+ /**
19
+ * A query to the native <dialog> element.
20
+ */
21
+ dialogElement: HTMLDialogElement;
22
+ /**
23
+ * Internal flag used when animating the closing.
24
+ */
25
+ private _isClosing;
26
+ updated(changedProperties: Map<string, any>): void;
27
+ private _onDialogClick;
28
+ private _onDialogCancel;
29
+ private _onDialogClose;
30
+ private _animateClose;
31
+ /**
32
+ * Public method to open the drawer.
33
+ */
22
34
  openDialog(): void;
23
- static styles: import("lit").CSSResult[];
35
+ /**
36
+ * Public method to close the drawer.
37
+ */
38
+ closeDialog(): void;
39
+ static styles: import("lit").CSSResult;
24
40
  render(): import("lit-html").TemplateResult<1>;
25
41
  }
26
42
  declare global {
@@ -1,4 +1,4 @@
1
- import './exm-drawer.js';
1
+ import '@exmg/exm-drawer/exm-drawer.js';
2
2
  import '@exmg/exm-button/exm-filled-button.js';
3
3
  import '@material/web/button/text-button.js';
4
4
  import { ExmgElement } from '@exmg/lit-base';
@@ -2,7 +2,7 @@ import { __decorate } from "tslib";
2
2
  import { html, nothing } from 'lit';
3
3
  import { property } from 'lit/decorators.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
- import './exm-drawer.js';
5
+ import '@exmg/exm-drawer/exm-drawer.js';
6
6
  import '@exmg/exm-button/exm-filled-button.js';
7
7
  import '@material/web/button/text-button.js';
8
8
  import { ExmgElement } from '@exmg/lit-base';
@@ -140,7 +140,7 @@ export class ExmFormDrawerBase extends ExmFormValidateMixin(ExmgElement) {
140
140
  ?no-cancel-on-outside-click="${this.noCancelOnOutsideClick}"
141
141
  @exm-drawer-opened-changed=${this.handleDrawerOpenedChanged}
142
142
  scroll-action=${ifDefined(this.scrollAction)}
143
- style="max-width: ${this.style.maxWidth || '547px'}"
143
+ maxWidth="${this.style.maxWidth || '547px'}"
144
144
  >
145
145
  <div class="header">
146
146
  <slot name="title" class="title">${this.title}</slot>
@@ -1,2 +1 @@
1
1
  export declare const style: import("lit").CSSResult;
2
- export default style;
@@ -1,2 +1 @@
1
1
  export declare const style: import("lit").CSSResult;
2
- export default style;
@@ -1,4 +1,59 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{display:flex}:host .header{display:flex;flex-direction:row;align-items:center;margin:0;padding:20px;border-bottom:1px solid var(--exm-form-drawer-header-separator-color, var(--mdc-theme-on-surface, rgba(2, 24, 43, 0.1)))}:host .header .title{font-size:1.4rem}:host .form-elements{padding:0 0px}.header-buttons{display:flex;flex-direction:row;flex:1;justify-content:flex-end}.header-buttons>*{margin-left:20px}:host(:not([disable-sticky-header])) .header{position:sticky;top:0;background-color:var(--exm-drawer-bg-color, var(--md-sys-color-surface-variant, white));z-index:2}form{margin:0 !important;padding:.5rem 1rem;box-sizing:border-box}.error{background-color:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);padding:.5rem}.error>*{margin:1rem}`;
3
- export default style;
2
+ export const style = css `
3
+ :host {
4
+ display: flex;
5
+ }
6
+
7
+ :host .header {
8
+ display: flex;
9
+ flex-direction: row;
10
+ align-items: center;
11
+ margin: 0;
12
+ padding: 20px;
13
+ border-bottom: 1px solid
14
+ var(--exm-form-drawer-header-separator-color, var(--mdc-theme-on-surface, rgba(2, 24, 43, 0.1)));
15
+ }
16
+
17
+ :host .header .title {
18
+ font-size: 1.4rem;
19
+ }
20
+
21
+ :host .form-elements {
22
+ padding: 0 0px;
23
+ }
24
+
25
+ .header-buttons {
26
+ display: flex;
27
+ flex-direction: row;
28
+ flex: 1;
29
+ justify-content: flex-end;
30
+ }
31
+
32
+ .header-buttons > * {
33
+ margin-left: 20px;
34
+ }
35
+
36
+ :host(:not([disable-sticky-header])) .header {
37
+ position: sticky;
38
+ top: 0;
39
+ background-color: var(--exm-drawer-bg-color, var(--md-sys-color-surface-variant, white));
40
+ z-index: 2;
41
+ }
42
+
43
+ form {
44
+ margin: 1rem 0 !important;
45
+ padding: 0.5rem 1rem;
46
+ box-sizing: border-box;
47
+ }
48
+
49
+ .error {
50
+ background-color: var(--md-sys-color-error-container);
51
+ color: var(--md-sys-color-on-error-container);
52
+ padding: 0.5rem;
53
+ }
54
+
55
+ .error > * {
56
+ margin: 1rem;
57
+ }
58
+ `;
4
59
  //# sourceMappingURL=exm-form-drawer-styles-css.js.map
package/src/exm-drawer.js DELETED
@@ -1,71 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { LitElement, html } from 'lit';
3
- import { customElement, property } from 'lit/decorators.js';
4
- import '@polymer/neon-animation/animations/slide-from-right-animation.js';
5
- import '@polymer/neon-animation/animations/slide-right-animation.js';
6
- import '@polymer/paper-dialog/paper-dialog.js';
7
- import { style } from './styles/exm-drawer-styles-css.js';
8
- import { ifDefined } from 'lit/directives/if-defined.js';
9
- let ExmDrawer = class ExmDrawer extends LitElement {
10
- constructor() {
11
- super(...arguments);
12
- /**
13
- * The opened state of the drawer
14
- * @type {Boolean}
15
- */
16
- this.opened = false;
17
- /**
18
- * Prevent cancel on outside click or not
19
- * @type {Boolean}
20
- */
21
- this.noCancelOnOutsideClick = false;
22
- }
23
- handleOpenedChanged(e) {
24
- this.opened = e.detail.value;
25
- this.dispatchEvent(new CustomEvent('exm-drawer-opened-changed', {
26
- bubbles: true,
27
- composed: true,
28
- detail: {
29
- value: e.detail.value,
30
- },
31
- }));
32
- }
33
- openDialog() {
34
- this.opened = true;
35
- }
36
- render() {
37
- return html `
38
- <style>
39
- paper-dialog {
40
- max-width: var(--exm-drawer-max-width, ${this.style.maxWidth || '547px'});
41
- }
42
- </style>
43
- <paper-dialog
44
- scroll-action=${ifDefined(this.scrollAction)}
45
- ?opened="${this.opened}"
46
- ?no-cancel-on-outside-click="${this.noCancelOnOutsideClick}"
47
- @opened-changed="${this.handleOpenedChanged}"
48
- entry-animation="slide-from-right-animation"
49
- exit-animation="slide-right-animation"
50
- with-backdrop
51
- >
52
- <slot></slot>
53
- </paper-dialog>
54
- `;
55
- }
56
- };
57
- ExmDrawer.styles = [style];
58
- __decorate([
59
- property({ type: Boolean })
60
- ], ExmDrawer.prototype, "opened", void 0);
61
- __decorate([
62
- property({ type: Boolean, attribute: 'no-cancel-on-outside-click' })
63
- ], ExmDrawer.prototype, "noCancelOnOutsideClick", void 0);
64
- __decorate([
65
- property({ type: String, attribute: 'scroll-action' })
66
- ], ExmDrawer.prototype, "scrollAction", void 0);
67
- ExmDrawer = __decorate([
68
- customElement('exm-drawer')
69
- ], ExmDrawer);
70
- export { ExmDrawer };
71
- //# sourceMappingURL=exm-drawer.js.map
@@ -1,4 +0,0 @@
1
- import { css } from 'lit';
2
- export const style = css `paper-dialog{margin:0;padding:0;position:fixed;top:0;right:0;bottom:0;width:100%;box-shadow:none;overflow:scroll;color:var(--exm-drawer-color, var(--md-sys-color-on-surface, black));background-color:var(--exm-drawer-bg-color, var(--md-sys-color-surface-variant, white))}`;
3
- export default style;
4
- //# sourceMappingURL=exm-drawer-styles-css.js.map
@@ -1,15 +0,0 @@
1
- paper-dialog {
2
- margin: 0;
3
- padding: 0;
4
- position: fixed;
5
- top: 0;
6
- right: 0;
7
- bottom: 0;
8
- width: 100%;
9
- box-shadow: none;
10
- overflow: scroll;
11
-
12
- color: var(--exm-drawer-color, var(--md-sys-color-on-surface, black));
13
- // background-color: var(--exm-drawer-bg-color, var(--mdc-theme-surface, $exm-drawer-bg-color));
14
- background-color: var(--exm-drawer-bg-color, var(--md-sys-color-surface-variant, white));
15
- }
@@ -1,55 +0,0 @@
1
- :host {
2
- display: flex;
3
-
4
- .header {
5
- display: flex;
6
- flex-direction: row;
7
- align-items: center;
8
-
9
- margin: 0;
10
- padding: 20px;
11
- border-bottom: 1px solid
12
- var(--exm-form-drawer-header-separator-color, var(--mdc-theme-on-surface, rgba(#02182b, 0.1)));
13
-
14
- .title {
15
- font-size: 1.4rem;
16
- }
17
- }
18
-
19
- .form-elements {
20
- padding: 0 0px;
21
- }
22
- }
23
-
24
- .header-buttons {
25
- display: flex;
26
- flex-direction: row;
27
- flex: 1;
28
- justify-content: flex-end;
29
-
30
- > * {
31
- margin-left: 20px;
32
- }
33
- }
34
-
35
- :host(:not([disable-sticky-header])) .header {
36
- position: sticky;
37
- top: 0;
38
- background-color: var(--exm-drawer-bg-color, var(--md-sys-color-surface-variant, white));
39
- z-index: 2;
40
- }
41
-
42
- form {
43
- margin: 0 !important;
44
- padding: 0.5rem 1rem;
45
- box-sizing: border-box;
46
- }
47
-
48
- .error {
49
- background-color: var(--md-sys-color-error-container);
50
- color: var(--md-sys-color-on-error-container);
51
- padding: 0.5rem;
52
- > * {
53
- margin: 1rem;
54
- }
55
- }