hayun-vite 0.0.3 → 0.1.0

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.
Files changed (42) hide show
  1. package/assets/styles-test.css +90 -90
  2. package/assets/styles.css +90 -90
  3. package/data/formData1.js +42 -42
  4. package/data/officesObjStore.js +56 -56
  5. package/data/patientsObjStore.js +73 -73
  6. package/data/sampleData.js +94 -94
  7. package/index.js +11 -11
  8. package/package.json +1 -1
  9. package/src/Audiogram/Audiogram.js +194 -197
  10. package/src/Audiogram/dims.js +83 -83
  11. package/src/Form/Form.js +268 -276
  12. package/src/Form/Form_N.js +158 -158
  13. package/src/Form/Forms-Test.html +124 -124
  14. package/src/Form/Forms.js +121 -134
  15. package/src/Form/Header.js +91 -91
  16. package/src/Form/Reflex.js +141 -141
  17. package/src/Form/Sections.js +71 -71
  18. package/src/Form/Speech.js +132 -132
  19. package/src/Form/TextBox.js +66 -82
  20. package/src/Form/Tympanogram.js +355 -355
  21. package/src/Form/formStyles.css +122 -122
  22. package/src/Form/globalinfo.js +68 -68
  23. package/src/Form/grid/drawGrid.js +84 -84
  24. package/src/Form/grid/hideGrid.js +8 -8
  25. package/src/Form/printForm.js +122 -75
  26. package/src/Form/templates/combo.js +248 -248
  27. package/src/Form/templates/dims.js +204 -204
  28. package/src/Form/templates/rasaAud.js +287 -287
  29. package/src/Symbol/Symbols.js +29 -29
  30. package/src/Symbol/createSymbolSVG.js +240 -240
  31. package/src/Symbol/getAllSymbolsSVG.js +21 -21
  32. package/src/Symbol/insertSymbol.js +10 -10
  33. package/src/Symbol/symbolChart.js +47 -47
  34. package/src/common/putLine.js +16 -16
  35. package/src/common/putPoint.js +12 -12
  36. package/src/common/putRect.js +13 -13
  37. package/src/common/putText.js +17 -16
  38. package/src/common/putTopLayer.js +17 -17
  39. package/src/main.js +88 -87
  40. package/src/note.css +62 -0
  41. package/src/style.css +189 -156
  42. package/src/note.html +0 -1
