@descope/web-components-ui 1.90.0 → 1.92.0
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 +24 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +24 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-date-field-index-js.js +1 -1
- package/dist/umd/descope-date-field-index-js.js.map +1 -1
- package/dist/umd/descope-hybrid-field-index-js.js +3 -3
- package/dist/umd/descope-hybrid-field-index-js.js.map +1 -1
- package/package.json +1 -1
- package/src/components/descope-date-field/DateFieldClass.js +21 -1
- package/src/components/descope-hybrid-field/HybridFieldClass.js +3 -0
package/dist/index.esm.js
CHANGED
@@ -6645,7 +6645,7 @@ const componentName$14 = getComponentName$1('date-field');
|
|
6645
6645
|
const BASE_SELECTOR = 'vaadin-popover';
|
6646
6646
|
const BaseInputClass$a = createBaseInputClass$1({ componentName: componentName$14, baseSelector: BASE_SELECTOR });
|
6647
6647
|
|
6648
|
-
const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly'];
|
6648
|
+
const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];
|
6649
6649
|
const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
|
6650
6650
|
const observedAttrs$3 = [...dateFieldAttrs, ...calendarAttrs];
|
6651
6651
|
|
@@ -6735,6 +6735,10 @@ class RawDateFieldClass extends BaseInputClass$a {
|
|
6735
6735
|
:host([readonly="true"]) .toggle-calendar {
|
6736
6736
|
pointer-events: none;
|
6737
6737
|
}
|
6738
|
+
|
6739
|
+
.hidden {
|
6740
|
+
display: none;
|
6741
|
+
}
|
6738
6742
|
`,
|
6739
6743
|
this
|
6740
6744
|
);
|
@@ -6820,6 +6824,10 @@ class RawDateFieldClass extends BaseInputClass$a {
|
|
6820
6824
|
return this.dateCounters.some((dc) => !dc.isInRange(dc.numberValue));
|
6821
6825
|
}
|
6822
6826
|
|
6827
|
+
get disableCalendar() {
|
6828
|
+
return this.getAttribute('disable-calendar') === 'true';
|
6829
|
+
}
|
6830
|
+
|
6823
6831
|
reportValidity() {
|
6824
6832
|
this.inputElement.reportValidity();
|
6825
6833
|
}
|
@@ -6980,6 +6988,7 @@ class RawDateFieldClass extends BaseInputClass$a {
|
|
6980
6988
|
}
|
6981
6989
|
|
6982
6990
|
openPopover() {
|
6991
|
+
if (this.disableCalendar) return;
|
6983
6992
|
this.setAttribute('opened', 'true');
|
6984
6993
|
}
|
6985
6994
|
|
@@ -7233,6 +7242,14 @@ class RawDateFieldClass extends BaseInputClass$a {
|
|
7233
7242
|
}
|
7234
7243
|
}
|
7235
7244
|
|
7245
|
+
togglePopoverAccess(visibility) {
|
7246
|
+
if (visibility) {
|
7247
|
+
this.popoverToggleButton.classList.remove('hidden');
|
7248
|
+
} else {
|
7249
|
+
this.popoverToggleButton.classList.add('hidden');
|
7250
|
+
}
|
7251
|
+
}
|
7252
|
+
|
7236
7253
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
7237
7254
|
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
7238
7255
|
|
@@ -7240,6 +7257,9 @@ class RawDateFieldClass extends BaseInputClass$a {
|
|
7240
7257
|
if (attrName === 'years-range') {
|
7241
7258
|
this.setYearRange(newValue);
|
7242
7259
|
}
|
7260
|
+
if (attrName === 'disable-calendar') {
|
7261
|
+
this.togglePopoverAccess(newValue !== 'true');
|
7262
|
+
}
|
7243
7263
|
if (dateFieldAttrs.includes(attrName)) {
|
7244
7264
|
if (newValue && attrName === 'format') {
|
7245
7265
|
this.onFormatUpdate(newValue);
|
@@ -18468,8 +18488,11 @@ class RawHybridField extends BaseClass$2 {
|
|
18468
18488
|
// On reportValidity we want to set the caret at the end of the input value.
|
18469
18489
|
// Since checkValidity triggers `focus` on the input, it sets the caret at the start of the input,
|
18470
18490
|
// regardless the existing value.
|
18491
|
+
const origInputType = ele.type;
|
18492
|
+
ele.setAttribute('type', 'text');
|
18471
18493
|
setTimeout(() => {
|
18472
18494
|
ele.setSelectionRange?.(ele.value.length, ele.value.length);
|
18495
|
+
ele.setAttribute('type', origInputType);
|
18473
18496
|
});
|
18474
18497
|
|
18475
18498
|
return this.activeInput.reportValidity();
|