@everymatrix/general-input 1.90.7 → 1.90.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/checkbox-group-input_14.cjs.entry.js +373 -345
- package/dist/cjs/general-input.cjs.js +2 -2
- package/dist/cjs/{index-3b546c2c.js → index-7a4b2771.js} +1 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +34 -20
- package/dist/collection/components/checkbox-input/checkbox-input.js +33 -19
- package/dist/collection/components/date-input/date-input.js +34 -20
- package/dist/collection/components/email-input/email-input.js +34 -20
- package/dist/collection/components/general-input/general-input.js +35 -64
- package/dist/collection/components/number-input/number-input.js +34 -20
- package/dist/collection/components/password-input/password-input.js +34 -20
- package/dist/collection/components/postalcode-input/postalcode-input.js +35 -19
- package/dist/collection/components/radio-input/radio-input.js +36 -20
- package/dist/collection/components/select-input/select-input.js +35 -21
- package/dist/collection/components/tel-input/tel-input.js +34 -20
- package/dist/collection/components/text-input/text-input.js +36 -22
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +34 -20
- package/dist/collection/components/twofa-input/twofa-input.js +26 -59
- package/dist/esm/checkbox-group-input_14.entry.js +373 -345
- package/dist/esm/general-input.js +3 -3
- package/dist/esm/{index-ca174b7a.js → index-9174417a.js} +1 -4
- package/dist/esm/loader.js +3 -3
- package/dist/general-input/checkbox-group-input_14.entry.js +242 -242
- package/dist/general-input/general-input.esm.js +1 -1
- package/dist/general-input/{index-ca174b7a.js → index-9174417a.js} +2 -2
- package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +7 -4
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +7 -4
- package/dist/types/components/date-input/date-input.d.ts +7 -4
- package/dist/types/components/email-input/email-input.d.ts +7 -4
- package/dist/types/components/general-input/general-input.d.ts +4 -6
- package/dist/types/components/number-input/number-input.d.ts +7 -4
- package/dist/types/components/password-input/password-input.d.ts +7 -4
- package/dist/types/components/postalcode-input/postalcode-input.d.ts +7 -4
- package/dist/types/components/radio-input/radio-input.d.ts +8 -4
- package/dist/types/components/select-input/select-input.d.ts +7 -4
- package/dist/types/components/tel-input/tel-input.d.ts +7 -4
- package/dist/types/components/text-input/text-input.d.ts +7 -4
- package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +7 -4
- package/dist/types/components/twofa-input/twofa-input.d.ts +3 -7
- package/dist/types/components.d.ts +96 -0
- package/package.json +1 -1
|
@@ -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-7a4b2771.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const TRANSLATIONS = {
|
|
@@ -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;
|
|
@@ -13312,11 +13393,6 @@ const NumberInput = class {
|
|
|
13312
13393
|
this.errorMessage = this.setErrorMessage();
|
|
13313
13394
|
this.touched = true;
|
|
13314
13395
|
};
|
|
13315
|
-
this.setClientStyling = () => {
|
|
13316
|
-
let sheet = document.createElement('style');
|
|
13317
|
-
sheet.innerHTML = this.clientStyling;
|
|
13318
|
-
this.stylingContainer.prepend(sheet);
|
|
13319
|
-
};
|
|
13320
13396
|
this.name = undefined;
|
|
13321
13397
|
this.displayName = undefined;
|
|
13322
13398
|
this.placeholder = undefined;
|
|
@@ -13327,14 +13403,15 @@ const NumberInput = class {
|
|
|
13327
13403
|
this.language = undefined;
|
|
13328
13404
|
this.emitValue = undefined;
|
|
13329
13405
|
this.clientStyling = '';
|
|
13406
|
+
this.mbSource = undefined;
|
|
13330
13407
|
this.errorMessage = undefined;
|
|
13331
13408
|
this.isValid = undefined;
|
|
13332
|
-
this.limitStylingAppends = false;
|
|
13333
13409
|
this.showTooltip = false;
|
|
13334
13410
|
}
|
|
13335
|
-
|
|
13336
|
-
if (newValue !== oldValue)
|
|
13337
|
-
this.
|
|
13411
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13412
|
+
if (newValue !== oldValue) {
|
|
13413
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13414
|
+
}
|
|
13338
13415
|
}
|
|
13339
13416
|
validityChanged() {
|
|
13340
13417
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -13362,16 +13439,17 @@ const NumberInput = class {
|
|
|
13362
13439
|
connectedCallback() {
|
|
13363
13440
|
this.validationPattern = this.setPattern();
|
|
13364
13441
|
}
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13442
|
+
handleClientStyling() {
|
|
13443
|
+
if (window.emMessageBus !== undefined) {
|
|
13444
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
13445
|
+
return;
|
|
13446
|
+
}
|
|
13447
|
+
if (this.clientStyling) {
|
|
13448
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13371
13449
|
}
|
|
13372
|
-
// end custom styling area
|
|
13373
13450
|
}
|
|
13374
13451
|
componentDidLoad() {
|
|
13452
|
+
this.handleClientStyling();
|
|
13375
13453
|
this.isValid = this.setValidity();
|
|
13376
13454
|
if (this.defaultValue) {
|
|
13377
13455
|
this.value = this.defaultValue;
|
|
@@ -13412,11 +13490,11 @@ const NumberInput = class {
|
|
|
13412
13490
|
if (this.touched) {
|
|
13413
13491
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13414
13492
|
}
|
|
13415
|
-
return index.h("div", { key: '
|
|
13416
|
-
index.h("img", { key: '
|
|
13493
|
+
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 &&
|
|
13494
|
+
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));
|
|
13417
13495
|
}
|
|
13418
13496
|
static get watchers() { return {
|
|
13419
|
-
"clientStyling": ["
|
|
13497
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
13420
13498
|
"isValid": ["validityChanged"],
|
|
13421
13499
|
"emitValue": ["emitValueHandler"]
|
|
13422
13500
|
}; }
|
|
@@ -13465,11 +13543,6 @@ const PasswordInput = class {
|
|
|
13465
13543
|
this.showPopup = true;
|
|
13466
13544
|
this.calculateComplexity(this.value);
|
|
13467
13545
|
};
|
|
13468
|
-
this.setClientStyling = () => {
|
|
13469
|
-
let sheet = document.createElement('style');
|
|
13470
|
-
sheet.innerHTML = this.clientStyling;
|
|
13471
|
-
this.stylingContainer.prepend(sheet);
|
|
13472
|
-
};
|
|
13473
13546
|
this.name = undefined;
|
|
13474
13547
|
this.displayName = undefined;
|
|
13475
13548
|
this.placeholder = undefined;
|
|
@@ -13484,17 +13557,18 @@ const PasswordInput = class {
|
|
|
13484
13557
|
this.hidePasswordComplexity = false;
|
|
13485
13558
|
this.clientStyling = '';
|
|
13486
13559
|
this.enableSouthAfricanMode = undefined;
|
|
13560
|
+
this.mbSource = undefined;
|
|
13487
13561
|
this.isValid = undefined;
|
|
13488
13562
|
this.errorMessage = undefined;
|
|
13489
|
-
this.limitStylingAppends = false;
|
|
13490
13563
|
this.showTooltip = false;
|
|
13491
13564
|
this.passwordComplexity = undefined;
|
|
13492
13565
|
this.showPopup = undefined;
|
|
13493
13566
|
this.value = '';
|
|
13494
13567
|
}
|
|
13495
|
-
|
|
13496
|
-
if (newValue !== oldValue)
|
|
13497
|
-
this.
|
|
13568
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13569
|
+
if (newValue !== oldValue) {
|
|
13570
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13571
|
+
}
|
|
13498
13572
|
}
|
|
13499
13573
|
validityChanged() {
|
|
13500
13574
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -13555,16 +13629,17 @@ const PasswordInput = class {
|
|
|
13555
13629
|
this.showTooltip = false;
|
|
13556
13630
|
}
|
|
13557
13631
|
}
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13632
|
+
handleClientStyling() {
|
|
13633
|
+
if (window.emMessageBus !== undefined) {
|
|
13634
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
13635
|
+
return;
|
|
13636
|
+
}
|
|
13637
|
+
if (this.clientStyling) {
|
|
13638
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13564
13639
|
}
|
|
13565
|
-
// end custom styling area
|
|
13566
13640
|
}
|
|
13567
13641
|
componentDidLoad() {
|
|
13642
|
+
this.handleClientStyling();
|
|
13568
13643
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
13569
13644
|
this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
|
|
13570
13645
|
this.passwordButton.tabIndex = -1;
|
|
@@ -13671,8 +13746,8 @@ const PasswordInput = class {
|
|
|
13671
13746
|
if (this.touched) {
|
|
13672
13747
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13673
13748
|
}
|
|
13674
|
-
return index.h("div", { key: '
|
|
13675
|
-
index.h("img", { key: '
|
|
13749
|
+
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 &&
|
|
13750
|
+
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 &&
|
|
13676
13751
|
this.showPopup &&
|
|
13677
13752
|
!this.hidePasswordComplexity &&
|
|
13678
13753
|
!this.isDuplicateInput &&
|
|
@@ -13682,7 +13757,7 @@ const PasswordInput = class {
|
|
|
13682
13757
|
}
|
|
13683
13758
|
get element() { return index.getElement(this); }
|
|
13684
13759
|
static get watchers() { return {
|
|
13685
|
-
"clientStyling": ["
|
|
13760
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
13686
13761
|
"isValid": ["validityChanged"],
|
|
13687
13762
|
"value": ["valueChanged"],
|
|
13688
13763
|
"emitValue": ["emitValueHandler"]
|
|
@@ -13832,11 +13907,6 @@ const PostalCodeInput = class {
|
|
|
13832
13907
|
targetInput.focus();
|
|
13833
13908
|
}
|
|
13834
13909
|
};
|
|
13835
|
-
this.setClientStyling = () => {
|
|
13836
|
-
let sheet = document.createElement('style');
|
|
13837
|
-
sheet.innerHTML = this.clientStyling;
|
|
13838
|
-
this.stylingContainer.prepend(sheet);
|
|
13839
|
-
};
|
|
13840
13910
|
this.handleOutsideClick = (event) => {
|
|
13841
13911
|
if (!this.openAddressDropdown)
|
|
13842
13912
|
return;
|
|
@@ -13862,9 +13932,9 @@ const PostalCodeInput = class {
|
|
|
13862
13932
|
this.postalcodelength = undefined;
|
|
13863
13933
|
this.addresses = undefined;
|
|
13864
13934
|
this.ignoreCountry = false;
|
|
13935
|
+
this.mbSource = undefined;
|
|
13865
13936
|
this.isValid = undefined;
|
|
13866
13937
|
this.errorMessage = '';
|
|
13867
|
-
this.limitStylingAppends = false;
|
|
13868
13938
|
this.showTooltip = false;
|
|
13869
13939
|
this.selectedCountryCode = '';
|
|
13870
13940
|
this.currentPostalCode = '';
|
|
@@ -13873,9 +13943,10 @@ const PostalCodeInput = class {
|
|
|
13873
13943
|
this.refreshTrigger = 0;
|
|
13874
13944
|
this.isFetchingAddresses = false;
|
|
13875
13945
|
}
|
|
13876
|
-
|
|
13877
|
-
if (newValue !== oldValue)
|
|
13878
|
-
this.
|
|
13946
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13947
|
+
if (newValue !== oldValue) {
|
|
13948
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13949
|
+
}
|
|
13879
13950
|
}
|
|
13880
13951
|
validityChanged() {
|
|
13881
13952
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -13936,19 +14007,22 @@ const PostalCodeInput = class {
|
|
|
13936
14007
|
connectedCallback() {
|
|
13937
14008
|
this.validationPattern = this.setPattern();
|
|
13938
14009
|
}
|
|
13939
|
-
componentDidRender() {
|
|
13940
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
13941
|
-
if (this.clientStyling)
|
|
13942
|
-
this.setClientStyling();
|
|
13943
|
-
this.limitStylingAppends = true;
|
|
13944
|
-
}
|
|
13945
|
-
}
|
|
13946
14010
|
componentWillLoad() {
|
|
13947
14011
|
if (this.defaultValue) {
|
|
13948
14012
|
this.value = this.defaultValue;
|
|
13949
14013
|
}
|
|
13950
14014
|
}
|
|
14015
|
+
handleClientStyling() {
|
|
14016
|
+
if (window.emMessageBus !== undefined) {
|
|
14017
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14018
|
+
return;
|
|
14019
|
+
}
|
|
14020
|
+
if (this.clientStyling) {
|
|
14021
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14022
|
+
}
|
|
14023
|
+
}
|
|
13951
14024
|
componentDidLoad() {
|
|
14025
|
+
this.handleClientStyling();
|
|
13952
14026
|
if (this.defaultValue) {
|
|
13953
14027
|
this.valueHandler({ name: this.name, value: this.value });
|
|
13954
14028
|
}
|
|
@@ -14040,10 +14114,10 @@ const PostalCodeInput = class {
|
|
|
14040
14114
|
let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
|
|
14041
14115
|
this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
|
|
14042
14116
|
let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
|
|
14043
|
-
return (index.h("div", { key: '
|
|
14117
|
+
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('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('searchingForAddresses', this.language)))), shouldShowNoResults && (index.h("div", { key: '212a74fed94b3ee089aed5c9afb544966b5f11cd', class: "postalcode__no-results-message" }, translate('postalLookUpNoAddressFound', this.language)))), index.h("small", { key: '4f66e97dd811b9917c92ff4bcbf236817ac57933', class: 'text__error-message' }, this.errorMessage)));
|
|
14044
14118
|
}
|
|
14045
14119
|
static get watchers() { return {
|
|
14046
|
-
"clientStyling": ["
|
|
14120
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14047
14121
|
"isValid": ["validityChanged"],
|
|
14048
14122
|
"emitValue": ["emitValueHandler"],
|
|
14049
14123
|
"addresses": ["handleAddresses"]
|
|
@@ -14059,11 +14133,6 @@ const RadioInput = class {
|
|
|
14059
14133
|
index.registerInstance(this, hostRef);
|
|
14060
14134
|
this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
|
|
14061
14135
|
this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
|
|
14062
|
-
this.setClientStyling = () => {
|
|
14063
|
-
let sheet = document.createElement('style');
|
|
14064
|
-
sheet.innerHTML = this.clientStyling;
|
|
14065
|
-
this.stylingContainer.prepend(sheet);
|
|
14066
|
-
};
|
|
14067
14136
|
this.name = undefined;
|
|
14068
14137
|
this.displayName = undefined;
|
|
14069
14138
|
this.optionsGroup = undefined;
|
|
@@ -14072,14 +14141,15 @@ const RadioInput = class {
|
|
|
14072
14141
|
this.language = undefined;
|
|
14073
14142
|
this.emitValue = undefined;
|
|
14074
14143
|
this.clientStyling = '';
|
|
14144
|
+
this.mbSource = undefined;
|
|
14075
14145
|
this.errorMessage = undefined;
|
|
14076
14146
|
this.isValid = undefined;
|
|
14077
|
-
this.limitStylingAppends = false;
|
|
14078
14147
|
this.showTooltip = false;
|
|
14079
14148
|
}
|
|
14080
|
-
|
|
14081
|
-
if (newValue !== oldValue)
|
|
14082
|
-
this.
|
|
14149
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14150
|
+
if (newValue !== oldValue) {
|
|
14151
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14152
|
+
}
|
|
14083
14153
|
}
|
|
14084
14154
|
validityChanged() {
|
|
14085
14155
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14104,14 +14174,17 @@ const RadioInput = class {
|
|
|
14104
14174
|
this.showTooltip = false;
|
|
14105
14175
|
}
|
|
14106
14176
|
}
|
|
14107
|
-
|
|
14108
|
-
|
|
14109
|
-
|
|
14110
|
-
|
|
14111
|
-
this.setClientStyling();
|
|
14112
|
-
this.limitStylingAppends = true;
|
|
14177
|
+
handleClientStyling() {
|
|
14178
|
+
if (window.emMessageBus !== undefined) {
|
|
14179
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14180
|
+
return;
|
|
14113
14181
|
}
|
|
14114
|
-
|
|
14182
|
+
if (this.clientStyling) {
|
|
14183
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14184
|
+
}
|
|
14185
|
+
}
|
|
14186
|
+
componentDidLoad() {
|
|
14187
|
+
this.handleClientStyling();
|
|
14115
14188
|
}
|
|
14116
14189
|
handleClick(event) {
|
|
14117
14190
|
this.value = event.target.value;
|
|
@@ -14134,11 +14207,11 @@ const RadioInput = class {
|
|
|
14134
14207
|
return null;
|
|
14135
14208
|
}
|
|
14136
14209
|
render() {
|
|
14137
|
-
return index.h("fieldset", { key: '
|
|
14138
|
-
index.h("img", { key: '
|
|
14210
|
+
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 &&
|
|
14211
|
+
index.h("img", { key: 'dfe155a429485b5c891db2943d9115cdc40e169b', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
14139
14212
|
}
|
|
14140
14213
|
static get watchers() { return {
|
|
14141
|
-
"clientStyling": ["
|
|
14214
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14142
14215
|
"isValid": ["validityChanged"],
|
|
14143
14216
|
"emitValue": ["emitValueHandler"]
|
|
14144
14217
|
}; }
|
|
@@ -14187,11 +14260,6 @@ const SelectInput = class {
|
|
|
14187
14260
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
14188
14261
|
this.emitValueHandler(true);
|
|
14189
14262
|
};
|
|
14190
|
-
this.setClientStyling = () => {
|
|
14191
|
-
let sheet = document.createElement('style');
|
|
14192
|
-
sheet.innerHTML = this.clientStyling;
|
|
14193
|
-
this.stylingContainer.prepend(sheet);
|
|
14194
|
-
};
|
|
14195
14263
|
this.name = undefined;
|
|
14196
14264
|
this.displayName = undefined;
|
|
14197
14265
|
this.placeholder = undefined;
|
|
@@ -14204,14 +14272,15 @@ const SelectInput = class {
|
|
|
14204
14272
|
this.language = undefined;
|
|
14205
14273
|
this.emitValue = undefined;
|
|
14206
14274
|
this.clientStyling = '';
|
|
14275
|
+
this.mbSource = undefined;
|
|
14207
14276
|
this.errorMessage = undefined;
|
|
14208
14277
|
this.isValid = undefined;
|
|
14209
|
-
this.limitStylingAppends = false;
|
|
14210
14278
|
this.showTooltip = false;
|
|
14211
14279
|
}
|
|
14212
|
-
|
|
14213
|
-
if (newValue !== oldValue)
|
|
14214
|
-
this.
|
|
14280
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14281
|
+
if (newValue !== oldValue) {
|
|
14282
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14283
|
+
}
|
|
14215
14284
|
}
|
|
14216
14285
|
validityChanged() {
|
|
14217
14286
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14261,16 +14330,17 @@ const SelectInput = class {
|
|
|
14261
14330
|
}
|
|
14262
14331
|
}
|
|
14263
14332
|
}
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14333
|
+
handleClientStyling() {
|
|
14334
|
+
if (window.emMessageBus !== undefined) {
|
|
14335
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14336
|
+
return;
|
|
14337
|
+
}
|
|
14338
|
+
if (this.clientStyling) {
|
|
14339
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14270
14340
|
}
|
|
14271
|
-
// end custom styling area
|
|
14272
14341
|
}
|
|
14273
14342
|
componentDidLoad() {
|
|
14343
|
+
this.handleClientStyling();
|
|
14274
14344
|
this.inputReference = this.vaadinCombo.querySelector('input');
|
|
14275
14345
|
if (this.defaultValue) {
|
|
14276
14346
|
this.value = this.defaultValue;
|
|
@@ -14335,13 +14405,13 @@ const SelectInput = class {
|
|
|
14335
14405
|
if (this.touched) {
|
|
14336
14406
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
14337
14407
|
}
|
|
14338
|
-
return index.h("div", { key: '
|
|
14339
|
-
index.h("img", { key: '
|
|
14408
|
+
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 &&
|
|
14409
|
+
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 })
|
|
14340
14410
|
:
|
|
14341
|
-
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: '
|
|
14411
|
+
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));
|
|
14342
14412
|
}
|
|
14343
14413
|
static get watchers() { return {
|
|
14344
|
-
"clientStyling": ["
|
|
14414
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14345
14415
|
"isValid": ["validityChanged"],
|
|
14346
14416
|
"emitValue": ["emitValueHandler"]
|
|
14347
14417
|
}; }
|
|
@@ -14376,11 +14446,6 @@ const TelInput = class {
|
|
|
14376
14446
|
this.isValid = this.isValidValue();
|
|
14377
14447
|
this.errorMessage = this.setErrorMessage();
|
|
14378
14448
|
};
|
|
14379
|
-
this.setClientStyling = () => {
|
|
14380
|
-
let sheet = document.createElement('style');
|
|
14381
|
-
sheet.innerHTML = this.clientStyling;
|
|
14382
|
-
this.stylingContainer.prepend(sheet);
|
|
14383
|
-
};
|
|
14384
14449
|
this.name = undefined;
|
|
14385
14450
|
this.displayName = undefined;
|
|
14386
14451
|
this.placeholder = undefined;
|
|
@@ -14393,9 +14458,9 @@ const TelInput = class {
|
|
|
14393
14458
|
this.language = undefined;
|
|
14394
14459
|
this.emitValue = undefined;
|
|
14395
14460
|
this.clientStyling = '';
|
|
14461
|
+
this.mbSource = undefined;
|
|
14396
14462
|
this.isValid = undefined;
|
|
14397
14463
|
this.errorMessage = undefined;
|
|
14398
|
-
this.limitStylingAppends = false;
|
|
14399
14464
|
this.showTooltip = false;
|
|
14400
14465
|
this.disablePhonePrefix = false;
|
|
14401
14466
|
this.phoneValue = '';
|
|
@@ -14407,9 +14472,10 @@ const TelInput = class {
|
|
|
14407
14472
|
if (this.inputReference)
|
|
14408
14473
|
this.inputReference.value = this.phoneValue;
|
|
14409
14474
|
}
|
|
14410
|
-
|
|
14411
|
-
if (newValue !== oldValue)
|
|
14412
|
-
this.
|
|
14475
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14476
|
+
if (newValue !== oldValue) {
|
|
14477
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14478
|
+
}
|
|
14413
14479
|
}
|
|
14414
14480
|
validityChanged() {
|
|
14415
14481
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14460,16 +14526,17 @@ const TelInput = class {
|
|
|
14460
14526
|
}
|
|
14461
14527
|
}
|
|
14462
14528
|
}
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14529
|
+
handleClientStyling() {
|
|
14530
|
+
if (window.emMessageBus !== undefined) {
|
|
14531
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14532
|
+
return;
|
|
14533
|
+
}
|
|
14534
|
+
if (this.clientStyling) {
|
|
14535
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14469
14536
|
}
|
|
14470
|
-
// end custom styling area
|
|
14471
14537
|
}
|
|
14472
14538
|
componentDidLoad() {
|
|
14539
|
+
this.handleClientStyling();
|
|
14473
14540
|
this.isValid = this.isValidValue();
|
|
14474
14541
|
if (this.defaultValue) {
|
|
14475
14542
|
this.value = this.defaultValue;
|
|
@@ -14561,11 +14628,11 @@ const TelInput = class {
|
|
|
14561
14628
|
if (this.touched) {
|
|
14562
14629
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
14563
14630
|
}
|
|
14564
|
-
return index.h("div", { key: '
|
|
14565
|
-
index.h("img", { key: '
|
|
14631
|
+
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 &&
|
|
14632
|
+
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));
|
|
14566
14633
|
}
|
|
14567
14634
|
static get watchers() { return {
|
|
14568
|
-
"clientStyling": ["
|
|
14635
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14569
14636
|
"isValid": ["validityChanged"],
|
|
14570
14637
|
"emitValue": ["emitValueHandler"]
|
|
14571
14638
|
}; }
|
|
@@ -14609,11 +14676,6 @@ const TextInput = class {
|
|
|
14609
14676
|
this.touched = true;
|
|
14610
14677
|
this.updateValidationState();
|
|
14611
14678
|
};
|
|
14612
|
-
this.setClientStyling = () => {
|
|
14613
|
-
let sheet = document.createElement('style');
|
|
14614
|
-
sheet.innerHTML = this.clientStyling;
|
|
14615
|
-
this.stylingContainer.prepend(sheet);
|
|
14616
|
-
};
|
|
14617
14679
|
this.name = undefined;
|
|
14618
14680
|
this.displayName = undefined;
|
|
14619
14681
|
this.placeholder = undefined;
|
|
@@ -14628,15 +14690,16 @@ const TextInput = class {
|
|
|
14628
14690
|
this.clientStyling = '';
|
|
14629
14691
|
this.haspostalcodelookup = undefined;
|
|
14630
14692
|
this.enableSouthAfricanMode = undefined;
|
|
14693
|
+
this.mbSource = undefined;
|
|
14631
14694
|
this.isValid = undefined;
|
|
14632
14695
|
this.errorMessage = '';
|
|
14633
|
-
this.limitStylingAppends = false;
|
|
14634
14696
|
this.showTooltip = false;
|
|
14635
14697
|
this.selectedCountryCode = '';
|
|
14636
14698
|
}
|
|
14637
|
-
|
|
14638
|
-
if (newValue !== oldValue)
|
|
14639
|
-
this.
|
|
14699
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14700
|
+
if (newValue !== oldValue) {
|
|
14701
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14702
|
+
}
|
|
14640
14703
|
}
|
|
14641
14704
|
validityChanged() {
|
|
14642
14705
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14748,21 +14811,22 @@ const TextInput = class {
|
|
|
14748
14811
|
}
|
|
14749
14812
|
this.validityStateHandler({ valid: false, name: this.name });
|
|
14750
14813
|
}
|
|
14751
|
-
componentDidRender() {
|
|
14752
|
-
// start custom styling area
|
|
14753
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
14754
|
-
if (this.clientStyling)
|
|
14755
|
-
this.setClientStyling();
|
|
14756
|
-
this.limitStylingAppends = true;
|
|
14757
|
-
}
|
|
14758
|
-
// end custom styling area
|
|
14759
|
-
}
|
|
14760
14814
|
componentWillLoad() {
|
|
14761
14815
|
if (this.defaultValue) {
|
|
14762
14816
|
this.value = this.defaultValue;
|
|
14763
14817
|
}
|
|
14764
14818
|
}
|
|
14819
|
+
handleClientStyling() {
|
|
14820
|
+
if (window.emMessageBus !== undefined) {
|
|
14821
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14822
|
+
return;
|
|
14823
|
+
}
|
|
14824
|
+
if (this.clientStyling) {
|
|
14825
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14826
|
+
}
|
|
14827
|
+
}
|
|
14765
14828
|
componentDidLoad() {
|
|
14829
|
+
this.handleClientStyling();
|
|
14766
14830
|
if (this.defaultValue) {
|
|
14767
14831
|
this.value = this.defaultValue;
|
|
14768
14832
|
this.valueHandler({ name: this.name, value: this.value });
|
|
@@ -14874,11 +14938,11 @@ const TextInput = class {
|
|
|
14874
14938
|
if (this.touched) {
|
|
14875
14939
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
14876
14940
|
}
|
|
14877
|
-
return index.h("div", { key: '
|
|
14878
|
-
index.h("img", { key: '
|
|
14941
|
+
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 &&
|
|
14942
|
+
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));
|
|
14879
14943
|
}
|
|
14880
14944
|
static get watchers() { return {
|
|
14881
|
-
"clientStyling": ["
|
|
14945
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14882
14946
|
"isValid": ["validityChanged"],
|
|
14883
14947
|
"emitValue": ["emitValueHandler"]
|
|
14884
14948
|
}; }
|
|
@@ -14900,11 +14964,6 @@ const ToggleCheckboxInput = class {
|
|
|
14900
14964
|
event.stopPropagation();
|
|
14901
14965
|
window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
|
|
14902
14966
|
};
|
|
14903
|
-
this.setClientStyling = () => {
|
|
14904
|
-
let sheet = document.createElement('style');
|
|
14905
|
-
sheet.innerHTML = this.clientStyling;
|
|
14906
|
-
this.stylingContainer.prepend(sheet);
|
|
14907
|
-
};
|
|
14908
14967
|
this.name = undefined;
|
|
14909
14968
|
this.displayName = undefined;
|
|
14910
14969
|
this.defaultValue = '';
|
|
@@ -14915,15 +14974,16 @@ const ToggleCheckboxInput = class {
|
|
|
14915
14974
|
this.language = undefined;
|
|
14916
14975
|
this.emitValue = undefined;
|
|
14917
14976
|
this.clientStyling = '';
|
|
14977
|
+
this.mbSource = undefined;
|
|
14918
14978
|
this.errorMessage = undefined;
|
|
14919
14979
|
this.isValid = undefined;
|
|
14920
|
-
this.limitStylingAppends = false;
|
|
14921
14980
|
this.showTooltip = false;
|
|
14922
14981
|
this.showFields = this.defaultValue === 'true';
|
|
14923
14982
|
}
|
|
14924
|
-
|
|
14925
|
-
if (newValue !== oldValue)
|
|
14926
|
-
this.
|
|
14983
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14984
|
+
if (newValue !== oldValue) {
|
|
14985
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14986
|
+
}
|
|
14927
14987
|
}
|
|
14928
14988
|
validityStateHandler(inputStateEvent) {
|
|
14929
14989
|
this.sendValidityState.emit(inputStateEvent);
|
|
@@ -14937,16 +14997,17 @@ const ToggleCheckboxInput = class {
|
|
|
14937
14997
|
this.showTooltip = false;
|
|
14938
14998
|
}
|
|
14939
14999
|
}
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
15000
|
+
handleClientStyling() {
|
|
15001
|
+
if (window.emMessageBus !== undefined) {
|
|
15002
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
15003
|
+
return;
|
|
15004
|
+
}
|
|
15005
|
+
if (this.clientStyling) {
|
|
15006
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14946
15007
|
}
|
|
14947
|
-
// end custom styling area
|
|
14948
15008
|
}
|
|
14949
15009
|
componentDidLoad() {
|
|
15010
|
+
this.handleClientStyling();
|
|
14950
15011
|
if (this.options.length === 0)
|
|
14951
15012
|
return;
|
|
14952
15013
|
this.options.forEach((subField) => {
|
|
@@ -14983,13 +15044,13 @@ const ToggleCheckboxInput = class {
|
|
|
14983
15044
|
return null;
|
|
14984
15045
|
}
|
|
14985
15046
|
render() {
|
|
14986
|
-
return index.h("div", { key: '
|
|
14987
|
-
index.h("img", { key: '
|
|
15047
|
+
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 &&
|
|
15048
|
+
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 => {
|
|
14988
15049
|
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 });
|
|
14989
15050
|
})));
|
|
14990
15051
|
}
|
|
14991
15052
|
static get watchers() { return {
|
|
14992
|
-
"clientStyling": ["
|
|
15053
|
+
"clientStyling": ["handleClientStylingChange"]
|
|
14993
15054
|
}; }
|
|
14994
15055
|
};
|
|
14995
15056
|
ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
|
|
@@ -15015,17 +15076,6 @@ const TwofaInput = class {
|
|
|
15015
15076
|
this.triggerResendInterval();
|
|
15016
15077
|
this.resendCode.emit();
|
|
15017
15078
|
};
|
|
15018
|
-
this.setClientStylingURL = () => {
|
|
15019
|
-
let url = new URL(this.clientStylingUrl);
|
|
15020
|
-
let cssFile = document.createElement('style');
|
|
15021
|
-
fetch(url.href)
|
|
15022
|
-
.then((res) => res.text())
|
|
15023
|
-
.then((data) => {
|
|
15024
|
-
cssFile.innerHTML = data;
|
|
15025
|
-
this.clientStyling = data;
|
|
15026
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
15027
|
-
});
|
|
15028
|
-
};
|
|
15029
15079
|
this.setInputRef = (el, idx) => {
|
|
15030
15080
|
if (el) {
|
|
15031
15081
|
this.inputRefs[idx] = el;
|
|
@@ -15081,21 +15131,6 @@ const TwofaInput = class {
|
|
|
15081
15131
|
this.setValidity();
|
|
15082
15132
|
this.setErrorMessage();
|
|
15083
15133
|
};
|
|
15084
|
-
this.setClientStyling = () => {
|
|
15085
|
-
let sheet = document.createElement('style');
|
|
15086
|
-
sheet.innerHTML = this.clientStyling;
|
|
15087
|
-
this.stylingContainer.prepend(sheet);
|
|
15088
|
-
};
|
|
15089
|
-
this.setStreamStyling = (domain) => {
|
|
15090
|
-
if (window.emMessageBus) {
|
|
15091
|
-
const sheet = document.createElement('style');
|
|
15092
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
15093
|
-
sheet.innerHTML = data;
|
|
15094
|
-
this.clientStyling = data;
|
|
15095
|
-
this.host.shadowRoot.prepend(sheet);
|
|
15096
|
-
});
|
|
15097
|
-
}
|
|
15098
|
-
};
|
|
15099
15134
|
this.name = '';
|
|
15100
15135
|
this.displayName = '';
|
|
15101
15136
|
this.placeholder = '';
|
|
@@ -15110,7 +15145,6 @@ const TwofaInput = class {
|
|
|
15110
15145
|
this.pinAttemptsExceeded = undefined;
|
|
15111
15146
|
this.clientStylingUrl = '';
|
|
15112
15147
|
this.mbSource = undefined;
|
|
15113
|
-
this.limitStylingAppends = false;
|
|
15114
15148
|
this.isValid = false;
|
|
15115
15149
|
this.isResendButtonAvailable = true;
|
|
15116
15150
|
this.showTooltip = false;
|
|
@@ -15130,9 +15164,16 @@ const TwofaInput = class {
|
|
|
15130
15164
|
this.valueHandler({ name: this.name, value: this.code.join('') });
|
|
15131
15165
|
}
|
|
15132
15166
|
}
|
|
15133
|
-
|
|
15134
|
-
if (newValue !== oldValue)
|
|
15135
|
-
this.
|
|
15167
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
15168
|
+
if (newValue !== oldValue) {
|
|
15169
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15170
|
+
}
|
|
15171
|
+
}
|
|
15172
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
15173
|
+
if (newValue !== oldValue) {
|
|
15174
|
+
if (this.clientStylingUrl)
|
|
15175
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
15176
|
+
}
|
|
15136
15177
|
}
|
|
15137
15178
|
validityStateHandler(inputStateEvent) {
|
|
15138
15179
|
this.sendValidityState.emit(inputStateEvent);
|
|
@@ -15146,10 +15187,6 @@ const TwofaInput = class {
|
|
|
15146
15187
|
this.showTooltip = false;
|
|
15147
15188
|
}
|
|
15148
15189
|
}
|
|
15149
|
-
handleStylingChange(newValue, oldValue) {
|
|
15150
|
-
if (newValue !== oldValue)
|
|
15151
|
-
this.setClientStyling();
|
|
15152
|
-
}
|
|
15153
15190
|
connectedCallback() {
|
|
15154
15191
|
this.validationPattern = this.setPattern();
|
|
15155
15192
|
this.code = new Array(this.validation.maxLength).fill('');
|
|
@@ -15157,30 +15194,21 @@ const TwofaInput = class {
|
|
|
15157
15194
|
disconnectedCallback() {
|
|
15158
15195
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
15159
15196
|
}
|
|
15160
|
-
|
|
15161
|
-
if (
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
}
|
|
15165
|
-
this.limitStylingAppends = true;
|
|
15197
|
+
handleClientStyling() {
|
|
15198
|
+
if (window.emMessageBus !== undefined) {
|
|
15199
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
15200
|
+
return;
|
|
15166
15201
|
}
|
|
15202
|
+
if (this.clientStyling)
|
|
15203
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15204
|
+
if (this.clientStylingUrl)
|
|
15205
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
15167
15206
|
}
|
|
15168
15207
|
componentDidLoad() {
|
|
15169
15208
|
this.setValidity();
|
|
15170
15209
|
this.registrationWidgetLoaded.emit();
|
|
15171
15210
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
15172
|
-
|
|
15173
|
-
if (window.emMessageBus != undefined) {
|
|
15174
|
-
this.setStreamStyling(`${this.mbSource}.Style`);
|
|
15175
|
-
}
|
|
15176
|
-
else {
|
|
15177
|
-
if (this.clientStyling)
|
|
15178
|
-
this.setClientStyling();
|
|
15179
|
-
if (this.clientStylingUrl)
|
|
15180
|
-
this.setClientStylingURL();
|
|
15181
|
-
this.limitStylingAppends = true;
|
|
15182
|
-
}
|
|
15183
|
-
}
|
|
15211
|
+
this.handleClientStyling();
|
|
15184
15212
|
}
|
|
15185
15213
|
handleKeyDown(e, idx) {
|
|
15186
15214
|
if (e.key === 'Backspace') {
|
|
@@ -15271,9 +15299,9 @@ const TwofaInput = class {
|
|
|
15271
15299
|
return current;
|
|
15272
15300
|
}
|
|
15273
15301
|
render() {
|
|
15274
|
-
return (index.h("div", { key: '
|
|
15302
|
+
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('twofaDescription', this.language, { values: { destination: this.destination } }) }), index.h("div", { key: '702c342eb7be0001ab8de310cadd7e8684a8025d', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
|
|
15275
15303
|
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) }));
|
|
15276
|
-
})), index.h("div", { key: '
|
|
15304
|
+
})), index.h("div", { key: '63564bd4a0442232f81058ba914ee86c537ce85a', class: "twofa__button-wrapper" }, index.h("p", { key: '219f5005c0d03189df48f05c5e0cd980eb0e1979', class: "twofa__resend-message" }, translate('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
|
|
15277
15305
|
? translate('twofaResendButton', this.language)
|
|
15278
15306
|
: this.formatTime()))));
|
|
15279
15307
|
}
|
|
@@ -15281,8 +15309,8 @@ const TwofaInput = class {
|
|
|
15281
15309
|
static get watchers() { return {
|
|
15282
15310
|
"isValid": ["validityChanged"],
|
|
15283
15311
|
"emitValue": ["emitValueHandler"],
|
|
15284
|
-
"
|
|
15285
|
-
"
|
|
15312
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
15313
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
15286
15314
|
}; }
|
|
15287
15315
|
};
|
|
15288
15316
|
TwofaInput.style = TwofaInputStyle0;
|