@everymatrix/general-registration 1.90.6 → 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_15.cjs.entry.js +396 -393
- package/dist/cjs/general-registration.cjs.js +2 -2
- package/dist/cjs/{index-14a0d114.js → index-8c179fe3.js} +1 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/general-registration/general-registration.js +24 -49
- package/dist/esm/checkbox-group-input_15.entry.js +396 -393
- package/dist/esm/general-registration.js +3 -3
- package/dist/esm/{index-7dc4a1f4.js → index-7f9689f9.js} +1 -4
- package/dist/esm/loader.js +3 -3
- package/dist/general-registration/checkbox-group-input_15.entry.js +241 -241
- package/dist/general-registration/general-registration.esm.js +1 -1
- package/dist/general-registration/{index-7dc4a1f4.js → index-7f9689f9.js} +2 -2
- package/dist/types/components/general-registration/general-registration.d.ts +4 -6
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-8c179fe3.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE$1 = 'en';
|
|
8
8
|
const TRANSLATIONS$1 = {
|
|
@@ -378,6 +378,124 @@ const validateID = (id) => {
|
|
|
378
378
|
|
|
379
379
|
const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
|
|
380
380
|
|
|
381
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @name setClientStyling
|
|
385
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
386
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
387
|
+
* @param {string} clientStyling The style content
|
|
388
|
+
*/
|
|
389
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
390
|
+
if (stylingContainer) {
|
|
391
|
+
const sheet = document.createElement('style');
|
|
392
|
+
sheet.innerHTML = clientStyling;
|
|
393
|
+
stylingContainer.appendChild(sheet);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @name setClientStylingURL
|
|
399
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
400
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
401
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
402
|
+
*/
|
|
403
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
404
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
405
|
+
|
|
406
|
+
const url = new URL(clientStylingUrl);
|
|
407
|
+
|
|
408
|
+
fetch(url.href)
|
|
409
|
+
.then((res) => res.text())
|
|
410
|
+
.then((data) => {
|
|
411
|
+
const cssFile = document.createElement('style');
|
|
412
|
+
cssFile.innerHTML = data;
|
|
413
|
+
if (stylingContainer) {
|
|
414
|
+
stylingContainer.appendChild(cssFile);
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
.catch((err) => {
|
|
418
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @name setStreamLibrary
|
|
424
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
425
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
426
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
427
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
428
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
429
|
+
*/
|
|
430
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
431
|
+
if (!window.emMessageBus) return;
|
|
432
|
+
|
|
433
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
434
|
+
|
|
435
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
436
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
437
|
+
|
|
438
|
+
return subscription;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (!window[StyleCacheKey]) {
|
|
442
|
+
window[StyleCacheKey] = {};
|
|
443
|
+
}
|
|
444
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
445
|
+
|
|
446
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
447
|
+
const wrappedUnsubscribe = () => {
|
|
448
|
+
if (window[StyleCacheKey][domain]) {
|
|
449
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
450
|
+
cachedObject.refCount > 1
|
|
451
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
452
|
+
: delete window[StyleCacheKey][domain];
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
originalUnsubscribe();
|
|
456
|
+
};
|
|
457
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
458
|
+
|
|
459
|
+
return subscription;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
463
|
+
const sheet = document.createElement('style');
|
|
464
|
+
|
|
465
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
466
|
+
if (stylingContainer) {
|
|
467
|
+
sheet.innerHTML = data;
|
|
468
|
+
stylingContainer.appendChild(sheet);
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
474
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
475
|
+
if (!stylingContainer) return;
|
|
476
|
+
|
|
477
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
478
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
479
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
480
|
+
|
|
481
|
+
if (!cachedStyle) {
|
|
482
|
+
cachedStyle = new CSSStyleSheet();
|
|
483
|
+
cachedStyle.replaceSync(data);
|
|
484
|
+
cacheStyleObject[domain] = {
|
|
485
|
+
sheet: cachedStyle,
|
|
486
|
+
refCount: 1
|
|
487
|
+
};
|
|
488
|
+
} else {
|
|
489
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
493
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
494
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
|
|
381
499
|
const checkboxGroupInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}vaadin-checkbox-group{margin-top:5px;margin-left:40px}.checkboxgroup{font-family:\"Roboto\";font-style:normal;font-size:15px}.checkboxgroup__wrapper{position:relative}.checkboxgroup__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.checkboxgroup__wrapper--relative{position:relative;display:inline}.checkboxgroup__input{vertical-align:baseline}.checkboxgroup__input[indeterminate]::part(checkbox)::after,.checkboxgroup__input[indeterminate]::part(checkbox),.checkboxgroup__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emw--registration-typography, var(--emw--color-black, #000000));line-height:1.5;padding-left:10px;vertical-align:baseline}.checkboxgroup__label-text{font-size:16px}.checkboxgroup__label a{color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.checkboxgroup__tooltip-icon{width:16px;height:auto}.checkboxgroup__tooltip{position:absolute;top:0;right:0;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkboxgroup__tooltip.visible{opacity:1}.checkbox__input::part(checkbox){background-color:var(--emw--color-white, #FFFFFF);transform:scale(0.8, 0.8);border-radius:var(--emw--border-radius-small, 2px);box-shadow:0 0px 0px 2px var(--emw--color-gray, #7a7a7a)}.checkbox__input[indeterminate]::part(checkbox),.checkbox__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));box-shadow:none}";
|
|
382
500
|
const CheckboxGroupInputStyle0 = checkboxGroupInputCss;
|
|
383
501
|
|
|
@@ -387,11 +505,6 @@ const CheckboxGroupInput = class {
|
|
|
387
505
|
this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
|
|
388
506
|
this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
|
|
389
507
|
this.value = null;
|
|
390
|
-
this.setClientStyling = () => {
|
|
391
|
-
let sheet = document.createElement('style');
|
|
392
|
-
sheet.innerHTML = this.clientStyling;
|
|
393
|
-
this.stylingContainer.prepend(sheet);
|
|
394
|
-
};
|
|
395
508
|
this.name = undefined;
|
|
396
509
|
this.displayName = undefined;
|
|
397
510
|
this.defaultValue = '';
|
|
@@ -402,16 +515,17 @@ const CheckboxGroupInput = class {
|
|
|
402
515
|
this.language = undefined;
|
|
403
516
|
this.emitValue = undefined;
|
|
404
517
|
this.clientStyling = '';
|
|
518
|
+
this.mbSource = undefined;
|
|
405
519
|
this.errorMessage = undefined;
|
|
406
520
|
this.isValid = undefined;
|
|
407
|
-
this.limitStylingAppends = false;
|
|
408
521
|
this.showTooltip = false;
|
|
409
522
|
this.selectedValues = [];
|
|
410
523
|
this.showCheckboxes = false;
|
|
411
524
|
}
|
|
412
|
-
|
|
413
|
-
if (newValue !== oldValue)
|
|
414
|
-
this.
|
|
525
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
526
|
+
if (newValue !== oldValue) {
|
|
527
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
528
|
+
}
|
|
415
529
|
}
|
|
416
530
|
validityChanged() {
|
|
417
531
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -443,16 +557,17 @@ const CheckboxGroupInput = class {
|
|
|
443
557
|
this.showTooltip = false;
|
|
444
558
|
}
|
|
445
559
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
560
|
+
handleClientStyling() {
|
|
561
|
+
if (window.emMessageBus !== undefined) {
|
|
562
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (this.clientStyling) {
|
|
566
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
452
567
|
}
|
|
453
|
-
// end custom styling area
|
|
454
568
|
}
|
|
455
569
|
componentDidLoad() {
|
|
570
|
+
this.handleClientStyling();
|
|
456
571
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
457
572
|
// For now this input has no validation. Send isValid as true immediately.
|
|
458
573
|
//@TODO: add validation logic to it, if business reason arises.
|
|
@@ -489,14 +604,14 @@ const CheckboxGroupInput = class {
|
|
|
489
604
|
return (index.h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, index.h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
|
|
490
605
|
}
|
|
491
606
|
render() {
|
|
492
|
-
return index.h("div", { key: '
|
|
493
|
-
index.h("img", { key: '
|
|
607
|
+
return index.h("div", { key: '342900ae923094f2746fd43917743d01efba942e', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '8f3b470274047b355741b438a4e15c7c46504f5a', class: 'checkboxgroup__wrapper--flex' }, index.h("vaadin-checkbox", { key: 'c7a74f9da877304f4d71607d58eba90dd0a29de7', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
|
|
608
|
+
index.h("img", { key: '75d807ad544e043a2e3beed46bf0c7dfa2125324', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("small", { key: '4b17e1e613c7561fb3c99f334926544ef2ba787a', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (index.h("vaadin-checkbox-group", { key: '9a8d573a7cb48bb2d68cceec5f39f1e0886ea05f', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
|
|
494
609
|
this.selectedValues = event.detail.value;
|
|
495
610
|
} }, this.options.map((checkbox) => index.h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName })))));
|
|
496
611
|
}
|
|
497
612
|
get element() { return index.getElement(this); }
|
|
498
613
|
static get watchers() { return {
|
|
499
|
-
"clientStyling": ["
|
|
614
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
500
615
|
"isValid": ["validityChanged"],
|
|
501
616
|
"selectedValues": ["setValue"],
|
|
502
617
|
"emitValue": ["emitValueHandler"]
|
|
@@ -513,11 +628,6 @@ const CheckboxInput = class {
|
|
|
513
628
|
this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
|
|
514
629
|
this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
|
|
515
630
|
this.value = '';
|
|
516
|
-
this.setClientStyling = () => {
|
|
517
|
-
let sheet = document.createElement('style');
|
|
518
|
-
sheet.innerHTML = this.clientStyling;
|
|
519
|
-
this.stylingContainer.prepend(sheet);
|
|
520
|
-
};
|
|
521
631
|
this.name = undefined;
|
|
522
632
|
this.displayName = undefined;
|
|
523
633
|
this.defaultValue = '';
|
|
@@ -527,14 +637,15 @@ const CheckboxInput = class {
|
|
|
527
637
|
this.language = undefined;
|
|
528
638
|
this.emitValue = undefined;
|
|
529
639
|
this.clientStyling = '';
|
|
640
|
+
this.mbSource = undefined;
|
|
530
641
|
this.errorMessage = undefined;
|
|
531
642
|
this.isValid = undefined;
|
|
532
|
-
this.limitStylingAppends = false;
|
|
533
643
|
this.showTooltip = false;
|
|
534
644
|
}
|
|
535
|
-
|
|
536
|
-
if (newValue !== oldValue)
|
|
537
|
-
this.
|
|
645
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
646
|
+
if (newValue !== oldValue) {
|
|
647
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
648
|
+
}
|
|
538
649
|
}
|
|
539
650
|
validityChanged() {
|
|
540
651
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -559,16 +670,17 @@ const CheckboxInput = class {
|
|
|
559
670
|
this.showTooltip = false;
|
|
560
671
|
}
|
|
561
672
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
673
|
+
handleClientStyling() {
|
|
674
|
+
if (window.emMessageBus !== undefined) {
|
|
675
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
if (this.clientStyling) {
|
|
679
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
568
680
|
}
|
|
569
|
-
// end custom styling area
|
|
570
681
|
}
|
|
571
682
|
componentDidLoad() {
|
|
683
|
+
this.handleClientStyling();
|
|
572
684
|
this.inputReference = this.vaadinCheckbox.querySelector('input');
|
|
573
685
|
if (this.defaultValue) {
|
|
574
686
|
this.value = this.defaultValue;
|
|
@@ -603,10 +715,10 @@ const CheckboxInput = class {
|
|
|
603
715
|
return null;
|
|
604
716
|
}
|
|
605
717
|
render() {
|
|
606
|
-
return (index.h("div", { key: '
|
|
718
|
+
return (index.h("div", { key: 'a8d8bf6aa2001b6aee44d728a198244819ae169e', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, index.h("vaadin-checkbox", { key: '13a5589a78bef4277922535e59c5718d36b1f318', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (index.h("img", { key: '008bb9a318c914b4b40e80b15080f7f174cc1262', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
|
|
607
719
|
}
|
|
608
720
|
static get watchers() { return {
|
|
609
|
-
"clientStyling": ["
|
|
721
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
610
722
|
"isValid": ["validityChanged"],
|
|
611
723
|
"emitValue": ["emitValueHandler"]
|
|
612
724
|
}; }
|
|
@@ -5997,11 +6109,6 @@ const DateInput = class {
|
|
|
5997
6109
|
const date = parse(inputValue, this.dateFormat, new Date());
|
|
5998
6110
|
return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
|
|
5999
6111
|
};
|
|
6000
|
-
this.setClientStyling = () => {
|
|
6001
|
-
let sheet = document.createElement('style');
|
|
6002
|
-
sheet.innerHTML = this.clientStyling;
|
|
6003
|
-
this.stylingContainer.prepend(sheet);
|
|
6004
|
-
};
|
|
6005
6112
|
this.handleDocumentIdUpdate = (e) => {
|
|
6006
6113
|
if (this.name !== CONSTANTS.BIRTHDATE) {
|
|
6007
6114
|
return;
|
|
@@ -6088,9 +6195,9 @@ const DateInput = class {
|
|
|
6088
6195
|
this.emitOnClick = false;
|
|
6089
6196
|
this.enableSouthAfricanMode = undefined;
|
|
6090
6197
|
this.enableManualDateInput = false;
|
|
6198
|
+
this.mbSource = undefined;
|
|
6091
6199
|
this.errorMessage = undefined;
|
|
6092
6200
|
this.isValid = undefined;
|
|
6093
|
-
this.limitStylingAppends = false;
|
|
6094
6201
|
this.showTooltip = false;
|
|
6095
6202
|
}
|
|
6096
6203
|
get formattedValue() {
|
|
@@ -6099,9 +6206,10 @@ const DateInput = class {
|
|
|
6099
6206
|
const parsedDate = parse(this.value, 'yyyy-MM-dd', new Date());
|
|
6100
6207
|
return format(parsedDate, this.dateFormat);
|
|
6101
6208
|
}
|
|
6102
|
-
|
|
6103
|
-
if (newValue !== oldValue)
|
|
6104
|
-
this.
|
|
6209
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
6210
|
+
if (newValue !== oldValue) {
|
|
6211
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6212
|
+
}
|
|
6105
6213
|
}
|
|
6106
6214
|
validityChanged() {
|
|
6107
6215
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -6139,17 +6247,18 @@ const DateInput = class {
|
|
|
6139
6247
|
this.minDate = parse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
|
|
6140
6248
|
this.maxDate = parse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
|
|
6141
6249
|
}
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6250
|
+
handleClientStyling() {
|
|
6251
|
+
if (window.emMessageBus !== undefined) {
|
|
6252
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
6253
|
+
return;
|
|
6254
|
+
}
|
|
6255
|
+
if (this.clientStyling) {
|
|
6256
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6148
6257
|
}
|
|
6149
|
-
// end custom styling area
|
|
6150
6258
|
}
|
|
6151
6259
|
componentDidLoad() {
|
|
6152
6260
|
var _a;
|
|
6261
|
+
this.handleClientStyling();
|
|
6153
6262
|
this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
|
|
6154
6263
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
6155
6264
|
if (this.datePicker) {
|
|
@@ -6304,12 +6413,12 @@ const DateInput = class {
|
|
|
6304
6413
|
if (this.touched) {
|
|
6305
6414
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
6306
6415
|
}
|
|
6307
|
-
return index.h("div", { key: '
|
|
6308
|
-
index.h("img", { key: '
|
|
6416
|
+
return index.h("div", { key: 'ffff8be16fb22a41ea8c5168a79e40b9f410c63b', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("label", { key: '60da1ad0bc4cc7757e6f1096866667a97bd146b5', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, index.h("span", { key: '450b4638efa34f4490035b0d99b0b186f053a2d0', class: this.validation.mandatory ? 'date__label--required' : '' })), index.h("vaadin-date-picker", { key: '421875a710bb4508e3218d28bf2c28dcd0e9793b', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), index.h("small", { key: '33a6fed8057a84cb648f94a318c3ec0b1e495fff', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
|
|
6417
|
+
index.h("img", { key: 'd91fcd13e1ae384b67b6d478834b65136ab77b77', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
6309
6418
|
}
|
|
6310
6419
|
get element() { return index.getElement(this); }
|
|
6311
6420
|
static get watchers() { return {
|
|
6312
|
-
"clientStyling": ["
|
|
6421
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
6313
6422
|
"isValid": ["validityChanged"],
|
|
6314
6423
|
"emitValue": ["emitValueHandler"],
|
|
6315
6424
|
"enableSouthAfricanMode": ["handleCustomRegistrationChange"]
|
|
@@ -6344,11 +6453,6 @@ const EmailInput = class {
|
|
|
6344
6453
|
this.errorMessage = this.setErrorMessage();
|
|
6345
6454
|
this.touched = true;
|
|
6346
6455
|
};
|
|
6347
|
-
this.setClientStyling = () => {
|
|
6348
|
-
let sheet = document.createElement('style');
|
|
6349
|
-
sheet.innerHTML = this.clientStyling;
|
|
6350
|
-
this.stylingContainer.prepend(sheet);
|
|
6351
|
-
};
|
|
6352
6456
|
this.name = undefined;
|
|
6353
6457
|
this.displayName = undefined;
|
|
6354
6458
|
this.placeholder = undefined;
|
|
@@ -6360,14 +6464,15 @@ const EmailInput = class {
|
|
|
6360
6464
|
this.emitValue = undefined;
|
|
6361
6465
|
this.isDuplicateInput = undefined;
|
|
6362
6466
|
this.clientStyling = '';
|
|
6467
|
+
this.mbSource = undefined;
|
|
6363
6468
|
this.errorMessage = undefined;
|
|
6364
6469
|
this.isValid = undefined;
|
|
6365
|
-
this.limitStylingAppends = false;
|
|
6366
6470
|
this.showTooltip = false;
|
|
6367
6471
|
}
|
|
6368
|
-
|
|
6369
|
-
if (newValue !== oldValue)
|
|
6370
|
-
this.
|
|
6472
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
6473
|
+
if (newValue !== oldValue) {
|
|
6474
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6475
|
+
}
|
|
6371
6476
|
}
|
|
6372
6477
|
validityChanged() {
|
|
6373
6478
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -6402,16 +6507,17 @@ const EmailInput = class {
|
|
|
6402
6507
|
connectedCallback() {
|
|
6403
6508
|
this.validationPattern = this.setPattern();
|
|
6404
6509
|
}
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6510
|
+
handleClientStyling() {
|
|
6511
|
+
if (window.emMessageBus !== undefined) {
|
|
6512
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
6513
|
+
return;
|
|
6514
|
+
}
|
|
6515
|
+
if (this.clientStyling) {
|
|
6516
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6411
6517
|
}
|
|
6412
|
-
// end custom styling area
|
|
6413
6518
|
}
|
|
6414
6519
|
componentDidLoad() {
|
|
6520
|
+
this.handleClientStyling();
|
|
6415
6521
|
this.isValid = this.setValidity();
|
|
6416
6522
|
if (this.defaultValue) {
|
|
6417
6523
|
this.value = this.defaultValue;
|
|
@@ -6457,11 +6563,11 @@ const EmailInput = class {
|
|
|
6457
6563
|
if (this.touched) {
|
|
6458
6564
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
6459
6565
|
}
|
|
6460
|
-
return index.h("div", { key: '
|
|
6461
|
-
index.h("img", { key: '
|
|
6566
|
+
return index.h("div", { key: 'f852525fe8d8b695e638fdd83e8b0c2c20d98771', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'd6a6dec4e76ba1fbe15bed09f82cecde12cabe1a', class: 'email__wrapper--flex' }, index.h("label", { key: '4498ae1bac287cb80544c4d743afad2ec678e3bd', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'e54d1258e48f54304a553cffb83466e4a4fadb4c', class: 'email__wrapper--relative' }, this.tooltip &&
|
|
6567
|
+
index.h("img", { key: '29d7b95f22c8cb70d505f74a7ea18284faa908ee', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.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 }), index.h("small", { key: '3024a57f5d0897f34013eb4397d78babc2333192', class: 'email__error-message' }, this.errorMessage));
|
|
6462
6568
|
}
|
|
6463
6569
|
static get watchers() { return {
|
|
6464
|
-
"clientStyling": ["
|
|
6570
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
6465
6571
|
"isValid": ["validityChanged"],
|
|
6466
6572
|
"emitValue": ["emitValueHandler"]
|
|
6467
6573
|
}; }
|
|
@@ -13135,32 +13241,6 @@ const GeneralInput = class {
|
|
|
13135
13241
|
constructor(hostRef) {
|
|
13136
13242
|
index.registerInstance(this, hostRef);
|
|
13137
13243
|
this.registrationWidgetLoaded = index.createEvent(this, "registrationWidgetLoaded", 7);
|
|
13138
|
-
this.setClientStyling = () => {
|
|
13139
|
-
let sheet = document.createElement('style');
|
|
13140
|
-
sheet.innerHTML = this.clientStyling;
|
|
13141
|
-
this.host.shadowRoot.prepend(sheet);
|
|
13142
|
-
};
|
|
13143
|
-
this.setStreamStyling = (domain) => {
|
|
13144
|
-
if (window.emMessageBus) {
|
|
13145
|
-
const sheet = document.createElement('style');
|
|
13146
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
13147
|
-
sheet.innerHTML = data;
|
|
13148
|
-
this.clientStyling = data;
|
|
13149
|
-
this.host.shadowRoot.prepend(sheet);
|
|
13150
|
-
});
|
|
13151
|
-
}
|
|
13152
|
-
};
|
|
13153
|
-
this.setClientStylingURL = () => {
|
|
13154
|
-
let url = new URL(this.clientStylingUrl);
|
|
13155
|
-
let cssFile = document.createElement('style');
|
|
13156
|
-
fetch(url.href)
|
|
13157
|
-
.then((res) => res.text())
|
|
13158
|
-
.then((data) => {
|
|
13159
|
-
cssFile.innerHTML = data;
|
|
13160
|
-
this.clientStyling = data;
|
|
13161
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
13162
|
-
});
|
|
13163
|
-
};
|
|
13164
13244
|
this.handleClick = (event) => {
|
|
13165
13245
|
if (this.emitOnClick) {
|
|
13166
13246
|
event.stopPropagation();
|
|
@@ -13197,15 +13277,17 @@ const GeneralInput = class {
|
|
|
13197
13277
|
this.enableManualDateInput = false;
|
|
13198
13278
|
this.pinAttemptsExceeded = undefined;
|
|
13199
13279
|
this.mbSource = undefined;
|
|
13200
|
-
this.limitStylingAppends = false;
|
|
13201
13280
|
}
|
|
13202
|
-
|
|
13203
|
-
if (newValue !== oldValue)
|
|
13204
|
-
this.
|
|
13281
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13282
|
+
if (newValue !== oldValue) {
|
|
13283
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13284
|
+
}
|
|
13205
13285
|
}
|
|
13206
|
-
|
|
13207
|
-
if (newValue !== oldValue)
|
|
13208
|
-
this.
|
|
13286
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
13287
|
+
if (newValue !== oldValue) {
|
|
13288
|
+
if (this.clientStylingUrl)
|
|
13289
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
13290
|
+
}
|
|
13209
13291
|
}
|
|
13210
13292
|
connectedCallback() {
|
|
13211
13293
|
if (this.translationUrl) {
|
|
@@ -13216,51 +13298,50 @@ const GeneralInput = class {
|
|
|
13216
13298
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
13217
13299
|
}
|
|
13218
13300
|
componentDidLoad() {
|
|
13301
|
+
this.handleClientStyling();
|
|
13219
13302
|
this.registrationWidgetLoaded.emit();
|
|
13220
13303
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
}
|
|
13225
|
-
|
|
13226
|
-
if (this.clientStyling)
|
|
13227
|
-
this.setClientStyling();
|
|
13228
|
-
if (this.clientStylingUrl)
|
|
13229
|
-
this.setClientStylingURL();
|
|
13230
|
-
this.limitStylingAppends = true;
|
|
13231
|
-
}
|
|
13304
|
+
}
|
|
13305
|
+
handleClientStyling() {
|
|
13306
|
+
if (window.emMessageBus !== undefined) {
|
|
13307
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
13308
|
+
return;
|
|
13232
13309
|
}
|
|
13310
|
+
if (this.clientStyling)
|
|
13311
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13312
|
+
if (this.clientStylingUrl)
|
|
13313
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
13233
13314
|
}
|
|
13234
13315
|
renderInput() {
|
|
13235
13316
|
var _a;
|
|
13236
13317
|
switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
|
13237
13318
|
case 'text':
|
|
13238
13319
|
if (this.haspostalcodelookup && this.name === 'PostalCode') {
|
|
13239
|
-
return index.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 });
|
|
13320
|
+
return index.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 });
|
|
13240
13321
|
}
|
|
13241
13322
|
else {
|
|
13242
|
-
return index.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 });
|
|
13323
|
+
return index.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 });
|
|
13243
13324
|
}
|
|
13244
13325
|
case 'email':
|
|
13245
|
-
return index.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 });
|
|
13326
|
+
return index.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 });
|
|
13246
13327
|
case 'number':
|
|
13247
|
-
return index.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 });
|
|
13328
|
+
return index.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 });
|
|
13248
13329
|
case 'checkbox':
|
|
13249
|
-
return index.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 });
|
|
13330
|
+
return index.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 });
|
|
13250
13331
|
case 'checkboxgroup':
|
|
13251
|
-
return index.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 });
|
|
13332
|
+
return index.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 });
|
|
13252
13333
|
case 'togglecheckbox':
|
|
13253
|
-
return index.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 });
|
|
13334
|
+
return index.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 });
|
|
13254
13335
|
case 'datetime':
|
|
13255
|
-
return index.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 });
|
|
13336
|
+
return index.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 });
|
|
13256
13337
|
case 'password':
|
|
13257
|
-
return index.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 });
|
|
13338
|
+
return index.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 });
|
|
13258
13339
|
case 'radio':
|
|
13259
|
-
return index.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 });
|
|
13340
|
+
return index.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 });
|
|
13260
13341
|
case 'tel':
|
|
13261
|
-
return index.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 });
|
|
13342
|
+
return index.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 });
|
|
13262
13343
|
case 'dropdown':
|
|
13263
|
-
return index.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 });
|
|
13344
|
+
return index.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 });
|
|
13264
13345
|
case 'twofa':
|
|
13265
13346
|
return index.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 });
|
|
13266
13347
|
case 'label':
|
|
@@ -13275,12 +13356,12 @@ const GeneralInput = class {
|
|
|
13275
13356
|
}
|
|
13276
13357
|
}
|
|
13277
13358
|
render() {
|
|
13278
|
-
return (index.h(index.Host, { key: '
|
|
13359
|
+
return (index.h(index.Host, { key: '12e3e43442ba3fd4a47bbc5c05456eb019405b1e', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
|
|
13279
13360
|
}
|
|
13280
13361
|
get host() { return index.getElement(this); }
|
|
13281
13362
|
static get watchers() { return {
|
|
13282
|
-
"clientStyling": ["
|
|
13283
|
-
"clientStylingUrl": ["
|
|
13363
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
13364
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
13284
13365
|
}; }
|
|
13285
13366
|
};
|
|
13286
13367
|
GeneralInput.style = GeneralInputStyle0;
|
|
@@ -14438,32 +14519,6 @@ const GeneralRegistration = class {
|
|
|
14438
14519
|
this.getIgnoreCountry = (input) => {
|
|
14439
14520
|
return input.name === 'PostalCode' && this.haspostalcodelookup && !this.listOfInputs.some(i => i.name === 'CountryCode');
|
|
14440
14521
|
};
|
|
14441
|
-
this.setClientStyling = () => {
|
|
14442
|
-
let sheet = document.createElement('style');
|
|
14443
|
-
sheet.innerHTML = this.clientStyling;
|
|
14444
|
-
this.host.shadowRoot.prepend(sheet);
|
|
14445
|
-
};
|
|
14446
|
-
this.setClientStylingURL = () => {
|
|
14447
|
-
let url = new URL(this.clientStylingUrl);
|
|
14448
|
-
let cssFile = document.createElement('style');
|
|
14449
|
-
fetch(url.href)
|
|
14450
|
-
.then((res) => res.text())
|
|
14451
|
-
.then((data) => {
|
|
14452
|
-
cssFile.innerHTML = data;
|
|
14453
|
-
this.clientStyling = data;
|
|
14454
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
14455
|
-
});
|
|
14456
|
-
};
|
|
14457
|
-
this.setStreamStyling = (domain) => {
|
|
14458
|
-
if (window.emMessageBus) {
|
|
14459
|
-
const sheet = document.createElement('style');
|
|
14460
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
14461
|
-
sheet.innerHTML = data;
|
|
14462
|
-
this.clientStyling = data;
|
|
14463
|
-
this.host.shadowRoot.prepend(sheet);
|
|
14464
|
-
});
|
|
14465
|
-
}
|
|
14466
|
-
};
|
|
14467
14522
|
// handles sending a custom event for initial interaction with the registration form
|
|
14468
14523
|
this.handleInitialClick = (e) => {
|
|
14469
14524
|
if (!this.isInitalInteraction)
|
|
@@ -14492,7 +14547,6 @@ const GeneralRegistration = class {
|
|
|
14492
14547
|
this.isLoadingPOST = false;
|
|
14493
14548
|
this.registrationStep = '';
|
|
14494
14549
|
this.forms = {};
|
|
14495
|
-
this.limitStylingAppends = false;
|
|
14496
14550
|
this.autofilled = false;
|
|
14497
14551
|
this.isInitalInteraction = true;
|
|
14498
14552
|
this.addresses = [];
|
|
@@ -14502,13 +14556,16 @@ const GeneralRegistration = class {
|
|
|
14502
14556
|
this.registrationStepUpdated.emit(this.registrationStep);
|
|
14503
14557
|
window.postMessage({ type: 'registrationStepUpdated', step: this.registrationStep }, window.location.href);
|
|
14504
14558
|
}
|
|
14505
|
-
|
|
14506
|
-
if (newValue !== oldValue)
|
|
14507
|
-
this.
|
|
14559
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14560
|
+
if (newValue !== oldValue) {
|
|
14561
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14562
|
+
}
|
|
14508
14563
|
}
|
|
14509
|
-
|
|
14510
|
-
if (newValue !== oldValue)
|
|
14511
|
-
this.
|
|
14564
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
14565
|
+
if (newValue !== oldValue) {
|
|
14566
|
+
if (this.clientStylingUrl)
|
|
14567
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
14568
|
+
}
|
|
14512
14569
|
}
|
|
14513
14570
|
setFormValidity() {
|
|
14514
14571
|
this.errorMessage = '';
|
|
@@ -14687,21 +14744,20 @@ const GeneralRegistration = class {
|
|
|
14687
14744
|
console.error(err);
|
|
14688
14745
|
});
|
|
14689
14746
|
}
|
|
14747
|
+
handleClientStyling() {
|
|
14748
|
+
if (window.emMessageBus !== undefined) {
|
|
14749
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14750
|
+
return;
|
|
14751
|
+
}
|
|
14752
|
+
if (this.clientStyling)
|
|
14753
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14754
|
+
if (this.clientStylingUrl)
|
|
14755
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
14756
|
+
}
|
|
14690
14757
|
componentDidLoad() {
|
|
14691
14758
|
this.registrationWidgetLoaded.emit();
|
|
14692
14759
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
14693
|
-
|
|
14694
|
-
if (window.emMessageBus != undefined) {
|
|
14695
|
-
this.setStreamStyling(`${this.mbSource}.Style`);
|
|
14696
|
-
}
|
|
14697
|
-
else {
|
|
14698
|
-
if (this.clientStyling)
|
|
14699
|
-
this.setClientStyling();
|
|
14700
|
-
if (this.clientStylingUrl)
|
|
14701
|
-
this.setClientStylingURL();
|
|
14702
|
-
this.limitStylingAppends = true;
|
|
14703
|
-
}
|
|
14704
|
-
}
|
|
14760
|
+
this.handleClientStyling();
|
|
14705
14761
|
}
|
|
14706
14762
|
disconnectedCallback() {
|
|
14707
14763
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
@@ -15440,13 +15496,13 @@ const GeneralRegistration = class {
|
|
|
15440
15496
|
else if (!this.isLoading && this.registerErrors) {
|
|
15441
15497
|
return this.renderErrorMessage(this.errorMessage);
|
|
15442
15498
|
}
|
|
15443
|
-
return (index.h("div", { class: `registration registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
|
|
15499
|
+
return (index.h("div", { ref: (el) => (this.stylingContainer = el), class: `registration registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
|
|
15444
15500
|
}
|
|
15445
15501
|
get host() { return index.getElement(this); }
|
|
15446
15502
|
static get watchers() { return {
|
|
15447
15503
|
"registrationStep": ["sendStep"],
|
|
15448
|
-
"clientStyling": ["
|
|
15449
|
-
"clientStylingUrl": ["
|
|
15504
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
15505
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"],
|
|
15450
15506
|
"forms": ["setFormValidity"],
|
|
15451
15507
|
"btag": ["addBtag"]
|
|
15452
15508
|
}; }
|
|
@@ -15480,11 +15536,6 @@ const NumberInput = class {
|
|
|
15480
15536
|
this.errorMessage = this.setErrorMessage();
|
|
15481
15537
|
this.touched = true;
|
|
15482
15538
|
};
|
|
15483
|
-
this.setClientStyling = () => {
|
|
15484
|
-
let sheet = document.createElement('style');
|
|
15485
|
-
sheet.innerHTML = this.clientStyling;
|
|
15486
|
-
this.stylingContainer.prepend(sheet);
|
|
15487
|
-
};
|
|
15488
15539
|
this.name = undefined;
|
|
15489
15540
|
this.displayName = undefined;
|
|
15490
15541
|
this.placeholder = undefined;
|
|
@@ -15495,14 +15546,15 @@ const NumberInput = class {
|
|
|
15495
15546
|
this.language = undefined;
|
|
15496
15547
|
this.emitValue = undefined;
|
|
15497
15548
|
this.clientStyling = '';
|
|
15549
|
+
this.mbSource = undefined;
|
|
15498
15550
|
this.errorMessage = undefined;
|
|
15499
15551
|
this.isValid = undefined;
|
|
15500
|
-
this.limitStylingAppends = false;
|
|
15501
15552
|
this.showTooltip = false;
|
|
15502
15553
|
}
|
|
15503
|
-
|
|
15504
|
-
if (newValue !== oldValue)
|
|
15505
|
-
this.
|
|
15554
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
15555
|
+
if (newValue !== oldValue) {
|
|
15556
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15557
|
+
}
|
|
15506
15558
|
}
|
|
15507
15559
|
validityChanged() {
|
|
15508
15560
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -15530,16 +15582,17 @@ const NumberInput = class {
|
|
|
15530
15582
|
connectedCallback() {
|
|
15531
15583
|
this.validationPattern = this.setPattern();
|
|
15532
15584
|
}
|
|
15533
|
-
|
|
15534
|
-
|
|
15535
|
-
|
|
15536
|
-
|
|
15537
|
-
|
|
15538
|
-
|
|
15585
|
+
handleClientStyling() {
|
|
15586
|
+
if (window.emMessageBus !== undefined) {
|
|
15587
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
15588
|
+
return;
|
|
15589
|
+
}
|
|
15590
|
+
if (this.clientStyling) {
|
|
15591
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15539
15592
|
}
|
|
15540
|
-
// end custom styling area
|
|
15541
15593
|
}
|
|
15542
15594
|
componentDidLoad() {
|
|
15595
|
+
this.handleClientStyling();
|
|
15543
15596
|
this.isValid = this.setValidity();
|
|
15544
15597
|
if (this.defaultValue) {
|
|
15545
15598
|
this.value = this.defaultValue;
|
|
@@ -15580,11 +15633,11 @@ const NumberInput = class {
|
|
|
15580
15633
|
if (this.touched) {
|
|
15581
15634
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
15582
15635
|
}
|
|
15583
|
-
return index.h("div", { key: '
|
|
15584
|
-
index.h("img", { key: '
|
|
15636
|
+
return index.h("div", { key: 'bd11140dc6c8ddb6b800d4fe6544df733c5157c4', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'c8318c687bc471fc225b9aba52686e38ecb400de', class: 'number__wrapper--flex' }, index.h("label", { key: '7eaf64057ef71b07a0defc1e372fd85baab2bd68', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '99f4151f50a7fb0abb9a8e53bacc8c8bd303d659', class: 'number__wrapper--relative' }, this.tooltip &&
|
|
15637
|
+
index.h("img", { key: '875d6284697dc06ac05c682509856faeade3d8be', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.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 }), index.h("small", { key: '0226f04a059fd8763822483de42bd7e647040bf3', class: 'number__error-message' }, this.errorMessage));
|
|
15585
15638
|
}
|
|
15586
15639
|
static get watchers() { return {
|
|
15587
|
-
"clientStyling": ["
|
|
15640
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
15588
15641
|
"isValid": ["validityChanged"],
|
|
15589
15642
|
"emitValue": ["emitValueHandler"]
|
|
15590
15643
|
}; }
|
|
@@ -15633,11 +15686,6 @@ const PasswordInput = class {
|
|
|
15633
15686
|
this.showPopup = true;
|
|
15634
15687
|
this.calculateComplexity(this.value);
|
|
15635
15688
|
};
|
|
15636
|
-
this.setClientStyling = () => {
|
|
15637
|
-
let sheet = document.createElement('style');
|
|
15638
|
-
sheet.innerHTML = this.clientStyling;
|
|
15639
|
-
this.stylingContainer.prepend(sheet);
|
|
15640
|
-
};
|
|
15641
15689
|
this.name = undefined;
|
|
15642
15690
|
this.displayName = undefined;
|
|
15643
15691
|
this.placeholder = undefined;
|
|
@@ -15652,17 +15700,18 @@ const PasswordInput = class {
|
|
|
15652
15700
|
this.hidePasswordComplexity = false;
|
|
15653
15701
|
this.clientStyling = '';
|
|
15654
15702
|
this.enableSouthAfricanMode = undefined;
|
|
15703
|
+
this.mbSource = undefined;
|
|
15655
15704
|
this.isValid = undefined;
|
|
15656
15705
|
this.errorMessage = undefined;
|
|
15657
|
-
this.limitStylingAppends = false;
|
|
15658
15706
|
this.showTooltip = false;
|
|
15659
15707
|
this.passwordComplexity = undefined;
|
|
15660
15708
|
this.showPopup = undefined;
|
|
15661
15709
|
this.value = '';
|
|
15662
15710
|
}
|
|
15663
|
-
|
|
15664
|
-
if (newValue !== oldValue)
|
|
15665
|
-
this.
|
|
15711
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
15712
|
+
if (newValue !== oldValue) {
|
|
15713
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15714
|
+
}
|
|
15666
15715
|
}
|
|
15667
15716
|
validityChanged() {
|
|
15668
15717
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -15723,16 +15772,17 @@ const PasswordInput = class {
|
|
|
15723
15772
|
this.showTooltip = false;
|
|
15724
15773
|
}
|
|
15725
15774
|
}
|
|
15726
|
-
|
|
15727
|
-
|
|
15728
|
-
|
|
15729
|
-
|
|
15730
|
-
|
|
15731
|
-
|
|
15775
|
+
handleClientStyling() {
|
|
15776
|
+
if (window.emMessageBus !== undefined) {
|
|
15777
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
15778
|
+
return;
|
|
15779
|
+
}
|
|
15780
|
+
if (this.clientStyling) {
|
|
15781
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15732
15782
|
}
|
|
15733
|
-
// end custom styling area
|
|
15734
15783
|
}
|
|
15735
15784
|
componentDidLoad() {
|
|
15785
|
+
this.handleClientStyling();
|
|
15736
15786
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
15737
15787
|
this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
|
|
15738
15788
|
this.passwordButton.tabIndex = -1;
|
|
@@ -15839,8 +15889,8 @@ const PasswordInput = class {
|
|
|
15839
15889
|
if (this.touched) {
|
|
15840
15890
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
15841
15891
|
}
|
|
15842
|
-
return index.h("div", { key: '
|
|
15843
|
-
index.h("img", { key: '
|
|
15892
|
+
return index.h("div", { key: '18213d251639938165f3e4ad58bdc904fb953fe2', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '092c431b178682d0006cf6ad5c14b0a7e6fb5569', class: 'password__wrapper--flex' }, index.h("label", { key: '64c101b7d70305ecf09735234d902a6b33823551', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '189929eefa1caf71a1be39f0d663eef914d241d5', class: 'password__wrapper--relative' }, this.tooltip &&
|
|
15893
|
+
index.h("img", { key: '95ee0d824b5be14ab4e62fc0b5f1731fe6ca5775', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.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 && index.h("small", { key: '3acbe164ff532bcfcd9e4a237a6f352df0cfdc2d', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
|
|
15844
15894
|
this.showPopup &&
|
|
15845
15895
|
!this.hidePasswordComplexity &&
|
|
15846
15896
|
!this.isDuplicateInput &&
|
|
@@ -15850,7 +15900,7 @@ const PasswordInput = class {
|
|
|
15850
15900
|
}
|
|
15851
15901
|
get element() { return index.getElement(this); }
|
|
15852
15902
|
static get watchers() { return {
|
|
15853
|
-
"clientStyling": ["
|
|
15903
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
15854
15904
|
"isValid": ["validityChanged"],
|
|
15855
15905
|
"value": ["valueChanged"],
|
|
15856
15906
|
"emitValue": ["emitValueHandler"]
|
|
@@ -16000,11 +16050,6 @@ const PostalCodeInput = class {
|
|
|
16000
16050
|
targetInput.focus();
|
|
16001
16051
|
}
|
|
16002
16052
|
};
|
|
16003
|
-
this.setClientStyling = () => {
|
|
16004
|
-
let sheet = document.createElement('style');
|
|
16005
|
-
sheet.innerHTML = this.clientStyling;
|
|
16006
|
-
this.stylingContainer.prepend(sheet);
|
|
16007
|
-
};
|
|
16008
16053
|
this.handleOutsideClick = (event) => {
|
|
16009
16054
|
if (!this.openAddressDropdown)
|
|
16010
16055
|
return;
|
|
@@ -16030,9 +16075,9 @@ const PostalCodeInput = class {
|
|
|
16030
16075
|
this.postalcodelength = undefined;
|
|
16031
16076
|
this.addresses = undefined;
|
|
16032
16077
|
this.ignoreCountry = false;
|
|
16078
|
+
this.mbSource = undefined;
|
|
16033
16079
|
this.isValid = undefined;
|
|
16034
16080
|
this.errorMessage = '';
|
|
16035
|
-
this.limitStylingAppends = false;
|
|
16036
16081
|
this.showTooltip = false;
|
|
16037
16082
|
this.selectedCountryCode = '';
|
|
16038
16083
|
this.currentPostalCode = '';
|
|
@@ -16041,9 +16086,10 @@ const PostalCodeInput = class {
|
|
|
16041
16086
|
this.refreshTrigger = 0;
|
|
16042
16087
|
this.isFetchingAddresses = false;
|
|
16043
16088
|
}
|
|
16044
|
-
|
|
16045
|
-
if (newValue !== oldValue)
|
|
16046
|
-
this.
|
|
16089
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
16090
|
+
if (newValue !== oldValue) {
|
|
16091
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16092
|
+
}
|
|
16047
16093
|
}
|
|
16048
16094
|
validityChanged() {
|
|
16049
16095
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -16104,19 +16150,22 @@ const PostalCodeInput = class {
|
|
|
16104
16150
|
connectedCallback() {
|
|
16105
16151
|
this.validationPattern = this.setPattern();
|
|
16106
16152
|
}
|
|
16107
|
-
componentDidRender() {
|
|
16108
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
16109
|
-
if (this.clientStyling)
|
|
16110
|
-
this.setClientStyling();
|
|
16111
|
-
this.limitStylingAppends = true;
|
|
16112
|
-
}
|
|
16113
|
-
}
|
|
16114
16153
|
componentWillLoad() {
|
|
16115
16154
|
if (this.defaultValue) {
|
|
16116
16155
|
this.value = this.defaultValue;
|
|
16117
16156
|
}
|
|
16118
16157
|
}
|
|
16158
|
+
handleClientStyling() {
|
|
16159
|
+
if (window.emMessageBus !== undefined) {
|
|
16160
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
16161
|
+
return;
|
|
16162
|
+
}
|
|
16163
|
+
if (this.clientStyling) {
|
|
16164
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16165
|
+
}
|
|
16166
|
+
}
|
|
16119
16167
|
componentDidLoad() {
|
|
16168
|
+
this.handleClientStyling();
|
|
16120
16169
|
if (this.defaultValue) {
|
|
16121
16170
|
this.valueHandler({ name: this.name, value: this.value });
|
|
16122
16171
|
}
|
|
@@ -16208,10 +16257,10 @@ const PostalCodeInput = class {
|
|
|
16208
16257
|
let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
|
|
16209
16258
|
this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
|
|
16210
16259
|
let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
|
|
16211
|
-
return (index.h("div", { key: '
|
|
16260
|
+
return (index.h("div", { key: 'f0dda39cf9a02d53213848926908c0cb39d1cd3f', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '5e1c51af264392d2be986e305e6526310f55f40b', class: 'text__wrapper--flex' }, index.h("label", { key: 'c12c45d88bdf42aeb6be505d473ab0f55da2be87', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '7b93a75f19590b445227fa1a64c90fd20c0afd5d', class: 'text__wrapper--relative' }, this.tooltip && (index.h("img", { key: '504004a13595694307c1e3450b69982150dc55fd', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), index.h("div", { key: '19de66fd72fd0a6befe3bbaebb6c8f99ec5f850b', class: 'input__text-wrapper' }, index.h("input", { key: '78cd4229ed5104518b991df0bc6bf527df2ec3e2', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (index.h("p", { key: '6b9e307d59fb9fed93f4df6c07a091d299844c62', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate$1('enterIEAddressManually', this.language))), showAddressesDropdown && (index.h("div", { key: 'ecb7892a9a8d967540d8fd013518ae19498fcd48', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, index.h("div", { key: 'a5ef3f81a85207a821964e23b21aaf783be807cc', class: "options" }, this.addresses.map((addr, index$1) => (index.h("div", { key: index$1, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (index.h("div", { key: '338c17e484721efb387e608f3ce4416a0e47b8af', class: "postalcode__loading-spinner" }, index.h("div", { key: '7638cea4fba975e3a27d4cb00bce217129bd0750', class: "loading-spinner" }), index.h("span", { key: 'b59a8a9c3d7ecf209a68717346d1d29062994f79' }, translate$1('searchingForAddresses', this.language)))), shouldShowNoResults && (index.h("div", { key: '212a74fed94b3ee089aed5c9afb544966b5f11cd', class: "postalcode__no-results-message" }, translate$1('postalLookUpNoAddressFound', this.language)))), index.h("small", { key: '4f66e97dd811b9917c92ff4bcbf236817ac57933', class: 'text__error-message' }, this.errorMessage)));
|
|
16212
16261
|
}
|
|
16213
16262
|
static get watchers() { return {
|
|
16214
|
-
"clientStyling": ["
|
|
16263
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
16215
16264
|
"isValid": ["validityChanged"],
|
|
16216
16265
|
"emitValue": ["emitValueHandler"],
|
|
16217
16266
|
"addresses": ["handleAddresses"]
|
|
@@ -16227,11 +16276,6 @@ const RadioInput = class {
|
|
|
16227
16276
|
index.registerInstance(this, hostRef);
|
|
16228
16277
|
this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
|
|
16229
16278
|
this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
|
|
16230
|
-
this.setClientStyling = () => {
|
|
16231
|
-
let sheet = document.createElement('style');
|
|
16232
|
-
sheet.innerHTML = this.clientStyling;
|
|
16233
|
-
this.stylingContainer.prepend(sheet);
|
|
16234
|
-
};
|
|
16235
16279
|
this.name = undefined;
|
|
16236
16280
|
this.displayName = undefined;
|
|
16237
16281
|
this.optionsGroup = undefined;
|
|
@@ -16240,14 +16284,15 @@ const RadioInput = class {
|
|
|
16240
16284
|
this.language = undefined;
|
|
16241
16285
|
this.emitValue = undefined;
|
|
16242
16286
|
this.clientStyling = '';
|
|
16287
|
+
this.mbSource = undefined;
|
|
16243
16288
|
this.errorMessage = undefined;
|
|
16244
16289
|
this.isValid = undefined;
|
|
16245
|
-
this.limitStylingAppends = false;
|
|
16246
16290
|
this.showTooltip = false;
|
|
16247
16291
|
}
|
|
16248
|
-
|
|
16249
|
-
if (newValue !== oldValue)
|
|
16250
|
-
this.
|
|
16292
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
16293
|
+
if (newValue !== oldValue) {
|
|
16294
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16295
|
+
}
|
|
16251
16296
|
}
|
|
16252
16297
|
validityChanged() {
|
|
16253
16298
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -16272,14 +16317,17 @@ const RadioInput = class {
|
|
|
16272
16317
|
this.showTooltip = false;
|
|
16273
16318
|
}
|
|
16274
16319
|
}
|
|
16275
|
-
|
|
16276
|
-
|
|
16277
|
-
|
|
16278
|
-
|
|
16279
|
-
this.setClientStyling();
|
|
16280
|
-
this.limitStylingAppends = true;
|
|
16320
|
+
handleClientStyling() {
|
|
16321
|
+
if (window.emMessageBus !== undefined) {
|
|
16322
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
16323
|
+
return;
|
|
16281
16324
|
}
|
|
16282
|
-
|
|
16325
|
+
if (this.clientStyling) {
|
|
16326
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16327
|
+
}
|
|
16328
|
+
}
|
|
16329
|
+
componentDidLoad() {
|
|
16330
|
+
this.handleClientStyling();
|
|
16283
16331
|
}
|
|
16284
16332
|
handleClick(event) {
|
|
16285
16333
|
this.value = event.target.value;
|
|
@@ -16302,11 +16350,11 @@ const RadioInput = class {
|
|
|
16302
16350
|
return null;
|
|
16303
16351
|
}
|
|
16304
16352
|
render() {
|
|
16305
|
-
return index.h("fieldset", { key: '
|
|
16306
|
-
index.h("img", { key: '
|
|
16353
|
+
return index.h("fieldset", { key: '7048de0e37c9541af1c9788e8b46c789ca788c31', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("legend", { key: '403b739c966d510740ca59621c094872b93e2cba', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => index.h("div", { class: 'radio__wrapper' }, index.h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), index.h("label", { htmlFor: `${option.label}__input` }, option.label))), index.h("small", { key: '46dce1082a6aa9f2a5bdc3e3654c924fcd2a8357', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
|
|
16354
|
+
index.h("img", { key: 'dfe155a429485b5c891db2943d9115cdc40e169b', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
16307
16355
|
}
|
|
16308
16356
|
static get watchers() { return {
|
|
16309
|
-
"clientStyling": ["
|
|
16357
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
16310
16358
|
"isValid": ["validityChanged"],
|
|
16311
16359
|
"emitValue": ["emitValueHandler"]
|
|
16312
16360
|
}; }
|
|
@@ -16355,11 +16403,6 @@ const SelectInput = class {
|
|
|
16355
16403
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
16356
16404
|
this.emitValueHandler(true);
|
|
16357
16405
|
};
|
|
16358
|
-
this.setClientStyling = () => {
|
|
16359
|
-
let sheet = document.createElement('style');
|
|
16360
|
-
sheet.innerHTML = this.clientStyling;
|
|
16361
|
-
this.stylingContainer.prepend(sheet);
|
|
16362
|
-
};
|
|
16363
16406
|
this.name = undefined;
|
|
16364
16407
|
this.displayName = undefined;
|
|
16365
16408
|
this.placeholder = undefined;
|
|
@@ -16372,14 +16415,15 @@ const SelectInput = class {
|
|
|
16372
16415
|
this.language = undefined;
|
|
16373
16416
|
this.emitValue = undefined;
|
|
16374
16417
|
this.clientStyling = '';
|
|
16418
|
+
this.mbSource = undefined;
|
|
16375
16419
|
this.errorMessage = undefined;
|
|
16376
16420
|
this.isValid = undefined;
|
|
16377
|
-
this.limitStylingAppends = false;
|
|
16378
16421
|
this.showTooltip = false;
|
|
16379
16422
|
}
|
|
16380
|
-
|
|
16381
|
-
if (newValue !== oldValue)
|
|
16382
|
-
this.
|
|
16423
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
16424
|
+
if (newValue !== oldValue) {
|
|
16425
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16426
|
+
}
|
|
16383
16427
|
}
|
|
16384
16428
|
validityChanged() {
|
|
16385
16429
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -16429,16 +16473,17 @@ const SelectInput = class {
|
|
|
16429
16473
|
}
|
|
16430
16474
|
}
|
|
16431
16475
|
}
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16476
|
+
handleClientStyling() {
|
|
16477
|
+
if (window.emMessageBus !== undefined) {
|
|
16478
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
16479
|
+
return;
|
|
16480
|
+
}
|
|
16481
|
+
if (this.clientStyling) {
|
|
16482
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16438
16483
|
}
|
|
16439
|
-
// end custom styling area
|
|
16440
16484
|
}
|
|
16441
16485
|
componentDidLoad() {
|
|
16486
|
+
this.handleClientStyling();
|
|
16442
16487
|
this.inputReference = this.vaadinCombo.querySelector('input');
|
|
16443
16488
|
if (this.defaultValue) {
|
|
16444
16489
|
this.value = this.defaultValue;
|
|
@@ -16503,13 +16548,13 @@ const SelectInput = class {
|
|
|
16503
16548
|
if (this.touched) {
|
|
16504
16549
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
16505
16550
|
}
|
|
16506
|
-
return index.h("div", { key: '
|
|
16507
|
-
index.h("img", { key: '
|
|
16551
|
+
return index.h("div", { key: 'eb6c9d7d85546159d44d06a0635f173263edd7d1', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '0fd71c528870966fdb23049b1806a267e9e6ca5c', class: 'select__wrapper--flex' }, index.h("label", { key: '44aeb4e50ab2f79df06741ff07ac03131c987447', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, index.h("span", { key: '796a83aeadd480a571b6bae035a46138d7b10b24', class: this.validation.mandatory ? 'select__label--required' : '' })), index.h("div", { key: '6d7b2d785c6b0bdd05c7444f563b21cedf26ff7c', class: 'select__wrapper--relative' }, this.tooltip &&
|
|
16552
|
+
index.h("img", { key: 'f33e43a9d42e8b8d1cf136374505eeaedcbede26', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? index.h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
|
|
16508
16553
|
:
|
|
16509
|
-
index.h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), index.h("small", { key: '
|
|
16554
|
+
index.h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), index.h("small", { key: '261b3c4abc9b360e6b937d851f8bfc810280a8c6', class: 'select__error-message' }, this.errorMessage));
|
|
16510
16555
|
}
|
|
16511
16556
|
static get watchers() { return {
|
|
16512
|
-
"clientStyling": ["
|
|
16557
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
16513
16558
|
"isValid": ["validityChanged"],
|
|
16514
16559
|
"emitValue": ["emitValueHandler"]
|
|
16515
16560
|
}; }
|
|
@@ -16544,11 +16589,6 @@ const TelInput = class {
|
|
|
16544
16589
|
this.isValid = this.isValidValue();
|
|
16545
16590
|
this.errorMessage = this.setErrorMessage();
|
|
16546
16591
|
};
|
|
16547
|
-
this.setClientStyling = () => {
|
|
16548
|
-
let sheet = document.createElement('style');
|
|
16549
|
-
sheet.innerHTML = this.clientStyling;
|
|
16550
|
-
this.stylingContainer.prepend(sheet);
|
|
16551
|
-
};
|
|
16552
16592
|
this.name = undefined;
|
|
16553
16593
|
this.displayName = undefined;
|
|
16554
16594
|
this.placeholder = undefined;
|
|
@@ -16561,9 +16601,9 @@ const TelInput = class {
|
|
|
16561
16601
|
this.language = undefined;
|
|
16562
16602
|
this.emitValue = undefined;
|
|
16563
16603
|
this.clientStyling = '';
|
|
16604
|
+
this.mbSource = undefined;
|
|
16564
16605
|
this.isValid = undefined;
|
|
16565
16606
|
this.errorMessage = undefined;
|
|
16566
|
-
this.limitStylingAppends = false;
|
|
16567
16607
|
this.showTooltip = false;
|
|
16568
16608
|
this.disablePhonePrefix = false;
|
|
16569
16609
|
this.phoneValue = '';
|
|
@@ -16575,9 +16615,10 @@ const TelInput = class {
|
|
|
16575
16615
|
if (this.inputReference)
|
|
16576
16616
|
this.inputReference.value = this.phoneValue;
|
|
16577
16617
|
}
|
|
16578
|
-
|
|
16579
|
-
if (newValue !== oldValue)
|
|
16580
|
-
this.
|
|
16618
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
16619
|
+
if (newValue !== oldValue) {
|
|
16620
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16621
|
+
}
|
|
16581
16622
|
}
|
|
16582
16623
|
validityChanged() {
|
|
16583
16624
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -16628,16 +16669,17 @@ const TelInput = class {
|
|
|
16628
16669
|
}
|
|
16629
16670
|
}
|
|
16630
16671
|
}
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16672
|
+
handleClientStyling() {
|
|
16673
|
+
if (window.emMessageBus !== undefined) {
|
|
16674
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
16675
|
+
return;
|
|
16676
|
+
}
|
|
16677
|
+
if (this.clientStyling) {
|
|
16678
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16637
16679
|
}
|
|
16638
|
-
// end custom styling area
|
|
16639
16680
|
}
|
|
16640
16681
|
componentDidLoad() {
|
|
16682
|
+
this.handleClientStyling();
|
|
16641
16683
|
this.isValid = this.isValidValue();
|
|
16642
16684
|
if (this.defaultValue) {
|
|
16643
16685
|
this.value = this.defaultValue;
|
|
@@ -16729,11 +16771,11 @@ const TelInput = class {
|
|
|
16729
16771
|
if (this.touched) {
|
|
16730
16772
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
16731
16773
|
}
|
|
16732
|
-
return index.h("div", { key: '
|
|
16733
|
-
index.h("img", { key: '
|
|
16774
|
+
return index.h("div", { key: '9cf9eb751bca1978d8554fffc912ef2039c42e41', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'cc88d6e9aa7a0f3801fad75e3ca509fbd01b0538', class: 'tel__wrapper--flex-label' }, index.h("label", { key: 'c8a35af4ddd2d4f9751d7f60c9e075ae8eccb441', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '73fcdcc25dde1be087ee60062dc5eee2d1e5d29e', class: 'tel__wrapper--relative' }, this.tooltip &&
|
|
16775
|
+
index.h("img", { key: '56df66fddf599fbafb179c7cd90ea7d58b008ea6', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("div", { key: '20eb5689932c2f71322102229cc7346d18e9bc87', class: `tel__wrapper--flex ${invalidClass}` }, index.h("vaadin-combo-box", { key: '9ec4142dc84e0022ced7e34248d5f4f8f59c34af', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), index.h("input", { key: 'c083b17f71de36b84892a8080f776debf1fe7351', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), index.h("small", { key: '2201c2d7b968731042624b265cf535c656c86933', class: 'tel__error-message' }, this.errorMessage));
|
|
16734
16776
|
}
|
|
16735
16777
|
static get watchers() { return {
|
|
16736
|
-
"clientStyling": ["
|
|
16778
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
16737
16779
|
"isValid": ["validityChanged"],
|
|
16738
16780
|
"emitValue": ["emitValueHandler"]
|
|
16739
16781
|
}; }
|
|
@@ -16777,11 +16819,6 @@ const TextInput = class {
|
|
|
16777
16819
|
this.touched = true;
|
|
16778
16820
|
this.updateValidationState();
|
|
16779
16821
|
};
|
|
16780
|
-
this.setClientStyling = () => {
|
|
16781
|
-
let sheet = document.createElement('style');
|
|
16782
|
-
sheet.innerHTML = this.clientStyling;
|
|
16783
|
-
this.stylingContainer.prepend(sheet);
|
|
16784
|
-
};
|
|
16785
16822
|
this.name = undefined;
|
|
16786
16823
|
this.displayName = undefined;
|
|
16787
16824
|
this.placeholder = undefined;
|
|
@@ -16796,15 +16833,16 @@ const TextInput = class {
|
|
|
16796
16833
|
this.clientStyling = '';
|
|
16797
16834
|
this.haspostalcodelookup = undefined;
|
|
16798
16835
|
this.enableSouthAfricanMode = undefined;
|
|
16836
|
+
this.mbSource = undefined;
|
|
16799
16837
|
this.isValid = undefined;
|
|
16800
16838
|
this.errorMessage = '';
|
|
16801
|
-
this.limitStylingAppends = false;
|
|
16802
16839
|
this.showTooltip = false;
|
|
16803
16840
|
this.selectedCountryCode = '';
|
|
16804
16841
|
}
|
|
16805
|
-
|
|
16806
|
-
if (newValue !== oldValue)
|
|
16807
|
-
this.
|
|
16842
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
16843
|
+
if (newValue !== oldValue) {
|
|
16844
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16845
|
+
}
|
|
16808
16846
|
}
|
|
16809
16847
|
validityChanged() {
|
|
16810
16848
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -16916,21 +16954,22 @@ const TextInput = class {
|
|
|
16916
16954
|
}
|
|
16917
16955
|
this.validityStateHandler({ valid: false, name: this.name });
|
|
16918
16956
|
}
|
|
16919
|
-
componentDidRender() {
|
|
16920
|
-
// start custom styling area
|
|
16921
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
16922
|
-
if (this.clientStyling)
|
|
16923
|
-
this.setClientStyling();
|
|
16924
|
-
this.limitStylingAppends = true;
|
|
16925
|
-
}
|
|
16926
|
-
// end custom styling area
|
|
16927
|
-
}
|
|
16928
16957
|
componentWillLoad() {
|
|
16929
16958
|
if (this.defaultValue) {
|
|
16930
16959
|
this.value = this.defaultValue;
|
|
16931
16960
|
}
|
|
16932
16961
|
}
|
|
16962
|
+
handleClientStyling() {
|
|
16963
|
+
if (window.emMessageBus !== undefined) {
|
|
16964
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
16965
|
+
return;
|
|
16966
|
+
}
|
|
16967
|
+
if (this.clientStyling) {
|
|
16968
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
16969
|
+
}
|
|
16970
|
+
}
|
|
16933
16971
|
componentDidLoad() {
|
|
16972
|
+
this.handleClientStyling();
|
|
16934
16973
|
if (this.defaultValue) {
|
|
16935
16974
|
this.value = this.defaultValue;
|
|
16936
16975
|
this.valueHandler({ name: this.name, value: this.value });
|
|
@@ -17042,11 +17081,11 @@ const TextInput = class {
|
|
|
17042
17081
|
if (this.touched) {
|
|
17043
17082
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
17044
17083
|
}
|
|
17045
|
-
return index.h("div", { key: '
|
|
17046
|
-
index.h("img", { key: '
|
|
17084
|
+
return index.h("div", { key: 'f48e592bac049022b283bac917c095772b1508f5', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'fe3626ead38dd18dfa14795ee2332e93f5f09652', class: 'text__wrapper--flex' }, index.h("label", { key: '6b2854b460e0ac7d4ae0ebccc06dbe64770581d5', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'f29d266973bd700a4270495bc4eb6e8296b6eeaf', class: 'text__wrapper--relative' }, this.tooltip &&
|
|
17085
|
+
index.h("img", { key: '68e69abbb78250e763822608e963bc16d702f099', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '99b8eab15ab32656f86fedd3f36a09a5bbe108d3', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: 'cc28c1c19370faa94fa1f738066042dce8d694ce', class: 'text__error-message' }, this.errorMessage));
|
|
17047
17086
|
}
|
|
17048
17087
|
static get watchers() { return {
|
|
17049
|
-
"clientStyling": ["
|
|
17088
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
17050
17089
|
"isValid": ["validityChanged"],
|
|
17051
17090
|
"emitValue": ["emitValueHandler"]
|
|
17052
17091
|
}; }
|
|
@@ -17068,11 +17107,6 @@ const ToggleCheckboxInput = class {
|
|
|
17068
17107
|
event.stopPropagation();
|
|
17069
17108
|
window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
|
|
17070
17109
|
};
|
|
17071
|
-
this.setClientStyling = () => {
|
|
17072
|
-
let sheet = document.createElement('style');
|
|
17073
|
-
sheet.innerHTML = this.clientStyling;
|
|
17074
|
-
this.stylingContainer.prepend(sheet);
|
|
17075
|
-
};
|
|
17076
17110
|
this.name = undefined;
|
|
17077
17111
|
this.displayName = undefined;
|
|
17078
17112
|
this.defaultValue = '';
|
|
@@ -17083,15 +17117,16 @@ const ToggleCheckboxInput = class {
|
|
|
17083
17117
|
this.language = undefined;
|
|
17084
17118
|
this.emitValue = undefined;
|
|
17085
17119
|
this.clientStyling = '';
|
|
17120
|
+
this.mbSource = undefined;
|
|
17086
17121
|
this.errorMessage = undefined;
|
|
17087
17122
|
this.isValid = undefined;
|
|
17088
|
-
this.limitStylingAppends = false;
|
|
17089
17123
|
this.showTooltip = false;
|
|
17090
17124
|
this.showFields = this.defaultValue === 'true';
|
|
17091
17125
|
}
|
|
17092
|
-
|
|
17093
|
-
if (newValue !== oldValue)
|
|
17094
|
-
this.
|
|
17126
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
17127
|
+
if (newValue !== oldValue) {
|
|
17128
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
17129
|
+
}
|
|
17095
17130
|
}
|
|
17096
17131
|
validityStateHandler(inputStateEvent) {
|
|
17097
17132
|
this.sendValidityState.emit(inputStateEvent);
|
|
@@ -17105,16 +17140,17 @@ const ToggleCheckboxInput = class {
|
|
|
17105
17140
|
this.showTooltip = false;
|
|
17106
17141
|
}
|
|
17107
17142
|
}
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17112
|
-
|
|
17113
|
-
|
|
17143
|
+
handleClientStyling() {
|
|
17144
|
+
if (window.emMessageBus !== undefined) {
|
|
17145
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
17146
|
+
return;
|
|
17147
|
+
}
|
|
17148
|
+
if (this.clientStyling) {
|
|
17149
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
17114
17150
|
}
|
|
17115
|
-
// end custom styling area
|
|
17116
17151
|
}
|
|
17117
17152
|
componentDidLoad() {
|
|
17153
|
+
this.handleClientStyling();
|
|
17118
17154
|
if (this.options.length === 0)
|
|
17119
17155
|
return;
|
|
17120
17156
|
this.options.forEach((subField) => {
|
|
@@ -17151,13 +17187,13 @@ const ToggleCheckboxInput = class {
|
|
|
17151
17187
|
return null;
|
|
17152
17188
|
}
|
|
17153
17189
|
render() {
|
|
17154
|
-
return index.h("div", { key: '
|
|
17155
|
-
index.h("img", { key: '
|
|
17190
|
+
return index.h("div", { key: '31cd24b5da24368eef2f53952714395d6d9f6285', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'aa14784bd8a3870f7015db79d23226521706ad58', class: 'togglecheckbox__wrapper--flex' }, index.h("input", { key: '0237f06c99b8b2ed7de80433f5b93b9eae7c25f5', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), index.h("small", { key: '7e26bea1cfcc725d5aa5a795fd0f999d99abe39d', class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { key: '4256fc552545b7a1050ff5cdeb005f5ea83cc5c1', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
|
|
17191
|
+
index.h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { key: '2d61bedaac02f21116318b10a21b361e70e0213f', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
|
|
17156
17192
|
return index.h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
|
|
17157
17193
|
})));
|
|
17158
17194
|
}
|
|
17159
17195
|
static get watchers() { return {
|
|
17160
|
-
"clientStyling": ["
|
|
17196
|
+
"clientStyling": ["handleClientStylingChange"]
|
|
17161
17197
|
}; }
|
|
17162
17198
|
};
|
|
17163
17199
|
ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
|
|
@@ -17183,17 +17219,6 @@ const TwofaInput = class {
|
|
|
17183
17219
|
this.triggerResendInterval();
|
|
17184
17220
|
this.resendCode.emit();
|
|
17185
17221
|
};
|
|
17186
|
-
this.setClientStylingURL = () => {
|
|
17187
|
-
let url = new URL(this.clientStylingUrl);
|
|
17188
|
-
let cssFile = document.createElement('style');
|
|
17189
|
-
fetch(url.href)
|
|
17190
|
-
.then((res) => res.text())
|
|
17191
|
-
.then((data) => {
|
|
17192
|
-
cssFile.innerHTML = data;
|
|
17193
|
-
this.clientStyling = data;
|
|
17194
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
17195
|
-
});
|
|
17196
|
-
};
|
|
17197
17222
|
this.setInputRef = (el, idx) => {
|
|
17198
17223
|
if (el) {
|
|
17199
17224
|
this.inputRefs[idx] = el;
|
|
@@ -17249,21 +17274,6 @@ const TwofaInput = class {
|
|
|
17249
17274
|
this.setValidity();
|
|
17250
17275
|
this.setErrorMessage();
|
|
17251
17276
|
};
|
|
17252
|
-
this.setClientStyling = () => {
|
|
17253
|
-
let sheet = document.createElement('style');
|
|
17254
|
-
sheet.innerHTML = this.clientStyling;
|
|
17255
|
-
this.stylingContainer.prepend(sheet);
|
|
17256
|
-
};
|
|
17257
|
-
this.setStreamStyling = (domain) => {
|
|
17258
|
-
if (window.emMessageBus) {
|
|
17259
|
-
const sheet = document.createElement('style');
|
|
17260
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
17261
|
-
sheet.innerHTML = data;
|
|
17262
|
-
this.clientStyling = data;
|
|
17263
|
-
this.host.shadowRoot.prepend(sheet);
|
|
17264
|
-
});
|
|
17265
|
-
}
|
|
17266
|
-
};
|
|
17267
17277
|
this.name = '';
|
|
17268
17278
|
this.displayName = '';
|
|
17269
17279
|
this.placeholder = '';
|
|
@@ -17278,7 +17288,6 @@ const TwofaInput = class {
|
|
|
17278
17288
|
this.pinAttemptsExceeded = undefined;
|
|
17279
17289
|
this.clientStylingUrl = '';
|
|
17280
17290
|
this.mbSource = undefined;
|
|
17281
|
-
this.limitStylingAppends = false;
|
|
17282
17291
|
this.isValid = false;
|
|
17283
17292
|
this.isResendButtonAvailable = true;
|
|
17284
17293
|
this.showTooltip = false;
|
|
@@ -17298,9 +17307,16 @@ const TwofaInput = class {
|
|
|
17298
17307
|
this.valueHandler({ name: this.name, value: this.code.join('') });
|
|
17299
17308
|
}
|
|
17300
17309
|
}
|
|
17301
|
-
|
|
17302
|
-
if (newValue !== oldValue)
|
|
17303
|
-
this.
|
|
17310
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
17311
|
+
if (newValue !== oldValue) {
|
|
17312
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
17313
|
+
}
|
|
17314
|
+
}
|
|
17315
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
17316
|
+
if (newValue !== oldValue) {
|
|
17317
|
+
if (this.clientStylingUrl)
|
|
17318
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
17319
|
+
}
|
|
17304
17320
|
}
|
|
17305
17321
|
validityStateHandler(inputStateEvent) {
|
|
17306
17322
|
this.sendValidityState.emit(inputStateEvent);
|
|
@@ -17314,10 +17330,6 @@ const TwofaInput = class {
|
|
|
17314
17330
|
this.showTooltip = false;
|
|
17315
17331
|
}
|
|
17316
17332
|
}
|
|
17317
|
-
handleStylingChange(newValue, oldValue) {
|
|
17318
|
-
if (newValue !== oldValue)
|
|
17319
|
-
this.setClientStyling();
|
|
17320
|
-
}
|
|
17321
17333
|
connectedCallback() {
|
|
17322
17334
|
this.validationPattern = this.setPattern();
|
|
17323
17335
|
this.code = new Array(this.validation.maxLength).fill('');
|
|
@@ -17325,30 +17337,21 @@ const TwofaInput = class {
|
|
|
17325
17337
|
disconnectedCallback() {
|
|
17326
17338
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
17327
17339
|
}
|
|
17328
|
-
|
|
17329
|
-
if (
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
}
|
|
17333
|
-
this.limitStylingAppends = true;
|
|
17340
|
+
handleClientStyling() {
|
|
17341
|
+
if (window.emMessageBus !== undefined) {
|
|
17342
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
17343
|
+
return;
|
|
17334
17344
|
}
|
|
17345
|
+
if (this.clientStyling)
|
|
17346
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
17347
|
+
if (this.clientStylingUrl)
|
|
17348
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
17335
17349
|
}
|
|
17336
17350
|
componentDidLoad() {
|
|
17337
17351
|
this.setValidity();
|
|
17338
17352
|
this.registrationWidgetLoaded.emit();
|
|
17339
17353
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
17340
|
-
|
|
17341
|
-
if (window.emMessageBus != undefined) {
|
|
17342
|
-
this.setStreamStyling(`${this.mbSource}.Style`);
|
|
17343
|
-
}
|
|
17344
|
-
else {
|
|
17345
|
-
if (this.clientStyling)
|
|
17346
|
-
this.setClientStyling();
|
|
17347
|
-
if (this.clientStylingUrl)
|
|
17348
|
-
this.setClientStylingURL();
|
|
17349
|
-
this.limitStylingAppends = true;
|
|
17350
|
-
}
|
|
17351
|
-
}
|
|
17354
|
+
this.handleClientStyling();
|
|
17352
17355
|
}
|
|
17353
17356
|
handleKeyDown(e, idx) {
|
|
17354
17357
|
if (e.key === 'Backspace') {
|
|
@@ -17439,9 +17442,9 @@ const TwofaInput = class {
|
|
|
17439
17442
|
return current;
|
|
17440
17443
|
}
|
|
17441
17444
|
render() {
|
|
17442
|
-
return (index.h("div", { key: '
|
|
17445
|
+
return (index.h("div", { key: 'cd5396afccaf4016201281f5cc53898c0a2052ed', class: "twofa", ref: el => this.stylingContainer = el }, index.h("div", { key: '008dd54682a0d93190e9e5b2b49673262ed01763', class: 'twofa__error-message' }, index.h("p", { key: '41db51d6b396ccd1f3149e4473e96960e92d05ca' }, this.errorMessage)), index.h("div", { key: '67e9e4ac90cf95f2269e75b121ed220a02c5f139', class: "twofa__description", innerHTML: translate$1('twofaDescription', this.language, { values: { destination: this.destination } }) }), index.h("div", { key: '702c342eb7be0001ab8de310cadd7e8684a8025d', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
|
|
17443
17446
|
return (index.h("input", { key: idx, ref: el => this.setInputRef(el, idx), id: `otp-input-${idx}`, type: "text", maxLength: 2, value: this.getInputDisplayValue(idx), onInput: (event) => this.handleInput(event, idx), onKeyDown: (event) => this.handleKeyDown(event, idx), onPaste: (event) => this.handlePaste(event) }));
|
|
17444
|
-
})), index.h("div", { key: '
|
|
17447
|
+
})), index.h("div", { key: '63564bd4a0442232f81058ba914ee86c537ce85a', class: "twofa__button-wrapper" }, index.h("p", { key: '219f5005c0d03189df48f05c5e0cd980eb0e1979', class: "twofa__resend-message" }, translate$1('twofaResendMessage', this.language)), index.h("button", { key: '12b7b4bc3ea165994f2c50107f406c64e708cf4d', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
|
|
17445
17448
|
? translate$1('twofaResendButton', this.language)
|
|
17446
17449
|
: this.formatTime()))));
|
|
17447
17450
|
}
|
|
@@ -17449,8 +17452,8 @@ const TwofaInput = class {
|
|
|
17449
17452
|
static get watchers() { return {
|
|
17450
17453
|
"isValid": ["validityChanged"],
|
|
17451
17454
|
"emitValue": ["emitValueHandler"],
|
|
17452
|
-
"
|
|
17453
|
-
"
|
|
17455
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
17456
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
17454
17457
|
}; }
|
|
17455
17458
|
};
|
|
17456
17459
|
TwofaInput.style = TwofaInputStyle0;
|