@descope/web-components-ui 3.3.2 → 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);