@designsystem-se/af 41.0.0 → 41.0.1-beta.1

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.
@@ -5055,7 +5055,7 @@ const FormLabel = class {
5055
5055
  this.afAnnounceIfOptionalText = _t.optional.toLowerCase();
5056
5056
  }
5057
5057
  componentWillLoad() {
5058
- this.setLabelText();
5058
+ this.warnIfMissingLabel();
5059
5059
  this.validateFor();
5060
5060
  this.handleSlotVisibility();
5061
5061
  }
@@ -5064,8 +5064,7 @@ const FormLabel = class {
5064
5064
  logger.warn(`digi-form-label must have a for attribute. Please add a for attribute using af-for`, this.hostElement);
5065
5065
  }
5066
5066
  }
5067
- setLabelText() {
5068
- this.labelText = `${this.afLabel} ${this.requiredText}`;
5067
+ warnIfMissingLabel() {
5069
5068
  if (!this.afLabel) {
5070
5069
  logger.warn(`digi-form-label must have a label. Please add a label using af-label`, this.hostElement);
5071
5070
  }
@@ -5087,7 +5086,7 @@ const FormLabel = class {
5087
5086
  }
5088
5087
  }
5089
5088
  render() {
5090
- return (h("div", { key: '78c3c9cc7609ede22abcd68c16514c85b52c945e', class: "digi-form-label" }, h("div", { key: '5bd7a74e6508c261f489716673f011391bf7c0d8', class: "digi-form-label__label-group" }, this.afFor && this.afLabel && (h("label", { key: '6952422ebe4e447857befae6116fd7336046dc1f', class: "digi-form-label__label", htmlFor: this.afFor, id: this.afId }, h("span", { key: '2da61e9396c9c20b40ee4d80c21ae96e2a491e8f', tabindex: "-1", class: "digi-form-label__label--label" }, this.labelText), this.afDescription && (h("span", { key: '858d2ae39681662c278352e42b7bccb511279bd0', tabindex: "-1", class: "digi-form-label__label--description" }, this.afDescription)))), this.hasActionSlot && (h("div", { key: '7719bef7cfe38637a5ef4b71d5e9a6237ed48ff2', class: "digi-form-label__actions" }, h("slot", { key: '37bd2332a7d4e7fa15c4ff61a0cc26c92bed08d8', name: "actions" }))))));
5089
+ return (h("div", { key: 'd505cd974e5fad197c27502bbd5a69e03b6da4c9', class: "digi-form-label" }, h("div", { key: '438d01b31f6b2814ae6a1ca04c824ea08ea2be23', class: "digi-form-label__label-group" }, this.afFor && this.afLabel && (h("label", { key: 'f339da21e44bd1d80bc2bcd71f2a7b85ded421a3', class: "digi-form-label__label", htmlFor: this.afFor, id: this.afId }, h("span", { key: '49c6e41049caafd257d39c8e4bbd61054e618ac9', tabindex: "-1", class: "digi-form-label__label--label" }, `${this.afLabel} ${this.requiredText}`), this.afDescription && (h("span", { key: '857cf559d405dc425fb16289d216cc5ed500775f', tabindex: "-1", class: "digi-form-label__label--description" }, this.afDescription)))), this.hasActionSlot && (h("div", { key: '11a7132c78dc5467b25c8a09724a1d13f3a324c3', class: "digi-form-label__actions" }, h("slot", { key: 'f499d1b9d31ccc825723a880bea8f110658b462d', name: "actions" }))))));
5091
5090
  }
5092
5091
  get hostElement() { return getElement(this); }
5093
5092
  static get watchers() { return {
@@ -5095,13 +5094,7 @@ const FormLabel = class {
5095
5094
  "validateFor": 0
5096
5095
  }],
5097
5096
  "afLabel": [{
5098
- "setLabelText": 0
5099
- }],
5100
- "afRequired": [{
5101
- "setLabelText": 0
5102
- }],
5103
- "afAnnounceIfOptional": [{
5104
- "setLabelText": 0
5097
+ "warnIfMissingLabel": 0
5105
5098
  }]
5106
5099
  }; }
5107
5100
  };