hayun-vite 0.15.0 → 0.15.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hayun-vite",
3
3
  "private": false,
4
- "version": "0.15.0",
4
+ "version": "0.15.2",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
package/src/Form/Form.js CHANGED
@@ -161,24 +161,22 @@ export default class Form {
161
161
 
162
162
  // let keys = Object.keys(data)
163
163
  // if (keys.includes("header")) {
164
-
165
- console.log(JSON.stringify(this.data.header) !== JSON.stringify(data.header));
166
-
167
- // console.log(this.data.header, data.header);
168
-
169
- JSON.stringify(this.data.header) !== JSON.stringify(data.header) &&
164
+ if (JSON.stringify(this.data.header) !== JSON.stringify(data.header) && data.header) {
170
165
  this.header?.update(data.header)
171
- this.data.header = data.header
166
+ this.data.header = data.header
167
+ }
172
168
  // }
173
169
  // if (keys.includes("patient")) {
174
- JSON.stringify(this.data.patient) !== JSON.stringify(data.patient) &&
170
+ if (JSON.stringify(this.data.patient) !== JSON.stringify(data.patient) && data.patient) {
175
171
  this.patient?.update(data.patient)
176
- this.data.patient = data.patient
172
+ this.data.patient = data.patient
173
+ }
177
174
  // }
178
175
  // if (keys.includes("history")) {
179
- JSON.stringify(this.data.history) !== JSON.stringify(data.history) &&
176
+ if (JSON.stringify(this.data.history) !== JSON.stringify(data.history) && data.history) {
180
177
  this.history?.update(session?.history)
181
- this.data.history = session.history;
178
+ this.data.history = session.history
179
+ }
182
180
  // }
183
181
  // if (keys.includes("audiogram")) {
184
182
  if (JSON.stringify(this.data.audiogram) !== JSON.stringify(data.audiogram)) {
@@ -209,14 +207,16 @@ export default class Form {
209
207
  this.data.reflex = session.reflex;
210
208
  // }
211
209
  // if (keys.includes("report")) {
212
- JSON.stringify(this.data.report) !== JSON.stringify(data.report) &&
210
+ if (JSON.stringify(this.data.report) !== JSON.stringify(data.report) && data.report) {
213
211
  this.report?.update(session.report)
214
- this.data.report = session.report;
212
+ this.data.report = session.report
213
+ }
215
214
  // }
216
215
  // if (keys.includes("footer")) {
217
- JSON.stringify(this.data.footer) !== JSON.stringify(data.footer) &&
216
+ if (JSON.stringify(this.data.footer) !== JSON.stringify(data.footer) && data.footer) {
218
217
  this.footer?.update(data?.footer)
219
- this.data.footer = data.footer;
218
+ this.data.footer = data.footer
219
+ }
220
220
  }
221
221
 
222
222
  // خطوط نقطه چین مارجین فرم
@@ -11,6 +11,8 @@ import templAudiometry from "../../assets/templates/templAudiometry.js"
11
11
  // کلاس جدید که فرم‌های مختلف را نمایش میدهد
12
12
  export default class Forms {
13
13
  constructor({ assets, container, templates, defaultTemplateIndex = 0, mode = 'production' } = {}) {
14
+ console.log('I`M FROM Forms.constructor METHOD !!!!!!!!!!!!!!');
15
+
14
16
  this.container = container
15
17
  this.mode = mode;
16
18
  this.forms = [] // آرایه آبجکت های فرم های مختلف
@@ -108,10 +110,15 @@ export default class Forms {
108
110
 
109
111
  // این تابع یک بار از بیرون کلاس فراخوانی میشه و یک بار وقتی از داخل تمپلت فرم را عوض میکنیم
110
112
  update({ officeData, patientData, sessionIndex = 0 }) {
111
- // ذخیره کل دیتا برای استفاده داخلی آپدیت فرم انتخاب شده
112
- this.dataParams = { officeData, patientData, sessionIndex }
113
- // this.selectedForm.update({ officeData, patientData, sessionIndex })
114
- this.forms[this.selectedIndex].update(this.dataParams)
113
+ console.log('I`M FROM Forms.update METHOD !!!!!!!!!!!!!!');
114
+
115
+ // اگر هر دو دیتا وجود داشت ادامه بده
116
+ if (officeData && patientData) {
117
+ // ذخیره کل دیتا برای استفاده داخلی آپدیت فرم انتخاب شده
118
+ this.dataParams = { officeData, patientData, sessionIndex }
119
+ // this.selectedForm.update({ officeData, patientData, sessionIndex })
120
+ this.forms[this.selectedIndex].update(this.dataParams)
121
+ }
115
122
  }
116
123
 
117
124
  // توابع داخلی ایجاد دکمه و لینک های بالای فرم