@@ -1,159 +1,159 @@
1
- const svgNS = "http://www.w3.org/2000/svg";
2
-
3
- import printForm from "./printForm.js";
4
- import Template from "./Templates/Template.js";
5
- import Template1 from "./Templates/Template1.js";
6
- import Template2 from "./Templates/Template2.js";
7
- import Template3 from "./Templates/Template3.js";
8
-
9
-
10
- export default class Form {
11
- constructor({ name, container } = {}) {
12
- // ایجاد یک دیو برای قرار دادن دکمه ها و لینک های فرم
13
- const div = document.createElement('div');
14
- div.style = 'border: 1px solid brown; margin: 0; padding: 0;'
15
- container.appendChild(div);
16
- // اضافه کردن دکمه به دیو فرم
17
- const btn1 = this.putButton({ container: div, text: 'Form 1', id: 'template1' });
18
- const btn2 = this.putButton({ container: div, text: 'Form 2', id: 'template2' });
19
- const btn3 = this.putButton({ container: div, text: 'Form 3', id: 'template3' });
20
- const printBtn = this.putButton({ container: div, text: 'Print', id: 'print' });
21
-
22
- // this.container = div;
23
-
24
- // یک دیو تعریف میکنیم که سمت ادیولاگ برای تعریف لیستنر استفاده می‌شود
25
- this.div = document.createElement('div'); // این بخش فقط شامل بخش اس‌وی‌جی هست
26
- container.appendChild(this.div)
27
-
28
- this.template1 = new Template({ container: this.div });
29
- this.template2 = new Template2({ container: this.div });
30
- this.template3 = new Template3({ container: this.div });
31
-
32
- // تعریف رویداد دکمه چاپ فرم نمایشی
33
- printBtn.addEventListener('click', () => { printForm({ container: this.activeForm }) })
34
-
35
- // ایجاد المنت چک باکس با برچسب
36
- // const checkBox = document.createElement('input');
37
- // checkBox.setAttribute('type', 'checkbox');
38
- // checkBox.setAttribute('id', 'chkb');
39
- // const label = document.createElement('label');
40
- // label.innerHTML = 'Select for Print';
41
- // label.setAttribute('for', checkBox.getAttribute('id'))
42
- // div.appendChild(checkBox)
43
- // div.appendChild(label)
44
-
45
- this.draw2();
46
- // نمایش پیش‌فرض فرم شماره یک
47
- this.template1.form.style.display = 'block';
48
- this.activeForm = this.template1.form;
49
-
50
- btn1.addEventListener('click', () => {
51
- this.template2.form.style.display = 'none'
52
- this.template3.form.style.display = 'none'
53
- this.template1.form.style.display = 'block';
54
- this.activeForm = this.template1.form;
55
- console.log(this.activeForm);
56
-
57
- });
58
-
59
- btn2.addEventListener('click', () => {
60
- this.template1.form.style.display = 'none'
61
- this.template3.form.style.display = 'none'
62
- this.template2.form.style.display = 'block';
63
- this.activeForm = this.template2.form;
64
-
65
- });
66
-
67
- btn3.addEventListener('click', () => {
68
- this.template1.form.style.display = 'none'
69
- this.template2.form.style.display = 'none'
70
- this.template3.form.style.display = 'block';
71
- this.activeForm = this.template3.form;
72
-
73
- });
74
- // for Develop
75
- this.event();
76
-
77
- }
78
-
79
- draw2() {
80
- this.template1.draw();
81
- this.template2.draw();
82
- this.template3.draw();
83
-
84
- }
85
-
86
- draw() { }
87
-
88
- event() {
89
- this.div.addEventListener('click', (e) => {
90
- console.log(e.target);
91
- })
92
- }
93
-
94
- update({ template, data, officeData, patientData, sessionIndex = 0 }) {
95
-
96
- this.template1.update({ data, officeData, patientData, sessionIndex })
97
- this.template2.update({ data, officeData, patientData, sessionIndex })
98
- this.template3.update({ data, officeData, patientData, sessionIndex })
99
-
100
- }
101
-
102
- // ایجاد دکمه تاگل خطوط مرزی فرم و سکشن و المان
103
- toggleBorders({ activeForm, container = 'form' }) {
104
-
105
- const borders = activeForm.querySelectorAll(`[data-name="${container}-border"]`);
106
- // آبجکت نگهداری رنگ بوردرها
107
- const color = { form: 'black', section: 'blue', element: 'green' }
108
- borders.forEach(border => {
109
- // console.log(border.style.stroke);
110
- border.style.stroke = (border.style.stroke === 'transparent') ? color[container] : 'transparent';
111
- })
112
- }
113
-
114
- // توابع داخلی ایجاد دکمه و لینک های بالای فرم
115
- putButton({ container, id, text, }) {
116
- let style = `
117
- background-color:rgb(0, 149, 149);
118
- /* Green background */
119
- border: none;
120
- /* Remove borders */
121
- color: white;
122
- /* White text */
123
- padding: 15px 32px;
124
- /* Some padding */
125
- text-align: center;
126
- /* Centered text */
127
- text-decoration: none;
128
- /* Remove underline */
129
- display: inline-block;
130
- /* Make the button inline */
131
- font-size: 16px;
132
- /* Increase font size */
133
- margin: 4px 2px;
134
- /* Add some margin */
135
- cursor: pointer;
136
- /* Pointer cursor on hover */
137
- border-radius: 8px;
138
- /* Rounded corners */
139
- transition: background-color 0.3s;
140
- /* Smooth transition */
141
- `;
142
- const button = document.createElement('button');
143
- button.setAttribute('id', id);
144
- button.setAttribute('style', style);
145
- button.innerHTML = text;
146
-
147
- button.addEventListener('mouseenter', () => {
148
- button.style.backgroundColor = 'rgb(54, 115, 115)'; // Change color on hover
149
- });
150
- button.addEventListener('mouseleave', () => {
151
- button.style.backgroundColor = 'rgb(0, 149, 149)'; // Revert color when not hovering
152
- });
153
-
154
- container.appendChild(button);
155
- return button;
156
-
157
- }
158
-
1
+ const svgNS = "http://www.w3.org/2000/svg";
2
+
3
+ import printForm from "./printForm.js";
4
+ import Template from "./Templates/Template.js";
5
+ import Template1 from "./Templates/Template1.js";
6
+ import Template2 from "./Templates/Template2.js";
7
+ import Template3 from "./Templates/Template3.js";
8
+
9
+
10
+ export default class Form {
11
+ constructor({ name, container } = {}) {
12
+ // ایجاد یک دیو برای قرار دادن دکمه ها و لینک های فرم
13
+ const div = document.createElement('div');
14
+ div.style = 'border: 1px solid brown; margin: 0; padding: 0;'
15
+ container.appendChild(div);
16
+ // اضافه کردن دکمه به دیو فرم
17
+ const btn1 = this.putButton({ container: div, text: 'Form 1', id: 'template1' });
18
+ const btn2 = this.putButton({ container: div, text: 'Form 2', id: 'template2' });
19
+ const btn3 = this.putButton({ container: div, text: 'Form 3', id: 'template3' });
20
+ const printBtn = this.putButton({ container: div, text: 'Print', id: 'print' });
21
+
22
+ // this.container = div;
23
+
24
+ // یک دیو تعریف میکنیم که سمت ادیولاگ برای تعریف لیستنر استفاده می‌شود
25
+ this.div = document.createElement('div'); // این بخش فقط شامل بخش اس‌وی‌جی هست
26
+ container.appendChild(this.div)
27
+
28
+ this.template1 = new Template({ container: this.div });
29
+ this.template2 = new Template2({ container: this.div });
30
+ this.template3 = new Template3({ container: this.div });
31
+
32
+ // تعریف رویداد دکمه چاپ فرم نمایشی
33
+ printBtn.addEventListener('click', () => { printForm({ container: this.activeForm }) })
34
+
35
+ // ایجاد المنت چک باکس با برچسب
36
+ // const checkBox = document.createElement('input');
37
+ // checkBox.setAttribute('type', 'checkbox');
38
+ // checkBox.setAttribute('id', 'chkb');
39
+ // const label = document.createElement('label');
40
+ // label.innerHTML = 'Select for Print';
41
+ // label.setAttribute('for', checkBox.getAttribute('id'))
42
+ // div.appendChild(checkBox)
43
+ // div.appendChild(label)
44
+
45
+ this.draw2();
46
+ // نمایش پیش‌فرض فرم شماره یک
47
+ this.template1.form.style.display = 'block';
48
+ this.activeForm = this.template1.form;
49
+
50
+ btn1.addEventListener('click', () => {
51
+ this.template2.form.style.display = 'none'
52
+ this.template3.form.style.display = 'none'
53
+ this.template1.form.style.display = 'block';
54
+ this.activeForm = this.template1.form;
55
+ console.log(this.activeForm);
56
+
57
+ });
58
+
59
+ btn2.addEventListener('click', () => {
60
+ this.template1.form.style.display = 'none'
61
+ this.template3.form.style.display = 'none'
62
+ this.template2.form.style.display = 'block';
63
+ this.activeForm = this.template2.form;
64
+
65
+ });
66
+
67
+ btn3.addEventListener('click', () => {
68
+ this.template1.form.style.display = 'none'
69
+ this.template2.form.style.display = 'none'
70
+ this.template3.form.style.display = 'block';
71
+ this.activeForm = this.template3.form;
72
+
73
+ });
74
+ // for Develop
75
+ this.event();
76
+
77
+ }
78
+
79
+ draw2() {
80
+ this.template1.draw();
81
+ this.template2.draw();
82
+ this.template3.draw();
83
+
84
+ }
85
+
86
+ draw() { }
87
+
88
+ event() {
89
+ this.div.addEventListener('click', (e) => {
90
+ console.log(e.target);
91
+ })
92
+ }
93
+
94
+ update({ template, data, officeData, patientData, sessionIndex = 0 }) {
95
+
96
+ this.template1.update({ data, officeData, patientData, sessionIndex })
97
+ this.template2.update({ data, officeData, patientData, sessionIndex })
98
+ this.template3.update({ data, officeData, patientData, sessionIndex })
99
+
100
+ }
101
+
102
+ // ایجاد دکمه تاگل خطوط مرزی فرم و سکشن و المان
103
+ toggleBorders({ activeForm, container = 'form' }) {
104
+
105
+ const borders = activeForm.querySelectorAll(`[data-name="${container}-border"]`);
106
+ // آبجکت نگهداری رنگ بوردرها
107
+ const color = { form: 'black', section: 'blue', element: 'green' }
108
+ borders.forEach(border => {
109
+ // console.log(border.style.stroke);
110
+ border.style.stroke = (border.style.stroke === 'transparent') ? color[container] : 'transparent';
111
+ })
112
+ }
113
+
114
+ // توابع داخلی ایجاد دکمه و لینک های بالای فرم
115
+ putButton({ container, id, text, }) {
116
+ let style = `
117
+ background-color:rgb(0, 149, 149);
118
+ /* Green background */
119
+ border: none;
120
+ /* Remove borders */
121
+ color: white;
122
+ /* White text */
123
+ padding: 15px 32px;
124
+ /* Some padding */
125
+ text-align: center;
126
+ /* Centered text */
127
+ text-decoration: none;
128
+ /* Remove underline */
129
+ display: inline-block;
130
+ /* Make the button inline */
131
+ font-size: 16px;
132
+ /* Increase font size */
133
+ margin: 4px 2px;
134
+ /* Add some margin */
135
+ cursor: pointer;
136
+ /* Pointer cursor on hover */
137
+ border-radius: 8px;
138
+ /* Rounded corners */
139
+ transition: background-color 0.3s;
140
+ /* Smooth transition */
141
+ `;
142
+ const button = document.createElement('button');
143
+ button.setAttribute('id', id);
144
+ button.setAttribute('style', style);
145
+ button.innerHTML = text;
146
+
147
+ button.addEventListener('mouseenter', () => {
148
+ button.style.backgroundColor = 'rgb(54, 115, 115)'; // Change color on hover
149
+ });
150
+ button.addEventListener('mouseleave', () => {
151
+ button.style.backgroundColor = 'rgb(0, 149, 149)'; // Revert color when not hovering
152
+ });
153
+
154
+ container.appendChild(button);
155
+ return button;
156
+
157
+ }
158
+
159
159
  }
@@ -1,125 +1,125 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Form New Test</title>
8
- <style>
9
- button {
10
- background-color: #4CAF50;
11
- /* Green background */
12
- border: none;
13
- /* Remove borders */
14
- color: white;
15
- /* White text */
16
- padding: 15px 32px;
17
- /* Some padding */
18
- text-align: center;
19
- /* Centered text */
20
- text-decoration: none;
21
- /* Remove underline */
22
- display: inline-block;
23
- /* Make the button inline */
24
- font-size: 16px;
25
- /* Increase font size */
26
- margin: 4px 2px;
27
- /* Add some margin */
28
- cursor: pointer;
29
- /* Pointer cursor on hover */
30
- border-radius: 8px;
31
- /* Rounded corners */
32
- transition: background-color 0.3s;
33
- /* Smooth transition */
34
- }
35
-
36
- button:hover {
37
- background-color: #45a049;
38
- /* Darker green on hover */
39
- }
40
-
41
- button:active {
42
- background-color: #3e8e41;
43
- /* Even darker green when clicked */
44
- }
45
- </style>
46
- <style>
47
- @page {
48
-
49
- size: a4 portrait;
50
- margin: 0cm;
51
- }
52
-
53
- @media print {
54
-
55
- /* All your print styles go here */
56
- button {
57
- display: none !important;
58
- }
59
-
60
- svg {
61
- margin: 0;
62
- }
63
-
64
- body {
65
- margin: 0;
66
- }
67
- }
68
- </style>
69
- </head>
70
- <!-- <button></button> -->
71
-
72
- <body>
73
- <input type="checkbox" id="a">
74
- <label for="a">Select for Print</label>
75
- <button id="formBtn">Hide Form Margins</button>
76
- <button id="sectionBtn">Hide Section Margins</button>
77
- <button id="elementBtn">Hide Element Margins</button>
78
- <button id="printBtn">Print Form</button>
79
- <!-- <svg width="210mm" height="298mm" id="form-div" style="border: 1px solid blue"></svg> -->
80
- <div id="form-div"></div>
81
-
82
- <script type="module">
83
- import Forms from "./Forms.js";
84
- import { officeData, patientData } from "../../data/sampleData.js"
85
- const forms = new Forms({ container: document.getElementById('form-div'), name: 'form1' });
86
- // form.draw();
87
- // تابع افزودن دکمه‌های تاگل نمایش و محو خطوط راهنما هر سه نوع
88
- // form section element
89
- // document.getElementById('formBtn').addEventListener('mouseenter', () => {
90
- // forms.toggleBorders({ container: 'form', activeForm: form.activeForm });
91
- // });
92
-
93
- // document.getElementById('sectionBtn').addEventListener('mouseenter', () => {
94
- // forms.toggleBorders({ container: 'section', activeForm: form.activeForm });
95
- // });
96
-
97
- // document.getElementById('elementBtn').addEventListener('mouseenter', () => {
98
- // forms.toggleBorders({ container: 'element', activeForm: form.activeForm });
99
- // });
100
-
101
- // document.getElementById('printBtn').addEventListener('mouseenter', () => {
102
- // // form.toggleBorders({container: 'element'});
103
- // // window.print()
104
- // // const printDateTime = form.print();
105
- // // console.log(printDateTime);
106
-
107
- // });
108
-
109
-
110
-
111
- // const data = {
112
- // audiogram: {
113
- // R: { R_AC: { 500: 25, 1000: 35, 2000: 45, 4000: 55, 8000: 60 } },
114
- // L: { L_AC: { 500: 70, 1000: 75, 2000: 80, 4000: 65, 8000: 60 } }
115
- // },
116
- // tympanogram: {
117
- // R: { ECV: 2.52, SC: 0.80, MEP: -100, type: 'An' },
118
- // L: { ECV: 2.52, SC: 0.80, MEP: -300, type: 'An' }
119
- // }
120
- // }
121
- forms.update({ officeData, patientData, sessionIndex: 0 })
122
- </script>
123
- </body>
124
-
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Form New Test</title>
8
+ <style>
9
+ button {
10
+ background-color: #4CAF50;
11
+ /* Green background */
12
+ border: none;
13
+ /* Remove borders */
14
+ color: white;
15
+ /* White text */
16
+ padding: 15px 32px;
17
+ /* Some padding */
18
+ text-align: center;
19
+ /* Centered text */
20
+ text-decoration: none;
21
+ /* Remove underline */
22
+ display: inline-block;
23
+ /* Make the button inline */
24
+ font-size: 16px;
25
+ /* Increase font size */
26
+ margin: 4px 2px;
27
+ /* Add some margin */
28
+ cursor: pointer;
29
+ /* Pointer cursor on hover */
30
+ border-radius: 8px;
31
+ /* Rounded corners */
32
+ transition: background-color 0.3s;
33
+ /* Smooth transition */
34
+ }
35
+
36
+ button:hover {
37
+ background-color: #45a049;
38
+ /* Darker green on hover */
39
+ }
40
+
41
+ button:active {
42
+ background-color: #3e8e41;
43
+ /* Even darker green when clicked */
44
+ }
45
+ </style>
46
+ <style>
47
+ @page {
48
+
49
+ size: a4 portrait;
50
+ margin: 0cm;
51
+ }
52
+
53
+ @media print {
54
+
55
+ /* All your print styles go here */
56
+ button {
57
+ display: none !important;
58
+ }
59
+
60
+ svg {
61
+ margin: 0;
62
+ }
63
+
64
+ body {
65
+ margin: 0;
66
+ }
67
+ }
68
+ </style>
69
+ </head>
70
+ <!-- <button></button> -->
71
+
72
+ <body>
73
+ <input type="checkbox" id="a">
74
+ <label for="a">Select for Print</label>
75
+ <button id="formBtn">Hide Form Margins</button>
76
+ <button id="sectionBtn">Hide Section Margins</button>
77
+ <button id="elementBtn">Hide Element Margins</button>
78
+ <button id="printBtn">Print Form</button>
79
+ <!-- <svg width="210mm" height="298mm" id="form-div" style="border: 1px solid blue"></svg> -->
80
+ <div id="form-div"></div>
81
+
82
+ <script type="module">
83
+ import Forms from "./Forms.js";
84
+ import { officeData, patientData } from "../../data/sampleData.js"
85
+ const forms = new Forms({ container: document.getElementById('form-div'), name: 'form1' });
86
+ // form.draw();
87
+ // تابع افزودن دکمه‌های تاگل نمایش و محو خطوط راهنما هر سه نوع
88
+ // form section element
89
+ // document.getElementById('formBtn').addEventListener('mouseenter', () => {
90
+ // forms.toggleBorders({ container: 'form', activeForm: form.activeForm });
91
+ // });
92
+
93
+ // document.getElementById('sectionBtn').addEventListener('mouseenter', () => {
94
+ // forms.toggleBorders({ container: 'section', activeForm: form.activeForm });
95
+ // });
96
+
97
+ // document.getElementById('elementBtn').addEventListener('mouseenter', () => {
98
+ // forms.toggleBorders({ container: 'element', activeForm: form.activeForm });
99
+ // });
100
+
101
+ // document.getElementById('printBtn').addEventListener('mouseenter', () => {
102
+ // // form.toggleBorders({container: 'element'});
103
+ // // window.print()
104
+ // // const printDateTime = form.print();
105
+ // // console.log(printDateTime);
106
+
107
+ // });
108
+
109
+
110
+
111
+ // const data = {
112
+ // audiogram: {
113
+ // R: { R_AC: { 500: 25, 1000: 35, 2000: 45, 4000: 55, 8000: 60 } },
114
+ // L: { L_AC: { 500: 70, 1000: 75, 2000: 80, 4000: 65, 8000: 60 } }
115
+ // },
116
+ // tympanogram: {
117
+ // R: { ECV: 2.52, SC: 0.80, MEP: -100, type: 'An' },
118
+ // L: { ECV: 2.52, SC: 0.80, MEP: -300, type: 'An' }
119
+ // }
120
+ // }
121
+ forms.update({ officeData, patientData, sessionIndex: 0 })
122
+ </script>
123
+ </body>
124
+
125
125
  </html>