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.
- package/assets/styles-test.css +90 -90
- package/assets/styles.css +90 -90
- package/data/formData1.js +42 -42
- package/data/officesObjStore.js +56 -56
- package/data/patientsObjStore.js +73 -73
- package/data/sampleData.js +94 -94
- package/index.js +11 -11
- package/package.json +1 -1
- package/src/Audiogram/Audiogram.js +194 -197
- package/src/Audiogram/dims.js +83 -83
- package/src/Form/Form.js +268 -276
- package/src/Form/Form_N.js +158 -158
- package/src/Form/Forms-Test.html +124 -124
- package/src/Form/Forms.js +121 -134
- package/src/Form/Header.js +91 -91
- package/src/Form/Reflex.js +141 -141
- package/src/Form/Sections.js +71 -71
- package/src/Form/Speech.js +132 -132
- package/src/Form/TextBox.js +66 -82
- package/src/Form/Tympanogram.js +355 -355
- package/src/Form/formStyles.css +122 -122
- package/src/Form/globalinfo.js +68 -68
- package/src/Form/grid/drawGrid.js +84 -84
- package/src/Form/grid/hideGrid.js +8 -8
- package/src/Form/printForm.js +122 -75
- package/src/Form/templates/combo.js +248 -248
- package/src/Form/templates/dims.js +204 -204
- package/src/Form/templates/rasaAud.js +287 -287
- package/src/Symbol/Symbols.js +29 -29
- package/src/Symbol/createSymbolSVG.js +240 -240
- package/src/Symbol/getAllSymbolsSVG.js +21 -21
- package/src/Symbol/insertSymbol.js +10 -10
- package/src/Symbol/symbolChart.js +47 -47
- package/src/common/putLine.js +16 -16
- package/src/common/putPoint.js +12 -12
- package/src/common/putRect.js +13 -13
- package/src/common/putText.js +17 -16
- package/src/common/putTopLayer.js +17 -17
- package/src/main.js +88 -87
- package/src/note.css +62 -0
- package/src/style.css +152 -157
- package/src/note.html +0 -1
package/src/common/putLine.js
CHANGED
@@ -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
|
}
|
package/src/common/putPoint.js
CHANGED
@@ -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
|
}
|
package/src/common/putRect.js
CHANGED
@@ -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
|
}
|
package/src/common/putText.js
CHANGED
@@ -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("
|
8
|
-
|
9
|
-
// text.setAttribute("
|
10
|
-
text.setAttribute("
|
11
|
-
text.setAttribute("
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
10
|
-
// import
|
11
|
-
// import
|
12
|
-
|
13
|
-
|
14
|
-
//
|
15
|
-
//
|
16
|
-
//
|
17
|
-
//
|
18
|
-
//
|
19
|
-
//
|
20
|
-
//
|
21
|
-
//
|
22
|
-
// <
|
23
|
-
//
|
24
|
-
//
|
25
|
-
//
|
26
|
-
//
|
27
|
-
//
|
28
|
-
//
|
29
|
-
//
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<button>
|
37
|
-
<
|
38
|
-
<
|
39
|
-
<
|
40
|
-
<div id="
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
forms
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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
|
+
}
|