@dile/crud 1.9.2 → 1.9.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.
@@ -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,6 +222,10 @@ 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
 
@@ -239,6 +247,10 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
239
247
  this._selectedId = null;
240
248
  this._clearSelect();
241
249
  this._refreshList();
250
+ if (this.hideErrorOnInput && this.errored) {
251
+ this.message = '';
252
+ this.errored = false;
253
+ }
242
254
  this._dispatch('many-relation-add-success');
243
255
  }
244
256
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "description": "Components to create a generic crud system based on Web Components and Lit",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "homepage": "https://dile-components.com/",
26
26
  "dependencies": {
27
- "@dile/ui": "^2.21.3",
27
+ "@dile/ui": "^2.21.4",
28
28
  "axios": "^1.16.0",
29
29
  "lit": "^2.7.0 || ^3.0.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "1fe481edcd8ccfaf7a7aeb74f8d66a22a4423228"
34
+ "gitHead": "f3d7061476125162d6d9822928d40dc15e110c6c"
35
35
  }