@descope/web-components-ui 1.124.0 → 1.126.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/index.esm.js CHANGED
@@ -5731,12 +5731,26 @@ const formatEpoch = (epoch, format) => {
5731
5731
  };
5732
5732
 
5733
5733
  // polyfill for safari Date API (which doesn't accept "YYYY-MM-DD" string as value)
5734
- const newDate = (date) => {
5734
+ const newDate = (date, isUtcTime) => {
5735
5735
  if (typeof date === 'number') {
5736
5736
  return new Date(date);
5737
5737
  }
5738
5738
  if (typeof date === 'string') {
5739
- return new Date(date.replace(/-/g, '/'));
5739
+ const d = new Date(date.replace(/-/g, '/'));
5740
+ if (isUtcTime) {
5741
+ return new Date(
5742
+ Date.UTC(
5743
+ d.getFullYear(),
5744
+ d.getMonth(),
5745
+ d.getDate(),
5746
+ d.getHours(),
5747
+ d.getMinutes(),
5748
+ d.getSeconds(),
5749
+ d.getMilliseconds()
5750
+ )
5751
+ );
5752
+ }
5753
+ return new Date(d);
5740
5754
  }
5741
5755
  return new Date();
5742
5756
  };
@@ -7041,10 +7055,10 @@ class RawDateFieldClass extends BaseInputClass$b {
7041
7055
  };
7042
7056
 
7043
7057
  updateEpoch(epochOrDate) {
7044
- if (!epochOrDate) {
7058
+ if (Number.isNaN(epochOrDate) || !epochOrDate.toString()?.length) {
7045
7059
  this.epoch = '';
7046
7060
  } else {
7047
- this.epoch = dateToEpoch(newDate(epochOrDate), this.isUtcTime);
7061
+ this.epoch = dateToEpoch(newDate(epochOrDate, this.isUtcTime), this.isUtcTime);
7048
7062
  }
7049
7063
  }
7050
7064
 
@@ -7173,7 +7187,7 @@ class RawDateFieldClass extends BaseInputClass$b {
7173
7187
  }
7174
7188
 
7175
7189
  set value(val) {
7176
- if (val) {
7190
+ if (!Number.isNaN(val)) {
7177
7191
  this.updateEpoch(val);
7178
7192
  this.updateDateCounters(newDate(val));
7179
7193
  } else {
@@ -7669,7 +7683,10 @@ class RawDateFieldClass extends BaseInputClass$b {
7669
7683
 
7670
7684
  // we need to wait for the text-field to init
7671
7685
  setTimeout(() => {
7672
- this.value = val;
7686
+ if (Number.isNaN(parseInt(val, 10))) {
7687
+ return;
7688
+ }
7689
+ this.value = Number(val);
7673
7690
  });
7674
7691
  }
7675
7692
 
@@ -7742,7 +7759,7 @@ class RawDateFieldClass extends BaseInputClass$b {
7742
7759
  year: '',
7743
7760
  };
7744
7761
 
7745
- if (!this.epoch) {
7762
+ if (Number.isNaN(this.epoch)) {
7746
7763
  return ret;
7747
7764
  }
7748
7765
 
@@ -24858,7 +24875,7 @@ class RawOutboundAppButton extends createBaseClass({
24858
24875
  baseSelector: ':host > descope-button',
24859
24876
  }) {
24860
24877
  static get observedAttributes() {
24861
- return ['label', 'icon-src'];
24878
+ return ['label', 'icon-src', 'icon-fill-current-color'];
24862
24879
  }
24863
24880
 
24864
24881
  constructor() {
@@ -24888,7 +24905,15 @@ class RawOutboundAppButton extends createBaseClass({
24888
24905
  init() {
24889
24906
  super.init?.();
24890
24907
 
24891
- forwardAttrs(this, this.button, { excludeAttrs: ['style', 'class', 'icon-src', 'label'] });
24908
+ forwardAttrs(this, this.button, {
24909
+ excludeAttrs: [
24910
+ 'style',
24911
+ 'class',
24912
+ 'label',
24913
+ 'icon-src',
24914
+ 'icon-fill-current-color',
24915
+ ]
24916
+ });
24892
24917
  }
24893
24918
 
24894
24919
  updateLabel(val = '') {
@@ -24917,7 +24942,14 @@ class RawOutboundAppButton extends createBaseClass({
24917
24942
  const OutboundAppButtonClass = compose(
24918
24943
  createStyleMixin({
24919
24944
  mappings: {
24920
- hostWidth: { selector: () => ':host', property: 'width' },
24945
+ hostWidth: {
24946
+ selector: () => ':host',
24947
+ property: 'width'
24948
+ },
24949
+ iconFillCurrentColor: {
24950
+ selector: () => 'descope-icon',
24951
+ property: ButtonClass.cssVarList.iconColor
24952
+ }
24921
24953
  },
24922
24954
  }),
24923
24955
  draggableMixin,
@@ -24927,6 +24959,12 @@ const OutboundAppButtonClass = compose(
24927
24959
  const compVars = OutboundAppButtonClass.cssVarList;
24928
24960
 
24929
24961
  const outboundAppButton = {
24962
+ [compVars.iconFill]: 'inherit',
24963
+
24964
+ _iconFillCurrentColor: {
24965
+ [compVars.iconFillCurrentColor]: 'currentColor',
24966
+ },
24967
+
24930
24968
  _fullWidth: {
24931
24969
  [compVars.hostWidth]: '100%',
24932
24970
  },