@descope/web-components-ui 1.111.0 → 1.112.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.
Files changed (28) hide show
  1. package/dist/cjs/index.cjs.js +73 -19
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +73 -19
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/DescopeDev.js +1 -1
  6. package/dist/umd/DescopeDev.js.map +1 -1
  7. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  8. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
  9. package/dist/umd/descope-button.js +1 -1
  10. package/dist/umd/descope-button.js.map +1 -1
  11. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  12. package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
  13. package/dist/umd/descope-outbound-apps.js +1 -1
  14. package/dist/umd/descope-outbound-apps.js.map +1 -1
  15. package/dist/umd/descope-timer-button.js +1 -1
  16. package/dist/umd/descope-timer-button.js.map +1 -1
  17. package/dist/umd/descope-upload-file-index-js.js +1 -1
  18. package/dist/umd/descope-upload-file-index-js.js.map +1 -1
  19. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  20. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  21. package/dist/umd/descope-user-auth-method-index-js.js +4 -4
  22. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  23. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  24. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  25. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  26. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  27. package/package.json +4 -4
  28. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +72 -18
@@ -3089,7 +3089,7 @@ const ButtonClass = compose(
3089
3089
  padding: 0;
3090
3090
  }
3091
3091
  `,
3092
- excludeAttrsSync: ['tabindex'],
3092
+ excludeAttrsSync: ['tabindex', 'class'],
3093
3093
  componentName: componentName$1b,
3094
3094
  })
3095
3095
  );
@@ -14679,10 +14679,13 @@ class RawUserAuthMethod extends createBaseClass({
14679
14679
  </div>
14680
14680
 
14681
14681
  <div class="btn-wrapper">
14682
- <descope-button size="sm" variant="link" mode="primary">
14682
+ <descope-button class="btn unfulfilled hidden" size="sm" variant="link" mode="primary">
14683
14683
  <slot name="button-icon"></slot>
14684
14684
  </descope-button>
14685
- <div class="fulfilled-indicator">
14685
+ <descope-button class="btn fulfilled hidden" size="sm" variant="link" mode="primary">
14686
+ <slot name="fulfilled-button-icon"></slot>
14687
+ </descope-button>
14688
+ <div class="status-indicator hidden">
14686
14689
  <vaadin-icon src=${greenVIcon}></vaadin-icon>
14687
14690
  </div>
14688
14691
  <descope-button class="hidden-btn" size="sm" variant="link" mode="primary"></descope-button>
@@ -14731,7 +14734,7 @@ class RawUserAuthMethod extends createBaseClass({
14731
14734
  display: inline-flex;
14732
14735
  }
14733
14736
 
14734
- .fulfilled-indicator {
14737
+ .status-indicator {
14735
14738
  width: 1em;
14736
14739
  height: 1em;
14737
14740
  display: flex;
@@ -14746,6 +14749,8 @@ class RawUserAuthMethod extends createBaseClass({
14746
14749
  .hidden-btn {
14747
14750
  width: 0;
14748
14751
  overflow: hidden;
14752
+ opacity: 0;
14753
+ pointer-events: none;
14749
14754
  }
14750
14755
 
14751
14756
  slot[name="method-icon"]{
@@ -14756,8 +14761,9 @@ class RawUserAuthMethod extends createBaseClass({
14756
14761
  this
14757
14762
  );
14758
14763
 
14759
- this.button = this.shadowRoot.querySelector('descope-button');
14760
- this.fulfilledIndicator = this.shadowRoot.querySelector('.fulfilled-indicator');
14764
+ this.unfulfilledButton = this.shadowRoot.querySelector('.btn.unfulfilled');
14765
+ this.fulfilledButton = this.shadowRoot.querySelector('.btn.fulfilled');
14766
+ this.statusIndicator = this.shadowRoot.querySelector('.status-indicator');
14761
14767
  this.labelText = this.shadowRoot.querySelector('descope-text[data-id="label-text"]');
14762
14768
  }
14763
14769
 
@@ -14766,49 +14772,91 @@ class RawUserAuthMethod extends createBaseClass({
14766
14772
  this.labelText.setAttribute('title', this.label);
14767
14773
  }
14768
14774
 
14769
- onButtonLabelChange() {
14770
- let textSpanEle = this.button.querySelector('span');
14775
+ updateButtonLabel(btnRef, label) {
14776
+ let textSpanEle = btnRef.querySelector('span');
14771
14777
 
14772
- if (this.buttonLabel) {
14778
+ if (label) {
14773
14779
  if (!textSpanEle) {
14774
14780
  textSpanEle = document.createElement('span');
14775
- this.button.appendChild(textSpanEle);
14781
+ btnRef.appendChild(textSpanEle);
14776
14782
  }
14777
- textSpanEle.innerText = this.buttonLabel;
14783
+ textSpanEle.innerText = label;
14778
14784
  } else if (textSpanEle) {
14779
- this.button.removeChild(textSpanEle);
14785
+ btnRef.removeChild(textSpanEle);
14780
14786
  }
14781
14787
  }
14782
14788
 
14783
14789
  onFulfilledChange() {
14784
- this.button.classList.toggle('hidden', this.isFulfilled);
14785
- this.fulfilledIndicator.classList.toggle('hidden', !this.isFulfilled);
14790
+ if (this.isFulfilled) {
14791
+ this.unfulfilledButton.classList.add('hidden');
14792
+ this.handleFulfilled();
14793
+ } else {
14794
+ this.fulfilledButton.classList.add('hidden');
14795
+ this.handleUnfulfilled();
14796
+ }
14797
+ }
14798
+
14799
+ handleFulfilled() {
14800
+ this.fulfilledButton.classList.toggle('hidden', !this.isFulfilledEditable);
14801
+ this.statusIndicator.classList.toggle('hidden', this.isFulfilledEditable);
14802
+ }
14803
+
14804
+ handleUnfulfilled() {
14805
+ this.unfulfilledButton.classList.toggle('hidden', !this.isUnfulfilledEditable);
14806
+ this.statusIndicator.classList.toggle('hidden', this.isUnfulfilledEditable);
14786
14807
  }
14787
14808
 
14788
14809
  get label() {
14789
14810
  return this.getAttribute('label') || '';
14790
14811
  }
14791
14812
 
14792
- get buttonLabel() {
14813
+ get unfulfilledButtonLabel() {
14793
14814
  return this.getAttribute('button-label') || '';
14794
14815
  }
14795
14816
 
14817
+ get fulfilledButtonLabel() {
14818
+ return this.getAttribute('fulfilled-button-label') || '';
14819
+ }
14820
+
14796
14821
  get isFulfilled() {
14797
14822
  return this.getAttribute('fulfilled') === 'true';
14798
14823
  }
14799
14824
 
14825
+ get isFulfilledEditable() {
14826
+ return this.getAttribute('fulfilled-editable') === 'true';
14827
+ }
14828
+
14829
+ get isUnfulfilledEditable() {
14830
+ // this is to keep backward compatibility with previous versions
14831
+ return this.getAttribute('unfulfilled-editable') !== 'false';
14832
+ }
14833
+
14800
14834
  init() {
14801
14835
  this.onLabelChange();
14802
- this.onButtonLabelChange();
14836
+ this.updateButtonLabel(this.fulfilledButton, this.fulfilledButtonLabel);
14837
+ this.updateButtonLabel(this.unfulfilledButton, this.unfulfilledButtonLabel);
14803
14838
  this.onFulfilledChange();
14804
14839
 
14805
- this.button.addEventListener('click', () =>
14840
+ this.unfulfilledButton.addEventListener('click', () =>
14806
14841
  this.dispatchEvent(new CustomEvent('button-clicked', { bubbles: true, composed: true }))
14807
14842
  );
14843
+
14844
+ this.fulfilledButton.addEventListener('click', () => {
14845
+ this.dispatchEvent(
14846
+ new CustomEvent('fulfilled-button-clicked', { bubbles: true, composed: true })
14847
+ );
14848
+ });
14808
14849
  }
14809
14850
 
14810
14851
  static get observedAttributes() {
14811
- return ['label', 'fulfilled'].concat(super.observedAttributes);
14852
+ return [
14853
+ 'label',
14854
+ 'fulfilled',
14855
+ 'button-label',
14856
+ 'fulfilled-button-label',
14857
+ 'fulfilled-editable',
14858
+ 'unfulfilled-editable',
14859
+ ].concat(super.observedAttributes);
14812
14860
  }
14813
14861
 
14814
14862
  attributeChangedCallback(name, oldValue, newValue) {
@@ -14822,7 +14870,13 @@ class RawUserAuthMethod extends createBaseClass({
14822
14870
  } else if (name === 'fulfilled') {
14823
14871
  this.onFulfilledChange();
14824
14872
  } else if (name === 'button-label') {
14825
- this.onButtonLabelChange();
14873
+ this.updateButtonLabel(this.unfulfilledButton, this.unfulfilledButtonLabel);
14874
+ } else if (name === 'fulfilled-button-label') {
14875
+ this.updateButtonLabel(this.fulfilledButton, this.fulfilledButtonLabel);
14876
+ } else if (name === 'fulfilled-editable' && this.isFulfilled) {
14877
+ this.handleFulfilled();
14878
+ } else if (name === 'unfulfilled-editable' && !this.isFulfilled) {
14879
+ this.handleUnfulfilled();
14826
14880
  }
14827
14881
  }
14828
14882
  }