@everymatrix/general-input 1.90.6 → 1.90.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/checkbox-group-input_14.cjs.entry.js +373 -345
- package/dist/cjs/general-input.cjs.js +2 -2
- package/dist/cjs/{index-3b546c2c.js → index-7a4b2771.js} +1 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +34 -20
- package/dist/collection/components/checkbox-input/checkbox-input.js +33 -19
- package/dist/collection/components/date-input/date-input.js +34 -20
- package/dist/collection/components/email-input/email-input.js +34 -20
- package/dist/collection/components/general-input/general-input.js +35 -64
- package/dist/collection/components/number-input/number-input.js +34 -20
- package/dist/collection/components/password-input/password-input.js +34 -20
- package/dist/collection/components/postalcode-input/postalcode-input.js +35 -19
- package/dist/collection/components/radio-input/radio-input.js +36 -20
- package/dist/collection/components/select-input/select-input.js +35 -21
- package/dist/collection/components/tel-input/tel-input.js +34 -20
- package/dist/collection/components/text-input/text-input.js +36 -22
- package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +34 -20
- package/dist/collection/components/twofa-input/twofa-input.js +26 -59
- package/dist/esm/checkbox-group-input_14.entry.js +373 -345
- package/dist/esm/general-input.js +3 -3
- package/dist/esm/{index-ca174b7a.js → index-9174417a.js} +1 -4
- package/dist/esm/loader.js +3 -3
- package/dist/general-input/checkbox-group-input_14.entry.js +242 -242
- package/dist/general-input/general-input.esm.js +1 -1
- package/dist/general-input/{index-ca174b7a.js → index-9174417a.js} +2 -2
- package/dist/types/components/checkbox-group-input/checkbox-group-input.d.ts +7 -4
- package/dist/types/components/checkbox-input/checkbox-input.d.ts +7 -4
- package/dist/types/components/date-input/date-input.d.ts +7 -4
- package/dist/types/components/email-input/email-input.d.ts +7 -4
- package/dist/types/components/general-input/general-input.d.ts +4 -6
- package/dist/types/components/number-input/number-input.d.ts +7 -4
- package/dist/types/components/password-input/password-input.d.ts +7 -4
- package/dist/types/components/postalcode-input/postalcode-input.d.ts +7 -4
- package/dist/types/components/radio-input/radio-input.d.ts +8 -4
- package/dist/types/components/select-input/select-input.d.ts +7 -4
- package/dist/types/components/tel-input/tel-input.d.ts +7 -4
- package/dist/types/components/text-input/text-input.d.ts +7 -4
- package/dist/types/components/toggle-checkbox-input/toggle-checkbox-input.d.ts +7 -4
- package/dist/types/components/twofa-input/twofa-input.d.ts +3 -7
- package/dist/types/components.d.ts +96 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-9174417a.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const TRANSLATIONS = {
|
|
@@ -374,6 +374,124 @@ const validateID = (id) => {
|
|
|
374
374
|
|
|
375
375
|
const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
|
|
376
376
|
|
|
377
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @name setClientStyling
|
|
381
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
382
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
383
|
+
* @param {string} clientStyling The style content
|
|
384
|
+
*/
|
|
385
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
386
|
+
if (stylingContainer) {
|
|
387
|
+
const sheet = document.createElement('style');
|
|
388
|
+
sheet.innerHTML = clientStyling;
|
|
389
|
+
stylingContainer.appendChild(sheet);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @name setClientStylingURL
|
|
395
|
+
* @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
|
|
396
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
397
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
398
|
+
*/
|
|
399
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
400
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
401
|
+
|
|
402
|
+
const url = new URL(clientStylingUrl);
|
|
403
|
+
|
|
404
|
+
fetch(url.href)
|
|
405
|
+
.then((res) => res.text())
|
|
406
|
+
.then((data) => {
|
|
407
|
+
const cssFile = document.createElement('style');
|
|
408
|
+
cssFile.innerHTML = data;
|
|
409
|
+
if (stylingContainer) {
|
|
410
|
+
stylingContainer.appendChild(cssFile);
|
|
411
|
+
}
|
|
412
|
+
})
|
|
413
|
+
.catch((err) => {
|
|
414
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* @name setStreamLibrary
|
|
420
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
421
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
422
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
423
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
424
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
425
|
+
*/
|
|
426
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
427
|
+
if (!window.emMessageBus) return;
|
|
428
|
+
|
|
429
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
430
|
+
|
|
431
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
432
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
433
|
+
|
|
434
|
+
return subscription;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (!window[StyleCacheKey]) {
|
|
438
|
+
window[StyleCacheKey] = {};
|
|
439
|
+
}
|
|
440
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
441
|
+
|
|
442
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
443
|
+
const wrappedUnsubscribe = () => {
|
|
444
|
+
if (window[StyleCacheKey][domain]) {
|
|
445
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
446
|
+
cachedObject.refCount > 1
|
|
447
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
448
|
+
: delete window[StyleCacheKey][domain];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
originalUnsubscribe();
|
|
452
|
+
};
|
|
453
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
454
|
+
|
|
455
|
+
return subscription;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
459
|
+
const sheet = document.createElement('style');
|
|
460
|
+
|
|
461
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
462
|
+
if (stylingContainer) {
|
|
463
|
+
sheet.innerHTML = data;
|
|
464
|
+
stylingContainer.appendChild(sheet);
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
470
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
471
|
+
if (!stylingContainer) return;
|
|
472
|
+
|
|
473
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
474
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
475
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
476
|
+
|
|
477
|
+
if (!cachedStyle) {
|
|
478
|
+
cachedStyle = new CSSStyleSheet();
|
|
479
|
+
cachedStyle.replaceSync(data);
|
|
480
|
+
cacheStyleObject[domain] = {
|
|
481
|
+
sheet: cachedStyle,
|
|
482
|
+
refCount: 1
|
|
483
|
+
};
|
|
484
|
+
} else {
|
|
485
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
489
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
490
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
|
|
377
495
|
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}";
|
|
378
496
|
const CheckboxGroupInputStyle0 = checkboxGroupInputCss;
|
|
379
497
|
|
|
@@ -383,11 +501,6 @@ const CheckboxGroupInput = class {
|
|
|
383
501
|
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
384
502
|
this.sendInputValue = createEvent(this, "sendInputValue", 7);
|
|
385
503
|
this.value = null;
|
|
386
|
-
this.setClientStyling = () => {
|
|
387
|
-
let sheet = document.createElement('style');
|
|
388
|
-
sheet.innerHTML = this.clientStyling;
|
|
389
|
-
this.stylingContainer.prepend(sheet);
|
|
390
|
-
};
|
|
391
504
|
this.name = undefined;
|
|
392
505
|
this.displayName = undefined;
|
|
393
506
|
this.defaultValue = '';
|
|
@@ -398,16 +511,17 @@ const CheckboxGroupInput = class {
|
|
|
398
511
|
this.language = undefined;
|
|
399
512
|
this.emitValue = undefined;
|
|
400
513
|
this.clientStyling = '';
|
|
514
|
+
this.mbSource = undefined;
|
|
401
515
|
this.errorMessage = undefined;
|
|
402
516
|
this.isValid = undefined;
|
|
403
|
-
this.limitStylingAppends = false;
|
|
404
517
|
this.showTooltip = false;
|
|
405
518
|
this.selectedValues = [];
|
|
406
519
|
this.showCheckboxes = false;
|
|
407
520
|
}
|
|
408
|
-
|
|
409
|
-
if (newValue !== oldValue)
|
|
410
|
-
this.
|
|
521
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
522
|
+
if (newValue !== oldValue) {
|
|
523
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
524
|
+
}
|
|
411
525
|
}
|
|
412
526
|
validityChanged() {
|
|
413
527
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -439,16 +553,17 @@ const CheckboxGroupInput = class {
|
|
|
439
553
|
this.showTooltip = false;
|
|
440
554
|
}
|
|
441
555
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
556
|
+
handleClientStyling() {
|
|
557
|
+
if (window.emMessageBus !== undefined) {
|
|
558
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
if (this.clientStyling) {
|
|
562
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
448
563
|
}
|
|
449
|
-
// end custom styling area
|
|
450
564
|
}
|
|
451
565
|
componentDidLoad() {
|
|
566
|
+
this.handleClientStyling();
|
|
452
567
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
453
568
|
// For now this input has no validation. Send isValid as true immediately.
|
|
454
569
|
//@TODO: add validation logic to it, if business reason arises.
|
|
@@ -485,14 +600,14 @@ const CheckboxGroupInput = class {
|
|
|
485
600
|
return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
|
|
486
601
|
}
|
|
487
602
|
render() {
|
|
488
|
-
return h("div", { key: '
|
|
489
|
-
h("img", { key: '
|
|
603
|
+
return h("div", { key: '342900ae923094f2746fd43917743d01efba942e', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '8f3b470274047b355741b438a4e15c7c46504f5a', class: 'checkboxgroup__wrapper--flex' }, 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 &&
|
|
604
|
+
h("img", { key: '75d807ad544e043a2e3beed46bf0c7dfa2125324', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: '4b17e1e613c7561fb3c99f334926544ef2ba787a', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (h("vaadin-checkbox-group", { key: '9a8d573a7cb48bb2d68cceec5f39f1e0886ea05f', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
|
|
490
605
|
this.selectedValues = event.detail.value;
|
|
491
606
|
} }, this.options.map((checkbox) => h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName })))));
|
|
492
607
|
}
|
|
493
608
|
get element() { return getElement(this); }
|
|
494
609
|
static get watchers() { return {
|
|
495
|
-
"clientStyling": ["
|
|
610
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
496
611
|
"isValid": ["validityChanged"],
|
|
497
612
|
"selectedValues": ["setValue"],
|
|
498
613
|
"emitValue": ["emitValueHandler"]
|
|
@@ -509,11 +624,6 @@ const CheckboxInput = class {
|
|
|
509
624
|
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
510
625
|
this.sendInputValue = createEvent(this, "sendInputValue", 7);
|
|
511
626
|
this.value = '';
|
|
512
|
-
this.setClientStyling = () => {
|
|
513
|
-
let sheet = document.createElement('style');
|
|
514
|
-
sheet.innerHTML = this.clientStyling;
|
|
515
|
-
this.stylingContainer.prepend(sheet);
|
|
516
|
-
};
|
|
517
627
|
this.name = undefined;
|
|
518
628
|
this.displayName = undefined;
|
|
519
629
|
this.defaultValue = '';
|
|
@@ -523,14 +633,15 @@ const CheckboxInput = class {
|
|
|
523
633
|
this.language = undefined;
|
|
524
634
|
this.emitValue = undefined;
|
|
525
635
|
this.clientStyling = '';
|
|
636
|
+
this.mbSource = undefined;
|
|
526
637
|
this.errorMessage = undefined;
|
|
527
638
|
this.isValid = undefined;
|
|
528
|
-
this.limitStylingAppends = false;
|
|
529
639
|
this.showTooltip = false;
|
|
530
640
|
}
|
|
531
|
-
|
|
532
|
-
if (newValue !== oldValue)
|
|
533
|
-
this.
|
|
641
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
642
|
+
if (newValue !== oldValue) {
|
|
643
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
644
|
+
}
|
|
534
645
|
}
|
|
535
646
|
validityChanged() {
|
|
536
647
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -555,16 +666,17 @@ const CheckboxInput = class {
|
|
|
555
666
|
this.showTooltip = false;
|
|
556
667
|
}
|
|
557
668
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
669
|
+
handleClientStyling() {
|
|
670
|
+
if (window.emMessageBus !== undefined) {
|
|
671
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (this.clientStyling) {
|
|
675
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
564
676
|
}
|
|
565
|
-
// end custom styling area
|
|
566
677
|
}
|
|
567
678
|
componentDidLoad() {
|
|
679
|
+
this.handleClientStyling();
|
|
568
680
|
this.inputReference = this.vaadinCheckbox.querySelector('input');
|
|
569
681
|
if (this.defaultValue) {
|
|
570
682
|
this.value = this.defaultValue;
|
|
@@ -599,10 +711,10 @@ const CheckboxInput = class {
|
|
|
599
711
|
return null;
|
|
600
712
|
}
|
|
601
713
|
render() {
|
|
602
|
-
return (h("div", { key: '
|
|
714
|
+
return (h("div", { key: 'a8d8bf6aa2001b6aee44d728a198244819ae169e', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, 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 && (h("img", { key: '008bb9a318c914b4b40e80b15080f7f174cc1262', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
|
|
603
715
|
}
|
|
604
716
|
static get watchers() { return {
|
|
605
|
-
"clientStyling": ["
|
|
717
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
606
718
|
"isValid": ["validityChanged"],
|
|
607
719
|
"emitValue": ["emitValueHandler"]
|
|
608
720
|
}; }
|
|
@@ -5993,11 +6105,6 @@ const DateInput = class {
|
|
|
5993
6105
|
const date = parse(inputValue, this.dateFormat, new Date());
|
|
5994
6106
|
return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
|
|
5995
6107
|
};
|
|
5996
|
-
this.setClientStyling = () => {
|
|
5997
|
-
let sheet = document.createElement('style');
|
|
5998
|
-
sheet.innerHTML = this.clientStyling;
|
|
5999
|
-
this.stylingContainer.prepend(sheet);
|
|
6000
|
-
};
|
|
6001
6108
|
this.handleDocumentIdUpdate = (e) => {
|
|
6002
6109
|
if (this.name !== CONSTANTS.BIRTHDATE) {
|
|
6003
6110
|
return;
|
|
@@ -6084,9 +6191,9 @@ const DateInput = class {
|
|
|
6084
6191
|
this.emitOnClick = false;
|
|
6085
6192
|
this.enableSouthAfricanMode = undefined;
|
|
6086
6193
|
this.enableManualDateInput = false;
|
|
6194
|
+
this.mbSource = undefined;
|
|
6087
6195
|
this.errorMessage = undefined;
|
|
6088
6196
|
this.isValid = undefined;
|
|
6089
|
-
this.limitStylingAppends = false;
|
|
6090
6197
|
this.showTooltip = false;
|
|
6091
6198
|
}
|
|
6092
6199
|
get formattedValue() {
|
|
@@ -6095,9 +6202,10 @@ const DateInput = class {
|
|
|
6095
6202
|
const parsedDate = parse(this.value, 'yyyy-MM-dd', new Date());
|
|
6096
6203
|
return format(parsedDate, this.dateFormat);
|
|
6097
6204
|
}
|
|
6098
|
-
|
|
6099
|
-
if (newValue !== oldValue)
|
|
6100
|
-
this.
|
|
6205
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
6206
|
+
if (newValue !== oldValue) {
|
|
6207
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6208
|
+
}
|
|
6101
6209
|
}
|
|
6102
6210
|
validityChanged() {
|
|
6103
6211
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -6135,17 +6243,18 @@ const DateInput = class {
|
|
|
6135
6243
|
this.minDate = parse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
|
|
6136
6244
|
this.maxDate = parse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
|
|
6137
6245
|
}
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6246
|
+
handleClientStyling() {
|
|
6247
|
+
if (window.emMessageBus !== undefined) {
|
|
6248
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
6249
|
+
return;
|
|
6250
|
+
}
|
|
6251
|
+
if (this.clientStyling) {
|
|
6252
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6144
6253
|
}
|
|
6145
|
-
// end custom styling area
|
|
6146
6254
|
}
|
|
6147
6255
|
componentDidLoad() {
|
|
6148
6256
|
var _a;
|
|
6257
|
+
this.handleClientStyling();
|
|
6149
6258
|
this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
|
|
6150
6259
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
6151
6260
|
if (this.datePicker) {
|
|
@@ -6300,12 +6409,12 @@ const DateInput = class {
|
|
|
6300
6409
|
if (this.touched) {
|
|
6301
6410
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
6302
6411
|
}
|
|
6303
|
-
return h("div", { key: '
|
|
6304
|
-
h("img", { key: '
|
|
6412
|
+
return h("div", { key: 'ffff8be16fb22a41ea8c5168a79e40b9f410c63b', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("label", { key: '60da1ad0bc4cc7757e6f1096866667a97bd146b5', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '450b4638efa34f4490035b0d99b0b186f053a2d0', class: this.validation.mandatory ? 'date__label--required' : '' })), 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 }), h("small", { key: '33a6fed8057a84cb648f94a318c3ec0b1e495fff', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
|
|
6413
|
+
h("img", { key: 'd91fcd13e1ae384b67b6d478834b65136ab77b77', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
6305
6414
|
}
|
|
6306
6415
|
get element() { return getElement(this); }
|
|
6307
6416
|
static get watchers() { return {
|
|
6308
|
-
"clientStyling": ["
|
|
6417
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
6309
6418
|
"isValid": ["validityChanged"],
|
|
6310
6419
|
"emitValue": ["emitValueHandler"],
|
|
6311
6420
|
"enableSouthAfricanMode": ["handleCustomRegistrationChange"]
|
|
@@ -6340,11 +6449,6 @@ const EmailInput = class {
|
|
|
6340
6449
|
this.errorMessage = this.setErrorMessage();
|
|
6341
6450
|
this.touched = true;
|
|
6342
6451
|
};
|
|
6343
|
-
this.setClientStyling = () => {
|
|
6344
|
-
let sheet = document.createElement('style');
|
|
6345
|
-
sheet.innerHTML = this.clientStyling;
|
|
6346
|
-
this.stylingContainer.prepend(sheet);
|
|
6347
|
-
};
|
|
6348
6452
|
this.name = undefined;
|
|
6349
6453
|
this.displayName = undefined;
|
|
6350
6454
|
this.placeholder = undefined;
|
|
@@ -6356,14 +6460,15 @@ const EmailInput = class {
|
|
|
6356
6460
|
this.emitValue = undefined;
|
|
6357
6461
|
this.isDuplicateInput = undefined;
|
|
6358
6462
|
this.clientStyling = '';
|
|
6463
|
+
this.mbSource = undefined;
|
|
6359
6464
|
this.errorMessage = undefined;
|
|
6360
6465
|
this.isValid = undefined;
|
|
6361
|
-
this.limitStylingAppends = false;
|
|
6362
6466
|
this.showTooltip = false;
|
|
6363
6467
|
}
|
|
6364
|
-
|
|
6365
|
-
if (newValue !== oldValue)
|
|
6366
|
-
this.
|
|
6468
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
6469
|
+
if (newValue !== oldValue) {
|
|
6470
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6471
|
+
}
|
|
6367
6472
|
}
|
|
6368
6473
|
validityChanged() {
|
|
6369
6474
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -6398,16 +6503,17 @@ const EmailInput = class {
|
|
|
6398
6503
|
connectedCallback() {
|
|
6399
6504
|
this.validationPattern = this.setPattern();
|
|
6400
6505
|
}
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6506
|
+
handleClientStyling() {
|
|
6507
|
+
if (window.emMessageBus !== undefined) {
|
|
6508
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
6509
|
+
return;
|
|
6510
|
+
}
|
|
6511
|
+
if (this.clientStyling) {
|
|
6512
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
6407
6513
|
}
|
|
6408
|
-
// end custom styling area
|
|
6409
6514
|
}
|
|
6410
6515
|
componentDidLoad() {
|
|
6516
|
+
this.handleClientStyling();
|
|
6411
6517
|
this.isValid = this.setValidity();
|
|
6412
6518
|
if (this.defaultValue) {
|
|
6413
6519
|
this.value = this.defaultValue;
|
|
@@ -6453,11 +6559,11 @@ const EmailInput = class {
|
|
|
6453
6559
|
if (this.touched) {
|
|
6454
6560
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
6455
6561
|
}
|
|
6456
|
-
return h("div", { key: '
|
|
6457
|
-
h("img", { key: '
|
|
6562
|
+
return h("div", { key: 'f852525fe8d8b695e638fdd83e8b0c2c20d98771', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'd6a6dec4e76ba1fbe15bed09f82cecde12cabe1a', class: 'email__wrapper--flex' }, h("label", { key: '4498ae1bac287cb80544c4d743afad2ec678e3bd', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e54d1258e48f54304a553cffb83466e4a4fadb4c', class: 'email__wrapper--relative' }, this.tooltip &&
|
|
6563
|
+
h("img", { key: '29d7b95f22c8cb70d505f74a7ea18284faa908ee', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '08754b178e395f26c1d8a61ff667b91df3fb0ec7', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '3024a57f5d0897f34013eb4397d78babc2333192', class: 'email__error-message' }, this.errorMessage));
|
|
6458
6564
|
}
|
|
6459
6565
|
static get watchers() { return {
|
|
6460
|
-
"clientStyling": ["
|
|
6566
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
6461
6567
|
"isValid": ["validityChanged"],
|
|
6462
6568
|
"emitValue": ["emitValueHandler"]
|
|
6463
6569
|
}; }
|
|
@@ -13131,32 +13237,6 @@ const GeneralInput = class {
|
|
|
13131
13237
|
constructor(hostRef) {
|
|
13132
13238
|
registerInstance(this, hostRef);
|
|
13133
13239
|
this.registrationWidgetLoaded = createEvent(this, "registrationWidgetLoaded", 7);
|
|
13134
|
-
this.setClientStyling = () => {
|
|
13135
|
-
let sheet = document.createElement('style');
|
|
13136
|
-
sheet.innerHTML = this.clientStyling;
|
|
13137
|
-
this.host.shadowRoot.prepend(sheet);
|
|
13138
|
-
};
|
|
13139
|
-
this.setStreamStyling = (domain) => {
|
|
13140
|
-
if (window.emMessageBus) {
|
|
13141
|
-
const sheet = document.createElement('style');
|
|
13142
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
13143
|
-
sheet.innerHTML = data;
|
|
13144
|
-
this.clientStyling = data;
|
|
13145
|
-
this.host.shadowRoot.prepend(sheet);
|
|
13146
|
-
});
|
|
13147
|
-
}
|
|
13148
|
-
};
|
|
13149
|
-
this.setClientStylingURL = () => {
|
|
13150
|
-
let url = new URL(this.clientStylingUrl);
|
|
13151
|
-
let cssFile = document.createElement('style');
|
|
13152
|
-
fetch(url.href)
|
|
13153
|
-
.then((res) => res.text())
|
|
13154
|
-
.then((data) => {
|
|
13155
|
-
cssFile.innerHTML = data;
|
|
13156
|
-
this.clientStyling = data;
|
|
13157
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
13158
|
-
});
|
|
13159
|
-
};
|
|
13160
13240
|
this.handleClick = (event) => {
|
|
13161
13241
|
if (this.emitOnClick) {
|
|
13162
13242
|
event.stopPropagation();
|
|
@@ -13193,15 +13273,17 @@ const GeneralInput = class {
|
|
|
13193
13273
|
this.enableManualDateInput = false;
|
|
13194
13274
|
this.pinAttemptsExceeded = undefined;
|
|
13195
13275
|
this.mbSource = undefined;
|
|
13196
|
-
this.limitStylingAppends = false;
|
|
13197
13276
|
}
|
|
13198
|
-
|
|
13199
|
-
if (newValue !== oldValue)
|
|
13200
|
-
this.
|
|
13277
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13278
|
+
if (newValue !== oldValue) {
|
|
13279
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13280
|
+
}
|
|
13201
13281
|
}
|
|
13202
|
-
|
|
13203
|
-
if (newValue !== oldValue)
|
|
13204
|
-
this.
|
|
13282
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
13283
|
+
if (newValue !== oldValue) {
|
|
13284
|
+
if (this.clientStylingUrl)
|
|
13285
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
13286
|
+
}
|
|
13205
13287
|
}
|
|
13206
13288
|
connectedCallback() {
|
|
13207
13289
|
if (this.translationUrl) {
|
|
@@ -13212,51 +13294,50 @@ const GeneralInput = class {
|
|
|
13212
13294
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
13213
13295
|
}
|
|
13214
13296
|
componentDidLoad() {
|
|
13297
|
+
this.handleClientStyling();
|
|
13215
13298
|
this.registrationWidgetLoaded.emit();
|
|
13216
13299
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
}
|
|
13221
|
-
|
|
13222
|
-
if (this.clientStyling)
|
|
13223
|
-
this.setClientStyling();
|
|
13224
|
-
if (this.clientStylingUrl)
|
|
13225
|
-
this.setClientStylingURL();
|
|
13226
|
-
this.limitStylingAppends = true;
|
|
13227
|
-
}
|
|
13300
|
+
}
|
|
13301
|
+
handleClientStyling() {
|
|
13302
|
+
if (window.emMessageBus !== undefined) {
|
|
13303
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
13304
|
+
return;
|
|
13228
13305
|
}
|
|
13306
|
+
if (this.clientStyling)
|
|
13307
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13308
|
+
if (this.clientStylingUrl)
|
|
13309
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
13229
13310
|
}
|
|
13230
13311
|
renderInput() {
|
|
13231
13312
|
var _a;
|
|
13232
13313
|
switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
|
|
13233
13314
|
case 'text':
|
|
13234
13315
|
if (this.haspostalcodelookup && this.name === 'PostalCode') {
|
|
13235
|
-
return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry });
|
|
13316
|
+
return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry, "mb-source": this.mbSource });
|
|
13236
13317
|
}
|
|
13237
13318
|
else {
|
|
13238
|
-
return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode });
|
|
13319
|
+
return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
|
|
13239
13320
|
}
|
|
13240
13321
|
case 'email':
|
|
13241
|
-
return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
13322
|
+
return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
13242
13323
|
case 'number':
|
|
13243
|
-
return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
13324
|
+
return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
13244
13325
|
case 'checkbox':
|
|
13245
|
-
return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
|
|
13326
|
+
return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, "mb-source": this.mbSource });
|
|
13246
13327
|
case 'checkboxgroup':
|
|
13247
|
-
return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
|
|
13328
|
+
return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "mb-source": this.mbSource });
|
|
13248
13329
|
case 'togglecheckbox':
|
|
13249
|
-
return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick });
|
|
13330
|
+
return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick, "mb-source": this.mbSource });
|
|
13250
13331
|
case 'datetime':
|
|
13251
|
-
return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput });
|
|
13332
|
+
return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput, "mb-source": this.mbSource });
|
|
13252
13333
|
case 'password':
|
|
13253
|
-
return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode });
|
|
13334
|
+
return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
|
|
13254
13335
|
case 'radio':
|
|
13255
|
-
return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling });
|
|
13336
|
+
return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, "mb-source": this.mbSource });
|
|
13256
13337
|
case 'tel':
|
|
13257
|
-
return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
13338
|
+
return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
13258
13339
|
case 'dropdown':
|
|
13259
|
-
return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
|
|
13340
|
+
return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
|
|
13260
13341
|
case 'twofa':
|
|
13261
13342
|
return h("twofa-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, destination: this.twofaDestination, "resend-interval-seconds": this.twofaResendIntervalSeconds, "enable-south-african-mode": this.enableSouthAfricanMode, "pin-attempts-exceeded": this.pinAttemptsExceeded, "mb-source": this.mbSource });
|
|
13262
13343
|
case 'label':
|
|
@@ -13271,12 +13352,12 @@ const GeneralInput = class {
|
|
|
13271
13352
|
}
|
|
13272
13353
|
}
|
|
13273
13354
|
render() {
|
|
13274
|
-
return (h(Host, { key: '
|
|
13355
|
+
return (h(Host, { key: '12e3e43442ba3fd4a47bbc5c05456eb019405b1e', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
|
|
13275
13356
|
}
|
|
13276
13357
|
get host() { return getElement(this); }
|
|
13277
13358
|
static get watchers() { return {
|
|
13278
|
-
"clientStyling": ["
|
|
13279
|
-
"clientStylingUrl": ["
|
|
13359
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
13360
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
13280
13361
|
}; }
|
|
13281
13362
|
};
|
|
13282
13363
|
GeneralInput.style = GeneralInputStyle0;
|
|
@@ -13308,11 +13389,6 @@ const NumberInput = class {
|
|
|
13308
13389
|
this.errorMessage = this.setErrorMessage();
|
|
13309
13390
|
this.touched = true;
|
|
13310
13391
|
};
|
|
13311
|
-
this.setClientStyling = () => {
|
|
13312
|
-
let sheet = document.createElement('style');
|
|
13313
|
-
sheet.innerHTML = this.clientStyling;
|
|
13314
|
-
this.stylingContainer.prepend(sheet);
|
|
13315
|
-
};
|
|
13316
13392
|
this.name = undefined;
|
|
13317
13393
|
this.displayName = undefined;
|
|
13318
13394
|
this.placeholder = undefined;
|
|
@@ -13323,14 +13399,15 @@ const NumberInput = class {
|
|
|
13323
13399
|
this.language = undefined;
|
|
13324
13400
|
this.emitValue = undefined;
|
|
13325
13401
|
this.clientStyling = '';
|
|
13402
|
+
this.mbSource = undefined;
|
|
13326
13403
|
this.errorMessage = undefined;
|
|
13327
13404
|
this.isValid = undefined;
|
|
13328
|
-
this.limitStylingAppends = false;
|
|
13329
13405
|
this.showTooltip = false;
|
|
13330
13406
|
}
|
|
13331
|
-
|
|
13332
|
-
if (newValue !== oldValue)
|
|
13333
|
-
this.
|
|
13407
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13408
|
+
if (newValue !== oldValue) {
|
|
13409
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13410
|
+
}
|
|
13334
13411
|
}
|
|
13335
13412
|
validityChanged() {
|
|
13336
13413
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -13358,16 +13435,17 @@ const NumberInput = class {
|
|
|
13358
13435
|
connectedCallback() {
|
|
13359
13436
|
this.validationPattern = this.setPattern();
|
|
13360
13437
|
}
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13438
|
+
handleClientStyling() {
|
|
13439
|
+
if (window.emMessageBus !== undefined) {
|
|
13440
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
13441
|
+
return;
|
|
13442
|
+
}
|
|
13443
|
+
if (this.clientStyling) {
|
|
13444
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13367
13445
|
}
|
|
13368
|
-
// end custom styling area
|
|
13369
13446
|
}
|
|
13370
13447
|
componentDidLoad() {
|
|
13448
|
+
this.handleClientStyling();
|
|
13371
13449
|
this.isValid = this.setValidity();
|
|
13372
13450
|
if (this.defaultValue) {
|
|
13373
13451
|
this.value = this.defaultValue;
|
|
@@ -13408,11 +13486,11 @@ const NumberInput = class {
|
|
|
13408
13486
|
if (this.touched) {
|
|
13409
13487
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13410
13488
|
}
|
|
13411
|
-
return h("div", { key: '
|
|
13412
|
-
h("img", { key: '
|
|
13489
|
+
return h("div", { key: 'bd11140dc6c8ddb6b800d4fe6544df733c5157c4', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'c8318c687bc471fc225b9aba52686e38ecb400de', class: 'number__wrapper--flex' }, h("label", { key: '7eaf64057ef71b07a0defc1e372fd85baab2bd68', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '99f4151f50a7fb0abb9a8e53bacc8c8bd303d659', class: 'number__wrapper--relative' }, this.tooltip &&
|
|
13490
|
+
h("img", { key: '875d6284697dc06ac05c682509856faeade3d8be', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'f1f563567cde4a744c68e27ab91a3d795f596be6', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '0226f04a059fd8763822483de42bd7e647040bf3', class: 'number__error-message' }, this.errorMessage));
|
|
13413
13491
|
}
|
|
13414
13492
|
static get watchers() { return {
|
|
13415
|
-
"clientStyling": ["
|
|
13493
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
13416
13494
|
"isValid": ["validityChanged"],
|
|
13417
13495
|
"emitValue": ["emitValueHandler"]
|
|
13418
13496
|
}; }
|
|
@@ -13461,11 +13539,6 @@ const PasswordInput = class {
|
|
|
13461
13539
|
this.showPopup = true;
|
|
13462
13540
|
this.calculateComplexity(this.value);
|
|
13463
13541
|
};
|
|
13464
|
-
this.setClientStyling = () => {
|
|
13465
|
-
let sheet = document.createElement('style');
|
|
13466
|
-
sheet.innerHTML = this.clientStyling;
|
|
13467
|
-
this.stylingContainer.prepend(sheet);
|
|
13468
|
-
};
|
|
13469
13542
|
this.name = undefined;
|
|
13470
13543
|
this.displayName = undefined;
|
|
13471
13544
|
this.placeholder = undefined;
|
|
@@ -13480,17 +13553,18 @@ const PasswordInput = class {
|
|
|
13480
13553
|
this.hidePasswordComplexity = false;
|
|
13481
13554
|
this.clientStyling = '';
|
|
13482
13555
|
this.enableSouthAfricanMode = undefined;
|
|
13556
|
+
this.mbSource = undefined;
|
|
13483
13557
|
this.isValid = undefined;
|
|
13484
13558
|
this.errorMessage = undefined;
|
|
13485
|
-
this.limitStylingAppends = false;
|
|
13486
13559
|
this.showTooltip = false;
|
|
13487
13560
|
this.passwordComplexity = undefined;
|
|
13488
13561
|
this.showPopup = undefined;
|
|
13489
13562
|
this.value = '';
|
|
13490
13563
|
}
|
|
13491
|
-
|
|
13492
|
-
if (newValue !== oldValue)
|
|
13493
|
-
this.
|
|
13564
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13565
|
+
if (newValue !== oldValue) {
|
|
13566
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13567
|
+
}
|
|
13494
13568
|
}
|
|
13495
13569
|
validityChanged() {
|
|
13496
13570
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -13551,16 +13625,17 @@ const PasswordInput = class {
|
|
|
13551
13625
|
this.showTooltip = false;
|
|
13552
13626
|
}
|
|
13553
13627
|
}
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13628
|
+
handleClientStyling() {
|
|
13629
|
+
if (window.emMessageBus !== undefined) {
|
|
13630
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
13631
|
+
return;
|
|
13632
|
+
}
|
|
13633
|
+
if (this.clientStyling) {
|
|
13634
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13560
13635
|
}
|
|
13561
|
-
// end custom styling area
|
|
13562
13636
|
}
|
|
13563
13637
|
componentDidLoad() {
|
|
13638
|
+
this.handleClientStyling();
|
|
13564
13639
|
this.inputReference = this.element.shadowRoot.querySelector('input');
|
|
13565
13640
|
this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
|
|
13566
13641
|
this.passwordButton.tabIndex = -1;
|
|
@@ -13667,8 +13742,8 @@ const PasswordInput = class {
|
|
|
13667
13742
|
if (this.touched) {
|
|
13668
13743
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
13669
13744
|
}
|
|
13670
|
-
return h("div", { key: '
|
|
13671
|
-
h("img", { key: '
|
|
13745
|
+
return h("div", { key: '18213d251639938165f3e4ad58bdc904fb953fe2', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '092c431b178682d0006cf6ad5c14b0a7e6fb5569', class: 'password__wrapper--flex' }, h("label", { key: '64c101b7d70305ecf09735234d902a6b33823551', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '189929eefa1caf71a1be39f0d663eef914d241d5', class: 'password__wrapper--relative' }, this.tooltip &&
|
|
13746
|
+
h("img", { key: '95ee0d824b5be14ab4e62fc0b5f1731fe6ca5775', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: 'bf85dde83305233c566b1c50d0286548ba0f48a5', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && h("small", { key: '3acbe164ff532bcfcd9e4a237a6f352df0cfdc2d', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
|
|
13672
13747
|
this.showPopup &&
|
|
13673
13748
|
!this.hidePasswordComplexity &&
|
|
13674
13749
|
!this.isDuplicateInput &&
|
|
@@ -13678,7 +13753,7 @@ const PasswordInput = class {
|
|
|
13678
13753
|
}
|
|
13679
13754
|
get element() { return getElement(this); }
|
|
13680
13755
|
static get watchers() { return {
|
|
13681
|
-
"clientStyling": ["
|
|
13756
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
13682
13757
|
"isValid": ["validityChanged"],
|
|
13683
13758
|
"value": ["valueChanged"],
|
|
13684
13759
|
"emitValue": ["emitValueHandler"]
|
|
@@ -13828,11 +13903,6 @@ const PostalCodeInput = class {
|
|
|
13828
13903
|
targetInput.focus();
|
|
13829
13904
|
}
|
|
13830
13905
|
};
|
|
13831
|
-
this.setClientStyling = () => {
|
|
13832
|
-
let sheet = document.createElement('style');
|
|
13833
|
-
sheet.innerHTML = this.clientStyling;
|
|
13834
|
-
this.stylingContainer.prepend(sheet);
|
|
13835
|
-
};
|
|
13836
13906
|
this.handleOutsideClick = (event) => {
|
|
13837
13907
|
if (!this.openAddressDropdown)
|
|
13838
13908
|
return;
|
|
@@ -13858,9 +13928,9 @@ const PostalCodeInput = class {
|
|
|
13858
13928
|
this.postalcodelength = undefined;
|
|
13859
13929
|
this.addresses = undefined;
|
|
13860
13930
|
this.ignoreCountry = false;
|
|
13931
|
+
this.mbSource = undefined;
|
|
13861
13932
|
this.isValid = undefined;
|
|
13862
13933
|
this.errorMessage = '';
|
|
13863
|
-
this.limitStylingAppends = false;
|
|
13864
13934
|
this.showTooltip = false;
|
|
13865
13935
|
this.selectedCountryCode = '';
|
|
13866
13936
|
this.currentPostalCode = '';
|
|
@@ -13869,9 +13939,10 @@ const PostalCodeInput = class {
|
|
|
13869
13939
|
this.refreshTrigger = 0;
|
|
13870
13940
|
this.isFetchingAddresses = false;
|
|
13871
13941
|
}
|
|
13872
|
-
|
|
13873
|
-
if (newValue !== oldValue)
|
|
13874
|
-
this.
|
|
13942
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
13943
|
+
if (newValue !== oldValue) {
|
|
13944
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
13945
|
+
}
|
|
13875
13946
|
}
|
|
13876
13947
|
validityChanged() {
|
|
13877
13948
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -13932,19 +14003,22 @@ const PostalCodeInput = class {
|
|
|
13932
14003
|
connectedCallback() {
|
|
13933
14004
|
this.validationPattern = this.setPattern();
|
|
13934
14005
|
}
|
|
13935
|
-
componentDidRender() {
|
|
13936
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
13937
|
-
if (this.clientStyling)
|
|
13938
|
-
this.setClientStyling();
|
|
13939
|
-
this.limitStylingAppends = true;
|
|
13940
|
-
}
|
|
13941
|
-
}
|
|
13942
14006
|
componentWillLoad() {
|
|
13943
14007
|
if (this.defaultValue) {
|
|
13944
14008
|
this.value = this.defaultValue;
|
|
13945
14009
|
}
|
|
13946
14010
|
}
|
|
14011
|
+
handleClientStyling() {
|
|
14012
|
+
if (window.emMessageBus !== undefined) {
|
|
14013
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14014
|
+
return;
|
|
14015
|
+
}
|
|
14016
|
+
if (this.clientStyling) {
|
|
14017
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14018
|
+
}
|
|
14019
|
+
}
|
|
13947
14020
|
componentDidLoad() {
|
|
14021
|
+
this.handleClientStyling();
|
|
13948
14022
|
if (this.defaultValue) {
|
|
13949
14023
|
this.valueHandler({ name: this.name, value: this.value });
|
|
13950
14024
|
}
|
|
@@ -14036,10 +14110,10 @@ const PostalCodeInput = class {
|
|
|
14036
14110
|
let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
|
|
14037
14111
|
this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
|
|
14038
14112
|
let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
|
|
14039
|
-
return (h("div", { key: '
|
|
14113
|
+
return (h("div", { key: 'f0dda39cf9a02d53213848926908c0cb39d1cd3f', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '5e1c51af264392d2be986e305e6526310f55f40b', class: 'text__wrapper--flex' }, h("label", { key: 'c12c45d88bdf42aeb6be505d473ab0f55da2be87', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '7b93a75f19590b445227fa1a64c90fd20c0afd5d', class: 'text__wrapper--relative' }, this.tooltip && (h("img", { key: '504004a13595694307c1e3450b69982150dc55fd', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), h("div", { key: '19de66fd72fd0a6befe3bbaebb6c8f99ec5f850b', class: 'input__text-wrapper' }, 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 && (h("p", { key: '6b9e307d59fb9fed93f4df6c07a091d299844c62', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate('enterIEAddressManually', this.language))), showAddressesDropdown && (h("div", { key: 'ecb7892a9a8d967540d8fd013518ae19498fcd48', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, h("div", { key: 'a5ef3f81a85207a821964e23b21aaf783be807cc', class: "options" }, this.addresses.map((addr, index) => (h("div", { key: index, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (h("div", { key: '338c17e484721efb387e608f3ce4416a0e47b8af', class: "postalcode__loading-spinner" }, h("div", { key: '7638cea4fba975e3a27d4cb00bce217129bd0750', class: "loading-spinner" }), h("span", { key: 'b59a8a9c3d7ecf209a68717346d1d29062994f79' }, translate('searchingForAddresses', this.language)))), shouldShowNoResults && (h("div", { key: '212a74fed94b3ee089aed5c9afb544966b5f11cd', class: "postalcode__no-results-message" }, translate('postalLookUpNoAddressFound', this.language)))), h("small", { key: '4f66e97dd811b9917c92ff4bcbf236817ac57933', class: 'text__error-message' }, this.errorMessage)));
|
|
14040
14114
|
}
|
|
14041
14115
|
static get watchers() { return {
|
|
14042
|
-
"clientStyling": ["
|
|
14116
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14043
14117
|
"isValid": ["validityChanged"],
|
|
14044
14118
|
"emitValue": ["emitValueHandler"],
|
|
14045
14119
|
"addresses": ["handleAddresses"]
|
|
@@ -14055,11 +14129,6 @@ const RadioInput = class {
|
|
|
14055
14129
|
registerInstance(this, hostRef);
|
|
14056
14130
|
this.sendInputValue = createEvent(this, "sendInputValue", 7);
|
|
14057
14131
|
this.sendValidityState = createEvent(this, "sendValidityState", 7);
|
|
14058
|
-
this.setClientStyling = () => {
|
|
14059
|
-
let sheet = document.createElement('style');
|
|
14060
|
-
sheet.innerHTML = this.clientStyling;
|
|
14061
|
-
this.stylingContainer.prepend(sheet);
|
|
14062
|
-
};
|
|
14063
14132
|
this.name = undefined;
|
|
14064
14133
|
this.displayName = undefined;
|
|
14065
14134
|
this.optionsGroup = undefined;
|
|
@@ -14068,14 +14137,15 @@ const RadioInput = class {
|
|
|
14068
14137
|
this.language = undefined;
|
|
14069
14138
|
this.emitValue = undefined;
|
|
14070
14139
|
this.clientStyling = '';
|
|
14140
|
+
this.mbSource = undefined;
|
|
14071
14141
|
this.errorMessage = undefined;
|
|
14072
14142
|
this.isValid = undefined;
|
|
14073
|
-
this.limitStylingAppends = false;
|
|
14074
14143
|
this.showTooltip = false;
|
|
14075
14144
|
}
|
|
14076
|
-
|
|
14077
|
-
if (newValue !== oldValue)
|
|
14078
|
-
this.
|
|
14145
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14146
|
+
if (newValue !== oldValue) {
|
|
14147
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14148
|
+
}
|
|
14079
14149
|
}
|
|
14080
14150
|
validityChanged() {
|
|
14081
14151
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14100,14 +14170,17 @@ const RadioInput = class {
|
|
|
14100
14170
|
this.showTooltip = false;
|
|
14101
14171
|
}
|
|
14102
14172
|
}
|
|
14103
|
-
|
|
14104
|
-
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
this.setClientStyling();
|
|
14108
|
-
this.limitStylingAppends = true;
|
|
14173
|
+
handleClientStyling() {
|
|
14174
|
+
if (window.emMessageBus !== undefined) {
|
|
14175
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14176
|
+
return;
|
|
14109
14177
|
}
|
|
14110
|
-
|
|
14178
|
+
if (this.clientStyling) {
|
|
14179
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14180
|
+
}
|
|
14181
|
+
}
|
|
14182
|
+
componentDidLoad() {
|
|
14183
|
+
this.handleClientStyling();
|
|
14111
14184
|
}
|
|
14112
14185
|
handleClick(event) {
|
|
14113
14186
|
this.value = event.target.value;
|
|
@@ -14130,11 +14203,11 @@ const RadioInput = class {
|
|
|
14130
14203
|
return null;
|
|
14131
14204
|
}
|
|
14132
14205
|
render() {
|
|
14133
|
-
return h("fieldset", { key: '
|
|
14134
|
-
h("img", { key: '
|
|
14206
|
+
return h("fieldset", { key: '7048de0e37c9541af1c9788e8b46c789ca788c31', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '403b739c966d510740ca59621c094872b93e2cba', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, 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) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: '46dce1082a6aa9f2a5bdc3e3654c924fcd2a8357', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
|
|
14207
|
+
h("img", { key: 'dfe155a429485b5c891db2943d9115cdc40e169b', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
|
|
14135
14208
|
}
|
|
14136
14209
|
static get watchers() { return {
|
|
14137
|
-
"clientStyling": ["
|
|
14210
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14138
14211
|
"isValid": ["validityChanged"],
|
|
14139
14212
|
"emitValue": ["emitValueHandler"]
|
|
14140
14213
|
}; }
|
|
@@ -14183,11 +14256,6 @@ const SelectInput = class {
|
|
|
14183
14256
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
14184
14257
|
this.emitValueHandler(true);
|
|
14185
14258
|
};
|
|
14186
|
-
this.setClientStyling = () => {
|
|
14187
|
-
let sheet = document.createElement('style');
|
|
14188
|
-
sheet.innerHTML = this.clientStyling;
|
|
14189
|
-
this.stylingContainer.prepend(sheet);
|
|
14190
|
-
};
|
|
14191
14259
|
this.name = undefined;
|
|
14192
14260
|
this.displayName = undefined;
|
|
14193
14261
|
this.placeholder = undefined;
|
|
@@ -14200,14 +14268,15 @@ const SelectInput = class {
|
|
|
14200
14268
|
this.language = undefined;
|
|
14201
14269
|
this.emitValue = undefined;
|
|
14202
14270
|
this.clientStyling = '';
|
|
14271
|
+
this.mbSource = undefined;
|
|
14203
14272
|
this.errorMessage = undefined;
|
|
14204
14273
|
this.isValid = undefined;
|
|
14205
|
-
this.limitStylingAppends = false;
|
|
14206
14274
|
this.showTooltip = false;
|
|
14207
14275
|
}
|
|
14208
|
-
|
|
14209
|
-
if (newValue !== oldValue)
|
|
14210
|
-
this.
|
|
14276
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14277
|
+
if (newValue !== oldValue) {
|
|
14278
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14279
|
+
}
|
|
14211
14280
|
}
|
|
14212
14281
|
validityChanged() {
|
|
14213
14282
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14257,16 +14326,17 @@ const SelectInput = class {
|
|
|
14257
14326
|
}
|
|
14258
14327
|
}
|
|
14259
14328
|
}
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14329
|
+
handleClientStyling() {
|
|
14330
|
+
if (window.emMessageBus !== undefined) {
|
|
14331
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14332
|
+
return;
|
|
14333
|
+
}
|
|
14334
|
+
if (this.clientStyling) {
|
|
14335
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14266
14336
|
}
|
|
14267
|
-
// end custom styling area
|
|
14268
14337
|
}
|
|
14269
14338
|
componentDidLoad() {
|
|
14339
|
+
this.handleClientStyling();
|
|
14270
14340
|
this.inputReference = this.vaadinCombo.querySelector('input');
|
|
14271
14341
|
if (this.defaultValue) {
|
|
14272
14342
|
this.value = this.defaultValue;
|
|
@@ -14331,13 +14401,13 @@ const SelectInput = class {
|
|
|
14331
14401
|
if (this.touched) {
|
|
14332
14402
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
14333
14403
|
}
|
|
14334
|
-
return h("div", { key: '
|
|
14335
|
-
h("img", { key: '
|
|
14404
|
+
return h("div", { key: 'eb6c9d7d85546159d44d06a0635f173263edd7d1', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '0fd71c528870966fdb23049b1806a267e9e6ca5c', class: 'select__wrapper--flex' }, h("label", { key: '44aeb4e50ab2f79df06741ff07ac03131c987447', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '796a83aeadd480a571b6bae035a46138d7b10b24', class: this.validation.mandatory ? 'select__label--required' : '' })), h("div", { key: '6d7b2d785c6b0bdd05c7444f563b21cedf26ff7c', class: 'select__wrapper--relative' }, this.tooltip &&
|
|
14405
|
+
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 ? 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 })
|
|
14336
14406
|
:
|
|
14337
|
-
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 }), h("small", { key: '
|
|
14407
|
+
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 }), h("small", { key: '261b3c4abc9b360e6b937d851f8bfc810280a8c6', class: 'select__error-message' }, this.errorMessage));
|
|
14338
14408
|
}
|
|
14339
14409
|
static get watchers() { return {
|
|
14340
|
-
"clientStyling": ["
|
|
14410
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14341
14411
|
"isValid": ["validityChanged"],
|
|
14342
14412
|
"emitValue": ["emitValueHandler"]
|
|
14343
14413
|
}; }
|
|
@@ -14372,11 +14442,6 @@ const TelInput = class {
|
|
|
14372
14442
|
this.isValid = this.isValidValue();
|
|
14373
14443
|
this.errorMessage = this.setErrorMessage();
|
|
14374
14444
|
};
|
|
14375
|
-
this.setClientStyling = () => {
|
|
14376
|
-
let sheet = document.createElement('style');
|
|
14377
|
-
sheet.innerHTML = this.clientStyling;
|
|
14378
|
-
this.stylingContainer.prepend(sheet);
|
|
14379
|
-
};
|
|
14380
14445
|
this.name = undefined;
|
|
14381
14446
|
this.displayName = undefined;
|
|
14382
14447
|
this.placeholder = undefined;
|
|
@@ -14389,9 +14454,9 @@ const TelInput = class {
|
|
|
14389
14454
|
this.language = undefined;
|
|
14390
14455
|
this.emitValue = undefined;
|
|
14391
14456
|
this.clientStyling = '';
|
|
14457
|
+
this.mbSource = undefined;
|
|
14392
14458
|
this.isValid = undefined;
|
|
14393
14459
|
this.errorMessage = undefined;
|
|
14394
|
-
this.limitStylingAppends = false;
|
|
14395
14460
|
this.showTooltip = false;
|
|
14396
14461
|
this.disablePhonePrefix = false;
|
|
14397
14462
|
this.phoneValue = '';
|
|
@@ -14403,9 +14468,10 @@ const TelInput = class {
|
|
|
14403
14468
|
if (this.inputReference)
|
|
14404
14469
|
this.inputReference.value = this.phoneValue;
|
|
14405
14470
|
}
|
|
14406
|
-
|
|
14407
|
-
if (newValue !== oldValue)
|
|
14408
|
-
this.
|
|
14471
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14472
|
+
if (newValue !== oldValue) {
|
|
14473
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14474
|
+
}
|
|
14409
14475
|
}
|
|
14410
14476
|
validityChanged() {
|
|
14411
14477
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14456,16 +14522,17 @@ const TelInput = class {
|
|
|
14456
14522
|
}
|
|
14457
14523
|
}
|
|
14458
14524
|
}
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14525
|
+
handleClientStyling() {
|
|
14526
|
+
if (window.emMessageBus !== undefined) {
|
|
14527
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14528
|
+
return;
|
|
14529
|
+
}
|
|
14530
|
+
if (this.clientStyling) {
|
|
14531
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14465
14532
|
}
|
|
14466
|
-
// end custom styling area
|
|
14467
14533
|
}
|
|
14468
14534
|
componentDidLoad() {
|
|
14535
|
+
this.handleClientStyling();
|
|
14469
14536
|
this.isValid = this.isValidValue();
|
|
14470
14537
|
if (this.defaultValue) {
|
|
14471
14538
|
this.value = this.defaultValue;
|
|
@@ -14557,11 +14624,11 @@ const TelInput = class {
|
|
|
14557
14624
|
if (this.touched) {
|
|
14558
14625
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
14559
14626
|
}
|
|
14560
|
-
return h("div", { key: '
|
|
14561
|
-
h("img", { key: '
|
|
14627
|
+
return h("div", { key: '9cf9eb751bca1978d8554fffc912ef2039c42e41', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'cc88d6e9aa7a0f3801fad75e3ca509fbd01b0538', class: 'tel__wrapper--flex-label' }, h("label", { key: 'c8a35af4ddd2d4f9751d7f60c9e075ae8eccb441', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '73fcdcc25dde1be087ee60062dc5eee2d1e5d29e', class: 'tel__wrapper--relative' }, this.tooltip &&
|
|
14628
|
+
h("img", { key: '56df66fddf599fbafb179c7cd90ea7d58b008ea6', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: '20eb5689932c2f71322102229cc7346d18e9bc87', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '9ec4142dc84e0022ced7e34248d5f4f8f59c34af', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), 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 })), h("small", { key: '2201c2d7b968731042624b265cf535c656c86933', class: 'tel__error-message' }, this.errorMessage));
|
|
14562
14629
|
}
|
|
14563
14630
|
static get watchers() { return {
|
|
14564
|
-
"clientStyling": ["
|
|
14631
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14565
14632
|
"isValid": ["validityChanged"],
|
|
14566
14633
|
"emitValue": ["emitValueHandler"]
|
|
14567
14634
|
}; }
|
|
@@ -14605,11 +14672,6 @@ const TextInput = class {
|
|
|
14605
14672
|
this.touched = true;
|
|
14606
14673
|
this.updateValidationState();
|
|
14607
14674
|
};
|
|
14608
|
-
this.setClientStyling = () => {
|
|
14609
|
-
let sheet = document.createElement('style');
|
|
14610
|
-
sheet.innerHTML = this.clientStyling;
|
|
14611
|
-
this.stylingContainer.prepend(sheet);
|
|
14612
|
-
};
|
|
14613
14675
|
this.name = undefined;
|
|
14614
14676
|
this.displayName = undefined;
|
|
14615
14677
|
this.placeholder = undefined;
|
|
@@ -14624,15 +14686,16 @@ const TextInput = class {
|
|
|
14624
14686
|
this.clientStyling = '';
|
|
14625
14687
|
this.haspostalcodelookup = undefined;
|
|
14626
14688
|
this.enableSouthAfricanMode = undefined;
|
|
14689
|
+
this.mbSource = undefined;
|
|
14627
14690
|
this.isValid = undefined;
|
|
14628
14691
|
this.errorMessage = '';
|
|
14629
|
-
this.limitStylingAppends = false;
|
|
14630
14692
|
this.showTooltip = false;
|
|
14631
14693
|
this.selectedCountryCode = '';
|
|
14632
14694
|
}
|
|
14633
|
-
|
|
14634
|
-
if (newValue !== oldValue)
|
|
14635
|
-
this.
|
|
14695
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14696
|
+
if (newValue !== oldValue) {
|
|
14697
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14698
|
+
}
|
|
14636
14699
|
}
|
|
14637
14700
|
validityChanged() {
|
|
14638
14701
|
this.validityStateHandler({ valid: this.isValid, name: this.name });
|
|
@@ -14744,21 +14807,22 @@ const TextInput = class {
|
|
|
14744
14807
|
}
|
|
14745
14808
|
this.validityStateHandler({ valid: false, name: this.name });
|
|
14746
14809
|
}
|
|
14747
|
-
componentDidRender() {
|
|
14748
|
-
// start custom styling area
|
|
14749
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
14750
|
-
if (this.clientStyling)
|
|
14751
|
-
this.setClientStyling();
|
|
14752
|
-
this.limitStylingAppends = true;
|
|
14753
|
-
}
|
|
14754
|
-
// end custom styling area
|
|
14755
|
-
}
|
|
14756
14810
|
componentWillLoad() {
|
|
14757
14811
|
if (this.defaultValue) {
|
|
14758
14812
|
this.value = this.defaultValue;
|
|
14759
14813
|
}
|
|
14760
14814
|
}
|
|
14815
|
+
handleClientStyling() {
|
|
14816
|
+
if (window.emMessageBus !== undefined) {
|
|
14817
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14818
|
+
return;
|
|
14819
|
+
}
|
|
14820
|
+
if (this.clientStyling) {
|
|
14821
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14822
|
+
}
|
|
14823
|
+
}
|
|
14761
14824
|
componentDidLoad() {
|
|
14825
|
+
this.handleClientStyling();
|
|
14762
14826
|
if (this.defaultValue) {
|
|
14763
14827
|
this.value = this.defaultValue;
|
|
14764
14828
|
this.valueHandler({ name: this.name, value: this.value });
|
|
@@ -14870,11 +14934,11 @@ const TextInput = class {
|
|
|
14870
14934
|
if (this.touched) {
|
|
14871
14935
|
invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
|
|
14872
14936
|
}
|
|
14873
|
-
return h("div", { key: '
|
|
14874
|
-
h("img", { key: '
|
|
14937
|
+
return h("div", { key: 'f48e592bac049022b283bac917c095772b1508f5', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: 'fe3626ead38dd18dfa14795ee2332e93f5f09652', class: 'text__wrapper--flex' }, h("label", { key: '6b2854b460e0ac7d4ae0ebccc06dbe64770581d5', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'f29d266973bd700a4270495bc4eb6e8296b6eeaf', class: 'text__wrapper--relative' }, this.tooltip &&
|
|
14938
|
+
h("img", { key: '68e69abbb78250e763822608e963bc16d702f099', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), 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 }), h("small", { key: 'cc28c1c19370faa94fa1f738066042dce8d694ce', class: 'text__error-message' }, this.errorMessage));
|
|
14875
14939
|
}
|
|
14876
14940
|
static get watchers() { return {
|
|
14877
|
-
"clientStyling": ["
|
|
14941
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
14878
14942
|
"isValid": ["validityChanged"],
|
|
14879
14943
|
"emitValue": ["emitValueHandler"]
|
|
14880
14944
|
}; }
|
|
@@ -14896,11 +14960,6 @@ const ToggleCheckboxInput = class {
|
|
|
14896
14960
|
event.stopPropagation();
|
|
14897
14961
|
window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
|
|
14898
14962
|
};
|
|
14899
|
-
this.setClientStyling = () => {
|
|
14900
|
-
let sheet = document.createElement('style');
|
|
14901
|
-
sheet.innerHTML = this.clientStyling;
|
|
14902
|
-
this.stylingContainer.prepend(sheet);
|
|
14903
|
-
};
|
|
14904
14963
|
this.name = undefined;
|
|
14905
14964
|
this.displayName = undefined;
|
|
14906
14965
|
this.defaultValue = '';
|
|
@@ -14911,15 +14970,16 @@ const ToggleCheckboxInput = class {
|
|
|
14911
14970
|
this.language = undefined;
|
|
14912
14971
|
this.emitValue = undefined;
|
|
14913
14972
|
this.clientStyling = '';
|
|
14973
|
+
this.mbSource = undefined;
|
|
14914
14974
|
this.errorMessage = undefined;
|
|
14915
14975
|
this.isValid = undefined;
|
|
14916
|
-
this.limitStylingAppends = false;
|
|
14917
14976
|
this.showTooltip = false;
|
|
14918
14977
|
this.showFields = this.defaultValue === 'true';
|
|
14919
14978
|
}
|
|
14920
|
-
|
|
14921
|
-
if (newValue !== oldValue)
|
|
14922
|
-
this.
|
|
14979
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
14980
|
+
if (newValue !== oldValue) {
|
|
14981
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14982
|
+
}
|
|
14923
14983
|
}
|
|
14924
14984
|
validityStateHandler(inputStateEvent) {
|
|
14925
14985
|
this.sendValidityState.emit(inputStateEvent);
|
|
@@ -14933,16 +14993,17 @@ const ToggleCheckboxInput = class {
|
|
|
14933
14993
|
this.showTooltip = false;
|
|
14934
14994
|
}
|
|
14935
14995
|
}
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14996
|
+
handleClientStyling() {
|
|
14997
|
+
if (window.emMessageBus !== undefined) {
|
|
14998
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
14999
|
+
return;
|
|
15000
|
+
}
|
|
15001
|
+
if (this.clientStyling) {
|
|
15002
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
14942
15003
|
}
|
|
14943
|
-
// end custom styling area
|
|
14944
15004
|
}
|
|
14945
15005
|
componentDidLoad() {
|
|
15006
|
+
this.handleClientStyling();
|
|
14946
15007
|
if (this.options.length === 0)
|
|
14947
15008
|
return;
|
|
14948
15009
|
this.options.forEach((subField) => {
|
|
@@ -14979,13 +15040,13 @@ const ToggleCheckboxInput = class {
|
|
|
14979
15040
|
return null;
|
|
14980
15041
|
}
|
|
14981
15042
|
render() {
|
|
14982
|
-
return h("div", { key: '
|
|
14983
|
-
h("img", { key: '
|
|
15043
|
+
return h("div", { key: '31cd24b5da24368eef2f53952714395d6d9f6285', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'aa14784bd8a3870f7015db79d23226521706ad58', class: 'togglecheckbox__wrapper--flex' }, 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()), h("small", { key: '7e26bea1cfcc725d5aa5a795fd0f999d99abe39d', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '4256fc552545b7a1050ff5cdeb005f5ea83cc5c1', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
|
|
15044
|
+
h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '2d61bedaac02f21116318b10a21b361e70e0213f', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
|
|
14984
15045
|
return 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 });
|
|
14985
15046
|
})));
|
|
14986
15047
|
}
|
|
14987
15048
|
static get watchers() { return {
|
|
14988
|
-
"clientStyling": ["
|
|
15049
|
+
"clientStyling": ["handleClientStylingChange"]
|
|
14989
15050
|
}; }
|
|
14990
15051
|
};
|
|
14991
15052
|
ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
|
|
@@ -15011,17 +15072,6 @@ const TwofaInput = class {
|
|
|
15011
15072
|
this.triggerResendInterval();
|
|
15012
15073
|
this.resendCode.emit();
|
|
15013
15074
|
};
|
|
15014
|
-
this.setClientStylingURL = () => {
|
|
15015
|
-
let url = new URL(this.clientStylingUrl);
|
|
15016
|
-
let cssFile = document.createElement('style');
|
|
15017
|
-
fetch(url.href)
|
|
15018
|
-
.then((res) => res.text())
|
|
15019
|
-
.then((data) => {
|
|
15020
|
-
cssFile.innerHTML = data;
|
|
15021
|
-
this.clientStyling = data;
|
|
15022
|
-
setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
|
|
15023
|
-
});
|
|
15024
|
-
};
|
|
15025
15075
|
this.setInputRef = (el, idx) => {
|
|
15026
15076
|
if (el) {
|
|
15027
15077
|
this.inputRefs[idx] = el;
|
|
@@ -15077,21 +15127,6 @@ const TwofaInput = class {
|
|
|
15077
15127
|
this.setValidity();
|
|
15078
15128
|
this.setErrorMessage();
|
|
15079
15129
|
};
|
|
15080
|
-
this.setClientStyling = () => {
|
|
15081
|
-
let sheet = document.createElement('style');
|
|
15082
|
-
sheet.innerHTML = this.clientStyling;
|
|
15083
|
-
this.stylingContainer.prepend(sheet);
|
|
15084
|
-
};
|
|
15085
|
-
this.setStreamStyling = (domain) => {
|
|
15086
|
-
if (window.emMessageBus) {
|
|
15087
|
-
const sheet = document.createElement('style');
|
|
15088
|
-
this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
|
|
15089
|
-
sheet.innerHTML = data;
|
|
15090
|
-
this.clientStyling = data;
|
|
15091
|
-
this.host.shadowRoot.prepend(sheet);
|
|
15092
|
-
});
|
|
15093
|
-
}
|
|
15094
|
-
};
|
|
15095
15130
|
this.name = '';
|
|
15096
15131
|
this.displayName = '';
|
|
15097
15132
|
this.placeholder = '';
|
|
@@ -15106,7 +15141,6 @@ const TwofaInput = class {
|
|
|
15106
15141
|
this.pinAttemptsExceeded = undefined;
|
|
15107
15142
|
this.clientStylingUrl = '';
|
|
15108
15143
|
this.mbSource = undefined;
|
|
15109
|
-
this.limitStylingAppends = false;
|
|
15110
15144
|
this.isValid = false;
|
|
15111
15145
|
this.isResendButtonAvailable = true;
|
|
15112
15146
|
this.showTooltip = false;
|
|
@@ -15126,9 +15160,16 @@ const TwofaInput = class {
|
|
|
15126
15160
|
this.valueHandler({ name: this.name, value: this.code.join('') });
|
|
15127
15161
|
}
|
|
15128
15162
|
}
|
|
15129
|
-
|
|
15130
|
-
if (newValue !== oldValue)
|
|
15131
|
-
this.
|
|
15163
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
15164
|
+
if (newValue !== oldValue) {
|
|
15165
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15166
|
+
}
|
|
15167
|
+
}
|
|
15168
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
15169
|
+
if (newValue !== oldValue) {
|
|
15170
|
+
if (this.clientStylingUrl)
|
|
15171
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
15172
|
+
}
|
|
15132
15173
|
}
|
|
15133
15174
|
validityStateHandler(inputStateEvent) {
|
|
15134
15175
|
this.sendValidityState.emit(inputStateEvent);
|
|
@@ -15142,10 +15183,6 @@ const TwofaInput = class {
|
|
|
15142
15183
|
this.showTooltip = false;
|
|
15143
15184
|
}
|
|
15144
15185
|
}
|
|
15145
|
-
handleStylingChange(newValue, oldValue) {
|
|
15146
|
-
if (newValue !== oldValue)
|
|
15147
|
-
this.setClientStyling();
|
|
15148
|
-
}
|
|
15149
15186
|
connectedCallback() {
|
|
15150
15187
|
this.validationPattern = this.setPattern();
|
|
15151
15188
|
this.code = new Array(this.validation.maxLength).fill('');
|
|
@@ -15153,30 +15190,21 @@ const TwofaInput = class {
|
|
|
15153
15190
|
disconnectedCallback() {
|
|
15154
15191
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
15155
15192
|
}
|
|
15156
|
-
|
|
15157
|
-
if (
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
}
|
|
15161
|
-
this.limitStylingAppends = true;
|
|
15193
|
+
handleClientStyling() {
|
|
15194
|
+
if (window.emMessageBus !== undefined) {
|
|
15195
|
+
this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
|
|
15196
|
+
return;
|
|
15162
15197
|
}
|
|
15198
|
+
if (this.clientStyling)
|
|
15199
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
15200
|
+
if (this.clientStylingUrl)
|
|
15201
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
15163
15202
|
}
|
|
15164
15203
|
componentDidLoad() {
|
|
15165
15204
|
this.setValidity();
|
|
15166
15205
|
this.registrationWidgetLoaded.emit();
|
|
15167
15206
|
window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
|
|
15168
|
-
|
|
15169
|
-
if (window.emMessageBus != undefined) {
|
|
15170
|
-
this.setStreamStyling(`${this.mbSource}.Style`);
|
|
15171
|
-
}
|
|
15172
|
-
else {
|
|
15173
|
-
if (this.clientStyling)
|
|
15174
|
-
this.setClientStyling();
|
|
15175
|
-
if (this.clientStylingUrl)
|
|
15176
|
-
this.setClientStylingURL();
|
|
15177
|
-
this.limitStylingAppends = true;
|
|
15178
|
-
}
|
|
15179
|
-
}
|
|
15207
|
+
this.handleClientStyling();
|
|
15180
15208
|
}
|
|
15181
15209
|
handleKeyDown(e, idx) {
|
|
15182
15210
|
if (e.key === 'Backspace') {
|
|
@@ -15267,9 +15295,9 @@ const TwofaInput = class {
|
|
|
15267
15295
|
return current;
|
|
15268
15296
|
}
|
|
15269
15297
|
render() {
|
|
15270
|
-
return (h("div", { key: '
|
|
15298
|
+
return (h("div", { key: 'cd5396afccaf4016201281f5cc53898c0a2052ed', class: "twofa", ref: el => this.stylingContainer = el }, h("div", { key: '008dd54682a0d93190e9e5b2b49673262ed01763', class: 'twofa__error-message' }, h("p", { key: '41db51d6b396ccd1f3149e4473e96960e92d05ca' }, this.errorMessage)), h("div", { key: '67e9e4ac90cf95f2269e75b121ed220a02c5f139', class: "twofa__description", innerHTML: translate('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '702c342eb7be0001ab8de310cadd7e8684a8025d', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
|
|
15271
15299
|
return (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) }));
|
|
15272
|
-
})), h("div", { key: '
|
|
15300
|
+
})), h("div", { key: '63564bd4a0442232f81058ba914ee86c537ce85a', class: "twofa__button-wrapper" }, h("p", { key: '219f5005c0d03189df48f05c5e0cd980eb0e1979', class: "twofa__resend-message" }, translate('twofaResendMessage', this.language)), h("button", { key: '12b7b4bc3ea165994f2c50107f406c64e708cf4d', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
|
|
15273
15301
|
? translate('twofaResendButton', this.language)
|
|
15274
15302
|
: this.formatTime()))));
|
|
15275
15303
|
}
|
|
@@ -15277,8 +15305,8 @@ const TwofaInput = class {
|
|
|
15277
15305
|
static get watchers() { return {
|
|
15278
15306
|
"isValid": ["validityChanged"],
|
|
15279
15307
|
"emitValue": ["emitValueHandler"],
|
|
15280
|
-
"
|
|
15281
|
-
"
|
|
15308
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
15309
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
15282
15310
|
}; }
|
|
15283
15311
|
};
|
|
15284
15312
|
TwofaInput.style = TwofaInputStyle0;
|