@exmg/exm-form-drawer 1.0.3 → 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",
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": "e911739a6688f56501a13ef72d2dacac5973cf80"
50
+ "gitHead": "b6f66a9358930f3883084da15e51fe4528897eac"
51
51
  }
@@ -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
  }
@@ -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
@@ -44,3 +44,12 @@ form {
44
44
  padding: 0.5rem 1rem;
45
45
  box-sizing: border-box;
46
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
+ }