@descope/web-components-ui 1.97.0 → 1.98.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.
@@ -15681,9 +15681,13 @@ const weekdays = [
15681
15681
  ];
15682
15682
 
15683
15683
  const counterConfig = {
15684
- MONTH: { id: 'month', min: 1, max: 12, placeholder: 'MM', count: 5, shiftCount: 10 },
15685
- DAY: { id: 'day', min: 1, max: 31, placeholder: 'DD', count: 5, shiftCount: 10 },
15686
- YEAR: { id: 'year', min: 1900, max: 2099, placeholder: 'YYYY', count: 10, shiftCount: 100 },
15684
+ MONTH: { id: 'month', min: 1, max: 12, placeholder: 'MM' },
15685
+ DAY: { id: 'day', min: 1, max: 31, placeholder: 'DD' },
15686
+ YEAR: { id: 'year', min: 0, max: 9999, placeholder: 'YYYY' },
15687
+ };
15688
+
15689
+ const valRange = {
15690
+ year: { min: 1900, max: 2099 },
15687
15691
  };
15688
15692
 
15689
15693
  const BUTTON_LABEL_DONE = 'Done';
@@ -17357,16 +17361,6 @@ class RawDateFieldClass extends BaseInputClass$1 {
17357
17361
  });
17358
17362
  }
17359
17363
 
17360
- setYearRange(val) {
17361
- if (!val) return;
17362
- const [min, max] = val.split?.('-');
17363
- if (min && max) {
17364
- const counter = this.getCounterById('year');
17365
- counter.setMin(min);
17366
- counter.setMax(max);
17367
- }
17368
- }
17369
-
17370
17364
  togglePopoverAccess(visibility) {
17371
17365
  if (visibility) {
17372
17366
  this.popoverToggleButton.classList.remove('hidden');
@@ -17379,9 +17373,6 @@ class RawDateFieldClass extends BaseInputClass$1 {
17379
17373
  super.attributeChangedCallback?.(attrName, oldValue, newValue);
17380
17374
 
17381
17375
  if (oldValue !== newValue) {
17382
- if (attrName === 'years-range') {
17383
- this.setYearRange(newValue);
17384
- }
17385
17376
  if (attrName === 'disable-calendar') {
17386
17377
  this.togglePopoverAccess(newValue !== 'true');
17387
17378
  }
@@ -17407,9 +17398,17 @@ class RawDateFieldClass extends BaseInputClass$1 {
17407
17398
  // To prevent this error from being submitted, we evaluate the
17408
17399
  // date parts against their generated Date value.
17409
17400
  isInvalidDate() {
17410
- return Object.entries(this.getDateVals()).some(
17411
- ([key, val]) => !val || this.getCounterById(key).numberValue !== val
17412
- );
17401
+ const yearCounter = this.getCounterById('year');
17402
+ const isYearOutOfRange =
17403
+ yearCounter.numberValue > valRange['year'].max ||
17404
+ yearCounter.numberValue < valRange['year'].min;
17405
+
17406
+ const isDateDisplayMismatch = Object.entries(this.getDateVals()).some(([key, val]) => {
17407
+ const counter = this.getCounterById(key);
17408
+ return !val || counter.numberValue !== val;
17409
+ });
17410
+
17411
+ return isYearOutOfRange || isDateDisplayMismatch;
17413
17412
  }
17414
17413
 
17415
17414
  getValidity() {