@quandis/qbo4.ui 4.0.1-CI-20240429-215003 → 4.0.1-CI-20240430-215338
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 +1 -1
- package/readme.md +0 -1
- package/src/qbo/IApiService.d.ts +1 -0
- package/src/qbo/IApiService.ts +3 -0
- package/src/qbo/Program.js +2 -7
- package/src/qbo/Program.ts +2 -7
- package/src/qbo/RestApiService.d.ts +1 -0
- package/src/qbo/RestApiService.js +5 -0
- package/src/qbo/RestApiService.ts +6 -0
- package/src/qbo/qbo-contact.js +37 -37
- package/src/qbo/qbo-contact.ts +37 -37
- package/src/qbo/qbo-form-edit.d.ts +5 -0
- package/src/qbo/qbo-form-edit.js +30 -5
- package/src/qbo/qbo-form-edit.ts +20 -5
- package/src/qbo/qbo-form-element.js +2 -0
- package/src/qbo/qbo-form-element.ts +1 -0
- package/src/qbo/qbo-select.d.ts +4 -2
- package/src/qbo/qbo-select.js +14 -2
- package/src/qbo/qbo-select.ts +11 -1
- package/wwwroot/js/qbo4.ui-code.js +2 -2
- package/wwwroot/js/qbo4.ui-code.min.js +1 -1
- package/wwwroot/js/qbo4.ui-code.min.js.map +1 -1
- package/wwwroot/js/qbo4.ui.js +91 -52
- package/wwwroot/js/qbo4.ui.min.js +51 -51
- package/wwwroot/js/qbo4.ui.min.js.map +1 -1
package/src/qbo/qbo-form-edit.js
CHANGED
|
@@ -12,8 +12,13 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
12
12
|
let QboFormEdit = class QboFormEdit extends LitElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
+
this.buttonPrimaryClass = 'qbo-primary';
|
|
15
16
|
this.createdDate = null;
|
|
16
17
|
this.createdPerson = null;
|
|
18
|
+
this.divButtonGroupClass = 'qbo-btn-group';
|
|
19
|
+
this.divFormActionClass = 'qbo-form-actions';
|
|
20
|
+
this.divSectionHeaderClass = 'qbo-header';
|
|
21
|
+
this.editLabel = 'Edit';
|
|
17
22
|
this.updatedDate = null;
|
|
18
23
|
this.updatedPerson = null;
|
|
19
24
|
this.renderInHost = true;
|
|
@@ -23,13 +28,13 @@ let QboFormEdit = class QboFormEdit extends LitElement {
|
|
|
23
28
|
}
|
|
24
29
|
render() {
|
|
25
30
|
return html `<slot>
|
|
26
|
-
<div class="
|
|
31
|
+
<div class="${this.divSectionHeaderClass}">
|
|
27
32
|
<hr />
|
|
28
33
|
</div>
|
|
29
|
-
<div class="
|
|
30
|
-
<div class="
|
|
31
|
-
<button type="button" class="
|
|
32
|
-
<span class="bi-pencil-square">
|
|
34
|
+
<div class="${this.divFormActionClass}">
|
|
35
|
+
<div class="${this.divButtonGroupClass}">
|
|
36
|
+
<button type="button" class="${this.buttonPrimaryClass}">
|
|
37
|
+
<span class="bi-pencil-square"> ${this.editLabel}</span>
|
|
33
38
|
</button>
|
|
34
39
|
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown"></button>
|
|
35
40
|
<ul class="dropdown-menu">
|
|
@@ -56,6 +61,10 @@ let QboFormEdit = class QboFormEdit extends LitElement {
|
|
|
56
61
|
</slot>`;
|
|
57
62
|
}
|
|
58
63
|
};
|
|
64
|
+
__decorate([
|
|
65
|
+
property({ type: String }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], QboFormEdit.prototype, "buttonPrimaryClass", void 0);
|
|
59
68
|
__decorate([
|
|
60
69
|
property({ type: Date }),
|
|
61
70
|
__metadata("design:type", Object)
|
|
@@ -64,6 +73,22 @@ __decorate([
|
|
|
64
73
|
property({ type: String }),
|
|
65
74
|
__metadata("design:type", Object)
|
|
66
75
|
], QboFormEdit.prototype, "createdPerson", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: String }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], QboFormEdit.prototype, "divButtonGroupClass", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: String }),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], QboFormEdit.prototype, "divFormActionClass", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: String }),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], QboFormEdit.prototype, "divSectionHeaderClass", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: String }),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], QboFormEdit.prototype, "editLabel", void 0);
|
|
67
92
|
__decorate([
|
|
68
93
|
property({ type: Date }),
|
|
69
94
|
__metadata("design:type", Object)
|
package/src/qbo/qbo-form-edit.ts
CHANGED
|
@@ -4,12 +4,27 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
4
4
|
@customElement('qbo-form-edit')
|
|
5
5
|
export class QboFormEdit extends LitElement {
|
|
6
6
|
|
|
7
|
+
@property({ type: String })
|
|
8
|
+
buttonPrimaryClass: String | null = 'qbo-primary';
|
|
9
|
+
|
|
7
10
|
@property({ type: Date })
|
|
8
11
|
createdDate = null;
|
|
9
12
|
|
|
10
13
|
@property({ type: String })
|
|
11
14
|
createdPerson = null;
|
|
12
15
|
|
|
16
|
+
@property({ type: String })
|
|
17
|
+
divButtonGroupClass: String | null = 'qbo-btn-group';
|
|
18
|
+
|
|
19
|
+
@property({ type: String })
|
|
20
|
+
divFormActionClass: String | null = 'qbo-form-actions';
|
|
21
|
+
|
|
22
|
+
@property({ type: String })
|
|
23
|
+
divSectionHeaderClass: String | null = 'qbo-header';
|
|
24
|
+
|
|
25
|
+
@property({ type: String })
|
|
26
|
+
editLabel: String | null = 'Edit';
|
|
27
|
+
|
|
13
28
|
@property({ type: Date })
|
|
14
29
|
updatedDate = null;
|
|
15
30
|
|
|
@@ -25,13 +40,13 @@ export class QboFormEdit extends LitElement {
|
|
|
25
40
|
|
|
26
41
|
render() {
|
|
27
42
|
return html`<slot>
|
|
28
|
-
<div class="
|
|
43
|
+
<div class="${this.divSectionHeaderClass}">
|
|
29
44
|
<hr />
|
|
30
45
|
</div>
|
|
31
|
-
<div class="
|
|
32
|
-
<div class="
|
|
33
|
-
<button type="button" class="
|
|
34
|
-
<span class="bi-pencil-square">
|
|
46
|
+
<div class="${this.divFormActionClass}">
|
|
47
|
+
<div class="${this.divButtonGroupClass}">
|
|
48
|
+
<button type="button" class="${this.buttonPrimaryClass}">
|
|
49
|
+
<span class="bi-pencil-square"> ${this.editLabel}</span>
|
|
35
50
|
</button>
|
|
36
51
|
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown"></button>
|
|
37
52
|
<ul class="dropdown-menu">
|
|
@@ -72,6 +72,8 @@ let QboFormElement = class QboFormElement extends LitElement {
|
|
|
72
72
|
}
|
|
73
73
|
establishFormData() {
|
|
74
74
|
const elements = this.shadowRoot?.querySelectorAll('input, select, textarea');
|
|
75
|
+
if (!elements || elements?.length === 0)
|
|
76
|
+
return;
|
|
75
77
|
const inputs = Array.from(elements).filter(e => !e.assignedSlot
|
|
76
78
|
&& (e instanceof HTMLInputElement
|
|
77
79
|
|| e instanceof HTMLSelectElement
|
|
@@ -60,6 +60,7 @@ export class QboFormElement extends LitElement {
|
|
|
60
60
|
|
|
61
61
|
establishFormData() {
|
|
62
62
|
const elements = this.shadowRoot?.querySelectorAll('input, select, textarea');
|
|
63
|
+
if (!elements || elements?.length === 0) return;
|
|
63
64
|
const inputs = Array.from(elements!).filter(e => !e.assignedSlot
|
|
64
65
|
&& (e instanceof HTMLInputElement
|
|
65
66
|
|| e instanceof HTMLSelectElement
|
package/src/qbo/qbo-select.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QboFormElement } from './Program.js';
|
|
2
2
|
/**
|
|
3
3
|
* Renders a <select> element with options populated from a JSON array.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
6
|
* This element is a thin wrapper around {@link QboFetch} that renders a <select> element with options populated from a JSON array.
|
|
7
7
|
*/
|
|
8
|
-
export declare class QboSelect extends
|
|
8
|
+
export declare class QboSelect extends QboFormElement {
|
|
9
|
+
apiEndpoint: string;
|
|
9
10
|
loading: boolean;
|
|
10
11
|
optionText: string | null;
|
|
11
12
|
optionValue: string | null;
|
|
@@ -15,6 +16,7 @@ export declare class QboSelect extends QboFetch {
|
|
|
15
16
|
options: Array<{
|
|
16
17
|
[key: string]: string;
|
|
17
18
|
}> | null;
|
|
19
|
+
jsonData: any | null;
|
|
18
20
|
renderInHost: boolean;
|
|
19
21
|
static styles: import("lit").CSSResult[];
|
|
20
22
|
connectedCallback(): Promise<void>;
|
package/src/qbo/qbo-select.js
CHANGED
|
@@ -10,16 +10,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { html, css } from 'lit';
|
|
11
11
|
import { customElement, property } from 'lit/decorators.js';
|
|
12
12
|
import { getArray } from './qbo-json.js';
|
|
13
|
-
import {
|
|
13
|
+
import { QboFormElement, getApiService } from './Program.js';
|
|
14
14
|
/**
|
|
15
15
|
* Renders a <select> element with options populated from a JSON array.
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
18
|
* This element is a thin wrapper around {@link QboFetch} that renders a <select> element with options populated from a JSON array.
|
|
19
19
|
*/
|
|
20
|
-
let QboSelect = class QboSelect extends
|
|
20
|
+
let QboSelect = class QboSelect extends QboFormElement {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
+
this.apiEndpoint = 'qbo';
|
|
23
24
|
this.loading = false;
|
|
24
25
|
this.optionText = null;
|
|
25
26
|
this.optionValue = null;
|
|
@@ -27,6 +28,7 @@ let QboSelect = class QboSelect extends QboFetch {
|
|
|
27
28
|
this.emptyOptionText = '--';
|
|
28
29
|
this.emptyOptionValue = '';
|
|
29
30
|
this.options = [];
|
|
31
|
+
this.jsonData = {};
|
|
30
32
|
this.renderInHost = true;
|
|
31
33
|
}
|
|
32
34
|
static { this.styles = [
|
|
@@ -38,6 +40,8 @@ let QboSelect = class QboSelect extends QboFetch {
|
|
|
38
40
|
async connectedCallback() {
|
|
39
41
|
this.optionText ??= this.optionValue;
|
|
40
42
|
super.connectedCallback();
|
|
43
|
+
const service = getApiService(this.apiEndpoint);
|
|
44
|
+
this.jsonData = await service.fetch(null, {});
|
|
41
45
|
}
|
|
42
46
|
createRenderRoot() {
|
|
43
47
|
return this.renderInHost ? this : super.createRenderRoot();
|
|
@@ -54,6 +58,10 @@ let QboSelect = class QboSelect extends QboFetch {
|
|
|
54
58
|
</select>`;
|
|
55
59
|
}
|
|
56
60
|
};
|
|
61
|
+
__decorate([
|
|
62
|
+
property({ type: String }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], QboSelect.prototype, "apiEndpoint", void 0);
|
|
57
65
|
__decorate([
|
|
58
66
|
property({ type: Boolean }),
|
|
59
67
|
__metadata("design:type", Object)
|
|
@@ -82,6 +90,10 @@ __decorate([
|
|
|
82
90
|
property({ type: Array }),
|
|
83
91
|
__metadata("design:type", Object)
|
|
84
92
|
], QboSelect.prototype, "options", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: Object }),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], QboSelect.prototype, "jsonData", void 0);
|
|
85
97
|
__decorate([
|
|
86
98
|
property({ type: Boolean }),
|
|
87
99
|
__metadata("design:type", Object)
|
package/src/qbo/qbo-select.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { getArray } from './qbo-json.js';
|
|
4
4
|
import { QboFetch } from './qbo-fetch.js';
|
|
5
|
+
import { IApiService, QboFormElement, getApiService } from './Program.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Renders a <select> element with options populated from a JSON array.
|
|
@@ -10,8 +11,11 @@ import { QboFetch } from './qbo-fetch.js';
|
|
|
10
11
|
* This element is a thin wrapper around {@link QboFetch} that renders a <select> element with options populated from a JSON array.
|
|
11
12
|
*/
|
|
12
13
|
@customElement('qbo-select')
|
|
13
|
-
export class QboSelect extends
|
|
14
|
+
export class QboSelect extends QboFormElement
|
|
14
15
|
{
|
|
16
|
+
@property({ type: String })
|
|
17
|
+
apiEndpoint = 'qbo';
|
|
18
|
+
|
|
15
19
|
@property({ type: Boolean })
|
|
16
20
|
loading = false;
|
|
17
21
|
|
|
@@ -33,6 +37,9 @@ export class QboSelect extends QboFetch
|
|
|
33
37
|
@property({ type: Array })
|
|
34
38
|
options: Array<{ [key: string]: string }> | null = [];
|
|
35
39
|
|
|
40
|
+
@property({ type: Object })
|
|
41
|
+
jsonData: any | null = {};
|
|
42
|
+
|
|
36
43
|
@property({ type: Boolean })
|
|
37
44
|
renderInHost = true;
|
|
38
45
|
|
|
@@ -46,6 +53,9 @@ export class QboSelect extends QboFetch
|
|
|
46
53
|
async connectedCallback() {
|
|
47
54
|
this.optionText ??= this.optionValue;
|
|
48
55
|
super.connectedCallback();
|
|
56
|
+
|
|
57
|
+
const service: IApiService = getApiService(this.apiEndpoint);
|
|
58
|
+
this.jsonData = await service.fetch(null, { });
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
createRenderRoot() {
|