hayun-vite 0.0.3 → 0.1.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.
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 +152 -157
  42. package/src/note.html +0 -1
@@ -1,17 +1,17 @@
1
- // تابع رسم خط
2
- const svgNS = "http://www.w3.org/2000/svg";
3
-
4
- export default function putLine({ container, x1, y1, x2, y2, style = 'stroke: black; stroke-width: 0.5;', name }) {
5
-
6
- let line = document.createElementNS(svgNS, "line");
7
- line.setAttribute("x1", x1);
8
- line.setAttribute("y1", y1);
9
- line.setAttribute("x2", x2);
10
- line.setAttribute("y2", y2);
11
- line.setAttribute("style", style)
12
- line.setAttribute("data-name", name)
13
- // line.setAttribute("stroke", "black");
14
- // line.setAttribute("stroke-width", 0.5);
15
- container.appendChild(line);
16
-
1
+ // تابع رسم خط
2
+ const svgNS = "http://www.w3.org/2000/svg";
3
+
4
+ export default function putLine({ container, x1, y1, x2, y2, style = 'stroke: black; stroke-width: 0.5;', name }) {
5
+
6
+ let line = document.createElementNS(svgNS, "line");
7
+ line.setAttribute("x1", x1);
8
+ line.setAttribute("y1", y1);
9
+ line.setAttribute("x2", x2);
10
+ line.setAttribute("y2", y2);
11
+ line.setAttribute("style", style)
12
+ line.setAttribute("data-name", name)
13
+ // line.setAttribute("stroke", "black");
14
+ // line.setAttribute("stroke-width", 0.5);
15
+ container.appendChild(line);
16
+
17
17
  }
@@ -1,13 +1,13 @@
1
- const svgNS = "http://www.w3.org/2000/svg";
2
-
3
- export default function putPoint({ container, x, y, r = 0.1, style = 'color: red; ', color = 'black', fill = 'black' }) {
4
- let circle = document.createElementNS(svgNS, "circle");
5
- circle.setAttribute("cx", x);
6
- circle.setAttribute("cy", y);
7
- circle.setAttribute("r", r);
8
- circle.setAttribute("stroke", color);
9
- circle.setAttribute("fill", fill);
10
- circle.setAttribute("stroke-width", 0)
11
- container.appendChild(circle);
12
- return circle;
1
+ const svgNS = "http://www.w3.org/2000/svg";
2
+
3
+ export default function putPoint({ container, x, y, r = 0.1, style = 'color: red; ', color = 'black', fill = 'black' }) {
4
+ let circle = document.createElementNS(svgNS, "circle");
5
+ circle.setAttribute("cx", x);
6
+ circle.setAttribute("cy", y);
7
+ circle.setAttribute("r", r);
8
+ circle.setAttribute("stroke", color);
9
+ circle.setAttribute("fill", fill);
10
+ circle.setAttribute("stroke-width", 0)
11
+ container.appendChild(circle);
12
+ return circle;
13
13
  }
@@ -1,14 +1,14 @@
1
- const svgNS = "http://www.w3.org/2000/svg";
2
-
3
- export default function putRect({ container, x, y, width, height, style = 'fill: transparent; stroke: green; stroke-width: 0.5;', name }) {
4
- let rect = document.createElementNS(svgNS, "rect");
5
- rect.setAttribute("x", x);
6
- rect.setAttribute("y", y);
7
- rect.setAttribute("width", width);
8
- rect.setAttribute("height", height);
9
- rect.setAttribute("style", style);
10
- rect.setAttribute("data-name", name);
11
- container.appendChild(rect);
12
- return rect;
13
-
1
+ const svgNS = "http://www.w3.org/2000/svg";
2
+
3
+ export default function putRect({ container, x, y, width, height, style = 'fill: transparent; stroke: green; stroke-width: 0.5;', name }) {
4
+ let rect = document.createElementNS(svgNS, "rect");
5
+ rect.setAttribute("x", x);
6
+ rect.setAttribute("y", y);
7
+ rect.setAttribute("width", width);
8
+ rect.setAttribute("height", height);
9
+ rect.setAttribute("style", style);
10
+ rect.setAttribute("data-name", name);
11
+ container.appendChild(rect);
12
+ return rect;
13
+
14
14
  }
@@ -1,16 +1,17 @@
1
- const svgNS = "http://www.w3.org/2000/svg";
2
-
3
- // متن اس‌وی‌جی
4
- export default function putText({ container, value = '', x, y, id, dx = 0, dy = 0, style, name }) {
5
- let text = document.createElementNS(svgNS, "text");
6
- text.setAttribute("data-name", name)
7
- text.setAttribute("style", style);
8
- // text.setAttribute("dominant-baseline", "middle"); // تراز عمودی
9
- // text.setAttribute("fill", color);
10
- text.setAttribute("x", x + dx);
11
- text.setAttribute("y", y + dy);
12
- // آی دی برای تکست ها میذاریم و خط پایین میره داخل تابع آپدیت دیتای اسپیچ
13
- text.innerHTML = value;
14
- container.appendChild(text);
15
- return text;
16
- }
1
+ const svgNS = "http://www.w3.org/2000/svg";
2
+
3
+ // متن اس‌وی‌جی
4
+ export default function putText({ container, value = '', x, y, id, dx = 0, dy = 0, style, name, className }) {
5
+ let text = document.createElementNS(svgNS, "text");
6
+ name && text.setAttribute("data-name", name)
7
+ className && text.setAttribute("class", className);
8
+ style && text.setAttribute("style", style);
9
+ // text.setAttribute("dominant-baseline", "middle"); // تراز عمودی
10
+ // text.setAttribute("fill", color);
11
+ text.setAttribute("x", x + dx);
12
+ text.setAttribute("y", y + dy);
13
+ // آی دی برای تکست ها میذاریم و خط پایین میره داخل تابع آپدیت دیتای اسپیچ
14
+ text.innerHTML = value;
15
+ container.appendChild(text);
16
+ return text;
17
+ }
@@ -1,18 +1,18 @@
1
- const svgNS = "http://www.w3.org/2000/svg";
2
-
3
- // این لایه بالایی برای شناسایی توسط کلیک لیسنر استفاده میشود
4
- export default function drawTopLayer({ container, dims }) {
5
- dims.forEach((dim) => {
6
- // بوردر راهنما
7
- const rect = document.createElementNS(svgNS, "rect");
8
- rect.setAttribute("x", dim.x);
9
- rect.setAttribute("y", dim.y);
10
- rect.setAttribute("width", dim.width);
11
- rect.setAttribute("height", dim.height);
12
- rect.setAttribute("fill", "transparent");
13
- rect.setAttribute("stroke", "transparent");
14
- // rect.setAttribute("stroke-width", "1mm");
15
- rect.setAttribute("data-name", dim.name);
16
- container.appendChild(rect);
17
- });
1
+ const svgNS = "http://www.w3.org/2000/svg";
2
+
3
+ // این لایه بالایی برای شناسایی توسط کلیک لیسنر استفاده میشود
4
+ export default function drawTopLayer({ container, dims }) {
5
+ dims.forEach((dim) => {
6
+ // بوردر راهنما
7
+ const rect = document.createElementNS(svgNS, "rect");
8
+ rect.setAttribute("x", dim.x);
9
+ rect.setAttribute("y", dim.y);
10
+ rect.setAttribute("width", dim.width);
11
+ rect.setAttribute("height", dim.height);
12
+ rect.setAttribute("fill", "transparent");
13
+ rect.setAttribute("stroke", "transparent");
14
+ // rect.setAttribute("stroke-width", "1mm");
15
+ rect.setAttribute("data-name", dim.name);
16
+ container.appendChild(rect);
17
+ });
18
18
  }
package/src/main.js CHANGED
@@ -1,87 +1,88 @@
1
- // import './style.css'
2
-
3
- import AudiogramChart from "./Audiogram/Audiogram.js"
4
- import dims from './Audiogram/dims.js'
5
- import Forms from "./Form/Forms.js";
6
- import { officeData, patientData } from "../data/sampleData.js"
7
-
8
-
9
- // import javascriptLogo from './javascript.svg'
10
- // import viteLogo from '/vite.svg'
11
- // import { setupCounter } from './counter.js'
12
-
13
- // document.querySelector('#app').innerHTML = `
14
- // <div>
15
- // <a href="https://vite.dev" target="_blank">
16
- // <img src="${viteLogo}" class="logo" alt="Vite logo" />
17
- // </a>
18
- // <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
19
- // <img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
20
- // </a>
21
- // <h1>Hello Vite!</h1>
22
- // <div class="card">
23
- // <button id="counter" type="button"></button>
24
- // </div>
25
- // <p class="read-the-docs">
26
- // Click on the Vite logo to learn more
27
- // </p>
28
- // </div>
29
- // `
30
-
31
- // setupCounter(document.querySelector('#counter'))
32
-
33
-
34
- document.querySelector('#app').innerHTML = `
35
- <button>Ok</button>
36
- <button>Tok</button>
37
- <p>Mahdi</p>
38
- <h1>مهدی جاویدی پرنده پرکلاغی</h1>
39
- <div id="forms-div"></div>
40
- <div id="audiogram-div"></div>
41
- `
42
-
43
- const forms = new Forms({ container: document.getElementById('forms-div'), name: 'form1' });
44
- forms.update({ officeData, patientData, sessionIndex: 0 })
45
-
46
-
47
- const RAudiogram = new AudiogramChart({
48
- container: document.getElementById('audiogram-div'),
49
- dims: dims.display,
50
- side: 'R', x: 0, y: 0,
51
- width: 700, height: 800, events: true
52
- })
53
-
54
- const LAudiogram = new AudiogramChart({
55
- container: document.getElementById('audiogram-div'),
56
- dims: dims.display,
57
- side: 'L', x: 0, y: 0,
58
- width: 700, height: 800, events: true
59
- })
60
-
61
- RAudiogram.update({
62
- data: {
63
- // R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
64
- R_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
65
- R_AC_NR: { 1500: 85 },
66
- R_BC_M: { 2000: 25, 6000: 25 },
67
- R_BC_M_NR: { 3000: 85 },
68
- R_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
69
- },
70
- side: 'R',
71
- })
72
-
73
- LAudiogram.update({
74
- data: {
75
- // R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
76
- L_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
77
- L_AC_NR: { 1500: 85 },
78
- L_BC_M: { 2000: 25, 6000: 25 },
79
- L_BC_M_NR: { 3000: 85 },
80
- L_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
81
- },
82
- side: 'L',
83
- })
84
-
85
-
86
-
87
-
1
+ // import './style.css'
2
+
3
+ import AudiogramChart from "./Audiogram/Audiogram.js"
4
+ import dims from './Audiogram/dims.js'
5
+ import Forms from "./Form/Forms.js";
6
+ import { officeData, patientData } from "../data/sampleData.js"
7
+
8
+
9
+
10
+ // import javascriptLogo from './javascript.svg'
11
+ // import viteLogo from '/vite.svg'
12
+ // import { setupCounter } from './counter.js'
13
+
14
+ // document.querySelector('#app').innerHTML = `
15
+ // <div>
16
+ // <a href="https://vite.dev" target="_blank">
17
+ // <img src="${viteLogo}" class="logo" alt="Vite logo" />
18
+ // </a>
19
+ // <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
20
+ // <img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
21
+ // </a>
22
+ // <h1>Hello Vite!</h1>
23
+ // <div class="card">
24
+ // <button id="counter" type="button"></button>
25
+ // </div>
26
+ // <p class="read-the-docs">
27
+ // Click on the Vite logo to learn more
28
+ // </p>
29
+ // </div>
30
+ // `
31
+
32
+ // setupCounter(document.querySelector('#counter'))
33
+
34
+
35
+ document.querySelector('#app').innerHTML = `
36
+ <button>Ok</button>
37
+ <button>Tok</button>
38
+ <p>Mahdi</p>
39
+ <h1>مهدی جاویدی پرنده پرکلاغی</h1>
40
+ <div id="forms-div"></div>
41
+ <div id="audiogram-div"></div>
42
+ `
43
+
44
+ const forms = new Forms({ container: document.getElementById('forms-div'), name: 'form1' });
45
+ forms.update({ officeData, patientData, sessionIndex: 0 })
46
+
47
+
48
+ const RAudiogram = new AudiogramChart({
49
+ container: document.getElementById('audiogram-div'),
50
+ dims: dims.display,
51
+ side: 'R', x: 0, y: 0,
52
+ width: 700, height: 800, events: true
53
+ })
54
+
55
+ const LAudiogram = new AudiogramChart({
56
+ container: document.getElementById('audiogram-div'),
57
+ dims: dims.display,
58
+ side: 'L', x: 0, y: 0,
59
+ width: 700, height: 800, events: true
60
+ })
61
+
62
+ RAudiogram.update({
63
+ data: {
64
+ // R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
65
+ R_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
66
+ R_AC_NR: { 1500: 85 },
67
+ R_BC_M: { 2000: 25, 6000: 25 },
68
+ R_BC_M_NR: { 3000: 85 },
69
+ R_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
70
+ },
71
+ side: 'R',
72
+ })
73
+
74
+ LAudiogram.update({
75
+ data: {
76
+ // R_AC_M: { 8000: 25, 2000: 5, 1500: 0, },
77
+ L_AC: { 1000: 25, 500: 15, 750: 20, 250: 10, 6000: 35, 2000: 45 },
78
+ L_AC_NR: { 1500: 85 },
79
+ L_BC_M: { 2000: 25, 6000: 25 },
80
+ L_BC_M_NR: { 3000: 85 },
81
+ L_BC: { 1000: 20, 500: 10, 750: 15, 250: 5, 4000: 20 },
82
+ },
83
+ side: 'L',
84
+ })
85
+
86
+
87
+
88
+
package/src/note.css ADDED
@@ -0,0 +1,62 @@
1
+ @font-face {
2
+ font-family: vazirmatn;
3
+ src:
4
+ url("../fonts/Vazirmatn-Regular.woff2") format("woff2"),
5
+ url('../fonts/Vazirmatn-Regular.woff') format('woff');
6
+ }
7
+ @page {
8
+
9
+ size: a4;
10
+ margin: 0;
11
+ padding: 0;
12
+ break-inside: avoid;
13
+ height: 100%;
14
+ }
15
+ @media print {
16
+ header,
17
+ footer {
18
+ display: none;
19
+ }
20
+
21
+ button {
22
+ display: none !important;
23
+ }
24
+
25
+ svg {
26
+ margin: 0;
27
+ padding: 0;
28
+ break-inside: avoid;
29
+ }
30
+
31
+ body {
32
+ margin: 0;
33
+ padding: 0;
34
+ break-inside: avoid;
35
+ }
36
+
37
+ html {
38
+ margin: 0;
39
+ padding: 0;
40
+ break-inside: avoid;
41
+ }
42
+
43
+ }
44
+
45
+ .text-box {
46
+ font-size: 0.8mm;
47
+ direction: rtl !important;
48
+ user-select: none;
49
+ }
50
+
51
+ .persian {
52
+ font-family: Roboto;
53
+ font-size: 1.2mm;
54
+ }
55
+
56
+ .align {
57
+ text-anchor: start;
58
+ }
59
+
60
+ .bold {
61
+ font-weight: bold;
62
+ }