@everymatrix/general-input 1.90.7 → 1.90.8
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/dist/cjs/checkbox-group-input_14.cjs.entry.js +373 -345
- package/dist/cjs/general-input.cjs.js +2 -2
- package/dist/cjs/{index-3b546c2c.js → index-7a4b2771.js} +1 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +34 -20
- package/dist/collection/components/checkbox-input/checkbox-input.js +33 -19
- package/dist/collection/components/date-input/date-input.js +34 -20
- package/dist/collection/components/email-input/email-input.js +34 -20
- package/dist/collection/components/general-input/general-input.js +35 -64
- package/dist/collection/components/number-input/number-input.js +34 -20
- package/dist/collection/components/password-input/password-input.js +34 -20
- package/dist/collection/components/postalcode-input/postalcode-input.js +35 -19
- package/dist/collection/components/radio-input/radio-input.js +36 -20
- package/dist/collection/components/select-input/select-input.js +35 -21
- package/dist/collection/components/tel-input/tel-input.js +34 -20
- package/dist/collection/components/text-input/text-input.js +36 -22
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +34 -20
- package/dist/collection/components/twofa-input/twofa-input.js +26 -59
- package/dist/esm/checkbox-group-input_14.entry.js +373 -345
- package/dist/esm/general-input.js +3 -3
- package/dist/esm/{index-ca174b7a.js → index-9174417a.js} +1 -4
- package/dist/esm/loader.js +3 -3
- package/dist/general-input/checkbox-group-input_14.entry.js +242 -242
- package/dist/general-input/general-input.esm.js +1 -1
- package/dist/general-input/{index-ca174b7a.js → index-9174417a.js} +2 -2
- package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +7 -4
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +7 -4
- package/dist/types/components/date-input/date-input.d.ts +7 -4
- package/dist/types/components/email-input/email-input.d.ts +7 -4
- package/dist/types/components/general-input/general-input.d.ts +4 -6
- package/dist/types/components/number-input/number-input.d.ts +7 -4
- package/dist/types/components/password-input/password-input.d.ts +7 -4
- package/dist/types/components/postalcode-input/postalcode-input.d.ts +7 -4
- package/dist/types/components/radio-input/radio-input.d.ts +8 -4
- package/dist/types/components/select-input/select-input.d.ts +7 -4
- package/dist/types/components/tel-input/tel-input.d.ts +7 -4
- package/dist/types/components/text-input/text-input.d.ts +7 -4
- package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +7 -4
- package/dist/types/components/twofa-input/twofa-input.d.ts +3 -7
- package/dist/types/components.d.ts +96 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { translate } from "../../utils/locale.utils";
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
|
+
import { setClientStyling, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
5
|
export class EmailInput {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.validationPattern = '';
|
|
@@ -22,11 +23,6 @@ export class EmailInput {
|
|
|
22
23
|
this.errorMessage = this.setErrorMessage();
|
|
23
24
|
this.touched = true;
|
|
24
25
|
};
|
|
25
|
-
this.setClientStyling = () => {
|
|
26
|
-
let sheet = document.createElement('style');
|
|
27
|
-
sheet.innerHTML = this.clientStyling;
|
|
28
|
-
this.stylingContainer.prepend(sheet);
|
|
29
|
-
};
|
|
30
26
|
this.name = undefined;
|
|
31
27
|
this.displayName = undefined;
|
|
32
28
|
this.placeholder = undefined;
|
|
@@ -38,14 +34,15 @@ export class EmailInput {
|
|
|
38
34
|
this.emitValue = undefined;
|
|
39
35
|
this.isDuplicateInput = undefined;
|
|
40
36
|
this.clientStyling = '';
|
|
37
|
+
this.mbSource = undefined;
|
|
41
38
|
this.errorMessage = undefined;
|
|
42
39
|
this.isValid = undefined;
|
|
43
|
-
this.limitStylingAppends = false;
|
|
44
40
|
this.showTooltip = false;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
|
-
if (newValue !== oldValue)
|
|
48
|
-
this.
|
|
42
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
43
|
+
if (newValue !== oldValue) {
|
|
44
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
45
|
+
}
|
|
49
46
|
}
|
|
50
47
|
validityChanged() {
|
|
51
48
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -80,16 +77,17 @@ export class EmailInput {
|
|
|
80
77
|
connectedCallback() {
|
|
81
78
|
this.validationPattern = this.setPattern();
|
|
82
79
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
handleClientStyling() {
|
|
81
|
+
if (window.emMessageBus !== undefined) {
|
|
82
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (this.clientStyling) {
|
|
86
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
89
87
|
}
|
|
90
|
-
// end custom styling area
|
|
91
88
|
}
|
|
92
89
|
componentDidLoad() {
|
|
90
|
+
this.handleClientStyling();
|
|
93
91
|
this.isValid = this.setValidity();
|
|
94
92
|
if (this.defaultValue) {
|
|
95
93
|
this.value = this.defaultValue;
|
|
@@ -135,8 +133,8 @@ export class EmailInput {
|
|
|
135
133
|
if (this.touched) {
|
|
136
134
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
137
135
|
}
|
|
138
|
-
return h("div", { key: '
|
|
139
|
-
h("img", { key: '
|
|
136
|
+
return h("div", { key: 'f852525fe8d8b695e638fdd83e8b0c2c20d98771', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'd6a6dec4e76ba1fbe15bed09f82cecde12cabe1a', class: 'email__wrapper--flex' }, h("label", { key: '4498ae1bac287cb80544c4d743afad2ec678e3bd', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e54d1258e48f54304a553cffb83466e4a4fadb4c', class: 'email__wrapper--relative' }, this.tooltip &&
|
|
137
|
+
h("img", { key: '29d7b95f22c8cb70d505f74a7ea18284faa908ee', class: 'email__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '08754b178e395f26c1d8a61ff667b91df3fb0ec7', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '3024a57f5d0897f34013eb4397d78babc2333192', class: 'email__error-message' }, this.errorMessage));
|
|
140
138
|
}
|
|
141
139
|
static get is() { return "email-input"; }
|
|
142
140
|
static get encapsulation() { return "shadow"; }
|
|
@@ -343,6 +341,23 @@ export class EmailInput {
|
|
|
343
341
|
"attribute": "client-styling",
|
|
344
342
|
"reflect": true,
|
|
345
343
|
"defaultValue": "''"
|
|
344
|
+
},
|
|
345
|
+
"mbSource": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"mutable": false,
|
|
348
|
+
"complexType": {
|
|
349
|
+
"original": "string",
|
|
350
|
+
"resolved": "string",
|
|
351
|
+
"references": {}
|
|
352
|
+
},
|
|
353
|
+
"required": false,
|
|
354
|
+
"optional": false,
|
|
355
|
+
"docs": {
|
|
356
|
+
"tags": [],
|
|
357
|
+
"text": "Client custom styling via message bus"
|
|
358
|
+
},
|
|
359
|
+
"attribute": "mb-source",
|
|
360
|
+
"reflect": true
|
|
346
361
|
}
|
|
347
362
|
};
|
|
348
363
|
}
|
|
@@ -350,7 +365,6 @@ export class EmailInput {
|
|
|
350
365
|
return {
|
|
351
366
|
"errorMessage": {},
|
|
352
367
|
"isValid": {},
|
|
353
|
-
"limitStylingAppends": {},
|
|
354
368
|
"showTooltip": {}
|
|
355
369
|
};
|
|
356
370
|
}
|
|
@@ -402,7 +416,7 @@ export class EmailInput {
|
|
|
402
416
|
static get watchers() {
|
|
403
417
|
return [{
|
|
404
418
|
"propName": "clientStyling",
|
|
405
|
-
"methodName": "
|
|
419
|
+
"methodName": "handleClientStylingChange"
|
|
406
420
|
}, {
|
|
407
421
|
"propName": "isValid",
|
|
408
422
|
"methodName": "validityChanged"
|
|
@@ -1,34 +1,9 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { getTranslations } from "../../utils/locale.utils";
|
|
3
|
+
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
3
4
|
import "../../../../../../../libs/vaadin-facade/index";
|
|
4
5
|
export class GeneralInput {
|
|
5
6
|
constructor() {
|
|
6
|
-
this.setClientStyling = () => {
|
|
7
|
-
let sheet = document.createElement('style');
|
|
8
|
-
sheet.innerHTML = this.clientStyling;
|
|
9
|
-
this.host.shadowRoot.prepend(sheet);
|
|
10
|
-
};
|
|
11
|
-
this.setStreamStyling = (domain) => {
|
|
12
|
-
if (window.emMessageBus) {
|
|
13
|
-
const sheet = document.createElement('style');
|
|
14
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
15
|
-
sheet.innerHTML = data;
|
|
16
|
-
this.clientStyling = data;
|
|
17
|
-
this.host.shadowRoot.prepend(sheet);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
this.setClientStylingURL = () => {
|
|
22
|
-
let url = new URL(this.clientStylingUrl);
|
|
23
|
-
let cssFile = document.createElement('style');
|
|
24
|
-
fetch(url.href)
|
|
25
|
-
.then((res) => res.text())
|
|
26
|
-
.then((data) => {
|
|
27
|
-
cssFile.innerHTML = data;
|
|
28
|
-
this.clientStyling = data;
|
|
29
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
7
|
this.handleClick = (event) => {
|
|
33
8
|
if (this.emitOnClick) {
|
|
34
9
|
event.stopPropagation();
|
|
@@ -65,15 +40,17 @@ export class GeneralInput {
|
|
|
65
40
|
this.enableManualDateInput = false;
|
|
66
41
|
this.pinAttemptsExceeded = undefined;
|
|
67
42
|
this.mbSource = undefined;
|
|
68
|
-
this.limitStylingAppends = false;
|
|
69
43
|
}
|
|
70
|
-
|
|
71
|
-
if (newValue !== oldValue)
|
|
72
|
-
this.
|
|
44
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
45
|
+
if (newValue !== oldValue) {
|
|
46
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
47
|
+
}
|
|
73
48
|
}
|
|
74
|
-
|
|
75
|
-
if (newValue !== oldValue)
|
|
76
|
-
this.
|
|
49
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
50
|
+
if (newValue !== oldValue) {
|
|
51
|
+
if (this.clientStylingUrl)
|
|
52
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
53
|
+
}
|
|
77
54
|
}
|
|
78
55
|
connectedCallback() {
|
|
79
56
|
if (this.translationUrl) {
|
|
@@ -84,51 +61,50 @@ export class GeneralInput {
|
|
|
84
61
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
85
62
|
}
|
|
86
63
|
componentDidLoad() {
|
|
64
|
+
this.handleClientStyling();
|
|
87
65
|
this.registrationWidgetLoaded.emit();
|
|
88
66
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (this.clientStyling)
|
|
95
|
-
this.setClientStyling();
|
|
96
|
-
if (this.clientStylingUrl)
|
|
97
|
-
this.setClientStylingURL();
|
|
98
|
-
this.limitStylingAppends = true;
|
|
99
|
-
}
|
|
67
|
+
}
|
|
68
|
+
handleClientStyling() {
|
|
69
|
+
if (window.emMessageBus !== undefined) {
|
|
70
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
71
|
+
return;
|
|
100
72
|
}
|
|
73
|
+
if (this.clientStyling)
|
|
74
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
75
|
+
if (this.clientStylingUrl)
|
|
76
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
101
77
|
}
|
|
102
78
|
renderInput() {
|
|
103
79
|
var _a;
|
|
104
80
|
switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
|
105
81
|
case 'text':
|
|
106
82
|
if (this.haspostalcodelookup && this.name === 'PostalCode') {
|
|
107
|
-
return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry });
|
|
83
|
+
return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry, "mb-source": this.mbSource });
|
|
108
84
|
}
|
|
109
85
|
else {
|
|
110
|
-
return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode });
|
|
86
|
+
return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
|
|
111
87
|
}
|
|
112
88
|
case 'email':
|
|
113
|
-
return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
89
|
+
return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
114
90
|
case 'number':
|
|
115
|
-
return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
91
|
+
return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
116
92
|
case 'checkbox':
|
|
117
|
-
return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
|
|
93
|
+
return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, "mb-source": this.mbSource });
|
|
118
94
|
case 'checkboxgroup':
|
|
119
|
-
return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
|
|
95
|
+
return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "mb-source": this.mbSource });
|
|
120
96
|
case 'togglecheckbox':
|
|
121
|
-
return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick });
|
|
97
|
+
return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick, "mb-source": this.mbSource });
|
|
122
98
|
case 'datetime':
|
|
123
|
-
return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput });
|
|
99
|
+
return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput, "mb-source": this.mbSource });
|
|
124
100
|
case 'password':
|
|
125
|
-
return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode });
|
|
101
|
+
return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
|
|
126
102
|
case 'radio':
|
|
127
|
-
return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling });
|
|
103
|
+
return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, "mb-source": this.mbSource });
|
|
128
104
|
case 'tel':
|
|
129
|
-
return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
105
|
+
return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
130
106
|
case 'dropdown':
|
|
131
|
-
return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
107
|
+
return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
132
108
|
case 'twofa':
|
|
133
109
|
return h("twofa-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, destination: this.twofaDestination, "resend-interval-seconds": this.twofaResendIntervalSeconds, "enable-south-african-mode": this.enableSouthAfricanMode, "pin-attempts-exceeded": this.pinAttemptsExceeded, "mb-source": this.mbSource });
|
|
134
110
|
case 'label':
|
|
@@ -143,7 +119,7 @@ export class GeneralInput {
|
|
|
143
119
|
}
|
|
144
120
|
}
|
|
145
121
|
render() {
|
|
146
|
-
return (h(Host, { key: '
|
|
122
|
+
return (h(Host, { key: '12e3e43442ba3fd4a47bbc5c05456eb019405b1e', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
|
|
147
123
|
}
|
|
148
124
|
static get is() { return "general-input"; }
|
|
149
125
|
static get encapsulation() { return "shadow"; }
|
|
@@ -686,11 +662,6 @@ export class GeneralInput {
|
|
|
686
662
|
}
|
|
687
663
|
};
|
|
688
664
|
}
|
|
689
|
-
static get states() {
|
|
690
|
-
return {
|
|
691
|
-
"limitStylingAppends": {}
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
665
|
static get events() {
|
|
695
666
|
return [{
|
|
696
667
|
"method": "registrationWidgetLoaded",
|
|
@@ -713,10 +684,10 @@ export class GeneralInput {
|
|
|
713
684
|
static get watchers() {
|
|
714
685
|
return [{
|
|
715
686
|
"propName": "clientStyling",
|
|
716
|
-
"methodName": "
|
|
687
|
+
"methodName": "handleClientStylingChange"
|
|
717
688
|
}, {
|
|
718
689
|
"propName": "clientStylingUrl",
|
|
719
|
-
"methodName": "
|
|
690
|
+
"methodName": "handleClientStylingChangeURL"
|
|
720
691
|
}];
|
|
721
692
|
}
|
|
722
693
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { translate } from "../../utils/locale.utils";
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
|
+
import { setClientStyling, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
5
|
export class NumberInput {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.validationPattern = '';
|
|
@@ -22,11 +23,6 @@ export class NumberInput {
|
|
|
22
23
|
this.errorMessage = this.setErrorMessage();
|
|
23
24
|
this.touched = true;
|
|
24
25
|
};
|
|
25
|
-
this.setClientStyling = () => {
|
|
26
|
-
let sheet = document.createElement('style');
|
|
27
|
-
sheet.innerHTML = this.clientStyling;
|
|
28
|
-
this.stylingContainer.prepend(sheet);
|
|
29
|
-
};
|
|
30
26
|
this.name = undefined;
|
|
31
27
|
this.displayName = undefined;
|
|
32
28
|
this.placeholder = undefined;
|
|
@@ -37,14 +33,15 @@ export class NumberInput {
|
|
|
37
33
|
this.language = undefined;
|
|
38
34
|
this.emitValue = undefined;
|
|
39
35
|
this.clientStyling = '';
|
|
36
|
+
this.mbSource = undefined;
|
|
40
37
|
this.errorMessage = undefined;
|
|
41
38
|
this.isValid = undefined;
|
|
42
|
-
this.limitStylingAppends = false;
|
|
43
39
|
this.showTooltip = false;
|
|
44
40
|
}
|
|
45
|
-
|
|
46
|
-
if (newValue !== oldValue)
|
|
47
|
-
this.
|
|
41
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
42
|
+
if (newValue !== oldValue) {
|
|
43
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
44
|
+
}
|
|
48
45
|
}
|
|
49
46
|
validityChanged() {
|
|
50
47
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -72,16 +69,17 @@ export class NumberInput {
|
|
|
72
69
|
connectedCallback() {
|
|
73
70
|
this.validationPattern = this.setPattern();
|
|
74
71
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
handleClientStyling() {
|
|
73
|
+
if (window.emMessageBus !== undefined) {
|
|
74
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (this.clientStyling) {
|
|
78
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
81
79
|
}
|
|
82
|
-
// end custom styling area
|
|
83
80
|
}
|
|
84
81
|
componentDidLoad() {
|
|
82
|
+
this.handleClientStyling();
|
|
85
83
|
this.isValid = this.setValidity();
|
|
86
84
|
if (this.defaultValue) {
|
|
87
85
|
this.value = this.defaultValue;
|
|
@@ -122,8 +120,8 @@ export class NumberInput {
|
|
|
122
120
|
if (this.touched) {
|
|
123
121
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
124
122
|
}
|
|
125
|
-
return h("div", { key: '
|
|
126
|
-
h("img", { key: '
|
|
123
|
+
return h("div", { key: 'bd11140dc6c8ddb6b800d4fe6544df733c5157c4', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'c8318c687bc471fc225b9aba52686e38ecb400de', class: 'number__wrapper--flex' }, h("label", { key: '7eaf64057ef71b07a0defc1e372fd85baab2bd68', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '99f4151f50a7fb0abb9a8e53bacc8c8bd303d659', class: 'number__wrapper--relative' }, this.tooltip &&
|
|
124
|
+
h("img", { key: '875d6284697dc06ac05c682509856faeade3d8be', class: 'number__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'f1f563567cde4a744c68e27ab91a3d795f596be6', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '0226f04a059fd8763822483de42bd7e647040bf3', class: 'number__error-message' }, this.errorMessage));
|
|
127
125
|
}
|
|
128
126
|
static get is() { return "number-input"; }
|
|
129
127
|
static get encapsulation() { return "shadow"; }
|
|
@@ -313,6 +311,23 @@ export class NumberInput {
|
|
|
313
311
|
"attribute": "client-styling",
|
|
314
312
|
"reflect": true,
|
|
315
313
|
"defaultValue": "''"
|
|
314
|
+
},
|
|
315
|
+
"mbSource": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"mutable": false,
|
|
318
|
+
"complexType": {
|
|
319
|
+
"original": "string",
|
|
320
|
+
"resolved": "string",
|
|
321
|
+
"references": {}
|
|
322
|
+
},
|
|
323
|
+
"required": false,
|
|
324
|
+
"optional": false,
|
|
325
|
+
"docs": {
|
|
326
|
+
"tags": [],
|
|
327
|
+
"text": "Client custom styling via message bus"
|
|
328
|
+
},
|
|
329
|
+
"attribute": "mb-source",
|
|
330
|
+
"reflect": true
|
|
316
331
|
}
|
|
317
332
|
};
|
|
318
333
|
}
|
|
@@ -320,7 +335,6 @@ export class NumberInput {
|
|
|
320
335
|
return {
|
|
321
336
|
"errorMessage": {},
|
|
322
337
|
"isValid": {},
|
|
323
|
-
"limitStylingAppends": {},
|
|
324
338
|
"showTooltip": {}
|
|
325
339
|
};
|
|
326
340
|
}
|
|
@@ -372,7 +386,7 @@ export class NumberInput {
|
|
|
372
386
|
static get watchers() {
|
|
373
387
|
return [{
|
|
374
388
|
"propName": "clientStyling",
|
|
375
|
-
"methodName": "
|
|
389
|
+
"methodName": "handleClientStylingChange"
|
|
376
390
|
}, {
|
|
377
391
|
"propName": "isValid",
|
|
378
392
|
"methodName": "validityChanged"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { translate, STATUS_ICONS, CONSTANTS } from "../../utils/locale.utils";
|
|
3
3
|
import tooltipIcon from "../../utils/tooltipIcon.svg";
|
|
4
|
+
import { setClientStyling, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
5
|
export class PasswordInput {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.touched = false;
|
|
@@ -36,11 +37,6 @@ export class PasswordInput {
|
|
|
36
37
|
this.showPopup = true;
|
|
37
38
|
this.calculateComplexity(this.value);
|
|
38
39
|
};
|
|
39
|
-
this.setClientStyling = () => {
|
|
40
|
-
let sheet = document.createElement('style');
|
|
41
|
-
sheet.innerHTML = this.clientStyling;
|
|
42
|
-
this.stylingContainer.prepend(sheet);
|
|
43
|
-
};
|
|
44
40
|
this.name = undefined;
|
|
45
41
|
this.displayName = undefined;
|
|
46
42
|
this.placeholder = undefined;
|
|
@@ -55,17 +51,18 @@ export class PasswordInput {
|
|
|
55
51
|
this.hidePasswordComplexity = false;
|
|
56
52
|
this.clientStyling = '';
|
|
57
53
|
this.enableSouthAfricanMode = undefined;
|
|
54
|
+
this.mbSource = undefined;
|
|
58
55
|
this.isValid = undefined;
|
|
59
56
|
this.errorMessage = undefined;
|
|
60
|
-
this.limitStylingAppends = false;
|
|
61
57
|
this.showTooltip = false;
|
|
62
58
|
this.passwordComplexity = undefined;
|
|
63
59
|
this.showPopup = undefined;
|
|
64
60
|
this.value = '';
|
|
65
61
|
}
|
|
66
|
-
|
|
67
|
-
if (newValue !== oldValue)
|
|
68
|
-
this.
|
|
62
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
63
|
+
if (newValue !== oldValue) {
|
|
64
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
65
|
+
}
|
|
69
66
|
}
|
|
70
67
|
validityChanged() {
|
|
71
68
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -126,16 +123,17 @@ export class PasswordInput {
|
|
|
126
123
|
this.showTooltip = false;
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
handleClientStyling() {
|
|
127
|
+
if (window.emMessageBus !== undefined) {
|
|
128
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (this.clientStyling) {
|
|
132
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
135
133
|
}
|
|
136
|
-
// end custom styling area
|
|
137
134
|
}
|
|
138
135
|
componentDidLoad() {
|
|
136
|
+
this.handleClientStyling();
|
|
139
137
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
140
138
|
this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
|
|
141
139
|
this.passwordButton.tabIndex = -1;
|
|
@@ -242,8 +240,8 @@ export class PasswordInput {
|
|
|
242
240
|
if (this.touched) {
|
|
243
241
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
244
242
|
}
|
|
245
|
-
return h("div", { key: '
|
|
246
|
-
h("img", { key: '
|
|
243
|
+
return h("div", { key: '18213d251639938165f3e4ad58bdc904fb953fe2', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '092c431b178682d0006cf6ad5c14b0a7e6fb5569', class: 'password__wrapper--flex' }, h("label", { key: '64c101b7d70305ecf09735234d902a6b33823551', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '189929eefa1caf71a1be39f0d663eef914d241d5', class: 'password__wrapper--relative' }, this.tooltip &&
|
|
244
|
+
h("img", { key: '95ee0d824b5be14ab4e62fc0b5f1731fe6ca5775', class: 'password__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: 'bf85dde83305233c566b1c50d0286548ba0f48a5', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && h("small", { key: '3acbe164ff532bcfcd9e4a237a6f352df0cfdc2d', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
|
|
247
245
|
this.showPopup &&
|
|
248
246
|
!this.hidePasswordComplexity &&
|
|
249
247
|
!this.isDuplicateInput &&
|
|
@@ -510,6 +508,23 @@ export class PasswordInput {
|
|
|
510
508
|
},
|
|
511
509
|
"attribute": "enable-south-african-mode",
|
|
512
510
|
"reflect": true
|
|
511
|
+
},
|
|
512
|
+
"mbSource": {
|
|
513
|
+
"type": "string",
|
|
514
|
+
"mutable": false,
|
|
515
|
+
"complexType": {
|
|
516
|
+
"original": "string",
|
|
517
|
+
"resolved": "string",
|
|
518
|
+
"references": {}
|
|
519
|
+
},
|
|
520
|
+
"required": false,
|
|
521
|
+
"optional": false,
|
|
522
|
+
"docs": {
|
|
523
|
+
"tags": [],
|
|
524
|
+
"text": "Client custom styling via message bus"
|
|
525
|
+
},
|
|
526
|
+
"attribute": "mb-source",
|
|
527
|
+
"reflect": true
|
|
513
528
|
}
|
|
514
529
|
};
|
|
515
530
|
}
|
|
@@ -517,7 +532,6 @@ export class PasswordInput {
|
|
|
517
532
|
return {
|
|
518
533
|
"isValid": {},
|
|
519
534
|
"errorMessage": {},
|
|
520
|
-
"limitStylingAppends": {},
|
|
521
535
|
"showTooltip": {},
|
|
522
536
|
"passwordComplexity": {},
|
|
523
537
|
"showPopup": {},
|
|
@@ -594,7 +608,7 @@ export class PasswordInput {
|
|
|
594
608
|
static get watchers() {
|
|
595
609
|
return [{
|
|
596
610
|
"propName": "clientStyling",
|
|
597
|
-
"methodName": "
|
|
611
|
+
"methodName": "handleClientStylingChange"
|
|
598
612
|
}, {
|
|
599
613
|
"propName": "isValid",
|
|
600
614
|
"methodName": "validityChanged"
|