@descope/web-components-ui 1.0.385 → 1.0.387

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. package/dist/cjs/index.cjs.js +68 -47
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +68 -47
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1033.js +2 -0
  6. package/dist/umd/{9423.js → 1053.js} +15 -15
  7. package/dist/umd/1414.js +352 -0
  8. package/dist/umd/{9314.js → 1437.js} +10 -10
  9. package/dist/umd/1672.js +1 -0
  10. package/dist/umd/{3830.js → 2566.js} +2 -2
  11. package/dist/umd/{7856.js → 2838.js} +2 -2
  12. package/dist/umd/286.js +148 -0
  13. package/dist/umd/{5135.js → 2919.js} +8 -8
  14. package/dist/umd/3222.js +282 -0
  15. package/dist/umd/{7056.js → 351.js} +10 -10
  16. package/dist/umd/3607.js +2 -0
  17. package/dist/umd/3711.js +123 -0
  18. package/dist/umd/4619.js +1 -0
  19. package/dist/umd/{3951.js → 4834.js} +8 -8
  20. package/dist/umd/{1612.js → 5026.js} +7 -7
  21. package/dist/umd/{7284.js → 5086.js} +8 -8
  22. package/dist/umd/{8191.js → 5273.js} +6 -6
  23. package/dist/umd/5412.js +109 -0
  24. package/dist/umd/{4024.js → 5443.js} +7 -7
  25. package/dist/umd/5459.js +1 -0
  26. package/dist/umd/{6594.js → 6418.js} +2 -2
  27. package/dist/umd/{1438.js → 6474.js} +16 -16
  28. package/dist/umd/650.js +1 -0
  29. package/dist/umd/6637.js +73 -0
  30. package/dist/umd/6726.js +148 -0
  31. package/dist/umd/{63.js → 7212.js} +9 -9
  32. package/dist/umd/{9562.js → 7407.js} +7 -7
  33. package/dist/umd/{7541.js → 7607.js} +11 -11
  34. package/dist/umd/{4052.js → 7824.js} +7 -7
  35. package/dist/umd/{4525.js → 8162.js} +3 -3
  36. package/dist/umd/8164.js +319 -0
  37. package/dist/umd/8980.js +143 -0
  38. package/dist/umd/{8137.js → 9167.js} +10 -10
  39. package/dist/umd/{5778.js → 9632.js} +10 -10
  40. package/dist/umd/9878.js +1 -0
  41. package/dist/umd/9895.js +17 -0
  42. package/dist/umd/DescopeDev.js +1 -1
  43. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -1
  44. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  45. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  46. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  47. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -1
  48. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  49. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -1
  50. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  51. package/dist/umd/descope-apps-list-index-js.js +1 -1
  52. package/dist/umd/descope-avatar-index-js.js +1 -1
  53. package/dist/umd/descope-badge-index-js.js +1 -1
  54. package/dist/umd/descope-button-index-js.js +6 -6
  55. package/dist/umd/descope-code-snippet-index-js.js +1 -1
  56. package/dist/umd/descope-combo-box-index-js.js +7 -7
  57. package/dist/umd/descope-container-index-js.js +1 -1
  58. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
  59. package/dist/umd/descope-date-field-index-js.js +1 -1
  60. package/dist/umd/descope-divider-index-js.js +1 -1
  61. package/dist/umd/descope-email-field-index-js.js +4 -4
  62. package/dist/umd/descope-enriched-text-index-js.js +1 -1
  63. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +4 -4
  64. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +4 -4
  65. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  66. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +4 -4
  67. package/dist/umd/descope-grid-index-js.js +1 -1
  68. package/dist/umd/descope-icon-index-js.js +1 -1
  69. package/dist/umd/descope-image-index-js.js +1 -1
  70. package/dist/umd/descope-link-index-js.js +1 -1
  71. package/dist/umd/descope-list-index-js.js +1 -1
  72. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  73. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  74. package/dist/umd/descope-logo-index-js.js +1 -1
  75. package/dist/umd/descope-modal-index-js.js +1 -1
  76. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  77. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  78. package/dist/umd/descope-new-password-index-js.js +1 -1
  79. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
  80. package/dist/umd/descope-notification-index-js.js +1 -1
  81. package/dist/umd/descope-notp-image-index-js.js +1 -1
  82. package/dist/umd/descope-number-field-index-js.js +1 -1
  83. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  84. package/dist/umd/descope-passcode-index-js.js +1 -1
  85. package/dist/umd/descope-password-index-js.js +1 -1
  86. package/dist/umd/descope-policy-validation-index-js.js +1 -1
  87. package/dist/umd/descope-radio-group-index-js.js +1 -1
  88. package/dist/umd/descope-recaptcha-index-js.js +1 -1
  89. package/dist/umd/descope-text-area-index-js.js +1 -1
  90. package/dist/umd/descope-text-field-index-js.js +2 -2
  91. package/dist/umd/descope-text-index-js.js +1 -1
  92. package/dist/umd/descope-totp-image-index-js.js +1 -1
  93. package/dist/umd/descope-upload-file-index-js.js +1 -1
  94. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  95. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  96. package/dist/umd/index.js +1 -1
  97. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -1
  98. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -1
  99. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  100. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -1
  101. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  102. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  103. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  104. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +2 -2
  105. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  106. package/package.json +2 -2
  107. package/src/components/descope-date-field/DateFieldClass.js +66 -44
  108. package/src/components/descope-date-field/descope-calendar/CalendarClass.js +2 -2
  109. package/src/theme/components/dateField.js +0 -1
  110. package/dist/umd/1224.js +0 -2
  111. package/dist/umd/2773.js +0 -148
  112. package/dist/umd/3227.js +0 -17
  113. package/dist/umd/3966.js +0 -319
  114. package/dist/umd/4392.js +0 -1
  115. package/dist/umd/4569.js +0 -1
  116. package/dist/umd/4978.js +0 -1
  117. package/dist/umd/5517.js +0 -2
  118. package/dist/umd/5806.js +0 -109
  119. package/dist/umd/5910.js +0 -1
  120. package/dist/umd/5977.js +0 -140
  121. package/dist/umd/602.js +0 -282
  122. package/dist/umd/637.js +0 -1
  123. package/dist/umd/6770.js +0 -148
  124. package/dist/umd/7911.js +0 -73
  125. package/dist/umd/8060.js +0 -352
  126. package/dist/umd/8655.js +0 -123
  127. /package/dist/umd/{1224.js.LICENSE.txt → 1033.js.LICENSE.txt} +0 -0
  128. /package/dist/umd/{9423.js.LICENSE.txt → 1053.js.LICENSE.txt} +0 -0
  129. /package/dist/umd/{8060.js.LICENSE.txt → 1414.js.LICENSE.txt} +0 -0
  130. /package/dist/umd/{1612.js.LICENSE.txt → 1437.js.LICENSE.txt} +0 -0
  131. /package/dist/umd/{3830.js.LICENSE.txt → 2566.js.LICENSE.txt} +0 -0
  132. /package/dist/umd/{7856.js.LICENSE.txt → 2838.js.LICENSE.txt} +0 -0
  133. /package/dist/umd/{4024.js.LICENSE.txt → 286.js.LICENSE.txt} +0 -0
  134. /package/dist/umd/{5135.js.LICENSE.txt → 2919.js.LICENSE.txt} +0 -0
  135. /package/dist/umd/{3227.js.LICENSE.txt → 3222.js.LICENSE.txt} +0 -0
  136. /package/dist/umd/{4052.js.LICENSE.txt → 351.js.LICENSE.txt} +0 -0
  137. /package/dist/umd/{5517.js.LICENSE.txt → 3607.js.LICENSE.txt} +0 -0
  138. /package/dist/umd/{8655.js.LICENSE.txt → 3711.js.LICENSE.txt} +0 -0
  139. /package/dist/umd/{3951.js.LICENSE.txt → 4834.js.LICENSE.txt} +0 -0
  140. /package/dist/umd/{4525.js.LICENSE.txt → 5026.js.LICENSE.txt} +0 -0
  141. /package/dist/umd/{6770.js.LICENSE.txt → 5086.js.LICENSE.txt} +0 -0
  142. /package/dist/umd/{7056.js.LICENSE.txt → 5273.js.LICENSE.txt} +0 -0
  143. /package/dist/umd/{5806.js.LICENSE.txt → 5412.js.LICENSE.txt} +0 -0
  144. /package/dist/umd/{7284.js.LICENSE.txt → 5443.js.LICENSE.txt} +0 -0
  145. /package/dist/umd/{6594.js.LICENSE.txt → 6418.js.LICENSE.txt} +0 -0
  146. /package/dist/umd/{1438.js.LICENSE.txt → 6474.js.LICENSE.txt} +0 -0
  147. /package/dist/umd/{7911.js.LICENSE.txt → 6637.js.LICENSE.txt} +0 -0
  148. /package/dist/umd/{2773.js.LICENSE.txt → 6726.js.LICENSE.txt} +0 -0
  149. /package/dist/umd/{63.js.LICENSE.txt → 7212.js.LICENSE.txt} +0 -0
  150. /package/dist/umd/{8191.js.LICENSE.txt → 7407.js.LICENSE.txt} +0 -0
  151. /package/dist/umd/{7541.js.LICENSE.txt → 7607.js.LICENSE.txt} +0 -0
  152. /package/dist/umd/{9314.js.LICENSE.txt → 7824.js.LICENSE.txt} +0 -0
  153. /package/dist/umd/{9562.js.LICENSE.txt → 8162.js.LICENSE.txt} +0 -0
  154. /package/dist/umd/{3966.js.LICENSE.txt → 8164.js.LICENSE.txt} +0 -0
  155. /package/dist/umd/{5977.js.LICENSE.txt → 8980.js.LICENSE.txt} +0 -0
  156. /package/dist/umd/{8137.js.LICENSE.txt → 9167.js.LICENSE.txt} +0 -0
  157. /package/dist/umd/{5778.js.LICENSE.txt → 9632.js.LICENSE.txt} +0 -0
  158. /package/dist/umd/{602.js.LICENSE.txt → 9895.js.LICENSE.txt} +0 -0
