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

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-20240422-135811",
6
+ "version": "4.0.1-CI-20240425-185108",
7
7
  "workspaces": [
8
8
  "code"
9
9
  ],
@@ -5,7 +5,9 @@ export * from './IValidate.js';
5
5
  export * from './Validators.js';
6
6
  export * from './DependencyValidator.js';
7
7
  export * from './RestApiService.js';
8
+ export * from './qbo-api.js';
8
9
  export * from './qbo-badge.js';
10
+ export * from './qbo-contact.js';
9
11
  export * from './qbo-datalist.js';
10
12
  export * from './qbo-docviewer.js';
11
13
  export * from './qbo-form-element.js';
@@ -20,7 +22,6 @@ export * from './qbo-select.js';
20
22
  export * from './qbo-sidebar.js';
21
23
  export * from './qbo-table.js';
22
24
  export * from './qbo-validate.js';
23
- export * from './qbo-api.js';
24
25
  export declare function elementOptions(element: any, prefix: any, options?: string): {};
25
26
  export declare function elementSelectorAll(element: Element, selector: string): Element[];
26
27
  export declare function elementResetValue(element: Element): void;
@@ -5,7 +5,9 @@ export * from './IValidate.js';
5
5
  export * from './Validators.js';
6
6
  export * from './DependencyValidator.js';
7
7
  export * from './RestApiService.js';
8
+ export * from './qbo-api.js';
8
9
  export * from './qbo-badge.js';
10
+ export * from './qbo-contact.js';
9
11
  export * from './qbo-datalist.js';
10
12
  export * from './qbo-docviewer.js';
11
13
  export * from './qbo-form-element.js';
@@ -20,7 +22,6 @@ export * from './qbo-select.js';
20
22
  export * from './qbo-sidebar.js';
21
23
  export * from './qbo-table.js';
22
24
  export * from './qbo-validate.js';
23
- export * from './qbo-api.js';
24
25
  // Return JSON object from element attributes.
