@quandis/qbo4.ui 4.0.1-CI-20240425-185108 → 4.0.1-CI-20240425-194927

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
@@ -3,7 +3,7 @@
3
3
  "author": "Quandis, Inc.",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "4.0.1-CI-20240425-185108",
6
+ "version": "4.0.1-CI-20240425-194927",
7
7
  "workspaces": [
8
8
  "code"
9
9
  ],
@@ -46,13 +46,7 @@ let QboContact = class QboContact extends LitElement {
46
46
  </div>
47
47
  <div class="${this.colSixClass}">
48
48
  <label for="ContactTemplateID" class="${this.formLabelSmallClass}">Template</label>
49
-
50
-
51
-
52
- <qbo-select disabled qbo-class="${this.formSelectSmallClass}" name="ContactTemplateID" apiEndpoint="/ui/contacttemplate/listwhere.json?appliesto=${this.jsonData?.ContactItem?.Object}" defaultValue="${this.jsonData?.ContactItem?.ContactTemplateID}"/>
53
-
54
-
55
-
49
+ <qbo-select qbo-disabled="true" qbo-class="${this.formSelectSmallClass}" name="ContactTemplateID" apiEndpoint="/ui/contacttemplate/listwhere.json?appliesto=${this.jsonData?.ContactItem?.Object}" defaultValue="${this.jsonData?.ContactItem?.ContactTemplateID}"></qbo-select>
56
50
  </div>
57
51
  <div class="${this.colSixClass}">
58
52
  <label for="Status" class="${this.formLabelSmallClass}">Status</label>
@@ -73,13 +73,7 @@ export class QboContact extends LitElement {
73
73
  </div>
74
74
  <div class="${this.colSixClass}">
75
75
  <label for="ContactTemplateID" class="${this.formLabelSmallClass}">Template</label>
76
-
77
-
78
-
79
- <qbo-select disabled qbo-class="${this.formSelectSmallClass}" name="ContactTemplateID" apiEndpoint="/ui/contacttemplate/listwhere.json?appliesto=${this.jsonData?.ContactItem?.Object}" defaultValue="${this.jsonData?.ContactItem?.ContactTemplateID}"/>
80
-
81
-
82
-
76
+ <qbo-select qbo-disabled="true" qbo-class="${this.formSelectSmallClass}" name="ContactTemplateID" apiEndpoint="/ui/contacttemplate/listwhere.json?appliesto=${this.jsonData?.ContactItem?.Object}" defaultValue="${this.jsonData?.ContactItem?.ContactTemplateID}"></qbo-select>
83
77
  </div>
84
78
  <div class="${this.colSixClass}">
85
79
  <label for="Status" class="${this.formLabelSmallClass}">Status</label>
@@ -10,7 +10,10 @@ export declare class QboSelect extends QboFetch {
10
10
  optionText: string | null;
11
11
  optionValue: string | null;
12
12
  defaultValue: null;
13
+ emptyOptionText: String | null;
14
+ emptyOptionValue: String | null;
13
15
  qboClass: null;
16
+ qboDisabled: boolean;
14
17
  options: Array<{
15
18
  [key: string]: string;
16
19
  }> | null;
@@ -24,7 +24,10 @@ let QboSelect = class QboSelect extends QboFetch {
24
24
  this.optionText = null;
25
25
  this.optionValue = null;
26
26
  this.defaultValue = null;
27
+ this.emptyOptionText = '--';
28
+ this.emptyOptionValue = '';
27
29
  this.qboClass = null;
30
+ this.qboDisabled = false;
28
31
  this.options = [];
29
32
  this.renderInHost = true;
30
33
  }
@@ -48,9 +51,10 @@ let QboSelect = class QboSelect extends QboFetch {
48
51
  this.optionValue ??= Object.keys(this.options[0])[0];
49
52
  this.optionText ??= Object.keys(this.options[0])[1] ?? this.optionValue;
50
53
  return html `
51
- <select class=${this.qboClass}>
52
- ${this.options.map(option => html `<option value="${option[this.optionValue]}" ?selected="${option[this.optionValue] === this.defaultValue}">${option[this.optionText]}</option>`)}
53
- </select>`;
54
+ <select ?disabled=${this.qboDisabled} class=${this.qboClass}>
55
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
56
+ ${this.options.map(option => html `<option value="${option[this.optionValue]}" ?selected="${option[this.optionValue] === this.defaultValue}">${option[this.optionText]}</option>`)}
57
+ </select>`;
54
58
  }
55
59
  };
56
60
  __decorate([
@@ -70,9 +74,21 @@ __decorate([
70
74
  __metadata("design:type", Object)
71
75
  ], QboSelect.prototype, "defaultValue", void 0);
72
76
  __decorate([
73
- property({ attribute: 'qbo-class' }),
77
+ property({ type: String }),
78
+ __metadata("design:type", Object)
79
+ ], QboSelect.prototype, "emptyOptionText", void 0);
80
+ __decorate([
81
+ property({ type: String }),
82
+ __metadata("design:type", Object)
83
+ ], QboSelect.prototype, "emptyOptionValue", void 0);
84
+ __decorate([
85
+ property({ type: String, attribute: 'qbo-class' }),
74
86
  __metadata("design:type", Object)
75
87
  ], QboSelect.prototype, "qboClass", void 0);
88
+ __decorate([
89
+ property({ type: Boolean, attribute: 'qbo-disabled' }),
90
+ __metadata("design:type", Object)
91
+ ], QboSelect.prototype, "qboDisabled", void 0);
76
92
  __decorate([
77
93
  property({ type: Array }),
78
94
  __metadata("design:type", Object)
@@ -24,9 +24,18 @@ export class QboSelect extends QboFetch
24
24
  @property({ type: String })
25
25
  defaultValue = null;
26
26
 
27
- @property({ attribute: 'qbo-class' })
27
+ @property({ type: String })
28
+ emptyOptionText: String | null = '--';
29
+
30
+ @property({ type: String })
31
+ emptyOptionValue: String | null = '';
32
+
33
+ @property({ type: String, attribute: 'qbo-class' })
28
34
  qboClass = null;
29
35
 
36
+ @property({ type: Boolean, attribute: 'qbo-disabled' })
37
+ qboDisabled = false;
38
+
30
39
  @property({ type: Array })
31
40
  options: Array<{ [key: string]: string }> | null = [];
32
41
 
@@ -58,8 +67,9 @@ export class QboSelect extends QboFetch
58
67
  this.optionText ??= Object.keys(this.options[0])[1] ?? this.optionValue;
59
68
 
60
69
  return html`
61
- <select class=${this.qboClass}>
62
- ${this.options.map(option => html`<option value="${option[this.optionValue!]}" ?selected="${option[this.optionValue!] === this.defaultValue}">${option[this.optionText!]}</option>`)}
63
- </select>`;
70
+ <select ?disabled=${this.qboDisabled} class=${this.qboClass}>
71
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
72
+ ${this.options.map(option => html`<option value="${option[this.optionValue!]}" ?selected="${option[this.optionValue!] === this.defaultValue}">${option[this.optionText!]}</option>`)}
73
+ </select>`;
64
74
  }
65
75
  }