@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
package/dist/index.esm.js CHANGED
@@ -3961,8 +3961,8 @@ const {
3961
3961
  weekday: { selector: () => '.weekday' },
3962
3962
  navPrev: { selector: () => '.nav-prev' },
3963
3963
  navNext: { selector: () => '.nav-next' },
3964
- navPrevRTL: { selector: () => ':host(:dir(rtl)) .nav-prev' },
3965
- navNextRTL: { selector: () => ':host(:dir(rtl)) .nav-next' },
3964
+ navPrevRTL: { selector: () => ':host([st-host-direction="rtl"]) .nav-prev' },
3965
+ navNextRTL: { selector: () => ':host([st-host-direction="rtl"]) .nav-next' },
3966
3966
  yearInput: { selector: () => '.year-input' },
3967
3967
  monthInput: { selector: () => '.month-input' },
3968
3968
  };
@@ -4503,7 +4503,7 @@ const componentName$R = getComponentName('date-field');
4503
4503
  const BASE_SELECTOR = 'vaadin-popover';
4504
4504
  const BaseInputClass$8 = createBaseInputClass({ componentName: componentName$R, baseSelector: BASE_SELECTOR });
4505
4505
 
4506
- const dateFieldAttrs = ['format', 'opened', 'initial-value'];
4506
+ const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly'];
4507
4507
  const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
4508
4508
  const observedAttrs = [...dateFieldAttrs, ...calendarAttrs];
4509
4509
 
@@ -4545,19 +4545,16 @@ class RawDateFieldClass extends BaseInputClass$8 {
4545
4545
  display: flex;
4546
4546
  align-self: center;
4547
4547
  z-index: 1;
4548
+ height: 100%;
4549
+ align-items: center;
4548
4550
  }
4549
4551
 
