@exmg/exm-form-drawer 1.0.2 → 1.0.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-form-drawer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "b6f66a9358930f3883084da15e51fe4528897eac"
|
|
51
51
|
}
|
|
@@ -81,5 +81,6 @@ export declare class ExmFormDrawerBase extends ExmgElement {
|
|
|
81
81
|
*/
|
|
82
82
|
protected renderFormContent(): import("lit-html").TemplateResult<1>;
|
|
83
83
|
protected renderError(): import("lit-html").TemplateResult<1>;
|
|
84
|
+
protected handleDrawerOpenedChanged(e: CustomEvent): void;
|
|
84
85
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
85
86
|
}
|
|
@@ -113,6 +113,7 @@ export class ExmFormDrawerBase extends ExmgElement {
|
|
|
113
113
|
}
|
|
114
114
|
async handleSubmit() {
|
|
115
115
|
const form = this.getForm();
|
|
116
|
+
this.errorMessage = null;
|
|
116
117
|
// Return when there are invalid fields
|
|
117
118
|
if (!this.formValid) {
|
|
118
119
|
return;
|
|
@@ -131,7 +132,7 @@ export class ExmFormDrawerBase extends ExmgElement {
|
|
|
131
132
|
}
|
|
132
133
|
finally {
|
|
133
134
|
this.submitting = false;
|
|
134
|
-
if (!this.keepOpenedOnSubmitSuccess) {
|
|
135
|
+
if (this.errorMessage === null && !this.keepOpenedOnSubmitSuccess) {
|
|
135
136
|
this.opened = false;
|
|
136
137
|
}
|
|
137
138
|
}
|
|
@@ -156,11 +157,18 @@ export class ExmFormDrawerBase extends ExmgElement {
|
|
|
156
157
|
renderError() {
|
|
157
158
|
return html `<div class="error"><div>${this.errorMessage}</div></div>`;
|
|
158
159
|
}
|
|
160
|
+
handleDrawerOpenedChanged(e) {
|
|
161
|
+
this.opened = e.detail.value;
|
|
162
|
+
if (this.opened) {
|
|
163
|
+
this._checkFormValidity();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
159
166
|
render() {
|
|
160
167
|
return html `
|
|
161
168
|
<exm-drawer
|
|
162
169
|
?opened="${this.opened}"
|
|
163
170
|
?no-cancel-on-outside-click="${this.noCancelOnOutsideClick}"
|
|
171
|
+
@exm-drawer-opened-changed=${this.handleDrawerOpenedChanged}
|
|
164
172
|
scroll-action=${ifDefined(this.scrollAction)}
|
|
165
173
|
style="max-width: ${this.style.maxWidth || '547px'}"
|
|
166
174
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
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}`;
|
|
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
3
|
export default style;
|
|
4
4
|
//# sourceMappingURL=exm-form-drawer-styles-css.js.map
|