@descope/web-components-ui 2.2.1 → 2.2.3

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/index.esm.js CHANGED
@@ -4585,8 +4585,10 @@ const CheckboxClass = compose(
4585
4585
  inputOutlineOffset: { ...checkboxElement, property: 'outline-offset' },
4586
4586
  inputOutlineColor: { ...checkboxElement, property: 'outline-color' },
4587
4587
  inputOutlineStyle: { ...checkboxElement, property: 'outline-style' },
4588
+ inputAlign: { ...checkboxElement, property: 'align-self' },
4588
4589
 
4589
4590
  inputContainerPadding: { ...component$1, property: 'padding' },
4591
+ inputContainerBackgroundColor: { ...component$1, property: 'background-color' },
4590
4592
  inputContainerBorderRadius: { ...component$1, property: 'border-radius' },
4591
4593
  inputContainerBorderWidth: { ...component$1, property: 'border-width' },
4592
4594
  inputContainerBorderColor: { ...component$1, property: 'border-color' },
@@ -4636,6 +4638,10 @@ const CheckboxClass = compose(
4636
4638
  height: 100%;
4637
4639
  }
4638
4640
 
4641
+ :host([full-width]) vaadin-checkbox {
4642
+ flex-grow: 1;
4643
+ }
4644
+
4639
4645
  vaadin-checkbox::part(checkbox) {
4640
4646
  margin: 0;
4641
4647
  }
@@ -6262,19 +6268,6 @@ const newDate = (date, isUtcTime) => {
6262
6268
  }
6263
6269
  if (typeof date === 'string') {
6264
6270
  const d = new Date(date.replace(/-/g, '/'));
6265
- if (isUtcTime) {
6266
- return new Date(
6267
- Date.UTC(
6268
- d.getFullYear(),
6269
- d.getMonth(),
6270
- d.getDate(),
6271
- d.getHours(),
6272
- d.getMinutes(),
6273
- d.getSeconds(),
6274
- d.getMilliseconds()
6275
- )
6276
- );
6277
- }
6278
6271
  return new Date(d);
6279
6272
  }
6280
6273
  return new Date();
@@ -6372,9 +6365,16 @@ const parseDateString = (val, format) => {
6372
6365
  };
6373
6366
 
6374
6367
  const dateToEpoch = (date, isUtc) => {
6368
+ // If it's already a number (epoch), return it directly - no conversion needed
6369
+ if (typeof date === 'number') {
6370
+ return date;
6371
+ }
6372
+
6375
6373
  if (isUtc) {
6376
- return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).getTime();
6374
+ return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());
6377
6375
  }
6376
+
6377
+ // Default: return epoch in local timezone
6378
6378
  return date.getTime();
6379
6379
  };
6380
6380
 
@@ -7636,7 +7636,7 @@ class RawDateFieldClass extends BaseInputClass$b {
7636
7636
 
7637
7637
  updateValue() {
7638
7638
  if (this.isCountersOutOfRange) {
7639
- this.updateEpoch('');
7639
+ this.resetEpoch();
7640
7640
  } else {
7641
7641
  const date = formats[this.format].getDate(this.inputElement.value);
7642
7642
  this.updateEpoch(dateToEpoch(date, this.isUtcTime));
@@ -7650,12 +7650,8 @@ class RawDateFieldClass extends BaseInputClass$b {
7650
7650
  this.#dispatchInput();
7651
7651
  };
7652
7652
 
7653
- updateEpoch(epochOrDate) {
7654
- if (Number.isNaN(epochOrDate) || !epochOrDate.toString()?.length) {
7655
- this.epoch = '';
7656
- } else {
7657
- this.epoch = dateToEpoch(newDate(epochOrDate, this.isUtcTime), this.isUtcTime);
7658
- }
7653
+ updateEpoch(epoch) {
7654
+ this.epoch = dateToEpoch(epoch, this.isUtcTime);
7659
7655
  }
7660
7656
 
7661
7657
  dateCounters = [
@@ -7786,14 +7782,18 @@ class RawDateFieldClass extends BaseInputClass$b {
7786
7782
  let value = parseInt(val, 10);
7787
7783
  if (!Number.isNaN(value)) {
7788
7784
  this.updateEpoch(value);
7789
- this.updateDateCounters(newDate(value));
7785
+ this.updateDateCounters(new Date(value));
7790
7786
  } else {
7791
- this.updateEpoch('');
7787
+ this.resetEpoch();
7792
7788
  this.resetDateCounters();
7793
7789
  this.clearInputEle();
7794
7790
  }
7795
7791
  }
7796
7792
 
7793
+ resetEpoch() {
7794
+ this.epoch = '';
7795
+ }
7796
+
7797
7797
  get isCountersEmpty() {
7798
7798
  return this.dateCounters.every((dc) => dc.isEmpty);
7799
7799
  }
@@ -8367,7 +8367,7 @@ class RawDateFieldClass extends BaseInputClass$b {
8367
8367
  }
8368
8368
 
8369
8369
  try {
8370
- const date = this.isUtcTime ? new Date(this.epoch) : newDate(this.epoch);
8370
+ const date = new Date(this.epoch);
8371
8371
 
8372
8372
  if (this.isUtcTime) {
8373
8373
  ret.month = date.getUTCMonth() + 1;