hayun-vite 0.7.2 → 0.7.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/package.json +1 -1
- package/src/Form/Forms.js +5 -5
- package/src/main.js +1 -1
package/package.json
CHANGED
package/src/Form/Forms.js
CHANGED
@@ -12,13 +12,13 @@ import '../style.css'
|
|
12
12
|
|
13
13
|
// کلاس جدید که فرمهای مختلف را نمایش میدهد
|
14
14
|
export default class Forms {
|
15
|
-
constructor({ assets, container } = {}) {
|
15
|
+
constructor({ assets, container, defaultFormIndex = 1 } = {}) {
|
16
16
|
this.container = container
|
17
|
-
this.addForms({ templates: [rasaAud, rasaTymp, combo] })
|
17
|
+
this.addForms({ templates: [rasaAud, rasaTymp, combo], defaultFormIndex })
|
18
18
|
}
|
19
19
|
|
20
20
|
// افزودن فرم
|
21
|
-
addForms({ templates }) {
|
21
|
+
addForms({ templates, defaultFormIndex }) {
|
22
22
|
const container = this.container
|
23
23
|
// ایجاد یک دیو برای قرار دادن دکمه ها و لینک های فرم
|
24
24
|
const div = document.createElement('div');
|
@@ -42,12 +42,12 @@ export default class Forms {
|
|
42
42
|
});
|
43
43
|
|
44
44
|
const printBtn = this.putButton({ container: div, text: 'چاپ', className });
|
45
|
-
|
45
|
+
|
46
46
|
// تعریف رویداد دکمه چاپ فرم نمایشی
|
47
47
|
printBtn.addEventListener('click', () => { printForm({ container: this.selectedForm.form }) });
|
48
48
|
|
49
49
|
// انتخاب فرم پیشفرض
|
50
|
-
let selectedIndex =
|
50
|
+
let selectedIndex = defaultFormIndex;
|
51
51
|
forms[selectedIndex].form.style.display = 'block';
|
52
52
|
this.selectedForm = this.forms[selectedIndex]
|
53
53
|
btns[selectedIndex].style.backgroundColor = ' #1c15e1'
|
package/src/main.js
CHANGED
@@ -39,7 +39,7 @@ LAudiogram.update({
|
|
39
39
|
})
|
40
40
|
|
41
41
|
*/
|
42
|
-
const forms = new Forms({ container: document.getElementById('forms-div')
|
42
|
+
const forms = new Forms({ container: document.getElementById('forms-div') });
|
43
43
|
forms.update({ officeData, patientData, sessionIndex: 0 })
|
44
44
|
|
45
45
|
|