@@ -14386,8 +14386,8 @@ const {
14386
14386
  weekday: { selector: () => '.weekday' },
14387
14387
  navPrev: { selector: () => '.nav-prev' },
14388
14388
  navNext: { selector: () => '.nav-next' },
14389
- navPrevRTL: { selector: () => ':host(:dir(rtl)) .nav-prev' },
14390
- navNextRTL: { selector: () => ':host(:dir(rtl)) .nav-next' },
14389
+ navPrevRTL: { selector: () => ':host([st-host-direction="rtl"]) .nav-prev' },
14390
+ navNextRTL: { selector: () => ':host([st-host-direction="rtl"]) .nav-next' },
14391
14391
  yearInput: { selector: () => '.year-input' },
14392
14392
  monthInput: { selector: () => '.month-input' },
14393
14393
  };
@@ -14743,7 +14743,7 @@ const componentName$5 = getComponentName('date-field');
14743
14743
  const BASE_SELECTOR = 'vaadin-popover';
14744
14744
  const BaseInputClass = createBaseInputClass({ componentName: componentName$5, baseSelector: BASE_SELECTOR });
14745
14745
 
14746
- const dateFieldAttrs = ['format', 'opened', 'initial-value'];
14746
+ const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly'];
14747
14747
  const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
14748
14748
  const observedAttrs = [...dateFieldAttrs, ...calendarAttrs];
