@dile/crud 1.9.0 → 1.9.1

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.
@@ -12,6 +12,13 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
12
12
  :host {
13
13
  display: block;
14
14
  }
15
+ label {
16
+ display: block;
17
+ margin-bottom: var(--dile-input-label-margin-bottom, 4px);
18
+ font-size: var(--dile-input-label-font-size, 1em);
19
+ color: var(--dile-input-label-color, #59e);
20
+ font-weight: var(--dile-input-label-font-weight, normal);
21
+ }
15
22
  dile-ajax-select-crud{
16
23
  margin-bottom: 0;
17
24
  }
@@ -45,7 +52,7 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
45
52
  }
46
53
  button.remove-btn dile-icon {
47
54
  --dile-icon-color: var(--many-relation-remove-color, #c00);
48
- --dile-icon-size: var(--many-relation-remove-size, 22px);
55
+ --dile-icon-size: var(--many-relation-remove-size, 24px);
49
56
  }
50
57
  .add-row {
51
58
  display: flex;
@@ -77,6 +84,8 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
77
84
 
78
85
  static get properties() {
79
86
  return {
87
+ label: { type: String },
88
+
80
89
  // Endpoints
81
90
  endpointGet: { type: String },
82
91
  endpointList: { type: String },
@@ -164,6 +173,10 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
164
173
  @ajax-error="${this._onRemoveError}"
165
174
  ></dile-ajax>
166
175
 
176
+ ${this.label
177
+ ? html`<label for="textField">${this.label}</label>`
178
+ : ""
179
+ }
167
180
  <div class="add-row">
168
181
  <dile-ajax-select-crud
169
182
  id="theselect"
@@ -212,7 +225,10 @@ export class DileManyRelation extends DileI18nMixin(LitElement) {
212
225
  }
213
226
 
214
227
  _addSelectedItem() {
215
- if (!this._selectedId) return;
228
+ if (!this._selectedId) {
229
+ this._dispatch('many-relation-add-no-selection');
230
+ return;
231
+ }
216
232
  const bodyKey = this.bodyIdProperty || this.idProperty;
217
233
  this._ajaxadd.data = { [bodyKey]: this._selectedId };
218
234
  this._ajaxadd.generateRequest();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
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": "67e2e845295d11fcdbf3dedcc989d26b821005d4"
34
+ "gitHead": "f56676f00eb84aed3ee4ffd8a0542988da652d51"
35
35
  }