4550
- descope-text-field .overlay-position-anchor {
4551
- position: absolute;
4552
- height: 100%;
4553
- width: 0;
4554
- z-index: 1;
4552
+ :host([readonly="true"]) .toggle-calendar {
4555
4553
  pointer-events: none;
4556
4554
  }
4557
4555
  </style>
4558
4556
  <div>
4559
4557
  <descope-text-field>
4560
- <span slot="prefix" class="overlay-position-anchor"></span>
4561
4558
  <span slot="suffix" class="toggle-calendar">
4562
4559
  <descope-icon>${calendarIcon}</descope-icon>
4563
4560
  </span>
@@ -4568,7 +4565,6 @@ class RawDateFieldClass extends BaseInputClass$8 {
4568
4565
 
4569
4566
  this.inputElement = this.shadowRoot.querySelector('descope-text-field');
4570
4567
  this.popoverToggleButton = this.inputElement.querySelector('.toggle-calendar');
4571
- this.overlayPositionAnchor = this.inputElement.querySelector('.overlay-position-anchor');
4572
4568
 
4573
4569
  this.oninvalid = () => {
4574
4570
  this.inputElement.setAttribute('invalid', 'true');
@@ -4617,6 +4613,17 @@ class RawDateFieldClass extends BaseInputClass$8 {
4617
4613
  return this.overlay?.querySelector('descope-calendar');
4618
4614
  }
4619
4615
 
4616
+ get isRTL() {
4617
+ const computedStyleDirection = getComputedStyle(this.baseElement).getPropertyValue('direction');
4618
+
4619
+ if (computedStyleDirection) {
4620
+ return computedStyleDirection === 'rtl';
4621
+ }
4622
+
4623
+ // Fallback: If for some reason computed style was not calculated in time, fallback to check on attribute
4624
+ return this.getAttribute('st-host-direction') === 'rtl';
4625
+ }
4626
+
4620
4627
  get value() {
4621
4628
  return this.timestamp;
4622
4629
  }
@@ -4697,10 +4704,8 @@ class RawDateFieldClass extends BaseInputClass$8 {
4697
4704
  }
4698
4705
 
4699
4706
  initPopover() {
4700
- this.baseElement.target = this.overlayPositionAnchor;
4701
4707
  this.baseElement.trigger = ['click'];
4702
4708
  this.baseElement.withBackdrop = true;
4703
- this.baseElement.noCloseOnOutsideClick = true;
4704
4709
  this.baseElement.renderer = this.#popoverRenderer.bind(this);
4705
4710
 
4706
4711
  // block popover events from focusing/blurring the text-field
@@ -4710,32 +4715,64 @@ class RawDateFieldClass extends BaseInputClass$8 {
4710
4715
  });
4711
4716
  }
4712
4717
 
4718
+ #popoverPosStylesheet;
4719
+
4713
4720
  #popoverRenderer(root) {
4714
4721
  // popoverRenderer should run only once, when the popover is first rendering.
4715
4722
  if (!root.firstChild) {
4723
+ this.overlay.positionTarget = this.shadowRoot.querySelector('.toggle-calendar');
4724
+
4716
4725
  root.appendChild(this.#getPopoverContent());
4726
+
4717
4727
  // override vaadin's constructed stylesheet which hides the host element
4718
4728
  overrideConstructedStylesheet(this.baseElement);
4719
4729
 
4720
- // To prevent position flickering of the dialog we set opacity to 0
4721
- root.style.setProperty('opacity', '0');
4730
+ this.backdrop.addEventListener('click', this.closePopover.bind(this));
4731
+ }
4722
4732
 
4723
- setTimeout(() => {
4724
- // on first render we adjust the a anchor element in the input
4725
- // so vaadin computes the popover position according to the anchor position
4726
- // (otherwise it will simply center the popover below the input).
4727
- this.#adjustOverlayPosition();
4733
+ // Hide overlay before adjusting position to prevent flickering
4734
+ root.style.setProperty('visibility', 'hidden');
4728
4735
 
4729
- // remove opacity to show overlay
4730
- root.style.setProperty('opacity', '1');
4736
+ // Wait until overlay is ready
4737
+ setTimeout(() => {
4738
+ this.#adjustPopoverPosition(root);
4731
4739
 
4732
- // on outside click - close popover. this event runs once on popover first render
4733
- // and does not need to be cleared
4734
- this.backdrop.addEventListener('click', this.closePopover.bind(this));
4735
- });
4740
+ // Show adjusted overlay
4741
+ root.style.setProperty('visibility', 'visible');
4742
+ this.updateCalendarView(root);
4743
+ }, 100);
4744
+ }
4745
+
4746
+ #adjustPopoverPosition() {
4747
+ const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;
4748
+
4749
+ // Remove previously added stylesheets
4750
+ this.#popoverPosStylesheet?.remove();
4751
+
4752
+ const windowRect = document.body.getBoundingClientRect();
4753
+ const inputRect = this.getBoundingClientRect();
4754
+ const calendarRect = this.calendar.getBoundingClientRect();
4755
+
4756
+ const side = this.isRTL ? 'right' : 'left';
4757
+ const offset = inputRect[side] - calendarRect[side];
4758
+ const availableLeft = calendarRect.left;
4759
+ const availableRight = windowRect.width - calendarRect.right;
4760
+
4761
+ let newOffset;
4762
+ if (offset > 0) {
4763
+ newOffset = Math.min(offset, availableRight);
4764
+ } else {
4765
+ newOffset = Math.min(Math.abs(offset), availableLeft) * -1;
4736
4766
  }
4737
4767
 
4738
- this.updateCalendarView();
4768
+ this.#popoverPosStylesheet = document.createElement('style');
4769
+ this.#popoverPosStylesheet.innerHTML = `
4770
+ vaadin-popover-overlay::part(overlay) {
4771
+ transform: translateX(${newOffset}px);
4772
+ }
4773
+ `;
4774
+
4775
+ popover.appendChild(this.#popoverPosStylesheet);
4739
4776
  }
4740
4777
 
4741
4778
  #getPopoverContent() {
@@ -4751,17 +4788,6 @@ class RawDateFieldClass extends BaseInputClass$8 {
4751
4788
  return ele;
4752
4789
  }
4753
4790
 
4754
- #adjustOverlayPosition() {
4755
- const { width: inputEleWidth } = this.inputElement.getClientRects()[0];
4756
- const { width: calendarEleWidth } = this.calendar.getClientRects()[0];
4757
- const pos = inputEleWidth - calendarEleWidth / 2;
4758
- /* eslint-disable no-use-before-define */
4759
- this.overlayPositionAnchor.style.setProperty(
4760
- DateFieldClass.cssVarList.overlayAnchorPos,
4761
- `${pos}px`
4762
- );
4763
- }
4764
-
4765
4791
  // the default vaadin behavior is to attach the overlay to the body when opened
4766
4792
  // we do not want that because it's difficult to style the overlay in this way
4767
4793
  // so we override it to open inside the shadow DOM
@@ -4845,6 +4871,10 @@ class RawDateFieldClass extends BaseInputClass$8 {
4845
4871
  }
4846
4872
 
4847
4873
  onFocus() {
4874
+ if (this.isReadOnly) {
4875
+ return;
4876
+ }
4877
+
4848
4878
  if (!this.inputElement.value) {
4849
4879
  this.inputElement.value = this.format;
4850
4880
  this.setInputSelectionRange();
@@ -5082,12 +5112,10 @@ class RawDateFieldClass extends BaseInputClass$8 {
5082
5112
  }
5083
5113
  }
5084
5114
 
5085
- const { host: host$i, input, toggleButton, overlayAnchor, overlayAnchorRTL, overlay, backdrop } = {
5115
+ const { host: host$i, input, toggleButton, overlay, backdrop } = {
5086
5116
  host: { selector: () => ':host' },
5087
5117
  input: { selector: () => 'descope-text-field' },
5088
5118
  toggleButton: { selector: () => '.toggle-calendar' },
5089
- overlayAnchor: { selector: () => ':host .overlay-position-anchor' },
5090
- overlayAnchorRTL: { selector: ':host([st-host-direction="rtl"]) .overlay-position-anchor' },
5091
5119
  overlay: { selector: 'vaadin-popover-overlay::part(overlay)' },
5092
5120
  backdrop: { selector: 'vaadin-popover-overlay::part(backdrop)' },
5093
5121
  };
@@ -5100,14 +5128,9 @@ const DateFieldClass = compose(
5100
5128
  hostWidth: { ...host$i, property: 'width' },
5101
5129
  hostDirection: { ...host$i, property: 'direction' },
5102
5130
  textAlign: { ...input, property: 'text-align' },
5103
- overlayAnchorPos: [
5104
- { ...overlayAnchor, property: 'right' },
5105
- { ...overlayAnchorRTL, property: 'left' },
5106
- ],
5107
5131
  overlayGap: {
5108
5132
  property: () => DateFieldClass.cssVarList.overlayGap,
5109
5133
  },
5110
-
5111
5134
  overlayBackgroundColor: {
5112
5135
  property: () => DateFieldClass.cssVarList.overlayBackgroundColor,
5113
5136
  },
@@ -5139,7 +5162,6 @@ const DateFieldClass = compose(
5139
5162
  outlineWidth: { ...overlay },
5140
5163
  outlineColor: { ...overlay },
5141
5164
  outlineStyle: { ...overlay },
5142
- direction: { ...overlay },
5143
5165
  },
5144
5166
  }),
5145
5167
  draggableMixin,
@@ -17141,7 +17163,6 @@ const dateField = {
17141
17163
  [vars$4.overlay.outlineWidth]: '0',
17142
17164
  [vars$4.overlay.outlineColor]: 'transparent',
17143
17165
  [vars$4.overlay.outlineStyle]: 'none',
17144
- [vars$4.overlay.direction]: refs.direction,
17145
17166
  [vars$4.overlay.padding]: '0',
17146
17167
  };
17147
17168