25
26
  export function elementOptions(element, prefix, options = 'options') {
26
27
  const result = {};
@@ -6,7 +6,9 @@ export * from './IValidate.js';
6
6
  export * from './Validators.js';
7
7
  export * from './DependencyValidator.js';
8
8
  export * from './RestApiService.js';
9
+ export * from './qbo-api.js';
9
10
  export * from './qbo-badge.js';
11
+ export * from './qbo-contact.js';
10
12
  export * from './qbo-datalist.js'
11
13
  export * from './qbo-docviewer.js'
12
14
  export * from './qbo-form-element.js';
@@ -21,7 +23,6 @@ export * from './qbo-select.js';
21
23
  export * from './qbo-sidebar.js'
22
24
  export * from './qbo-table.js';
23
25
  export * from './qbo-validate.js';
24
- export * from './qbo-api.js';
25
26
 
26
27
  // Return JSON object from element attributes.
27
28
  export function elementOptions(element, prefix, options = 'options') {
@@ -35,7 +36,7 @@ export function elementOptions(element, prefix, options = 'options') {
35
36
  if (options != null && attr === optionsKey) {
36
37
  try {
37
38
  const options = JSON.parse(element.getAttribute(attr));
38
- Object.assign(result, options);
39
+ Object.assign(result, options);
39
40
  } catch (error) {
40
41
  console.error(`Error parsing JSON from element ${element.name} attribute ${optionsKey} (${element.getAttribute(attr)}):`, element, error);
41
42
  }
@@ -84,7 +85,7 @@ export function elementClearValue(element: Element) {
84
85
  else
85
86
  element.value = '';
86
87
  }
87
- else if (element instanceof HTMLSelectElement)
88
+ else if (element instanceof HTMLSelectElement)
88
89
  element.options.selectedIndex = 0;
89
90
  }
90
91
 
@@ -3,6 +3,6 @@ export declare class ApiServiceComponent extends LitElement {
3
3
  name: string | null;
4
4
  apiEndpoint: string | null;
5
5
  method: string;
6
- firstUpdated(): void;
6
+ connectedCallback(): void;
7
7
  render(): import("lit-html").TemplateResult<1>;
8
8
  }
@@ -17,7 +17,8 @@ let ApiServiceComponent = class ApiServiceComponent extends LitElement {
17
17
  this.apiEndpoint = null;
18
18
  this.method = 'POST';
19
19
  }
20
- firstUpdated() {
20
+ connectedCallback() {
21
+ super.connectedCallback();
21
22
  const headers = {};
22
23
  if (this.name == null)
23
24
  console.error('qbo-api name is required.');
@@ -38,6 +39,8 @@ let ApiServiceComponent = class ApiServiceComponent extends LitElement {
38
39
  }
39
40
  // container.registerInstance<IApiService>(this.name!, new RestApiService(this.apiEndpoint!, headers, this.method));
40
41
  // Call the registerRestApi function with the extracted configuration
42
+ if (!this.apiEndpoint?.startsWith("http"))
43
+ this.apiEndpoint = new URL(this.apiEndpoint ?? '', document.location.origin).href;
41
44
  registerRestApi(this.name, this.apiEndpoint, headers, this.method);
42
45
  }
43
46
  render() {
@@ -15,7 +15,9 @@ export class ApiServiceComponent extends LitElement {
15
15
  @property({ type: String })
16
16
  method: string = 'POST';
17
17
 
18
- firstUpdated() {
18
+ connectedCallback() {
19
+ super.connectedCallback();
20
+
19
21
  const headers: HeadersInit = {};
20
22
 
21
23
  if (this.name == null)
@@ -41,6 +43,8 @@ export class ApiServiceComponent extends LitElement {
41
43
  // container.registerInstance<IApiService>(this.name!, new RestApiService(this.apiEndpoint!, headers, this.method));
42
44
 
43
45
  // Call the registerRestApi function with the extracted configuration
46
+ if (!this.apiEndpoint?.startsWith("http"))
47
+ this.apiEndpoint = new URL(this.apiEndpoint ?? '', document.location.origin).href;
44
48
  registerRestApi(this.name!, this.apiEndpoint!, headers, this.method);
45
49
  }
46
50
 
@@ -0,0 +1,22 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class QboContact extends LitElement {
3
+ apiEndpoint: string;
4
+ colFourClass: String | null;
5
+ colSixClass: String | null;
6
+ colThreeClass: String | null;
7
+ colTwelveClass: String | null;
8
+ contactId: String | null;
9
+ contactLabel: String | null;
10
+ contactName: String | null;
11
+ divSectionHeaderClass: String | null;
12
+ emptyOptionText: String | null;
13
+ emptyOptionValue: String | null;
14
+ formControlSmallClass: String | null;
15
+ formLabelSmallClass: String | null;
16
+ formSelectSmallClass: String | null;
17
+ renderInHost: boolean;
18
+ jsonData: any;
19
+ createRenderRoot(): HTMLElement | DocumentFragment;
20
+ connectedCallback(): Promise<void>;
21
+ render(): import("lit-html").TemplateResult<1>;
22
+ }
@@ -0,0 +1,274 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { html, LitElement } from 'lit';
11
+ import { customElement, property } from 'lit/decorators.js';
12
+ import { services } from '@quandis/qbo4.configuration';
13
+ import { RestApiService } from './RestApiService.js';
14
+ let QboContact = class QboContact extends LitElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.apiEndpoint = 'qbo';
18
+ this.colFourClass = 'qbo-col-4';
19
+ this.colSixClass = 'qbo-col-6';
20
+ this.colThreeClass = 'qbo-col-3';
21
+ this.colTwelveClass = 'qbo-col-12';
22
+ this.contactId = null;
23
+ this.contactLabel = 'Contact';
24
+ this.contactName = 'Contact';
25
+ this.divSectionHeaderClass = 'qbo-header';
26
+ this.emptyOptionText = '--';
27
+ this.emptyOptionValue = '';
28
+ this.formControlSmallClass = 'qbo-sm';
29
+ this.formLabelSmallClass = 'qbo-sm';
30
+ this.formSelectSmallClass = 'qbo-sm';
31
+ this.renderInHost = true;
32
+ }
33
+ createRenderRoot() {
34
+ return this.renderInHost ? this : super.createRenderRoot();
35
+ }
36
+ async connectedCallback() {
37
+ super.connectedCallback();
38
+ const service = services.container.isRegistered(this.apiEndpoint) ? services.container.resolve(this.apiEndpoint) : new RestApiService(this.apiEndpoint);
39
+ this.jsonData = await service.fetch('contact/summary', { ID: `${this.contactId}` });
40
+ }
41
+ render() {
42
+ return html `<slot>
43
+ <div class="${this.colSixClass}">
44
+ <label for="${this.contactName}" class="${this.formLabelSmallClass}">${this.contactLabel}</label>
45
+ <input type="text" disabled class="${this.formControlSmallClass}" name="${this.contactName}" value="${this.jsonData?.ContactItem?.Contact}"/>
46
+ </div>
47
+ <div class="${this.colSixClass}">
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
+
56
+ </div>
57
+ <div class="${this.colSixClass}">
58
+ <label for="Status" class="${this.formLabelSmallClass}">Status</label>
59
+ <select disabled class="${this.formSelectSmallClass}" name="Status">
60
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
61
+ </select>
62
+ </div>
63
+ <div class="${this.colSixClass}">
64
+ <label for="ContactType" class="${this.formLabelSmallClass}">Type</label>
65
+ <select disabled class="${this.formSelectSmallClass}" name="ContactType">
66
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
67
+ </select>
68
+ </div>
69
+ <div class="${this.colFourClass}">
70
+ <label for="Phone" class="${this.formLabelSmallClass}">Phone</label>
71
+ <input type="tel" disabled class="${this.formControlSmallClass}" name="Phone"/>
72
+ </div>
73
+ <div class="${this.colFourClass}">
74
+ <label for="Email" class="${this.formLabelSmallClass}">Email</label>
75
+ <input type="email" disabled class="${this.formControlSmallClass}" name="Email"/>
76
+ </div>
77
+ <div class="${this.colFourClass}">
78
+ <label for="Title" class="${this.formLabelSmallClass}">Title</label>
79
+ <select disabled class="${this.formSelectSmallClass}" name="Title">
80
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
81
+ </select>
82
+ </div>
83
+ <div class="${this.divSectionHeaderClass}">
84
+ <h5>Location</h5>
85
+ </div>
86
+ <div class="${this.colTwelveClass}">
87
+ <label for="Company" class="${this.formLabelSmallClass}">Company</label>
88
+ <input type="text" disabled class="${this.formControlSmallClass}" name="Company"/>
89
+ </div>
90
+ <div class="${this.colTwelveClass}">
91
+ <label for="Address" class="${this.formLabelSmallClass}">Address</label>
92
+ <textarea disabled class="${this.formControlSmallClass}" name="Address"></textarea>
93
+ </div>
94
+ <div class="${this.colSixClass}">
95
+ <label for="City" class="${this.formLabelSmallClass}">City</label>
96
+ <input type="text" disabled class="${this.formControlSmallClass}" name="City"/>
97
+ </div>
98
+ <div class="${this.colThreeClass}">
99
+ <label for="State" class="${this.formLabelSmallClass}">State</label>
100
+ <select disabled class="${this.formSelectSmallClass}" name="State">
101
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
102
+ </select>
103
+ </div>
104
+ <div class="${this.colThreeClass}">
105
+ <label for="PostalCode" class="${this.formLabelSmallClass}">Postal Code</label>
106
+ <input type="text" disabled class="${this.formControlSmallClass}" name="PostalCode" pattern="\d{5}-?(\d{4})?"/>
107
+ </div>
108
+ <div class="${this.colSixClass}">
109
+ <label for="Country" class="${this.formLabelSmallClass}">Country</label>
110
+ <input type="text" disabled class="${this.formControlSmallClass}" name="Country"/>
111
+ </div>
112
+ <div class="${this.colThreeClass}">
113
+ <label for="Latitude" class="${this.formLabelSmallClass}">Latitude</label>
114
+ <input type="number" disabled class="${this.formControlSmallClass}" name="Latitude"/>
115
+ </div>
116
+ <div class="${this.colThreeClass}">
117
+ <label for="Longitude" class="${this.formLabelSmallClass}">Longitude</label>
118
+ <input type="number" disabled class="${this.formControlSmallClass}" name="Longitude"/>
119
+ </div>
120
+ <div class="${this.divSectionHeaderClass}">
121
+ <h5>Identity</h5>
122
+ </div>
123
+ <div class="${this.colThreeClass}">
124
+ <label for="USSSN" class="${this.formLabelSmallClass}">SSN</label>
125
+ <input type="number" disabled class="${this.formControlSmallClass}" name="USSSN"/>
126
+ </div>
127
+ <div class="${this.colThreeClass}">
128
+ <label for="TIN" class="${this.formLabelSmallClass}">TIN</label>
129
+ <input type="number" disabled class="${this.formControlSmallClass}" name="TIN"/>
130
+ </div>
131
+ <div class="${this.colThreeClass}">
132
+ <label for="Nationality" class="${this.formLabelSmallClass}">Nationality</label>
133
+ <select disabled class="${this.formSelectSmallClass}" name="Nationality">
134
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
135
+ </select>
136
+ </div>
137
+ <div class="${this.colThreeClass}">
138
+ <label for="SpokenLanguage" class="${this.formLabelSmallClass}">Spoken Language</label>
139
+ <select disabled class="${this.formSelectSmallClass}" name="SpokenLanguage">
140
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
141
+ </select>
142
+ </div>
143
+ <div class="${this.colThreeClass}">
144
+ <label for="BirthDate" class="${this.formLabelSmallClass}">Birth Date</label>
145
+ <input type="date" disabled class="${this.formControlSmallClass}" name="BirthDate"/>
146
+ </div>
147
+ <div class="${this.colThreeClass}">
148
+ <label for="DeathDate" class="${this.formLabelSmallClass}">Death Date</label>
149
+ <input type="date" disabled class="${this.formControlSmallClass}" name="DeathDate"/>
150
+ </div>
151
+ <div class="${this.colThreeClass}">
152
+ <label for="ValidStart" class="${this.formLabelSmallClass}">Valid Start</label>
153
+ <input type="date" disabled class="${this.formControlSmallClass}" name="ValidStart"/>
154
+ </div>
155
+ <div class="${this.colThreeClass}">
156
+ <label for="ValidEnd" class="${this.formLabelSmallClass}">Valid End</label>
157
+ <input type="date" disabled class="${this.formControlSmallClass}" name="ValidEnd"/>
158
+ </div>
159
+ <div class="${this.colSixClass}">
160
+ <label for="VerifiedSource" class="${this.formLabelSmallClass}">Verified Source</label>
161
+ <input type="text" disabled class="${this.formControlSmallClass}" name="VerifiedSource"/>
162
+ </div>
163
+ <div class="${this.colThreeClass}">
164
+ <label for="VerifiedDate" class="${this.formLabelSmallClass}">Verified Date</label>
165
+ <input type="date" disabled class="${this.formControlSmallClass}" name="VerifiedDate"/>
166
+ </div>
167
+ <div class="${this.colThreeClass}">
168
+ <label for="VerifiedConfidence" class="${this.formLabelSmallClass}">Verified Confidence</label>
169
+ <input type="number" disabled class="${this.formControlSmallClass}" name="VerifiedConfidence"/>
170
+ </div>
171
+ <div class="${this.divSectionHeaderClass}">
172
+ <h5>SCRA</h5>
173
+ </div>
174
+ <div class="${this.colThreeClass}">
175
+ <label for="SCRAStatus" class="${this.formLabelSmallClass}">SCRA Status</label>
176
+ <select disabled class="${this.formSelectSmallClass}" name="SCRAStatus">
177
+ <option value="${this.emptyOptionValue}">${this.emptyOptionText}</option>
178
+ </select>
179
+ </div>
180
+ <div class="${this.colThreeClass}">
181
+ <label for="SCRAStatusAsOf" class="${this.formLabelSmallClass}">SCRA Status As Of</label>
182
+ <input type="date" disabled class="${this.formControlSmallClass}" name="SCRAStatusAsOf"/>
183
+ </div>
184
+ <div class="${this.colThreeClass}">
185
+ <label for="SCRAStartDate" class="${this.formLabelSmallClass}">SCRA Start Date</label>
186
+ <input type="date" disabled class="${this.formControlSmallClass}" name="SCRAStartDate"/>
187
+ </div>
188
+ <div class="${this.colThreeClass}">
189
+ <label for="SCRADischargeDate" class="${this.formLabelSmallClass}">SCRA Discharge Date</label>
190
+ <input type="date" disabled class="${this.formControlSmallClass}" name="SCRADischargeDate"/>
191
+ </div>
192
+ <div class="${this.colThreeClass}">
193
+ <label for="SCRAVerified" class="${this.formLabelSmallClass}">SCRA Verified</label>
194
+ <input type="text" disabled class="${this.formControlSmallClass}" name="SCRAVerified"/>
195
+ </div>
196
+ <div class="${this.colThreeClass}">
197
+ <label for="SCRAVerifiedDate" class="${this.formLabelSmallClass}">SCRA Verified Date</label>
198
+ <input type="date" disabled class="${this.formControlSmallClass}" name="SCRAVerifiedDate"/>
199
+ </div>
200
+ <div class="${this.colThreeClass}">
201
+ <label for="SCRASource" class="${this.formLabelSmallClass}">SCRA Source</label>
202
+ <input type="text" disabled class="${this.formControlSmallClass}" name="SCRASource"/>
203
+ </div>
204
+ <div class="${this.colThreeClass}">
205
+ <label for="SCRAID" class="${this.formLabelSmallClass}">SCRA ID</label>
206
+ <input type="number" disabled class="${this.formControlSmallClass}" name="SCRAID"/>
207
+ </div>
208
+ </slot>`;
209
+ }
210
+ };
211
+ __decorate([
212
+ property({ type: String }),
213
+ __metadata("design:type", Object)
214
+ ], QboContact.prototype, "apiEndpoint", void 0);
215
+ __decorate([
216
+ property({ type: String }),
217
+ __metadata("design:type", Object)
218
+ ], QboContact.prototype, "colFourClass", void 0);
219
+ __decorate([
220
+ property({ type: String }),
221
+ __metadata("design:type", Object)
222
+ ], QboContact.prototype, "colSixClass", void 0);
223
+ __decorate([
224
+ property({ type: String }),
225
+ __metadata("design:type", Object)
226
+ ], QboContact.prototype, "colThreeClass", void 0);
227
+ __decorate([
228
+ property({ type: String }),
229
+ __metadata("design:type", Object)
230
+ ], QboContact.prototype, "colTwelveClass", void 0);
231
+ __decorate([
232
+ property({ type: String }),
233
+ __metadata("design:type", Object)
234
+ ], QboContact.prototype, "contactId", void 0);
235
+ __decorate([
236
+ property({ type: String }),
237
+ __metadata("design:type", Object)
238
+ ], QboContact.prototype, "contactLabel", void 0);
239
+ __decorate([
240
+ property({ type: String }),
241
+ __metadata("design:type", Object)
242
+ ], QboContact.prototype, "contactName", void 0);
243
+ __decorate([
244
+ property({ type: String }),
245
+ __metadata("design:type", Object)
246
+ ], QboContact.prototype, "divSectionHeaderClass", void 0);
247
+ __decorate([
248
+ property({ type: String }),
249
+ __metadata("design:type", Object)
250
+ ], QboContact.prototype, "emptyOptionText", void 0);
251
+ __decorate([
252
+ property({ type: String }),
253
+ __metadata("design:type", Object)
254
+ ], QboContact.prototype, "emptyOptionValue", void 0);
255
+ __decorate([
256
+ property({ type: String }),
257
+ __metadata("design:type", Object)
258
+ ], QboContact.prototype, "formControlSmallClass", void 0);
259
+ __decorate([
260
+ property({ type: String }),
261
+ __metadata("design:type", Object)
262
+ ], QboContact.prototype, "formLabelSmallClass", void 0);
263
+ __decorate([
264
+ property({ type: String }),
265
+ __metadata("design:type", Object)
266
+ ], QboContact.prototype, "formSelectSmallClass", void 0);
267
+ __decorate([
268
+ property({ type: Boolean }),
269
+ __metadata("design:type", Object)
270
+ ], QboContact.prototype, "renderInHost", void 0);
271
+ QboContact = __decorate([
272
+ customElement('qbo-contact')
273
+ ], QboContact);
274
+ export { QboContact };