@dile/crud 1.9.2 → 1.9.3

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.
@@ -5,6 +5,7 @@ import '../../ajax/ajax.js';
5
5
  import '../../ajax-select-crud/ajax-select-crud.js';
6
6
  import '@dile/ui/components/icon/icon.js';
7
7
  import '@dile/ui/components/spinner/spinner.js';
8
+ import '@dile/ui/components/input/input-message.js';
8
9
 
9
10
  export class DileManyRelation extends DileI18nMixin(LitElement) {
10
11
  static styles = [
@@ -113,6 +114,9 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
113
114
  addRelationLabel: { type: String },
114
115
  emptyListMessage: { type: String },
115
116
  bodyIdProperty: { type: String },
117
+ message: { type: String },
118
+ errored: { type: Boolean },
119
+ hideErrorOnInput: { type: Boolean },
116
120
 
117
121
  // Internal state
118
122
  _items: { type: Array, state: true },
@@ -218,11 +222,19 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
218
222
  </div>
219
223
  `)
220
224
  }
225
+ ${this.message
226
+ ? html`<dile-input-message message="${this.message}" ?errored=${this.errored}></dile-input-message>`
227
+ : ''
228
+ }
221
229
  `;
222
230
  }
223
231
 
224
232
  _onSelectChanged(e) {
225
233
  this._selectedId = e.detail.value || null;
234
+ if (this.hideErrorOnInput && this.errored) {
235
+ this.message = '';
236
+ this.errored = false;
237
+ }
226
238
  }
227
239
 
228
240
  _addSelectedItem() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Components to create a generic crud system based on Web Components and Lit",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "1fe481edcd8ccfaf7a7aeb74f8d66a22a4423228"
34
+ "gitHead": "6cce2cd32f997433190f40ba776e501421b771a6"
35
35
  }