@claudebernard/patient-profile-element 0.8.0 → 0.8.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.
@@ -15,6 +15,10 @@ declare interface MissingPreferences {
15
15
  }
16
16
 
17
17
  declare interface OverviewPreferences {
18
+ editButton?: {
19
+ /** @default true */
20
+ display?: boolean;
21
+ };
18
22
  warning?: {
19
23
  missingWeight?: MissingPreferences;
20
24
  missingHeight?: MissingPreferences;
@@ -24,7 +28,6 @@ declare interface OverviewPreferences {
24
28
 
25
29
  export declare class PatientProfile extends LitElement {
26
30
  patientProfile?: Bundle;
27
- editButtonVisible: boolean | undefined;
28
31
  apiUrl: string;
29
32
  apiKey: string | undefined;
30
33
  context?: WebComponentContext;
@@ -62,7 +65,6 @@ export declare interface PatientProfilePreferences {
62
65
 
63
66
  export declare interface PatientProfileProps {
64
67
  patientProfile?: Bundle;
65
- editButtonVisible?: boolean;
66
68
  apiUrl: string;
67
69
  apiKey?: string;
68
70
  preferences?: PatientProfilePreferences;
@@ -111,21 +113,21 @@ declare global {
111
113
 
112
114
  declare global {
113
115
  interface HTMLElementTagNameMap {
114
- "bcb-patient-reproductive-form": PatientReproductiveForm;
116
+ "bcb-patient-pathologies-form": PatientPathologiesForm;
115
117
  }
116
118
  }
117
119
 
118
120
 
119
121
  declare global {
120
122
  interface HTMLElementTagNameMap {
121
- "bcb-patient-demographics-form": PatientDemographicsForm;
123
+ "bcb-patient-allergies-form": PatientAllergiesForm;
122
124
  }
123
125
  }
124
126
 
125
127
 
126
128
  declare global {
127
129
  interface HTMLElementTagNameMap {
128
- "bcb-patient-pathologies-form": PatientPathologiesForm;
130
+ "bcb-patient-demographics-form": PatientDemographicsForm;
129
131
  }
130
132
  }
131
133
 
@@ -146,7 +148,7 @@ declare global {
146
148
 
147
149
  declare global {
148
150
  interface HTMLElementTagNameMap {
149
- "bcb-patient-allergies-form": PatientAllergiesForm;
151
+ "bcb-patient-reproductive-form": PatientReproductiveForm;
150
152
  }
151
153
  }
152
154
 
@@ -4085,7 +4085,6 @@ var __decorateClass = (decorators, target, key, kind) => {
4085
4085
  let PatientProfile = class extends i$2 {
4086
4086
  constructor() {
4087
4087
  super(...arguments);
4088
- this.editButtonVisible = true;
4089
4088
  this.apiUrl = "https://api-dev.claudebernard.fr";
4090
4089
  this.preferences = {
4091
4090
  forms: {
@@ -4093,6 +4092,9 @@ let PatientProfile = class extends i$2 {
4093
4092
  sexe: { display: true, readOnly: false }
4094
4093
  },
4095
4094
  overview: {
4095
+ editButton: {
4096
+ display: true
4097
+ },
4096
4098
  warning: {
4097
4099
  missingWeight: { display: false },
4098
4100
  missingHeight: { display: false },
@@ -4294,7 +4296,7 @@ let PatientProfile = class extends i$2 {
4294
4296
  <div class="${PREFIX}-patient-profile__no-profile__first">Aucun profil patient renseigné</div>
4295
4297
  <div class="${PREFIX}-patient-profile__no-profile__second">Veuillez remplir le formulaire</div>
4296
4298
  </div>
4297
- ${this.editButtonVisible || this.editButtonVisible === void 0 ? b`<bcbd-button icon="pencil" size="medium" background-color="primary" outlined aria-label="Modifier le profil patient" data-test-id="modify-button" @click=${this.openEditionModal}></bcbd-button>` : A}
4299
+ ${this.preferences?.overview?.editButton?.display !== false ? b`<bcbd-button icon="pencil" size="medium" background-color="primary" outlined aria-label="Modifier le profil patient" data-test-id="modify-button" @click=${this.openEditionModal}></bcbd-button>` : A}
4298
4300
  ` : b`
4299
4301
  <div class="${PREFIX}-patient-profile__id-info-container">
4300
4302
  <div class="${PREFIX}-patient-profile__name-info" data-test-id="patient-name" title=${o(getPatientName(this.patientProfile))}>
@@ -4349,7 +4351,7 @@ let PatientProfile = class extends i$2 {
4349
4351
  </div>
4350
4352
 
4351
4353
  <div class="${PREFIX}-patient-profile__action-buttons-container" data-test-id="action-buttons">
4352
- ${this.editButtonVisible || this.editButtonVisible === void 0 ? b`
4354
+ ${this.preferences?.overview?.editButton?.display !== false ? b`
4353
4355
  <bcbd-tooltip content="Editer le profil patient" placement="top">
4354
4356
  <bcbd-button icon="pencil" size="medium" background-color="primary" outlined aria-label="Editer le profil patient" data-test-id="modify-button" @click=${this.openEditionModal}></bcbd-button>
4355
4357
  </bcbd-tooltip>
@@ -4398,9 +4400,6 @@ PatientProfile.styles = i$5`${r$4(patientProfileCSS)}`;
4398
4400
  __decorateClass([
4399
4401
  n2({ type: Object, attribute: "patient-profile" })
4400
4402
  ], PatientProfile.prototype, "patientProfile", 2);
4401
- __decorateClass([
4402
- n2({ type: Boolean, attribute: "edit-button-visible" })
4403
- ], PatientProfile.prototype, "editButtonVisible", 2);
4404
4403
  __decorateClass([
4405
4404
  n2({ type: String, attribute: "api-url" })
4406
4405
  ], PatientProfile.prototype, "apiUrl", 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudebernard/patient-profile-element",
3
- "version": "0.8.0",
3
+ "version": "0.8.1-beta.1",
4
4
  "main": "dist/patient-profile.es.js",
5
5
  "module": "dist/patient-profile.es.js",
6
6
  "types": "dist/patient-profile.d.ts",
@@ -87,7 +87,7 @@
87
87
  "vitest": "^4.0.7"
88
88
  },
89
89
  "peerDependencies": {
90
- "@claudebernard/design-system": "^2.37.2",
90
+ "@claudebernard/design-system": "^2.39.3",
91
91
  "@claudebernard/types": "^0.35.0 || ^0.36.0"
92
92
  },
93
93
  "customElements": "dist/custom-elements.json",