hayun-vite 0.0.2 → 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 -80
  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,76 +1,123 @@
1
- export default function printForm({ container }) {
2
- // const paperForm = document.getElementById(elementID);
3
- const paperForm = container;
4
-
5
- console.log("Print!");
6
- console.log(paperForm);
7
- print(paperForm);
8
-
9
- function print(paperForm) {
10
- iframePrint(paperForm);
11
- return new Date().toLocaleString("fa-IR");
12
- }
13
-
14
- function iframePrint(paperForm) {
15
- const hideFrame = document.createElement("iframe");
16
- let printDateTime;
17
- hideFrame.onload = setPrint;
18
- hideFrame.style.display = "none"; // hide iframe
19
- // hideFrame.src = "page-print.html";
20
- let style = `
21
- @page {
22
-
23
- size: a4;
24
- margin: 0;
25
-
26
- padding: 0;
27
- break-inside: avoid;
28
-
29
- /* width: 100%; */
30
- height: 100%;
31
- /* max-width: 800px; */
32
- /* margin: auto; */
33
-
34
- }
35
- @media print {
36
- /* All your print styles go here */
37
- header, footer {
38
- display: none; /* Hide header and footer when printing */
39
- }
40
- button {
41
- display: none !important;
42
- }
43
- svg {
44
- margin: 0;
45
- padding: 0;
46
- break-inside: avoid;
47
- }
48
- body {
49
- margin: 0;
50
- padding: 0;
51
- break-inside: avoid;
52
- }
53
- html {
54
- margin: 0;
55
- padding: 0;
56
- break-inside: avoid;
57
- }
58
-
59
- }
60
- `;
61
- hideFrame.srcdoc = `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title></title><style>${style}</style></head><body>${paperForm.outerHTML}</body></html>`;
62
- document.body.appendChild(hideFrame);
63
- // setTimeout(() => console.log(printDateTime), 2000)
64
- // console.log(printDateTime);
65
- return printDateTime;
66
- function setPrint() {
67
- const closePrint = () => { document.body.removeChild(this); };
68
- this.contentWindow.onbeforeunload = () => closePrint();
69
- this.contentWindow.onafterprint = () => {
70
- closePrint();
71
- printDateTime = (new Date().toLocaleString("fa-IR"));
72
- }
73
- this.contentWindow.print();
74
- }
75
- }
1
+ // import '../style.css'
2
+ // import '../fonts/Vazirmatn-Regular.woff2'
3
+
4
+
5
+ export default function printForm({ container }) {
6
+ // const paperForm = document.getElementById(elementID);
7
+ const paperForm = container;
8
+
9
+ print(paperForm);
10
+
11
+ function print(paperForm) {
12
+ iframePrint(paperForm);
13
+ return new Date().toLocaleString("fa-IR");
14
+ }
15
+
16
+ function iframePrint(paperForm) {
17
+ const hideFrame = document.createElement("iframe");
18
+ let printDateTime;
19
+ hideFrame.onload = setPrint;
20
+ hideFrame.style.display = "block"; // hide iframe
21
+
22
+ let style = `
23
+ @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');
24
+
25
+ @page {
26
+
27
+ size: a4;
28
+ margin: 0;
29
+ padding: 0;
30
+ break-inside: avoid;
31
+ height: 100%;
32
+ }
33
+
34
+ @media print {
35
+
36
+ header,
37
+ footer {
38
+ display: none;
39
+ }
40
+
41
+ button {
42
+ display: none !important;
43
+ }
44
+
45
+ svg {
46
+ margin: 0;
47
+ padding: 0;
48
+ break-inside: avoid;
49
+ }
50
+
51
+ body {
52
+ margin: 0;
53
+ padding: 0;
54
+ break-inside: avoid;
55
+ }
56
+
57
+ html {
58
+ margin: 0;
59
+ padding: 0;
60
+ break-inside: avoid;
61
+ }
62
+
63
+ }
64
+
65
+ .text-box {
66
+ font-size: 0.8mm;
67
+ direction: rtl !important;
68
+ user-select: none;
69
+ }
70
+
71
+ .persian {
72
+ font-family: "Vazirmatn";
73
+
74
+ font-weight: 200;
75
+ font-style: normal;
76
+ font-size: 0.8mm;
77
+
78
+ }
79
+
80
+ .align {
81
+ text-anchor: start;
82
+ }
83
+
84
+ .bold {
85
+ font-weight: bold;
86
+ }
87
+
88
+ `;
89
+ hideFrame.srcdoc = `
90
+ <!DOCTYPE html>
91
+ <html lang="en">
92
+
93
+ <head>
94
+ <meta charset="UTF-8">
95
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
96
+ <title></title>
97
+
98
+
99
+
100
+ <style>${style}</style>
101
+ </head>
102
+
103
+ <body>${paperForm.outerHTML}</body>
104
+
105
+ <script type="module">
106
+ console.log('fdfd')
107
+ </script>
108
+
109
+ </html>
110
+ `;
111
+ document.body.appendChild(hideFrame);
112
+
113
+ return 1;
114
+ function setPrint() {
115
+ const closePrint = () => { document.body.removeChild(this); };
116
+ this.contentWindow.onbeforeunload = () => closePrint();
117
+ this.contentWindow.onafterprint = () => {
118
+ closePrint();
119
+ }
120
+ this.contentWindow.print();
121
+ }
122
+ }
76
123
  }