hayun-vite 0.2.0 → 0.3.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hayun-vite",
3
3
  "private": false,
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -43,35 +43,39 @@ export default class AudiogramChart {
43
43
  svg.setAttribute("x", x);
44
44
  svg.setAttribute("y", y);
45
45
  svg.setAttribute("viewBox", [-chartPadding.left, -chartPadding.top, width, height]);
46
- // محدوده مختصات خطوط جدول
47
- const chartArea = putRect({
48
- container: svg,
49
- x: this.getX(vFrequency.min), y: this.getY(intensity.min),
50
- width: vFrequencyAxiosLength.mm, height: intensityAxiosLength.mm,
51
- style: 'stroke-width: 0.4; stroke: gray; fill: transparent'
52
- })
46
+
53
47
 
54
48
  const currentPointer = putPoint({ container: svg, x: 0, y: 0, r: 4, color: 'black' });
55
49
  this.currentPointer = currentPointer;
56
- // رسم خطوط افقی از بالا به پایین
57
- let x1 = this.getX(vFrequency.min);
58
- let x2 = this.getX(vFrequency.max);
59
- for (let i = intensity.min; i <= intensity.max; i += intensity.step) {
60
- const y1 = this.getY(i)
61
- const y2 = y1
62
- putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
63
- }
64
- // رسم خطوط عمودی از چپ به راست
65
- let y1 = this.getY(intensity.min)
66
- let y2 = this.getY(intensity.max)
67
- for (let f = vFrequency.min; f <= vFrequency.max; f += vFrequency.step) {
68
- const x1 = this.getX(f)
69
- const x2 = x1
70
- putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
50
+ // برای فرم‌های پیش چاپ شده
51
+ if (!dims.blank) {
52
+ // محدوده مختصات خطوط جدول
53
+ const chartArea = putRect({
54
+ container: svg,
55
+ x: this.getX(vFrequency.min), y: this.getY(intensity.min),
56
+ width: vFrequencyAxiosLength.mm, height: intensityAxiosLength.mm,
57
+ style: 'stroke-width: 0.4; stroke: gray; fill: transparent'
58
+ })
59
+ // رسم خطوط افقی از بالا به پایین
60
+ let x1 = this.getX(vFrequency.min);
61
+ let x2 = this.getX(vFrequency.max);
62
+ for (let i = intensity.min; i <= intensity.max; i += intensity.step) {
63
+ const y1 = this.getY(i)
64
+ const y2 = y1
65
+ putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
66
+ }
67
+ // رسم خطوط عمودی از چپ به راست
68
+ let y1 = this.getY(intensity.min)
69
+ let y2 = this.getY(intensity.max)
70
+ for (let f = vFrequency.min; f <= vFrequency.max; f += vFrequency.step) {
71
+ const x1 = this.getX(f)
72
+ const x2 = x1
73
+ putLine({ container: svg, x1, y1, x2, y2, style: styles.line })
74
+ }
71
75
  }
72
76
  // یک بوردر راهنمای توسعه برای اس‌ وی جی به تمام پهنا و ارتفاع رسم می‌کنیم
73
77
  // این مربع مرزی را آخرین ایجاد میکنیم تا بالاترین لایه باشد و روی ریودادها درست عمل کند
74
- const borderRect = putRect({ container: svg, x: -chartPadding.left, y: -chartPadding.top, width, height, name: 'RAudiogram' });
78
+ const borderRect = putRect({ container: svg, x: -chartPadding.left, y: -chartPadding.top, width, height, name: 'RAudiogram', style: style = 'fill: transparent;' });
75
79
  this.borderRect = borderRect;
76
80
  // ایجاد رویدادها روی فقط چارت جدول
77
81
  borderRect.addEventListener('mousemove', (e) => {
@@ -160,7 +164,6 @@ export default class AudiogramChart {
160
164
 
161
165
  getSymbol(symbolName) {
162
166
  const point = this.symbols[symbolName].cloneNode(true);
163
-
164
167
  return point
165
168
  }
166
169
  }
@@ -43,7 +43,8 @@ const dims = {
43
43
  juncLine: `stroke-width: 1; stroke-opacity: 0.8;`,
44
44
  }
45
45
  },
46
- rasa: {
46
+ rasa_audiometry: {
47
+ blank: true, // define Blank Chart for PrePrinted Chart, Lines do not draw
47
48
  // width: 70.6,
48
49
  // height: 70,
49
50
  // margin: { left: 17, top: 18.5, },
package/src/Form/Form.js CHANGED
@@ -142,7 +142,7 @@ export default class Form {
142
142
  image.setAttribute('height', height);
143
143
 
144
144
  image.setAttribute('x', 0)
145
- image.setAttribute('y', 0)
145
+ image.setAttribute('y', -0.6)
146
146
  // image.setAttribute('height', height);
147
147
  image.setAttribute('href', this.image);
148
148
 
@@ -174,6 +174,7 @@ export default class Form {
174
174
  gender: patientData?.gender,
175
175
  age: patientData.sessions[sessionIndex]?.age,
176
176
  referrer: patientData.sessions[sessionIndex]?.referrer,
177
+ date: new Date().toLocaleDateString('fa-IR'),
177
178
 
178
179
  },
179
180
  footer: {
package/src/Form/Forms.js CHANGED
@@ -3,8 +3,10 @@ const svgNS = "http://www.w3.org/2000/svg";
3
3
  import printForm from "./printForm.js";
4
4
  import Form from "./Form.js";
5
5
  import combo from "./templates/combo.js"; // این در حقیقیت یک تمپلت هست
6
- import rasaAud from "./templates/rasaAud.js";
7
- import rasaAudImage from './templates/rasaAud.png'
6
+ import rasaAud from "./templates/rasa_audiometry.js";
7
+ // import rasaAudImage from './templates/rasaAud.png'
8
+ import rasaAudImage from './templates/rasa_audiometry.png'
9
+
8
10
  // خط کد زیر لازم هست
9
11
  import '../fonts/Vazirmatn-Regular.woff2'
10
12
  import '../style.css'
@@ -32,10 +34,9 @@ export default class Forms {
32
34
  this.forms.push(new Form({ container: this.div, template: combo }));
33
35
 
34
36
  // انتخاب فرم پیش‌فرض
35
- this.forms[1].form.style.display = 'block';
36
- this.selectedForm = this.forms[1]
37
- btn[1].style.backgroundColor = ' #1c15e1'
38
-
37
+ this.forms[0].form.style.display = 'block';
38
+ this.selectedForm = this.forms[0]
39
+ btn[0].style.backgroundColor = ' #1c15e1'
39
40
 
40
41
  // تعریف رویداد دکمه چاپ فرم نمایشی
41
42
  printBtn.addEventListener('click', () => { printForm({ container: this.selectedForm.form }) })
@@ -2,11 +2,11 @@ import audDims from "../../Audiogram/dims.js";
2
2
 
3
3
 
4
4
  const templateRasaAud = {
5
- name: 'rasa',
5
+ name: 'rasa_audiometry',
6
6
  label: 'ادیومتری رسا',
7
7
  backgroundImage: 'backgroundImage',
8
8
  margin: { left: 0, top: 0, right: 0, bottom: 0 },
9
- paper: { type: 'A4', case: 'portrait', width: 210, height: 296 },
9
+ paper: { type: 'A4', case: 'portrait', width: 209, height: 294.5 },
10
10
 
11
11
  // Printable Dimention
12
12
  calc1: function () {
@@ -55,8 +55,8 @@ const templateRasaAud = {
55
55
  audDims[this.name],
56
56
  {
57
57
  name: 'RAudiogram',
58
- w: width / 2, h: 100,
59
- margin: { left: 17, top: 18.5, right: 17.2, bottom: 11.5 },
58
+ w: width / 2, h: 99,
59
+ margin: { left: 18.1, top: 18.5, right: 16.4, bottom: 11.2 },
60
60
  display: 'inline',
61
61
  });
62
62
 
@@ -65,8 +65,8 @@ const templateRasaAud = {
65
65
  audDims[this.name],
66
66
  {
67
67
  name: 'LAudiogram',
68
- w: width / 2, h: 100, // پهنای سکشن هست
69
- margin: { left: 17.7, top: 18.5, right: 16.8, bottom: 11.5 },
68
+ w: width / 2, h: 99, // پهنای سکشن هست
69
+ margin: { left: 18.2, top: 18.5, right: 16.4, bottom: 11.2 },
70
70
  display: 'block',
71
71
  });
72
72
 
@@ -74,7 +74,7 @@ const templateRasaAud = {
74
74
 
75
75
  this.RSpeech = {
76
76
  name: 'RSpeech',
77
- w: width / 2, h: 38.2,
77
+ w: width / 2, h: 37.6,
78
78
  margin: { left: 0, top: 0, right: 0, bottom: 0 },
79
79
  display: 'inline',
80
80
  hideContext: true,
@@ -82,39 +82,16 @@ const templateRasaAud = {
82
82
  }
83
83
  this.LSpeech = {
84
84
  name: 'LSpeech',
85
- w: width / 2, h: 38.2,
85
+ w: width / 2, h: 37.6,
86
86
  margin: { left: 0, top: 0, right: 0, bottom: 0 },
87
87
  display: 'block',
88
88
  hideContext: true,
89
89
  forceInsert: true,
90
90
  }
91
- this.RTympanogram = {
92
- name: 'RTympanogram',
93
- w: width / 2, h: 60,
94
- margin: { left: 2, top: 2, right: 2, bottom: 2 },
95
- display: 'inline',
96
- }
97
- this.LTympanogram = {
98
- name: 'LTympanogram',
99
- w: width / 2, h: 60,
100
- margin: { left: 2, top: 2, right: 2, bottom: 2 },
101
- display: 'block',
102
- }
103
- this.RReflex = {
104
- name: 'RReflex',
105
- w: width / 2, h: 30,
106
- margin: { left: 2, top: 2, right: 2, bottom: 2 },
107
- display: 'inline'
108
- }
109
- this.LReflex = {
110
- name: 'LReflex',
111
- w: width / 2, h: 30,
112
- margin: { left: 2, top: 2, right: 2, bottom: 2 },
113
- display: 'block'
114
- }
91
+
115
92
  this.report = {
116
93
  name: 'report',
117
- w: width, h: 37.4,
94
+ w: width, h: 36.9,
118
95
  margin: { left: 0, top: 0, right: 0, bottom: 0 },
119
96
  display: 'block',
120
97
  hideContext: true,
@@ -131,13 +108,7 @@ const templateRasaAud = {
131
108
  calc2: function () {
132
109
  // let dims = this.dims;
133
110
  let width, height;
134
- //آیتم های روی این تمپلت
135
- // روش جدید محاسبه ابعاد منطقی تر و تمیز تر
136
- // Object.assign(this.header, {
137
- // width: this.getWidth(this.header),
138
- // height: this.getHeight(this.header),
139
- // })
140
- // New
111
+
141
112
  width = this.header.width = this.getWidth(this.header)
142
113
  height = this.header.height = this.getHeight(this.header)
143
114
 
@@ -169,7 +140,8 @@ const templateRasaAud = {
169
140
  { name: 'name', x: width - 45, y: 12 },
170
141
  { name: 'lastName', x: width - 75, y: 12 },
171
142
  { name: 'age', x: width - 105, y: 12 },
172
- { name: 'referrer', x: width - 150, y: 12 }
143
+ { name: 'referrer', x: width - 150, y: 12 },
144
+ { name: 'date', x: width - 185, y: 12 }
173
145
  ]
174
146
 
175
147
  width = this.history.width = this.getWidth(this.history)
@@ -192,32 +164,22 @@ const templateRasaAud = {
192
164
  this.RSpeech.height = this.getHeight(this.RSpeech)
193
165
  this.RSpeech.labels = ["SRT", "MCL", "SDS", 'UCL']
194
166
  this.RSpeech.forceInputs = [
195
- { name: 'SRT', x: 23, y: 26 },
196
- { name: 'MCL', x: 35, y: 26 },
197
- { name: 'SDS', x: 47, y: 26 },
198
- { name: 'UCL', x: 59, y: 26 },
167
+ { name: 'SRT', x: 24, y: 26 },
168
+ { name: 'MCL', x: 36, y: 26 },
169
+ { name: 'SDS', x: 48, y: 26 },
170
+ { name: 'UCL', x: 60, y: 26 },
199
171
  ]
200
172
 
201
173
  width = this.LSpeech.width = this.getWidth(this.LSpeech)
202
174
  this.LSpeech.height = this.getHeight(this.LSpeech)
203
175
  this.LSpeech.labels = ["SRT", "MCL", "SDS", 'UCL']
204
176
  this.LSpeech.forceInputs = [
205
- { name: 'SRT', x: 33, y: 26 },
206
- { name: 'MCL', x: 45, y: 26 },
207
- { name: 'SDS', x: 57, y: 26 },
208
- { name: 'UCL', x: 69, y: 26 },
177
+ { name: 'SRT', x: 34, y: 26 },
178
+ { name: 'MCL', x: 46, y: 26 },
179
+ { name: 'SDS', x: 58, y: 26 },
180
+ { name: 'UCL', x: 70, y: 26 },
209
181
  ]
210
182
 
211
- width = this.RTympanogram.width = this.getWidth(this.RTympanogram)
212
- this.RTympanogram.height = this.getHeight(this.RTympanogram)
213
- width = this.LTympanogram.width = this.getWidth(this.LTympanogram)
214
- this.LTympanogram.height = this.getHeight(this.LTympanogram)
215
-
216
- width = this.RReflex.width = this.getWidth(this.RReflex)
217
- this.RReflex.height = this.getHeight(this.RReflex)
218
- width = this.LReflex.width = this.getWidth(this.LReflex)
219
- this.LReflex.height = this.getHeight(this.LReflex)
220
-
221
183
  width = this.report.width = this.getWidth(this.report)
222
184
  this.report.height = this.getHeight(this.report)
223
185
  this.report.elements = [
@@ -231,7 +193,6 @@ const templateRasaAud = {
231
193
 
232
194
  ]
233
195
 
234
-
235
196
  width = this.footer.width = this.getWidth(this.footer)
236
197
  this.footer.height = this.getHeight(this.footer)
237
198
  this.footer.elements = [
package/src/style.css CHANGED
@@ -105,7 +105,7 @@ a:hover {
105
105
  padding: 0.6em 1.2em;
106
106
  font-size: 1em;
107
107
  font-weight: 500;
108
- font-family: inherit;
108
+ /* font-family: inherit; */
109
109
  background-color: #7472e2;
110
110
  color: #ffffff;
111
111
  cursor: pointer;
Binary file
package/src/counter.js DELETED
@@ -1,9 +0,0 @@
1
- export function setupCounter(element) {
2
- let counter = 0
3
- const setCounter = (count) => {
4
- counter = count
5
- element.innerHTML = `count is ${counter}`
6
- }
7
- element.addEventListener('click', () => setCounter(counter + 1))
8
- setCounter(0)
9
- }
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="#F7DF1E" d="M0 0h256v256H0V0Z"></path><path d="m67.312 213.932l19.59-11.856c3.78 6.701 7.218 12.371 15.465 12.371c7.905 0 12.89-3.092 12.89-15.12v-81.798h24.057v82.138c0 24.917-14.606 36.259-35.916 36.259c-19.245 0-30.416-9.967-36.087-21.996m85.07-2.576l19.588-11.341c5.157 8.421 11.859 14.607 23.715 14.607c9.969 0 16.325-4.984 16.325-11.858c0-8.248-6.53-11.17-17.528-15.98l-6.013-2.58c-17.357-7.387-28.87-16.667-28.87-36.257c0-18.044 13.747-31.792 35.228-31.792c15.294 0 26.292 5.328 34.196 19.247l-18.732 12.03c-4.125-7.389-8.591-10.31-15.465-10.31c-7.046 0-11.514 4.468-11.514 10.31c0 7.217 4.468 10.14 14.778 14.608l6.014 2.577c20.45 8.765 31.963 17.7 31.963 37.804c0 21.654-17.012 33.51-39.867 33.51c-22.339 0-36.774-10.654-43.819-24.574"></path></svg>