@quandis/qbo4.ui 4.0.1-CI-20240507-201707 → 4.0.1-CI-20240514-221344
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/qbo-contact.js +1 -1
- package/src/qbo/qbo-contact.ts +1 -1
- package/src/qbo/qbo-form-edit.d.ts +9 -0
- package/src/qbo/qbo-form-edit.js +56 -12
- package/src/qbo/qbo-form-edit.ts +38 -12
- package/src/qbo/qbo-ssn.d.ts +7 -0
- package/src/qbo/qbo-ssn.js +43 -8
- package/src/qbo/qbo-ssn.ts +29 -8
- package/wwwroot/js/qbo4.ui-flowchart.js +37 -17
- package/wwwroot/js/qbo4.ui-flowchart.min.js +2 -2
- package/wwwroot/js/qbo4.ui-flowchart.min.js.map +1 -1
- package/wwwroot/js/qbo4.ui.js +203 -124
- package/wwwroot/js/qbo4.ui.min.js +18 -18
- package/wwwroot/js/qbo4.ui.min.js.map +1 -1
package/package.json
CHANGED
package/src/qbo/qbo-contact.js
CHANGED
|
@@ -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 ssn="${this.jsonData.Root.ContactItem?.USSSN}" contactId="${this.contactId}"></qbo-ssn>
|
|
106
|
+
<qbo-ssn .data="${this.jsonData.Root.ContactItem}" ssn="${this.jsonData.Root.ContactItem?.USSSN}" contactId="${this.contactId}"></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
|
@@ -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 ssn="${this.jsonData.Root.ContactItem?.USSSN}" contactId="${this.contactId}"></qbo-ssn>
|
|
131
|
+
<qbo-ssn .data="${this.jsonData.Root.ContactItem}" ssn="${this.jsonData.Root.ContactItem?.USSSN}" contactId="${this.contactId}"></qbo-ssn>
|
|
132
132
|
</div>
|
|
133
133
|
<div class="${this.colThreeClass}">
|
|
134
134
|
<label for="TIN" class="${this.formLabelSmallClass}">TIN</label>
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
export declare class QboFormEdit extends LitElement {
|
|
3
|
+
aDropdownClass: String | null;
|
|
3
4
|
buttonPrimaryClass: String | null;
|
|
5
|
+
buttonPrimaryDropdownClass: String | null;
|
|
6
|
+
buttonType: String | null;
|
|
4
7
|
data: Object;
|
|
5
8
|
divButtonGroupClass: String | null;
|
|
6
9
|
divFormActionClass: String | null;
|
|
7
10
|
divSectionHeaderClass: String | null;
|
|
11
|
+
dropdownToggle: String | null;
|
|
8
12
|
editLabel: String | null;
|
|
13
|
+
helpIcon: String | null;
|
|
14
|
+
helpText: String | null;
|
|
15
|
+
historyIcon: String | null;
|
|
16
|
+
historyText: String | null;
|
|
9
17
|
infoButtonClass: String | null;
|
|
10
18
|
infoIconClass: String | null;
|
|
11
19
|
infoTitle: String | null;
|
|
12
20
|
popoverClass: String | null;
|
|
13
21
|
spanEditClass: String | null;
|
|
22
|
+
ulDropdownClass: String | null;
|
|
14
23
|
type: string | null;
|
|
15
24
|
renderInHost: boolean;
|
|
16
25
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
package/src/qbo/qbo-form-edit.js
CHANGED
|
@@ -48,17 +48,26 @@ formEditMap.set('updatedLayout', (component) => {
|
|
|
48
48
|
let QboFormEdit = class QboFormEdit extends LitElement {
|
|
49
49
|
constructor() {
|
|
50
50
|
super(...arguments);
|
|
51
|
+
this.aDropdownClass = 'dropdown-item qbo-pointer';
|
|
51
52
|
this.buttonPrimaryClass = 'qbo-primary';
|
|
53
|
+
this.buttonPrimaryDropdownClass = 'qbo-primary-dropdown';
|
|
54
|
+
this.buttonType = 'button';
|
|
52
55
|
this.data = {};
|
|
53
56
|
this.divButtonGroupClass = 'qbo-btn-group';
|
|
54
57
|
this.divFormActionClass = 'qbo-form-actions';
|
|
55
58
|
this.divSectionHeaderClass = 'qbo-header';
|
|
59
|
+
this.dropdownToggle = 'dropdown';
|
|
56
60
|
this.editLabel = 'Edit';
|
|
61
|
+
this.helpIcon = 'qbo-icon-question';
|
|
62
|
+
this.helpText = 'Help';
|
|
63
|
+
this.historyIcon = 'qbo-icon-clock-history';
|
|
64
|
+
this.historyText = 'History';
|
|
57
65
|
this.infoButtonClass = 'qbo-btn-light';
|
|
58
66
|
this.infoIconClass = 'qbo-icon-info';
|
|
59
67
|
this.infoTitle = 'Last Updated';
|
|
60
68
|
this.popoverClass = 'qbo-float-end';
|
|
61
69
|
this.spanEditClass = 'qbo-icon-edit';
|
|
70
|
+
this.ulDropdownClass = 'dropdown-menu';
|
|
62
71
|
this.type = 'defaultLayout';
|
|
63
72
|
this.renderInHost = true;
|
|
64
73
|
}
|
|
@@ -66,9 +75,8 @@ let QboFormEdit = class QboFormEdit extends LitElement {
|
|
|
66
75
|
return this.renderInHost ? this : super.createRenderRoot();
|
|
67
76
|
}
|
|
68
77
|
render() {
|
|
69
|
-
const data = this.closest('*[apiendpoint]');
|
|
70
78
|
if (this.type == null)
|
|
71
|
-
this.type = '
|
|
79
|
+
this.type = 'defaultLayout';
|
|
72
80
|
const popover = formEditMap.has(this.type) ? formEditMap.get(this.type)(this.data) : null;
|
|
73
81
|
return html `<slot>
|
|
74
82
|
<div class="${this.divSectionHeaderClass}">
|
|
@@ -76,27 +84,27 @@ let QboFormEdit = class QboFormEdit extends LitElement {
|
|
|
76
84
|
</div>
|
|
77
85
|
<div class="${this.divFormActionClass}">
|
|
78
86
|
<div class="${this.divButtonGroupClass}">
|
|
79
|
-
<button type="
|
|
87
|
+
<button type="${this.buttonType}" class="${this.buttonPrimaryClass}">
|
|
80
88
|
<span class="${this.spanEditClass}"> ${this.editLabel}</span>
|
|
81
89
|
</button>
|
|
82
|
-
<button type="
|
|
83
|
-
<ul class="
|
|
90
|
+
<button type="${this.buttonType}" class="${this.buttonPrimaryDropdownClass}" data-bs-toggle="${this.dropdownToggle}"></button>
|
|
91
|
+
<ul class="${this.ulDropdownClass}">
|
|
84
92
|
<li>
|
|
85
|
-
<a class="
|
|
86
|
-
<i class="
|
|
87
|
-
<span
|
|
93
|
+
<a class="${this.aDropdownClass}" onclick="alert('Show History');">
|
|
94
|
+
<i class="${this.historyIcon}"></i>
|
|
95
|
+
<span>${this.historyText}</span>
|
|
88
96
|
</a>
|
|
89
97
|
</li>
|
|
90
98
|
<li>
|
|
91
|
-
<a class="
|
|
92
|
-
<i class="
|
|
93
|
-
<span
|
|
99
|
+
<a class="${this.aDropdownClass}" onclick="alert('Show Help');">
|
|
100
|
+
<i class="${this.helpIcon}"></i>
|
|
101
|
+
<span>${this.helpText}</span>
|
|
94
102
|
</a>
|
|
95
103
|
</li>
|
|
96
104
|
</ul>
|
|
97
105
|
</div>
|
|
98
106
|
<qbo-popover class="${this.popoverClass}">
|
|
99
|
-
<button type="
|
|
107
|
+
<button type="${this.buttonType}" class="${this.infoButtonClass}" title="${this.infoTitle}">
|
|
100
108
|
<i class="${this.infoIconClass}"></i>
|
|
101
109
|
</button>
|
|
102
110
|
${popover}
|
|
@@ -105,10 +113,22 @@ let QboFormEdit = class QboFormEdit extends LitElement {
|
|
|
105
113
|
</slot>`;
|
|
106
114
|
}
|
|
107
115
|
};
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: String }),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], QboFormEdit.prototype, "aDropdownClass", void 0);
|
|
108
120
|
__decorate([
|
|
109
121
|
property({ type: String }),
|
|
110
122
|
__metadata("design:type", Object)
|
|
111
123
|
], QboFormEdit.prototype, "buttonPrimaryClass", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: String }),
|
|
126
|
+
__metadata("design:type", Object)
|
|
127
|
+
], QboFormEdit.prototype, "buttonPrimaryDropdownClass", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property({ type: String }),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], QboFormEdit.prototype, "buttonType", void 0);
|
|
112
132
|
__decorate([
|
|
113
133
|
property({ type: Object, attribute: false }),
|
|
114
134
|
__metadata("design:type", Object)
|
|
@@ -125,10 +145,30 @@ __decorate([
|
|
|
125
145
|
property({ type: String }),
|
|
126
146
|
__metadata("design:type", Object)
|
|
127
147
|
], QboFormEdit.prototype, "divSectionHeaderClass", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
property({ type: String }),
|
|
150
|
+
__metadata("design:type", Object)
|
|
151
|
+
], QboFormEdit.prototype, "dropdownToggle", void 0);
|
|
128
152
|
__decorate([
|
|
129
153
|
property({ type: String }),
|
|
130
154
|
__metadata("design:type", Object)
|
|
131
155
|
], QboFormEdit.prototype, "editLabel", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ type: String }),
|
|
158
|
+
__metadata("design:type", Object)
|
|
159
|
+
], QboFormEdit.prototype, "helpIcon", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: String }),
|
|
162
|
+
__metadata("design:type", Object)
|
|
163
|
+
], QboFormEdit.prototype, "helpText", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: String }),
|
|
166
|
+
__metadata("design:type", Object)
|
|
167
|
+
], QboFormEdit.prototype, "historyIcon", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
property({ type: String }),
|
|
170
|
+
__metadata("design:type", Object)
|
|
171
|
+
], QboFormEdit.prototype, "historyText", void 0);
|
|
132
172
|
__decorate([
|
|
133
173
|
property({ type: String }),
|
|
134
174
|
__metadata("design:type", Object)
|
|
@@ -149,6 +189,10 @@ __decorate([
|
|
|
149
189
|
property({ type: String }),
|
|
150
190
|
__metadata("design:type", Object)
|
|
151
191
|
], QboFormEdit.prototype, "spanEditClass", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
property({ type: String }),
|
|
194
|
+
__metadata("design:type", Object)
|
|
195
|
+
], QboFormEdit.prototype, "ulDropdownClass", void 0);
|
|
152
196
|
__decorate([
|
|
153
197
|
property(),
|
|
154
198
|
__metadata("design:type", Object)
|
package/src/qbo/qbo-form-edit.ts
CHANGED
|
@@ -42,9 +42,18 @@ formEditMap.set('updatedLayout', (component: any) => {
|
|
|
42
42
|
@customElement('qbo-form-edit')
|
|
43
43
|
export class QboFormEdit extends LitElement {
|
|
44
44
|
|
|
45
|
+
@property({ type: String })
|
|
46
|
+
aDropdownClass: String | null = 'dropdown-item qbo-pointer';
|
|
47
|
+
|
|
45
48
|
@property({ type: String })
|
|
46
49
|
buttonPrimaryClass: String | null = 'qbo-primary';
|
|
47
50
|
|
|
51
|
+
@property({ type: String })
|
|
52
|
+
buttonPrimaryDropdownClass: String | null = 'qbo-primary-dropdown';
|
|
53
|
+
|
|
54
|
+
@property({ type: String })
|
|
55
|
+
buttonType: String | null = 'button';
|
|
56
|
+
|
|
48
57
|
@property({ type: Object, attribute: false })
|
|
49
58
|
data: Object = { };
|
|
50
59
|
|
|
@@ -57,9 +66,24 @@ export class QboFormEdit extends LitElement {
|
|
|
57
66
|
@property({ type: String })
|
|
58
67
|
divSectionHeaderClass: String | null = 'qbo-header';
|
|
59
68
|
|
|
69
|
+
@property({ type: String })
|
|
70
|
+
dropdownToggle: String | null = 'dropdown';
|
|
71
|
+
|
|
60
72
|
@property({ type: String })
|
|
61
73
|
editLabel: String | null = 'Edit';
|
|
62
74
|
|
|
75
|
+
@property({ type: String })
|
|
76
|
+
helpIcon: String | null = 'qbo-icon-question';
|
|
77
|
+
|
|
78
|
+
@property({ type: String })
|
|
79
|
+
helpText: String | null = 'Help';
|
|
80
|
+
|
|
81
|
+
@property({ type: String })
|
|
82
|
+
historyIcon: String | null = 'qbo-icon-clock-history';
|
|
83
|
+
|
|
84
|
+
@property({ type: String })
|
|
85
|
+
historyText: String | null = 'History';
|
|
86
|
+
|
|
63
87
|
@property({ type: String })
|
|
64
88
|
infoButtonClass: String | null = 'qbo-btn-light';
|
|
65
89
|
|
|
@@ -75,6 +99,9 @@ export class QboFormEdit extends LitElement {
|
|
|
75
99
|
@property({ type: String })
|
|
76
100
|
spanEditClass: String | null = 'qbo-icon-edit';
|
|
77
101
|
|
|
102
|
+
@property({ type: String })
|
|
103
|
+
ulDropdownClass: String | null = 'dropdown-menu';
|
|
104
|
+
|
|
78
105
|
@property()
|
|
79
106
|
type: string | null = 'defaultLayout';
|
|
80
107
|
|
|
@@ -86,8 +113,7 @@ export class QboFormEdit extends LitElement {
|
|
|
86
113
|
}
|
|
87
114
|
|
|
88
115
|
render() {
|
|
89
|
-
|
|
90
|
-
if (this.type == null) this.type = 'createdLayout'
|
|
116
|
+
if (this.type == null) this.type = 'defaultLayout';
|
|
91
117
|
const popover = formEditMap.has(this.type) ? formEditMap.get(this.type)!(this.data) : null;
|
|
92
118
|
|
|
93
119
|
return html`<slot>
|
|
@@ -96,27 +122,27 @@ export class QboFormEdit extends LitElement {
|
|
|
96
122
|
</div>
|
|
97
123
|
<div class="${this.divFormActionClass}">
|
|
98
124
|
<div class="${this.divButtonGroupClass}">
|
|
99
|
-
<button type="
|
|
125
|
+
<button type="${this.buttonType}" class="${this.buttonPrimaryClass}">
|
|
100
126
|
<span class="${this.spanEditClass}"> ${this.editLabel}</span>
|
|
101
127
|
</button>
|
|
102
|
-
<button type="
|
|
103
|
-
<ul class="
|
|
128
|
+
<button type="${this.buttonType}" class="${this.buttonPrimaryDropdownClass}" data-bs-toggle="${this.dropdownToggle}"></button>
|
|
129
|
+
<ul class="${this.ulDropdownClass}">
|
|
104
130
|
<li>
|
|
105
|
-
<a class="
|
|
106
|
-
<i class="
|
|
107
|
-
<span
|
|
131
|
+
<a class="${this.aDropdownClass}" onclick="alert('Show History');">
|
|
132
|
+
<i class="${this.historyIcon}"></i>
|
|
133
|
+
<span>${this.historyText}</span>
|
|
108
134
|
</a>
|
|
109
135
|
</li>
|
|
110
136
|
<li>
|
|
111
|
-
<a class="
|
|
112
|
-
<i class="
|
|
113
|
-
<span
|
|
137
|
+
<a class="${this.aDropdownClass}" onclick="alert('Show Help');">
|
|
138
|
+
<i class="${this.helpIcon}"></i>
|
|
139
|
+
<span>${this.helpText}</span>
|
|
114
140
|
</a>
|
|
115
141
|
</li>
|
|
116
142
|
</ul>
|
|
117
143
|
</div>
|
|
118
144
|
<qbo-popover class="${this.popoverClass}">
|
|
119
|
-
<button type="
|
|
145
|
+
<button type="${this.buttonType}" class="${this.infoButtonClass}" title="${this.infoTitle}">
|
|
120
146
|
<i class="${this.infoIconClass}"></i>
|
|
121
147
|
</button>
|
|
122
148
|
${popover}
|
package/src/qbo/qbo-ssn.d.ts
CHANGED
|
@@ -3,10 +3,17 @@ export declare class QboSSN extends LitElement {
|
|
|
3
3
|
apiEndpoint: string;
|
|
4
4
|
contactId: String | null;
|
|
5
5
|
disabled: boolean;
|
|
6
|
+
divClass: String | null;
|
|
6
7
|
formControlSmallClass: String | null;
|
|
8
|
+
imageClassShow: String | null;
|
|
9
|
+
imageClassHide: String | null;
|
|
7
10
|
name: String | null;
|
|
11
|
+
selectorImage: String | null;
|
|
12
|
+
selectorInput: String | null;
|
|
8
13
|
show: boolean;
|
|
14
|
+
spanClass: String | null;
|
|
9
15
|
ssn: String | null;
|
|
16
|
+
type: string | null;
|
|
10
17
|
url: String | null;
|
|
11
18
|
renderInHost: boolean;
|
|
12
19
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
package/src/qbo/qbo-ssn.js
CHANGED
|
@@ -17,10 +17,17 @@ let QboSSN = class QboSSN extends LitElement {
|
|
|
17
17
|
this.apiEndpoint = 'qbo';
|
|
18
18
|
this.contactId = null;
|
|
19
19
|
this.disabled = true;
|
|
20
|
+
this.divClass = 'qbo-input-group';
|
|
20
21
|
this.formControlSmallClass = 'qbo-sm';
|
|
22
|
+
this.imageClassShow = 'qbo-icon-eye';
|
|
23
|
+
this.imageClassHide = 'qbo-icon-eye-slash';
|
|
21
24
|
this.name = 'USSSN';
|
|
25
|
+
this.selectorImage = 'i';
|
|
26
|
+
this.selectorInput = 'input';
|
|
22
27
|
this.show = false;
|
|
28
|
+
this.spanClass = 'qbo-input-group-text qbo-pointer';
|
|
23
29
|
this.ssn = null;
|
|
30
|
+
this.type = 'defaultLayout';
|
|
24
31
|
this.url = 'contact/UnmaskSSN';
|
|
25
32
|
this.renderInHost = true;
|
|
26
33
|
}
|
|
@@ -33,33 +40,33 @@ let QboSSN = class QboSSN extends LitElement {
|
|
|
33
40
|
const service = services.container.isRegistered(this.apiEndpoint)
|
|
34
41
|
? services.container.resolve(this.apiEndpoint) : new RestApiService(this.apiEndpoint);
|
|
35
42
|
const json = await service.fetch(`${this.url}`, { ID: `${this.contactId}` });
|
|
36
|
-
this.renderRoot.querySelectorAll(
|
|
43
|
+
this.renderRoot.querySelectorAll(`${this.selectorInput}`).forEach(input => {
|
|
37
44
|
if (input instanceof HTMLInputElement) {
|
|
38
45
|
if (json?.ContactCollection?.length > 0 && json.ContactCollection[0].USSSN != null && json.ContactCollection[0].USSSN.length == 9) {
|
|
39
46
|
const ssn = json.ContactCollection[0].USSSN;
|
|
40
47
|
input.value = `${ssn.substring(0, 3)}-${ssn.substring(3, 5)}-${ssn.substring(5, 9)}`;
|
|
41
|
-
this.renderRoot.querySelectorAll(
|
|
42
|
-
i.className =
|
|
48
|
+
this.renderRoot.querySelectorAll(`${this.selectorImage}`).forEach(i => {
|
|
49
|
+
i.className = `${this.imageClassHide}`;
|
|
43
50
|
});
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
});
|
|
47
54
|
}
|
|
48
55
|
else {
|
|
49
|
-
this.renderRoot.querySelectorAll(
|
|
56
|
+
this.renderRoot.querySelectorAll(`${this.selectorInput}`).forEach(input => {
|
|
50
57
|
if (input instanceof HTMLInputElement)
|
|
51
58
|
input.value = `${this.ssn}`;
|
|
52
|
-
this.renderRoot.querySelectorAll(
|
|
53
|
-
i.className =
|
|
59
|
+
this.renderRoot.querySelectorAll(`${this.selectorImage}`).forEach(i => {
|
|
60
|
+
i.className = `${this.imageClassShow}`;
|
|
54
61
|
});
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
65
|
render() {
|
|
59
66
|
return html `<slot>
|
|
60
|
-
<div class="
|
|
67
|
+
<div class="${this.divClass}">
|
|
61
68
|
<input type="text" ?disabled=${this.disabled} class="${this.formControlSmallClass}" name="${this.name}" value="${this.ssn}"/>
|
|
62
|
-
<span @click="${this.toggleSSN}" class="
|
|
69
|
+
<span @click="${this.toggleSSN}" class="${this.spanClass}"><i class="${this.imageClassShow}"></i></span>
|
|
63
70
|
</div>
|
|
64
71
|
</slot>`;
|
|
65
72
|
}
|
|
@@ -76,22 +83,50 @@ __decorate([
|
|
|
76
83
|
property({ type: Boolean }),
|
|
77
84
|
__metadata("design:type", Object)
|
|
78
85
|
], QboSSN.prototype, "disabled", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
property({ type: String }),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], QboSSN.prototype, "divClass", void 0);
|
|
79
90
|
__decorate([
|
|
80
91
|
property({ type: String }),
|
|
81
92
|
__metadata("design:type", Object)
|
|
82
93
|
], QboSSN.prototype, "formControlSmallClass", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
property({ type: String }),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], QboSSN.prototype, "imageClassShow", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: String }),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], QboSSN.prototype, "imageClassHide", void 0);
|
|
83
102
|
__decorate([
|
|
84
103
|
property({ type: String }),
|
|
85
104
|
__metadata("design:type", Object)
|
|
86
105
|
], QboSSN.prototype, "name", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ type: String }),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], QboSSN.prototype, "selectorImage", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: String }),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], QboSSN.prototype, "selectorInput", void 0);
|
|
87
114
|
__decorate([
|
|
88
115
|
property({ type: Boolean }),
|
|
89
116
|
__metadata("design:type", Object)
|
|
90
117
|
], QboSSN.prototype, "show", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: String }),
|
|
120
|
+
__metadata("design:type", Object)
|
|
121
|
+
], QboSSN.prototype, "spanClass", void 0);
|
|
91
122
|
__decorate([
|
|
92
123
|
property({ type: String }),
|
|
93
124
|
__metadata("design:type", Object)
|
|
94
125
|
], QboSSN.prototype, "ssn", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
property(),
|
|
128
|
+
__metadata("design:type", Object)
|
|
129
|
+
], QboSSN.prototype, "type", void 0);
|
|
95
130
|
__decorate([
|
|
96
131
|
property({ type: String }),
|
|
97
132
|
__metadata("design:type", Object)
|
package/src/qbo/qbo-ssn.ts
CHANGED
|
@@ -16,18 +16,39 @@ export class QboSSN extends LitElement {
|
|
|
16
16
|
@property({ type: Boolean })
|
|
17
17
|
disabled = true;
|
|
18
18
|
|
|
19
|
+
@property({ type: String })
|
|
20
|
+
divClass: String | null = 'qbo-input-group';
|
|
21
|
+
|
|
19
22
|
@property({ type: String })
|
|
20
23
|
formControlSmallClass: String | null = 'qbo-sm';
|
|
21
24
|
|
|
25
|
+
@property({ type: String })
|
|
26
|
+
imageClassShow: String | null = 'qbo-icon-eye';
|
|
27
|
+
|
|
28
|
+
@property({ type: String })
|
|
29
|
+
imageClassHide: String | null = 'qbo-icon-eye-slash';
|
|
30
|
+
|
|
22
31
|
@property({ type: String })
|
|
23
32
|
name: String | null = 'USSSN';
|
|
24
33
|
|
|
34
|
+
@property({ type: String })
|
|
35
|
+
selectorImage: String | null = 'i';
|
|
36
|
+
|
|
37
|
+
@property({ type: String })
|
|
38
|
+
selectorInput: String | null = 'input';
|
|
39
|
+
|
|
25
40
|
@property({ type: Boolean })
|
|
26
41
|
show = false;
|
|
27
42
|
|
|
43
|
+
@property({ type: String })
|
|
44
|
+
spanClass: String | null = 'qbo-input-group-text qbo-pointer';
|
|
45
|
+
|
|
28
46
|
@property({ type: String })
|
|
29
47
|
ssn: String | null = null;
|
|
30
48
|
|
|
49
|
+
@property()
|
|
50
|
+
type: string | null = 'defaultLayout';
|
|
51
|
+
|
|
31
52
|
@property({ type: String })
|
|
32
53
|
url: String | null = 'contact/UnmaskSSN';
|
|
33
54
|
|
|
@@ -46,24 +67,24 @@ export class QboSSN extends LitElement {
|
|
|
46
67
|
? services.container.resolve<IApiService>(this.apiEndpoint) : new RestApiService(this.apiEndpoint);
|
|
47
68
|
const json = await service.fetch(`${this.url}`, { ID: `${this.contactId}` });
|
|
48
69
|
|
|
49
|
-
this.renderRoot.querySelectorAll(
|
|
70
|
+
this.renderRoot.querySelectorAll(`${this.selectorInput}`).forEach(input => {
|
|
50
71
|
if (input instanceof HTMLInputElement) {
|
|
51
72
|
if (json?.ContactCollection?.length > 0 && json.ContactCollection[0].USSSN != null && json.ContactCollection[0].USSSN.length == 9) {
|
|
52
73
|
const ssn = json.ContactCollection[0].USSSN;
|
|
53
74
|
input.value = `${ssn.substring(0, 3)}-${ssn.substring(3, 5)}-${ssn.substring(5, 9)}`;
|
|
54
75
|
|
|
55
|
-
this.renderRoot.querySelectorAll(
|
|
56
|
-
i.className =
|
|
76
|
+
this.renderRoot.querySelectorAll(`${this.selectorImage}`).forEach(i => {
|
|
77
|
+
i.className = `${this.imageClassHide}`;
|
|
57
78
|
});
|
|
58
79
|
}
|
|
59
80
|
}
|
|
60
81
|
});
|
|
61
82
|
} else {
|
|
62
|
-
this.renderRoot.querySelectorAll(
|
|
83
|
+
this.renderRoot.querySelectorAll(`${this.selectorInput}`).forEach(input => {
|
|
63
84
|
if (input instanceof HTMLInputElement) input.value = `${this.ssn}`;
|
|
64
85
|
|
|
65
|
-
this.renderRoot.querySelectorAll(
|
|
66
|
-
i.className =
|
|
86
|
+
this.renderRoot.querySelectorAll(`${this.selectorImage}`).forEach(i => {
|
|
87
|
+
i.className = `${this.imageClassShow}`;
|
|
67
88
|
});
|
|
68
89
|
});
|
|
69
90
|
}
|
|
@@ -71,9 +92,9 @@ export class QboSSN extends LitElement {
|
|
|
71
92
|
|
|
72
93
|
render() {
|
|
73
94
|
return html`<slot>
|
|
74
|
-
<div class="
|
|
95
|
+
<div class="${this.divClass}">
|
|
75
96
|
<input type="text" ?disabled=${this.disabled} class="${this.formControlSmallClass}" name="${this.name}" value="${this.ssn}"/>
|
|
76
|
-
<span @click="${this.toggleSSN}" class="
|
|
97
|
+
<span @click="${this.toggleSSN}" class="${this.spanClass}"><i class="${this.imageClassShow}"></i></span>
|
|
77
98
|
</div>
|
|
78
99
|
</slot>`;
|
|
79
100
|
}
|