@claudebernard/therapeutic-alternative-element 1.0.1 → 1.0.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.
@@ -520,6 +520,7 @@ export declare class TherapeuticAlternative extends LitElement {
520
520
  currentPage: number;
521
521
  productsList: ProductBean[];
522
522
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
523
+ private decodeHtml;
523
524
  private selectIndication;
524
525
  private getIndicationsListForMedication;
525
526
  private searchTherapeuticAlternative;
@@ -972,6 +972,14 @@ let TherapeuticAlternative = class extends i$1 {
972
972
  this.getIndicationsListForMedication();
973
973
  }
974
974
  }
975
+ decodeHtml(html2) {
976
+ if (!html2) {
977
+ return "";
978
+ }
979
+ const textarea = document.createElement("textarea");
980
+ textarea.innerHTML = html2;
981
+ return textarea.value;
982
+ }
975
983
  selectIndication(event) {
976
984
  this.indicationSelected = this.indicationsList.find((option) => option.code === event.detail);
977
985
  this.currentPage = 1;
@@ -1082,10 +1090,10 @@ let TherapeuticAlternative = class extends i$1 {
1082
1090
  this.hasTitle ? "" : `${PREFIX}-therapeutic-alternative__choice-fieldset-without-title`
1083
1091
  ].join(" ");
1084
1092
  let medicationTitle = "";
1085
- if (this.medication?.medication.code?.text) {
1086
- medicationTitle = this.medication?.medication.code.text;
1093
+ if (this.medication?.medication?.code?.text) {
1094
+ medicationTitle = this.medication?.medication?.code?.text;
1087
1095
  } else {
1088
- medicationTitle = this.medication?.medication.code?.coding?.find(
1096
+ medicationTitle = this.medication?.medication?.code?.coding?.find(
1089
1097
  (coding) => coding.system === "https://platform.claudebernard.fr/fhir/CodeSystem/bcb-code"
1090
1098
  )?.display || "";
1091
1099
  }
@@ -1097,7 +1105,7 @@ let TherapeuticAlternative = class extends i$1 {
1097
1105
  <fieldset class=${fieldsetClasses} data-test-id="choice-fieldset">
1098
1106
  <legend class="${PREFIX}-therapeutic-alternative__choice-legend" data-test-id="choice-legend">
1099
1107
  Produit sélectionné:
1100
- <span class="text-primary">${medicationTitle !== "" ? medicationTitle : "Inconnu"} </span>
1108
+ <span class="text-primary">${medicationTitle !== "" ? this.decodeHtml(medicationTitle) : "Inconnu"} </span>
1101
1109
  </legend>
1102
1110
  <span class="text-primary mb-3 fs-2" data-test-id="choice-text">
1103
1111
  POUR QUELLE INDICATION CHERCHEZ-VOUS UNE ALTERNATIVE THÉRAPEUTIQUE ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/therapeutic-alternative-element",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/therapeutic-alternative.es.js",
5
5
  "module": "dist/therapeutic-alternative.es.js",
6
6
  "types": "dist/therapeutic-alternative.d.ts",