@descope/web-components-ui 1.0.403 → 1.0.404
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/index.cjs.js +33 -16
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +33 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-hybrid-field/HybridFieldClass.js +33 -16
- package/src/index.d.ts +2 -1
package/dist/index.d.ts
CHANGED
@@ -7,7 +7,7 @@ export {
|
|
7
7
|
componentsThemeManager,
|
8
8
|
} from './helpers/themeHelpers';
|
9
9
|
export { genColor } from './helpers/themeHelpers/colorsHelpers';
|
10
|
-
export { defaultTheme, themeVars } from './
|
10
|
+
export { defaultTheme, themeVars } from './theme';
|
11
11
|
export { default as darkTheme } from './darkTheme';
|
12
12
|
export { ButtonClass } from './components/descope-button';
|
13
13
|
export { CheckboxClass } from './components/boolean-fields/descope-checkbox';
|
@@ -49,6 +49,7 @@ export { PolicyValidationClass } from './components/descope-policy-validation/';
|
|
49
49
|
export { CodeSnippetClass } from './components/descope-code-snippet/';
|
50
50
|
export { CalendarClass } from './components/descope-date-field/descope-calendar';
|
51
51
|
export { DateFieldClass } from './components/descope-date-field/';
|
52
|
+
export { HybridFieldClass } from './components/descope-hybrid-field';
|
52
53
|
|
53
54
|
export type Theme = {
|
54
55
|
globals: {
|
package/dist/index.esm.js
CHANGED
@@ -15447,11 +15447,29 @@ class RawHybridField extends BaseClass {
|
|
15447
15447
|
this.activeInput.value = val;
|
15448
15448
|
}
|
15449
15449
|
|
15450
|
-
init() {
|
15450
|
+
async init() {
|
15451
15451
|
super.init?.();
|
15452
|
+
|
15452
15453
|
this.initInputs();
|
15453
15454
|
this.updateAttrs();
|
15454
15455
|
this.toggleInputVisibility();
|
15456
|
+
|
15457
|
+
await this.waitForInputs();
|
15458
|
+
|
15459
|
+
this.initInputEles();
|
15460
|
+
this.overrideEmailInputType();
|
15461
|
+
this.overrideEmailSetAttribute();
|
15462
|
+
}
|
15463
|
+
|
15464
|
+
waitForInputs() {
|
15465
|
+
return new Promise((resolve) => {
|
15466
|
+
const check = setInterval(() => {
|
15467
|
+
if (this.emailInputEle) {
|
15468
|
+
clearInterval(check);
|
15469
|
+
resolve();
|
15470
|
+
}
|
15471
|
+
});
|
15472
|
+
});
|
15455
15473
|
}
|
15456
15474
|
|
15457
15475
|
initInputs() {
|
@@ -15462,19 +15480,6 @@ class RawHybridField extends BaseClass {
|
|
15462
15480
|
this.inputs = [this.emailInput, this.phoneCountryCodeInput, this.phoneInputBoxInput];
|
15463
15481
|
|
15464
15482
|
this.activeInput = this.emailInput;
|
15465
|
-
|
15466
|
-
this.initInputEles();
|
15467
|
-
this.overrideEmailInputType();
|
15468
|
-
|
15469
|
-
// We want to prevent Vaadin from changing the input type to `email`
|
15470
|
-
// otherwise, we cannot get the selectionStart from the input.
|
15471
|
-
const origEmailSetAttr = this.emailInput.setAttribute.bind(this.emailInputEle);
|
15472
|
-
this.emailInputEle.setAttribute = (name, value) => {
|
15473
|
-
if (name !== 'type' || value !== 'email' || !this.emailInput.hasAttribute('focused')) {
|
15474
|
-
return origEmailSetAttr(name, value);
|
15475
|
-
}
|
15476
|
-
return false;
|
15477
|
-
};
|
15478
15483
|
}
|
15479
15484
|
|
15480
15485
|
// we need to listen on the inner `input` element itself, otherwise we don't always get an `input` event
|
@@ -15486,7 +15491,7 @@ class RawHybridField extends BaseClass {
|
|
15486
15491
|
];
|
15487
15492
|
|
15488
15493
|
inputEles.forEach((ele) => {
|
15489
|
-
ele
|
15494
|
+
ele.addEventListener('input', this.onValueChange.bind(this));
|
15490
15495
|
});
|
15491
15496
|
}
|
15492
15497
|
|
@@ -15496,11 +15501,23 @@ class RawHybridField extends BaseClass {
|
|
15496
15501
|
});
|
15497
15502
|
this.emailInputEle.addEventListener('blur', () => {
|
15498
15503
|
setTimeout(() => {
|
15499
|
-
this.emailInputEle
|
15504
|
+
this.emailInputEle.setAttribute('type', 'email');
|
15500
15505
|
});
|
15501
15506
|
});
|
15502
15507
|
}
|
15503
15508
|
|
15509
|
+
// We want to prevent Vaadin from changing the input type to `email`
|
15510
|
+
// otherwise, we cannot get the selectionStart from the input.
|
15511
|
+
overrideEmailSetAttribute() {
|
15512
|
+
const origEmailSetAttr = this.emailInput.setAttribute.bind(this.emailInputEle);
|
15513
|
+
this.emailInputEle.setAttribute = (name, value) => {
|
15514
|
+
if (name !== 'type' || value !== 'email' || !this.emailInput.hasAttribute('focused')) {
|
15515
|
+
return origEmailSetAttr(name, value);
|
15516
|
+
}
|
15517
|
+
return false;
|
15518
|
+
};
|
15519
|
+
}
|
15520
|
+
|
15504
15521
|
updateAttrs() {
|
15505
15522
|
this.inputs.forEach((input) => forwardAttrs(this, input, { includeAttrs: attrs.shared }));
|
15506
15523
|
|