14749
14749
 
@@ -14785,19 +14785,16 @@ class RawDateFieldClass extends BaseInputClass {
14785
14785
  display: flex;
14786
14786
  align-self: center;
14787
14787
  z-index: 1;
14788
+ height: 100%;
14789
+ align-items: center;
14788
14790
  }
14789
14791
 
14790
- descope-text-field .overlay-position-anchor {
14791
- position: absolute;
14792
- height: 100%;
14793
- width: 0;
14794
- z-index: 1;
14792
+ :host([readonly="true"]) .toggle-calendar {
14795
14793
  pointer-events: none;
14796
14794
  }
14797
14795
  </style>
14798
14796
  <div>
14799
14797
  <descope-text-field>
14800
- <span slot="prefix" class="overlay-position-anchor"></span>
14801
14798
  <span slot="suffix" class="toggle-calendar">
14802
14799
  <descope-icon>${calendarIcon}</descope-icon>
14803
14800
  </span>
@@ -14808,7 +14805,6 @@ class RawDateFieldClass extends BaseInputClass {
14808
14805
 
14809
14806
  this.inputElement = this.shadowRoot.querySelector('descope-text-field');
14810
14807
  this.popoverToggleButton = this.inputElement.querySelector('.toggle-calendar');
14811
- this.overlayPositionAnchor = this.inputElement.querySelector('.overlay-position-anchor');
14812
14808
 
14813
14809
  this.oninvalid = () => {
14814
14810
  this.inputElement.setAttribute('invalid', 'true');
@@ -14857,6 +14853,17 @@ class RawDateFieldClass extends BaseInputClass {
14857
14853
  return this.overlay?.querySelector('descope-calendar');
14858
14854
  }
14859
14855
 
14856
+ get isRTL() {
14857
+ const computedStyleDirection = getComputedStyle(this.baseElement).getPropertyValue('direction');
14858
+
14859
+ if (computedStyleDirection) {
14860
+ return computedStyleDirection === 'rtl';
14861
+ }
14862
+
14863
+ // Fallback: If for some reason computed style was not calculated in time, fallback to check on attribute
14864
+ return this.getAttribute('st-host-direction') === 'rtl';
14865
+ }
14866
+
14860
14867
  get value() {
14861
14868
  return this.timestamp;
14862
14869
  }
@@ -14937,10 +14944,8 @@ class RawDateFieldClass extends BaseInputClass {
14937
14944
  }
14938
14945
 
14939
14946
  initPopover() {
14940
- this.baseElement.target = this.overlayPositionAnchor;
14941
14947
  this.baseElement.trigger = ['click'];
14942
14948
  this.baseElement.withBackdrop = true;
14943
- this.baseElement.noCloseOnOutsideClick = true;
14944
14949
  this.baseElement.renderer = this.#popoverRenderer.bind(this);
14945
14950
 
14946
14951
  // block popover events from focusing/blurring the text-field
@@ -14950,32 +14955,64 @@ class RawDateFieldClass extends BaseInputClass {
14950
14955
  });
14951
14956
  }
14952
14957
 
14958
+ #popoverPosStylesheet;
14959
+
14953
14960
  #popoverRenderer(root) {
14954
14961
  // popoverRenderer should run only once, when the popover is first rendering.
14955
14962
  if (!root.firstChild) {
14963
+ this.overlay.positionTarget = this.shadowRoot.querySelector('.toggle-calendar');
14964
+
14956
14965
  root.appendChild(this.#getPopoverContent());
14966
+
14957
14967
  // override vaadin's constructed stylesheet which hides the host element
14958
14968
  overrideConstructedStylesheet(this.baseElement);
14959
14969
 
14960
- // To prevent position flickering of the dialog we set opacity to 0
14961
- root.style.setProperty('opacity', '0');
14970
+ this.backdrop.addEventListener('click', this.closePopover.bind(this));
14971
+ }
14962
14972
 
14963
- setTimeout(() => {
14964
- // on first render we adjust the a anchor element in the input
14965
- // so vaadin computes the popover position according to the anchor position
14966
- // (otherwise it will simply center the popover below the input).
14967
- this.#adjustOverlayPosition();
14973
+ // Hide overlay before adjusting position to prevent flickering
14974
+ root.style.setProperty('visibility', 'hidden');
14968
14975
 
14969
- // remove opacity to show overlay
14970
- root.style.setProperty('opacity', '1');
14976
+ // Wait until overlay is ready
14977
+ setTimeout(() => {
14978
+ this.#adjustPopoverPosition(root);
14971
14979
 
14972
- // on outside click - close popover. this event runs once on popover first render
14973
- // and does not need to be cleared
14974
- this.backdrop.addEventListener('click', this.closePopover.bind(this));
14975
- });
14980
+ // Show adjusted overlay
14981
+ root.style.setProperty('visibility', 'visible');
14982
+ this.updateCalendarView(root);
14983
+ }, 100);
14984
+ }
14985
+
14986
+ #adjustPopoverPosition() {
14987
+ const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;
14988
+
14989
+ // Remove previously added stylesheets
14990
+ this.#popoverPosStylesheet?.remove();
14991
+
14992
+ const windowRect = document.body.getBoundingClientRect();
14993
+ const inputRect = this.getBoundingClientRect();
14994
+ const calendarRect = this.calendar.getBoundingClientRect();
14995
+
14996
+ const side = this.isRTL ? 'right' : 'left';
14997
+ const offset = inputRect[side] - calendarRect[side];
14998
+ const availableLeft = calendarRect.left;
14999
+ const availableRight = windowRect.width - calendarRect.right;
15000
+
15001
+ let newOffset;
15002
+ if (offset > 0) {
15003
+ newOffset = Math.min(offset, availableRight);
15004
+ } else {
15005
+ newOffset = Math.min(Math.abs(offset), availableLeft) * -1;
14976
15006
  }
14977
15007
 
14978
- this.updateCalendarView();
15008
+ this.#popoverPosStylesheet = document.createElement('style');
15009
+ this.#popoverPosStylesheet.innerHTML = `
15010
+ vaadin-popover-overlay::part(overlay) {
15011
+ transform: translateX(${newOffset}px);
15012
+ }
15013
+ `;
15014
+
15015
+ popover.appendChild(this.#popoverPosStylesheet);
14979
15016
  }
14980
15017
 
14981
15018
  #getPopoverContent() {
@@ -14991,17 +15028,6 @@ class RawDateFieldClass extends BaseInputClass {
14991
15028
  return ele;
14992
15029
  }
14993
15030
 
14994
- #adjustOverlayPosition() {
14995
- const { width: inputEleWidth } = this.inputElement.getClientRects()[0];
14996
- const { width: calendarEleWidth } = this.calendar.getClientRects()[0];
14997
- const pos = inputEleWidth - calendarEleWidth / 2;
14998
- /* eslint-disable no-use-before-define */
14999
- this.overlayPositionAnchor.style.setProperty(
15000
- DateFieldClass.cssVarList.overlayAnchorPos,
15001
- `${pos}px`
15002
- );
15003
- }
15004
-
15005
15031
  // the default vaadin behavior is to attach the overlay to the body when opened
15006
15032
  // we do not want that because it's difficult to style the overlay in this way
15007
15033
  // so we override it to open inside the shadow DOM
@@ -15085,6 +15111,10 @@ class RawDateFieldClass extends BaseInputClass {
15085
15111
  }
15086
15112
 
15087
15113
  onFocus() {
15114
+ if (this.isReadOnly) {
15115
+ return;
15116
+ }
15117
+
15088
15118
  if (!this.inputElement.value) {
15089
15119
  this.inputElement.value = this.format;
15090
15120
  this.setInputSelectionRange();
@@ -15322,12 +15352,10 @@ class RawDateFieldClass extends BaseInputClass {
15322
15352
  }
15323
15353
  }
15324
15354
 
15325
- const { host, input, toggleButton, overlayAnchor, overlayAnchorRTL, overlay, backdrop } = {
15355
+ const { host, input, toggleButton, overlay, backdrop } = {
15326
15356
  host: { selector: () => ':host' },
15327
15357
  input: { selector: () => 'descope-text-field' },
15328
15358
  toggleButton: { selector: () => '.toggle-calendar' },
15329
- overlayAnchor: { selector: () => ':host .overlay-position-anchor' },
15330
- overlayAnchorRTL: { selector: ':host([st-host-direction="rtl"]) .overlay-position-anchor' },
15331
15359
  overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },
15332
15360
  backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },
15333
15361
  };
@@ -15340,14 +15368,9 @@ const DateFieldClass = compose(
15340
15368
  hostWidth: { ...host, property: 'width' },
15341
15369
  hostDirection: { ...host, property: 'direction' },
15342
15370
  textAlign: { ...input, property: 'text-align' },
15343
- overlayAnchorPos: [
15344
- { ...overlayAnchor, property: 'right' },
15345
- { ...overlayAnchorRTL, property: 'left' },
15346
- ],
15347
15371
  overlayGap: {
15348
15372
  property: () => DateFieldClass.cssVarList.overlayGap,
15349
15373
  },
15350
-
15351
15374
  overlayBackgroundColor: {
15352
15375
  property: () => DateFieldClass.cssVarList.overlayBackgroundColor,
15353
15376
  },
@@ -15379,7 +15402,6 @@ const DateFieldClass = compose(
15379
15402
  outlineWidth: { ...overlay },
15380
15403
  outlineColor: { ...overlay },
15381
15404
  outlineStyle: { ...overlay },
15382
- direction: { ...overlay },
15383
15405
  },
15384
15406
  }),
15385
15407
  draggableMixin,
@@ -15406,7 +15428,6 @@ const dateField = {
15406
15428
  [vars$4.overlay.outlineWidth]: '0',
15407
15429
  [vars$4.overlay.outlineColor]: 'transparent',
15408
15430
  [vars$4.overlay.outlineStyle]: 'none',
15409
- [vars$4.overlay.direction]: refs.direction,
15410
15431
  [vars$4.overlay.padding]: '0',
15411
15432
  };
15412
15433