@descope/web-components-ui 3.3.1 → 3.3.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
@@ -4817,7 +4817,16 @@ const TextClass = compose$1(
4817
4817
 
4818
4818
  const componentName$1l = getComponentName$1('link');
4819
4819
 
4820
- class RawLink extends createBaseClass$1({ componentName: componentName$1l, baseSelector: ':host a' }) {
4820
+ const observedAttrs$7 = ['href', 'readonly'];
4821
+
4822
+ class RawLink extends createBaseClass$1({
4823
+ componentName: componentName$1l,
4824
+ baseSelector: ':host a',
4825
+ }) {
4826
+ static get observedAttributes() {
4827
+ return observedAttrs$7.concat(super.observedAttributes || []);
4828
+ }
4829
+
4821
4830
  constructor() {
4822
4831
  super();
4823
4832
 
@@ -4850,10 +4859,12 @@ class RawLink extends createBaseClass$1({ componentName: componentName$1l, baseS
4850
4859
  white-space: nowrap;
4851
4860
  }
4852
4861
  `,
4853
- this
4862
+ this,
4854
4863
  );
4855
4864
 
4856
- forwardAttrs$1(this, this.shadowRoot.querySelector('a'), {
4865
+ this.anchor = this.shadowRoot.querySelector('a');
4866
+
4867
+ forwardAttrs$1(this, this.anchor, {
4857
4868
  includeAttrs: ['href', 'target', 'tooltip'],
4858
4869
  mapAttrs: {
4859
4870
  tooltip: 'title',
@@ -4863,6 +4874,16 @@ class RawLink extends createBaseClass$1({ componentName: componentName$1l, baseS
4863
4874
  forwardAttrs$1(this, this.shadowRoot.querySelector('descope-text'), {
4864
4875
  includeAttrs: ['mode', 'variant'],
4865
4876
  });
4877
+
4878
+ this.anchor.addEventListener('click', (e) => {
4879
+ if (this.readOnly) {
4880
+ e.preventDefault();
4881
+ }
4882
+ });
4883
+ }
4884
+
4885
+ get readOnly() {
4886
+ return this.getAttribute('readonly') === 'true';
4866
4887
  }
4867
4888
  }
4868
4889
 
@@ -4882,7 +4903,11 @@ const LinkClass = compose$1(
4882
4903
  hostWidth: { ...host$v, property: 'width' },
4883
4904
  hostDirection: { ...text$4, property: 'direction' },
4884
4905
  textAlign: wrapper$1,
4885
- textDecoration: { ...link$3, property: 'text-decoration', fallback: 'none' },
4906
+ textDecoration: {
4907
+ ...link$3,
4908
+ property: 'text-decoration',
4909
+ fallback: 'none',
4910
+ },
4886
4911
  textColor: [
4887
4912
  { ...anchor, property: 'color' },
4888
4913
  { ...text$4, property: TextClass.cssVarList.textColor },
@@ -4891,7 +4916,7 @@ const LinkClass = compose$1(
4891
4916
  },
4892
4917
  }),
4893
4918
  draggableMixin$1,
4894
- componentNameValidationMixin$1
4919
+ componentNameValidationMixin$1,
4895
4920
  )(RawLink);
4896
4921
 
4897
4922
  customElements.define(componentName$1m, TextClass);
@@ -8054,8 +8079,10 @@ class RawDateFieldClass extends BaseInputClass$c {
8054
8079
  #adjustPopoverPosition() {
8055
8080
  const popover = this.shadowRoot.querySelector('vaadin-popover').shadowRoot;
8056
8081
 
8057
- // Remove previously added stylesheets
8058
- this.#popoverPosStylesheet?.remove();
8082
+ // Reset any previous transform so getBoundingClientRect measures the natural position
8083
+ this.#popoverPosStylesheet?.replaceSync(
8084
+ `vaadin-popover-overlay::part(overlay) { transform: none; }`
8085
+ );
8059
8086
 
8060
8087
  const windowRect = document.body.getBoundingClientRect();
8061
8088
  const inputRect = this.getBoundingClientRect();
@@ -8073,14 +8100,17 @@ class RawDateFieldClass extends BaseInputClass$c {
8073
8100
  newOffset = Math.min(Math.abs(offset), availableLeft) * -1;
8074
8101
  }
8075
8102
 
8076
- injectStyle(
8077
- `
8103
+ const css = `
8078
8104
  vaadin-popover-overlay::part(overlay) {
8079
8105
  transform: translateX(${newOffset}px);
8080
8106
  }
8081
- `,
8082
- popover
8083
- );
8107
+ `;
8108
+
8109
+ if (this.#popoverPosStylesheet) {
8110
+ this.#popoverPosStylesheet.replaceSync(css);
8111
+ } else {
8112
+ this.#popoverPosStylesheet = injectStyle(css, popover);
8113
+ }
8084
8114
  }
8085
8115
 
8086
8116
  #getPopoverContent() {