@quandis/qbo4.ui 4.0.1-CI-20240514-221435 → 4.0.1-CI-20240515-215721
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/src/qbo/Program.d.ts +1 -0
- package/src/qbo/Program.js +1 -0
- package/src/qbo/Program.ts +1 -0
- package/src/qbo/qbo-contact-name.d.ts +22 -0
- package/src/qbo/qbo-contact-name.js +139 -0
- package/src/qbo/qbo-contact-name.ts +97 -0
- package/src/qbo/qbo-contact.js +2 -2
- package/src/qbo/qbo-contact.ts +2 -2
- package/src/qbo/qbo-popover.d.ts +3 -2
- package/src/qbo/qbo-popover.js +3 -2
- package/src/qbo/qbo-popover.ts +3 -2
- package/src/qbo/qbo-ssn.d.ts +12 -8
- package/src/qbo/qbo-ssn.js +66 -33
- package/src/qbo/qbo-ssn.ts +58 -27
- package/wwwroot/js/qbo4.ui-code.js +2 -1
- package/wwwroot/js/qbo4.ui-code.min.js.map +1 -1
- package/wwwroot/js/qbo4.ui.js +266 -70
- package/wwwroot/js/qbo4.ui.min.js +79 -53
- package/wwwroot/js/qbo4.ui.min.js.map +1 -1
package/package.json
CHANGED
package/src/qbo/Program.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './RestApiService.js';
|
|
|
9
9
|
export * from './qbo-api.js';
|
|
10
10
|
export * from './qbo-badge.js';
|
|
11
11
|
export * from './qbo-contact.js';
|
|
12
|
+
export * from './qbo-contact-name.js';
|
|
12
13
|
export * from './qbo-datalist.js';
|
|
13
14
|
export * from './qbo-docviewer.js';
|
|
14
15
|
export * from './qbo-form-edit.js';
|
package/src/qbo/Program.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './RestApiService.js';
|
|
|
10
10
|
export * from './qbo-api.js';
|
|
11
11
|
export * from './qbo-badge.js';
|
|
12
12
|
export * from './qbo-contact.js';
|
|
13
|
+
export * from './qbo-contact-name.js';
|
|
13
14
|
export * from './qbo-datalist.js';
|
|
14
15
|
export * from './qbo-docviewer.js';
|
|
15
16
|
export * from './qbo-form-edit.js';
|
package/src/qbo/Program.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './RestApiService.js';
|
|
|
12
12
|
export * from './qbo-api.js';
|
|
13
13
|
export * from './qbo-badge.js';
|
|
14
14
|
export * from './qbo-contact.js';
|
|
15
|
+
export * from './qbo-contact-name.js';
|
|
15
16
|
export * from './qbo-datalist.js'
|
|
16
17
|
export * from './qbo-docviewer.js'
|
|
17
18
|
export * from './qbo-form-edit.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
3
|
+
export declare class QboContactName extends QboFormElement {
|
|
4
|
+
buttonClass: String | null;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
elementClass: String | null;
|
|
7
|
+
elementStackedTopClass: String | null;
|
|
8
|
+
icon: String | null;
|
|
9
|
+
modalBodyDivClass: String | null;
|
|
10
|
+
modalContentDivClass: String | null;
|
|
11
|
+
modalDivClass: String | null;
|
|
12
|
+
modalDialogDivClass: String | null;
|
|
13
|
+
modalFooterDivClass: String | null;
|
|
14
|
+
modalHeaderDivClass: String | null;
|
|
15
|
+
modalHeaderText: String | null;
|
|
16
|
+
slotClass: String | null;
|
|
17
|
+
spanClass: String | null;
|
|
18
|
+
type: string | null;
|
|
19
|
+
renderInHost: boolean;
|
|
20
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
21
|
+
render(): TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
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 } from 'lit';
|
|
11
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
12
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
13
|
+
const contactNameMap = new Map();
|
|
14
|
+
contactNameMap.set('defaultLayout', (component) => {
|
|
15
|
+
return html `<div slot="content" class="${component.slotClass}">
|
|
16
|
+
<input type="text" ?disabled=${component.disabled} class="${component.getAttribute("class")}" name="${component.getAttribute("name")}" value="${component.data?.['Contact']}"/>
|
|
17
|
+
<qbo-popup>
|
|
18
|
+
<div slot="button">
|
|
19
|
+
<span class="${component.spanClass}">
|
|
20
|
+
<i class="${component.icon}"></i>
|
|
21
|
+
</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div slot="content">
|
|
24
|
+
<div class="${component.modalDivClass}">
|
|
25
|
+
<div class="${component.modalDialogDivClass}">
|
|
26
|
+
<div class="${component.modalContentDivClass}">
|
|
27
|
+
<div class="${component.modalHeaderDivClass}">${component.modalHeaderText}</div>
|
|
28
|
+
<div class="${component.modalBodyDivClass}">
|
|
29
|
+
<qbo-select ?disabled=${component.disabled} class="${component.elementClass}" name="Prefix" apiEndpoint="api://qbo/objecttype/list?object=Contact.Prefix" optionValue="ObjectType" defaultValue="${component.data?.['Prefix']}" emptyOptionText="-- Prefix --"></qbo-select>
|
|
30
|
+
<input type="text" ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="FirstName" placeholder="First Name" value="${component.data?.['FirstName']}"/>
|
|
31
|
+
<input type="text" ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="MiddleName" placeholder="Middle Name" value="${component.data?.['MiddleName']}"/>
|
|
32
|
+
<input type="text" ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="LastName" placeholder="Last Name" value="${component.data?.['LastName']}"/>
|
|
33
|
+
<qbo-select ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="Suffix" apiEndpoint="api://qbo/objecttype/list?object=Contact.Suffix" optionValue="ObjectType" defaultValue="${component.data?.['Suffix']}" emptyOptionText="-- Suffix --"></qbo-select>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="${component.modalFooterDivClass}">
|
|
36
|
+
<button type="button" class="${component.buttonClass}" data-dismiss="modal">Close</button>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</qbo-popup>
|
|
43
|
+
</div>`;
|
|
44
|
+
});
|
|
45
|
+
let QboContactName = class QboContactName extends QboFormElement {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
this.buttonClass = 'qbo-secondary';
|
|
49
|
+
this.disabled = true;
|
|
50
|
+
this.elementClass = 'qbo-sm';
|
|
51
|
+
this.elementStackedTopClass = 'qbo-sm-top';
|
|
52
|
+
this.icon = 'qbo-icon-person-lines-fill';
|
|
53
|
+
this.modalBodyDivClass = 'qbo-modal-body';
|
|
54
|
+
this.modalContentDivClass = 'qbo-modal-content';
|
|
55
|
+
this.modalDivClass = 'qbo-modal';
|
|
56
|
+
this.modalDialogDivClass = 'qbo-modal-dialog';
|
|
57
|
+
this.modalFooterDivClass = 'qbo-modal-footer';
|
|
58
|
+
this.modalHeaderDivClass = 'qbo-modal-header';
|
|
59
|
+
this.modalHeaderText = 'Contact Name';
|
|
60
|
+
this.slotClass = 'qbo-input-group';
|
|
61
|
+
this.spanClass = 'qbo-input-group-text qbo-pointer';
|
|
62
|
+
this.type = 'defaultLayout';
|
|
63
|
+
this.renderInHost = true;
|
|
64
|
+
}
|
|
65
|
+
createRenderRoot() {
|
|
66
|
+
return this.renderInHost ? this : super.createRenderRoot();
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return html `<slot>${contactNameMap.has(this.type) ? contactNameMap.get(this.type)(this) : null}</slot>`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
__decorate([
|
|
73
|
+
property({ type: String }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], QboContactName.prototype, "buttonClass", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: Boolean }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], QboContactName.prototype, "disabled", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: String }),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], QboContactName.prototype, "elementClass", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: String }),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], QboContactName.prototype, "elementStackedTopClass", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ type: String }),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], QboContactName.prototype, "icon", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
property({ type: String }),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], QboContactName.prototype, "modalBodyDivClass", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
property({ type: String }),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], QboContactName.prototype, "modalContentDivClass", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
property({ type: String }),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], QboContactName.prototype, "modalDivClass", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ type: String }),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], QboContactName.prototype, "modalDialogDivClass", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
property({ type: String }),
|
|
110
|
+
__metadata("design:type", Object)
|
|
111
|
+
], QboContactName.prototype, "modalFooterDivClass", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: String }),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], QboContactName.prototype, "modalHeaderDivClass", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: String }),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], QboContactName.prototype, "modalHeaderText", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: String }),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], QboContactName.prototype, "slotClass", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: String }),
|
|
126
|
+
__metadata("design:type", Object)
|
|
127
|
+
], QboContactName.prototype, "spanClass", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property(),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], QboContactName.prototype, "type", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ type: Boolean }),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], QboContactName.prototype, "renderInHost", void 0);
|
|
136
|
+
QboContactName = __decorate([
|
|
137
|
+
customElement('qbo-contact-name')
|
|
138
|
+
], QboContactName);
|
|
139
|
+
export { QboContactName };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { TemplateResult, html } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
4
|
+
|
|
5
|
+
type TemplateFunction = (component: any) => TemplateResult;
|
|
6
|
+
const contactNameMap: Map<string, TemplateFunction> = new Map();
|
|
7
|
+
contactNameMap.set('defaultLayout', (component: QboContactName) => {
|
|
8
|
+
return html`<div slot="content" class="${component.slotClass}">
|
|
9
|
+
<input type="text" ?disabled=${component.disabled} class="${component.getAttribute("class")}" name="${component.getAttribute("name")}" value="${component.data?.['Contact']}"/>
|
|
10
|
+
<qbo-popup>
|
|
11
|
+
<div slot="button">
|
|
12
|
+
<span class="${component.spanClass}">
|
|
13
|
+
<i class="${component.icon}"></i>
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
<div slot="content">
|
|
17
|
+
<div class="${component.modalDivClass}">
|
|
18
|
+
<div class="${component.modalDialogDivClass}">
|
|
19
|
+
<div class="${component.modalContentDivClass}">
|
|
20
|
+
<div class="${component.modalHeaderDivClass}">${component.modalHeaderText}</div>
|
|
21
|
+
<div class="${component.modalBodyDivClass}">
|
|
22
|
+
<qbo-select ?disabled=${component.disabled} class="${component.elementClass}" name="Prefix" apiEndpoint="api://qbo/objecttype/list?object=Contact.Prefix" optionValue="ObjectType" defaultValue="${component.data?.['Prefix']}" emptyOptionText="-- Prefix --"></qbo-select>
|
|
23
|
+
<input type="text" ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="FirstName" placeholder="First Name" value="${component.data?.['FirstName']}"/>
|
|
24
|
+
<input type="text" ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="MiddleName" placeholder="Middle Name" value="${component.data?.['MiddleName']}"/>
|
|
25
|
+
<input type="text" ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="LastName" placeholder="Last Name" value="${component.data?.['LastName']}"/>
|
|
26
|
+
<qbo-select ?disabled=${component.disabled} class="${component.elementClass} ${component.elementStackedTopClass}" name="Suffix" apiEndpoint="api://qbo/objecttype/list?object=Contact.Suffix" optionValue="ObjectType" defaultValue="${component.data?.['Suffix']}" emptyOptionText="-- Suffix --"></qbo-select>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="${component.modalFooterDivClass}">
|
|
29
|
+
<button type="button" class="${component.buttonClass}" data-dismiss="modal">Close</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</qbo-popup>
|
|
36
|
+
</div>`;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
@customElement('qbo-contact-name')
|
|
40
|
+
export class QboContactName extends QboFormElement {
|
|
41
|
+
|
|
42
|
+
@property({ type: String })
|
|
43
|
+
buttonClass: String | null = 'qbo-secondary';
|
|
44
|
+
|
|
45
|
+
@property({ type: Boolean })
|
|
46
|
+
disabled = true;
|
|
47
|
+
|
|
48
|
+
@property({ type: String })
|
|
49
|
+
elementClass: String | null = 'qbo-sm';
|
|
50
|
+
|
|
51
|
+
@property({ type: String })
|
|
52
|
+
elementStackedTopClass: String | null = 'qbo-sm-top';
|
|
53
|
+
|
|
54
|
+
@property({ type: String })
|
|
55
|
+
icon: String | null = 'qbo-icon-person-lines-fill';
|
|
56
|
+
|
|
57
|
+
@property({ type: String })
|
|
58
|
+
modalBodyDivClass: String | null = 'qbo-modal-body';
|
|
59
|
+
|
|
60
|
+
@property({ type: String })
|
|
61
|
+
modalContentDivClass: String | null = 'qbo-modal-content';
|
|
62
|
+
|
|
63
|
+
@property({ type: String })
|
|
64
|
+
modalDivClass: String | null = 'qbo-modal';
|
|
65
|
+
|
|
66
|
+
@property({ type: String })
|
|
67
|
+
modalDialogDivClass: String | null = 'qbo-modal-dialog';
|
|
68
|
+
|
|
69
|
+
@property({ type: String })
|
|
70
|
+
modalFooterDivClass: String | null = 'qbo-modal-footer';
|
|
71
|
+
|
|
72
|
+
@property({ type: String })
|
|
73
|
+
modalHeaderDivClass: String | null = 'qbo-modal-header';
|
|
74
|
+
|
|
75
|
+
@property({ type: String })
|
|
76
|
+
modalHeaderText: String | null = 'Contact Name';
|
|
77
|
+
|
|
78
|
+
@property({ type: String })
|
|
79
|
+
slotClass: String | null = 'qbo-input-group';
|
|
80
|
+
|
|
81
|
+
@property({ type: String })
|
|
82
|
+
spanClass: String | null = 'qbo-input-group-text qbo-pointer';
|
|
83
|
+
|
|
84
|
+
@property()
|
|
85
|
+
type: string | null = 'defaultLayout';
|
|
86
|
+
|
|
87
|
+
@property({ type: Boolean })
|
|
88
|
+
renderInHost = true;
|
|
89
|
+
|
|
90
|
+
createRenderRoot() {
|
|
91
|
+
return this.renderInHost ? this : super.createRenderRoot();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
render() {
|
|
95
|
+
return html`<slot>${contactNameMap.has(this.type!) ? contactNameMap.get(this.type!)!(this) : null}</slot>`;
|
|
96
|
+
}
|
|
97
|
+
}
|
package/src/qbo/qbo-contact.js
CHANGED
|
@@ -45,7 +45,7 @@ let QboContact = class QboContact extends LitElement {
|
|
|
45
45
|
return html `<slot>
|
|
46
46
|
<div class="${this.colSixClass}">
|
|
47
47
|
<label for="${this.contactName}" class="${this.formLabelSmallClass}">${this.contactLabel}</label>
|
|
48
|
-
<
|
|
48
|
+
<qbo-contact-name class="${this.formControlSmallClass}" name="${this.contactName}" .data="${this.jsonData.Root.ContactItem}"></qbo-contact-name>
|
|
49
49
|
</div>
|
|
50
50
|
<div class="${this.colSixClass}">
|
|
51
51
|
<label for="ContactTemplateID" class="${this.formLabelSmallClass}">Template</label>
|
|
@@ -103,7 +103,7 @@ let QboContact = class QboContact extends LitElement {
|
|
|
103
103
|
</div>
|
|
104
104
|
<div class="${this.colThreeClass}">
|
|
105
105
|
<label for="USSSN" class="${this.formLabelSmallClass}">SSN</label>
|
|
106
|
-
<qbo-ssn
|
|
106
|
+
<qbo-ssn .data="${this.jsonData.Root.ContactItem}"></qbo-ssn>
|
|
107
107
|
</div>
|
|
108
108
|
<div class="${this.colThreeClass}">
|
|
109
109
|
<label for="TIN" class="${this.formLabelSmallClass}">TIN</label>
|
package/src/qbo/qbo-contact.ts
CHANGED
|
@@ -70,7 +70,7 @@ export class QboContact extends LitElement {
|
|
|
70
70
|
return html`<slot>
|
|
71
71
|
<div class="${this.colSixClass}">
|
|
72
72
|
<label for="${this.contactName}" class="${this.formLabelSmallClass}">${this.contactLabel}</label>
|
|
73
|
-
<
|
|
73
|
+
<qbo-contact-name class="${this.formControlSmallClass}" name="${this.contactName}" .data="${this.jsonData.Root.ContactItem}"></qbo-contact-name>
|
|
74
74
|
</div>
|
|
75
75
|
<div class="${this.colSixClass}">
|
|
76
76
|
<label for="ContactTemplateID" class="${this.formLabelSmallClass}">Template</label>
|
|
@@ -128,7 +128,7 @@ export class QboContact extends LitElement {
|
|
|
128
128
|
</div>
|
|
129
129
|
<div class="${this.colThreeClass}">
|
|
130
130
|
<label for="USSSN" class="${this.formLabelSmallClass}">SSN</label>
|
|
131
|
-
<qbo-ssn
|
|
131
|
+
<qbo-ssn .data="${this.jsonData.Root.ContactItem}"></qbo-ssn>
|
|
132
132
|
</div>
|
|
133
133
|
<div class="${this.colThreeClass}">
|
|
134
134
|
<label for="TIN" class="${this.formLabelSmallClass}">TIN</label>
|
package/src/qbo/qbo-popover.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
3
|
+
export declare class QboPopover extends QboFormElement {
|
|
3
4
|
contentAtt: string;
|
|
4
5
|
contentStyle: string;
|
|
5
6
|
containerAtt: string;
|
package/src/qbo/qbo-popover.js
CHANGED
|
@@ -7,10 +7,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { html
|
|
10
|
+
import { html } from 'lit';
|
|
11
11
|
import { customElement, property } from 'lit/decorators.js';
|
|
12
12
|
import { Popover } from 'bootstrap';
|
|
13
|
-
|
|
13
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
14
|
+
let QboPopover = class QboPopover extends QboFormElement {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.contentAtt = 'data-bs-content';
|
package/src/qbo/qbo-popover.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { html,
|
|
1
|
+
import { html, PropertyValues } from 'lit';
|
|
2
2
|
import { customElement, property } from 'lit/decorators.js';
|
|
3
3
|
import { Popover } from 'bootstrap';
|
|
4
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
4
5
|
|
|
5
6
|
@customElement('qbo-popover')
|
|
6
|
-
export class QboPopover extends
|
|
7
|
+
export class QboPopover extends QboFormElement {
|
|
7
8
|
|
|
8
9
|
@property({ type: String })
|
|
9
10
|
contentAtt = 'data-bs-content';
|
package/src/qbo/qbo-ssn.d.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
3
|
+
export declare class QboSSN extends QboFormElement {
|
|
3
4
|
apiEndpoint: string;
|
|
4
|
-
contactId: String | null;
|
|
5
5
|
disabled: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
editMode: boolean;
|
|
7
|
+
event: String | null;
|
|
8
8
|
imageClassShow: String | null;
|
|
9
9
|
imageClassHide: String | null;
|
|
10
|
-
|
|
10
|
+
inputClass: String | null;
|
|
11
|
+
inputName: String | null;
|
|
11
12
|
selectorImage: String | null;
|
|
12
13
|
selectorInput: String | null;
|
|
14
|
+
selectorSpan: String | null;
|
|
13
15
|
show: boolean;
|
|
16
|
+
slotClass: String | null;
|
|
14
17
|
spanClass: String | null;
|
|
15
|
-
|
|
18
|
+
titleMaskText: String | null;
|
|
19
|
+
titleShowText: String | null;
|
|
16
20
|
type: string | null;
|
|
17
21
|
url: String | null;
|
|
18
22
|
renderInHost: boolean;
|
|
19
23
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
20
24
|
toggleSSN(): Promise<void>;
|
|
21
|
-
render():
|
|
25
|
+
render(): TemplateResult<1>;
|
|
22
26
|
}
|
package/src/qbo/qbo-ssn.js
CHANGED
|
@@ -7,26 +7,37 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { html
|
|
10
|
+
import { html } from 'lit';
|
|
11
11
|
import { customElement, property } from 'lit/decorators.js';
|
|
12
12
|
import { services } from '@quandis/qbo4.configuration';
|
|
13
13
|
import { RestApiService } from './RestApiService.js';
|
|
14
|
-
|
|
14
|
+
import { QboFormElement } from './qbo-form-element.js';
|
|
15
|
+
const ssnMap = new Map();
|
|
16
|
+
ssnMap.set('defaultLayout', (component) => {
|
|
17
|
+
return html `<div slot="content" class="${component.slotClass}">
|
|
18
|
+
<input type="text" ?disabled=${component.disabled} class="${component.inputClass}" name="${component.inputName}" value="${component.data?.['USSSN']}"/>
|
|
19
|
+
<span @click="${component.toggleSSN}" class="${component.spanClass}" title="${component.titleShowText}"><i class="${component.imageClassShow}"></i></span>
|
|
20
|
+
</div>`;
|
|
21
|
+
});
|
|
22
|
+
let QboSSN = class QboSSN extends QboFormElement {
|
|
15
23
|
constructor() {
|
|
16
24
|
super(...arguments);
|
|
17
25
|
this.apiEndpoint = 'qbo';
|
|
18
|
-
this.contactId = null;
|
|
19
26
|
this.disabled = true;
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
27
|
+
this.editMode = false;
|
|
28
|
+
this.event = 'click';
|
|
22
29
|
this.imageClassShow = 'qbo-icon-eye';
|
|
23
30
|
this.imageClassHide = 'qbo-icon-eye-slash';
|
|
24
|
-
this.
|
|
31
|
+
this.inputClass = 'qbo-sm';
|
|
32
|
+
this.inputName = 'USSSN';
|
|
25
33
|
this.selectorImage = 'i';
|
|
26
34
|
this.selectorInput = 'input';
|
|
35
|
+
this.selectorSpan = 'span';
|
|
27
36
|
this.show = false;
|
|
37
|
+
this.slotClass = 'qbo-input-group';
|
|
28
38
|
this.spanClass = 'qbo-input-group-text qbo-pointer';
|
|
29
|
-
this.
|
|
39
|
+
this.titleMaskText = 'Mask';
|
|
40
|
+
this.titleShowText = 'Show';
|
|
30
41
|
this.type = 'defaultLayout';
|
|
31
42
|
this.url = 'contact/UnmaskSSN';
|
|
32
43
|
this.renderInHost = true;
|
|
@@ -39,23 +50,38 @@ let QboSSN = class QboSSN extends LitElement {
|
|
|
39
50
|
if (this.show) {
|
|
40
51
|
const service = services.container.isRegistered(this.apiEndpoint)
|
|
41
52
|
? services.container.resolve(this.apiEndpoint) : new RestApiService(this.apiEndpoint);
|
|
42
|
-
const json = await service.fetch(`${this.url}`, { ID: `${this.
|
|
53
|
+
const json = await service.fetch(`${this.url}`, { ID: `${this.data?.['ContactID']}` });
|
|
43
54
|
this.renderRoot.querySelectorAll(`${this.selectorInput}`).forEach(input => {
|
|
44
|
-
if (input instanceof HTMLInputElement
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
if (input instanceof HTMLInputElement
|
|
56
|
+
&& json?.ContactCollection?.length > 0
|
|
57
|
+
&& json.ContactCollection[0].USSSN != null
|
|
58
|
+
&& json.ContactCollection[0].USSSN.length == 9) {
|
|
59
|
+
const ssn = json.ContactCollection[0].USSSN;
|
|
60
|
+
input.value = `${ssn.substring(0, 3)}-${ssn.substring(3, 5)}-${ssn.substring(5, 9)}`;
|
|
61
|
+
if (this.editMode)
|
|
62
|
+
input.disabled = false;
|
|
63
|
+
this.renderRoot.querySelectorAll(`${this.selectorSpan}`).forEach(span => {
|
|
64
|
+
span.setAttribute('title', `${this.titleMaskText}`);
|
|
65
|
+
});
|
|
66
|
+
this.renderRoot.querySelectorAll(`${this.selectorImage}`).forEach(i => {
|
|
67
|
+
i.className = `${this.imageClassHide}`;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.show = !this.show;
|
|
52
72
|
}
|
|
53
73
|
});
|
|
54
74
|
}
|
|
55
75
|
else {
|
|
56
76
|
this.renderRoot.querySelectorAll(`${this.selectorInput}`).forEach(input => {
|
|
57
|
-
if (input instanceof HTMLInputElement)
|
|
58
|
-
input.value = `${this.
|
|
77
|
+
if (input instanceof HTMLInputElement) {
|
|
78
|
+
input.value = `${this.data?.['USSSN']}`;
|
|
79
|
+
if (this.editMode)
|
|
80
|
+
input.disabled = true;
|
|
81
|
+
}
|
|
82
|
+
this.renderRoot.querySelectorAll(`${this.selectorSpan}`).forEach(span => {
|
|
83
|
+
span.setAttribute('title', `${this.titleShowText}`);
|
|
84
|
+
});
|
|
59
85
|
this.renderRoot.querySelectorAll(`${this.selectorImage}`).forEach(i => {
|
|
60
86
|
i.className = `${this.imageClassShow}`;
|
|
61
87
|
});
|
|
@@ -63,34 +89,25 @@ let QboSSN = class QboSSN extends LitElement {
|
|
|
63
89
|
}
|
|
64
90
|
}
|
|
65
91
|
render() {
|
|
66
|
-
return html `<slot
|
|
67
|
-
<div class="${this.divClass}">
|
|
68
|
-
<input type="text" ?disabled=${this.disabled} class="${this.formControlSmallClass}" name="${this.name}" value="${this.ssn}"/>
|
|
69
|
-
<span @click="${this.toggleSSN}" class="${this.spanClass}"><i class="${this.imageClassShow}"></i></span>
|
|
70
|
-
</div>
|
|
71
|
-
</slot>`;
|
|
92
|
+
return html `<slot>${ssnMap.has(this.type) ? ssnMap.get(this.type)(this) : null}</slot>`;
|
|
72
93
|
}
|
|
73
94
|
};
|
|
74
95
|
__decorate([
|
|
75
96
|
property({ type: String }),
|
|
76
97
|
__metadata("design:type", Object)
|
|
77
98
|
], QboSSN.prototype, "apiEndpoint", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
property({ type: String }),
|
|
80
|
-
__metadata("design:type", Object)
|
|
81
|
-
], QboSSN.prototype, "contactId", void 0);
|
|
82
99
|
__decorate([
|
|
83
100
|
property({ type: Boolean }),
|
|
84
101
|
__metadata("design:type", Object)
|
|
85
102
|
], QboSSN.prototype, "disabled", void 0);
|
|
86
103
|
__decorate([
|
|
87
|
-
property({ type:
|
|
104
|
+
property({ type: Boolean }),
|
|
88
105
|
__metadata("design:type", Object)
|
|
89
|
-
], QboSSN.prototype, "
|
|
106
|
+
], QboSSN.prototype, "editMode", void 0);
|
|
90
107
|
__decorate([
|
|
91
108
|
property({ type: String }),
|
|
92
109
|
__metadata("design:type", Object)
|
|
93
|
-
], QboSSN.prototype, "
|
|
110
|
+
], QboSSN.prototype, "event", void 0);
|
|
94
111
|
__decorate([
|
|
95
112
|
property({ type: String }),
|
|
96
113
|
__metadata("design:type", Object)
|
|
@@ -102,7 +119,11 @@ __decorate([
|
|
|
102
119
|
__decorate([
|
|
103
120
|
property({ type: String }),
|
|
104
121
|
__metadata("design:type", Object)
|
|
105
|
-
], QboSSN.prototype, "
|
|
122
|
+
], QboSSN.prototype, "inputClass", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ type: String }),
|
|
125
|
+
__metadata("design:type", Object)
|
|
126
|
+
], QboSSN.prototype, "inputName", void 0);
|
|
106
127
|
__decorate([
|
|
107
128
|
property({ type: String }),
|
|
108
129
|
__metadata("design:type", Object)
|
|
@@ -111,10 +132,18 @@ __decorate([
|
|
|
111
132
|
property({ type: String }),
|
|
112
133
|
__metadata("design:type", Object)
|
|
113
134
|
], QboSSN.prototype, "selectorInput", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
property({ type: String }),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], QboSSN.prototype, "selectorSpan", void 0);
|
|
114
139
|
__decorate([
|
|
115
140
|
property({ type: Boolean }),
|
|
116
141
|
__metadata("design:type", Object)
|
|
117
142
|
], QboSSN.prototype, "show", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
property({ type: String }),
|
|
145
|
+
__metadata("design:type", Object)
|
|
146
|
+
], QboSSN.prototype, "slotClass", void 0);
|
|
118
147
|
__decorate([
|
|
119
148
|
property({ type: String }),
|
|
120
149
|
__metadata("design:type", Object)
|
|
@@ -122,7 +151,11 @@ __decorate([
|
|
|
122
151
|
__decorate([
|
|
123
152
|
property({ type: String }),
|
|
124
153
|
__metadata("design:type", Object)
|
|
125
|
-
], QboSSN.prototype, "
|
|
154
|
+
], QboSSN.prototype, "titleMaskText", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
property({ type: String }),
|
|
157
|
+
__metadata("design:type", Object)
|
|
158
|
+
], QboSSN.prototype, "titleShowText", void 0);
|
|
126
159
|
__decorate([
|
|
127
160
|
property(),
|
|
128
161
|
__metadata("design:type", Object)
|