chem-generic-ui 0.1.35 → 0.1.38

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 (143) hide show
  1. package/.babelrc +11 -0
  2. package/.eslintrc +23 -0
  3. package/.tool-versions +3 -0
  4. package/package.json +45 -34
  5. package/public/ds_details.json +57 -0
  6. package/public/ds_klass.json +102 -0
  7. package/public/ds_props.json +54 -0
  8. package/public/favicon.ico +0 -0
  9. package/public/images/not_available.svg +1 -0
  10. package/public/index.html +47 -0
  11. package/public/logo192.png +0 -0
  12. package/public/logo512.png +0 -0
  13. package/public/manifest.json +25 -0
  14. package/public/robots.txt +3 -0
  15. package/public/sg_details.json +2036 -0
  16. package/public/sg_klass.json +850 -0
  17. package/public/test/ds_props.json +54 -0
  18. package/{dist/data/systemUnits.json → public/units_system.json} +0 -0
  19. package/src/app.js +50 -0
  20. package/{dist → src}/asserts/main.css +0 -7
  21. package/{dist → src}/asserts/main.scss +1 -7
  22. package/src/components/admin/ElementManager.js +28 -0
  23. package/src/components/details/GenDSDetails.js +164 -0
  24. package/src/components/details/GenSgDetails.js +396 -0
  25. package/{dist → src}/components/dnd/DragDropItemTypes.js +1 -9
  26. package/src/components/dnd/GenericElDropTarget.js +160 -0
  27. package/src/components/dnd/GridDnD.js +42 -0
  28. package/src/components/dnd/PanelDnD.js +85 -0
  29. package/src/components/fields/ButtonConfirm.js +45 -0
  30. package/src/components/fields/ButtonTooltip.js +46 -0
  31. package/src/components/fields/FieldLabel.js +18 -0
  32. package/src/components/fields/GenDSMisType.js +20 -0
  33. package/src/components/fields/GenFormGroupCb.js +17 -0
  34. package/src/components/fields/GenProperties.js +56 -0
  35. package/src/components/fields/GenPropertiesFields.js +318 -0
  36. package/src/components/layers/GenPropertiesLayer.js +176 -0
  37. package/src/components/layers/LayerModal.js +52 -0
  38. package/src/components/layers/LayersLayout.js +68 -0
  39. package/src/components/models/Attachment.js +37 -0
  40. package/src/components/models/GenericSubField.js +10 -0
  41. package/src/components/table/DropLinkRenderer.js +35 -0
  42. package/src/components/table/DropRenderer.js +31 -0
  43. package/src/components/table/DropTextRenderer.js +25 -0
  44. package/src/components/table/GenericElTableDropTarget.js +131 -0
  45. package/src/components/table/GridBtn.js +41 -0
  46. package/src/components/table/GridEntry.js +75 -0
  47. package/src/components/table/SamOption.js +53 -0
  48. package/src/components/table/SelectRenderer.js +34 -0
  49. package/src/components/table/TableRecord.js +254 -0
  50. package/src/components/table/UConverterRenderer.js +24 -0
  51. package/src/components/tools/collate.js +65 -0
  52. package/src/components/tools/orten.js +171 -0
  53. package/src/components/tools/utils.js +414 -0
  54. package/src/data/SystemUnits.js +434 -0
  55. package/src/data/systemUnits.json +430 -0
  56. package/{dist → src}/index.css +0 -0
  57. package/src/index.html +1 -0
  58. package/src/index.js +45 -0
  59. package/{dist → src}/logo.svg +0 -0
  60. package/src/simulations/SimuDS.js +52 -0
  61. package/src/simulations/SimuSG.js +54 -0
  62. package/webpack.config.js +52 -0
  63. package/dist/app.js +0 -106
  64. package/dist/app.js.map +0 -1
  65. package/dist/components/admin/ElementManager.js +0 -55
  66. package/dist/components/admin/ElementManager.js.map +0 -1
  67. package/dist/components/details/GenDSDetails.js +0 -274
  68. package/dist/components/details/GenDSDetails.js.map +0 -1
  69. package/dist/components/details/GenSgDetails.js +0 -567
  70. package/dist/components/details/GenSgDetails.js.map +0 -1
  71. package/dist/components/dnd/DragDropItemTypes.js.map +0 -1
  72. package/dist/components/dnd/GenericElDropTarget.js +0 -275
  73. package/dist/components/dnd/GenericElDropTarget.js.map +0 -1
  74. package/dist/components/dnd/GridDnD.js +0 -78
  75. package/dist/components/dnd/GridDnD.js.map +0 -1
  76. package/dist/components/dnd/PanelDnD.js +0 -172
  77. package/dist/components/dnd/PanelDnD.js.map +0 -1
  78. package/dist/components/fields/ButtonConfirm.js +0 -77
  79. package/dist/components/fields/ButtonConfirm.js.map +0 -1
  80. package/dist/components/fields/ButtonTooltip.js +0 -89
  81. package/dist/components/fields/ButtonTooltip.js.map +0 -1
  82. package/dist/components/fields/FieldLabel.js +0 -39
  83. package/dist/components/fields/FieldLabel.js.map +0 -1
  84. package/dist/components/fields/GenDSMisType.js +0 -45
  85. package/dist/components/fields/GenDSMisType.js.map +0 -1
  86. package/dist/components/fields/GenFormGroupCb.js +0 -32
  87. package/dist/components/fields/GenFormGroupCb.js.map +0 -1
  88. package/dist/components/fields/GenProperties.js +0 -84
  89. package/dist/components/fields/GenProperties.js.map +0 -1
  90. package/dist/components/fields/GenPropertiesFields.js +0 -617
  91. package/dist/components/fields/GenPropertiesFields.js.map +0 -1
  92. package/dist/components/flow/FlowView.js +0 -89
  93. package/dist/components/flow/FlowView.js.map +0 -1
  94. package/dist/components/flow/FlowViewerModal.js +0 -82
  95. package/dist/components/flow/FlowViewerModal.js.map +0 -1
  96. package/dist/components/flow/LayerNode.js +0 -60
  97. package/dist/components/flow/LayerNode.js.map +0 -1
  98. package/dist/components/layers/GenPropertiesLayer.js +0 -281
  99. package/dist/components/layers/GenPropertiesLayer.js.map +0 -1
  100. package/dist/components/layers/LayerModal.js +0 -82
  101. package/dist/components/layers/LayerModal.js.map +0 -1
  102. package/dist/components/layers/LayersLayout.js +0 -89
  103. package/dist/components/layers/LayersLayout.js.map +0 -1
  104. package/dist/components/models/Attachment.js +0 -74
  105. package/dist/components/models/Attachment.js.map +0 -1
  106. package/dist/components/models/GenericSubField.js +0 -38
  107. package/dist/components/models/GenericSubField.js.map +0 -1
  108. package/dist/components/table/DropLinkRenderer.js +0 -56
  109. package/dist/components/table/DropLinkRenderer.js.map +0 -1
  110. package/dist/components/table/DropRenderer.js +0 -46
  111. package/dist/components/table/DropRenderer.js.map +0 -1
  112. package/dist/components/table/DropTextRenderer.js +0 -46
  113. package/dist/components/table/DropTextRenderer.js.map +0 -1
  114. package/dist/components/table/GenericElTableDropTarget.js +0 -253
  115. package/dist/components/table/GenericElTableDropTarget.js.map +0 -1
  116. package/dist/components/table/GridBtn.js +0 -103
  117. package/dist/components/table/GridBtn.js.map +0 -1
  118. package/dist/components/table/GridEntry.js +0 -164
  119. package/dist/components/table/GridEntry.js.map +0 -1
  120. package/dist/components/table/SamOption.js +0 -88
  121. package/dist/components/table/SamOption.js.map +0 -1
  122. package/dist/components/table/SelectRenderer.js +0 -53
  123. package/dist/components/table/SelectRenderer.js.map +0 -1
  124. package/dist/components/table/TableRecord.js +0 -455
  125. package/dist/components/table/TableRecord.js.map +0 -1
  126. package/dist/components/table/UConverterRenderer.js +0 -42
  127. package/dist/components/table/UConverterRenderer.js.map +0 -1
  128. package/dist/components/tools/collate.js +0 -104
  129. package/dist/components/tools/collate.js.map +0 -1
  130. package/dist/components/tools/orten.js +0 -295
  131. package/dist/components/tools/orten.js.map +0 -1
  132. package/dist/components/tools/utils.js +0 -594
  133. package/dist/components/tools/utils.js.map +0 -1
  134. package/dist/data/SystemUnits.js +0 -589
  135. package/dist/data/SystemUnits.js.map +0 -1
  136. package/dist/index.js +0 -40
  137. package/dist/index.js.map +0 -1
  138. package/dist/simulations/SimWF.js +0 -124
  139. package/dist/simulations/SimWF.js.map +0 -1
  140. package/dist/simulations/SimuDS.js +0 -119
  141. package/dist/simulations/SimuDS.js.map +0 -1
  142. package/dist/simulations/SimuSG.js +0 -124
  143. package/dist/simulations/SimuSG.js.map +0 -1
@@ -0,0 +1,430 @@
1
+ {
2
+ "fields": [
3
+ {
4
+ "type": "numeric",
5
+ "field": "acceleration",
6
+ "label": "Acceleration",
7
+ "default": "",
8
+ "position": 10,
9
+ "placeholder": "acceleration",
10
+ "units": [
11
+ { "key": "mm_s2", "label": "mm/s<sup>2</sup>" }
12
+ ]
13
+ },
14
+ {
15
+ "type": "numeric",
16
+ "field": "agitation",
17
+ "label": "Agitation",
18
+ "default": "",
19
+ "position": 20,
20
+ "placeholder": "agitation",
21
+ "units": [
22
+ { "key": "rpm", "label": "rpm" }
23
+ ]
24
+ },
25
+ {
26
+ "type": "numeric",
27
+ "field": "amount_enzyme",
28
+ "label": "Amount enzyme as nmol/min",
29
+ "default": "",
30
+ "position": 30,
31
+ "placeholder": "amount enzyme as nmol/min",
32
+ "units": [
33
+ { "key": "u", "label": "U", "nm": 1 },
34
+ { "key": "mu", "label": "mU", "nm": 1000 }
35
+ ]
36
+ },
37
+ {
38
+ "type": "numeric",
39
+ "field": "molarity",
40
+ "label": "Chem. concentration (Molarity)",
41
+ "default": "",
42
+ "position": 40,
43
+ "placeholder": "molarity",
44
+ "units": [
45
+ { "key": "mol_l", "label": "mol/L (M)", "nm": 1 },
46
+ { "key": "mmol_l", "label": "mmol/L (mM)", "nm": 1000 },
47
+ { "key": "nmol_l", "label": "nmol/L (nM)", "nm": 1000000 },
48
+ { "key": "pmol_l", "label": "pmol/L (pM)", "nm": 1000000000 }
49
+ ]
50
+ },
51
+ {
52
+ "type": "numeric",
53
+ "field": "chem_distances",
54
+ "label": "Chem. distances",
55
+ "default": "",
56
+ "position": 50,
57
+ "placeholder": "Chem. distances",
58
+ "units": [
59
+ { "key": "angstrom", "label": "Å" }
60
+ ]
61
+ },
62
+ {
63
+ "type": "numeric",
64
+ "field": "concentration",
65
+ "label": "Concentration",
66
+ "default": "",
67
+ "position": 60,
68
+ "placeholder": "concentration",
69
+ "units": [
70
+ { "key": "ng_l", "label": "ng/L", "nm": 1000000 },
71
+ { "key": "mg_l", "label": "mg/L", "nm": 1000 },
72
+ { "key": "g_l", "label": "g/L", "nm": 1 }
73
+ ]
74
+ },
75
+ {
76
+ "type": "numeric",
77
+ "field": "conductivity",
78
+ "label": "Conductivity",
79
+ "default": "",
80
+ "position": 66,
81
+ "placeholder": "conductivity",
82
+ "units": [
83
+ { "key": "s_m", "label": "S/m", "nm": 1 }
84
+ ]
85
+ },{
86
+ "type": "numeric",
87
+ "field": "current",
88
+ "label": "Current",
89
+ "default": "",
90
+ "position": 60,
91
+ "placeholder": "Current",
92
+ "units": [
93
+ { "key": "A", "label": "A", "nm": 1 },
94
+ { "key": "mA", "label": "mA", "nm": 1000 },
95
+ { "key": "uA", "label": "µA", "nm": 1000000},
96
+ { "key": "nA", "label": "nA", "nm": 1000000000 }
97
+ ]
98
+ },
99
+ {
100
+ "type": "numeric",
101
+ "field": "degree",
102
+ "label": "Degree",
103
+ "default": "",
104
+ "position": 70,
105
+ "placeholder": "degree",
106
+ "units": [
107
+ { "key": "degree", "label": "°" }
108
+ ]
109
+ },
110
+ {
111
+ "type": "numeric",
112
+ "field": "density",
113
+ "label": "Density",
114
+ "default": "",
115
+ "position": 75,
116
+ "placeholder": "density",
117
+ "units": [
118
+ { "key": "g_cm3", "label": "g/cm<sup>3</sup>", "nm": 1 },
119
+ { "key": "kg_l", "label": "kg/l", "nm": 1 }
120
+ ]
121
+ },
122
+ {
123
+ "type": "numeric",
124
+ "field": "duration",
125
+ "label": "Duration",
126
+ "default": "",
127
+ "position": 80,
128
+ "placeholder": "duration",
129
+ "units": [
130
+ { "key": "d", "label": "d", "nm": 1 },
131
+ { "key": "h", "label": "h", "nm": 24 },
132
+ { "key": "min", "label": "m", "nm": 1440 },
133
+ { "key": "s", "label": "s", "nm": 86400 }
134
+ ]
135
+ },
136
+ {
137
+ "type": "numeric",
138
+ "field": "elastic_modulus",
139
+ "label": "Elastic modulus",
140
+ "default": "",
141
+ "position": 86,
142
+ "placeholder": "Elastic modulus",
143
+ "units": [
144
+ { "key": "m_pa", "label": "MPa", "nm": 1 },
145
+ { "key": "k_pa", "label": "kPa", "nm": 1000 },
146
+ { "key": "pa", "label": "Pa", "nm": 1000000 }
147
+ ]
148
+ },
149
+ {
150
+ "type": "numeric",
151
+ "field": "electric_field",
152
+ "label": "Electric field",
153
+ "default": "",
154
+ "position": 86,
155
+ "placeholder": "Electric field",
156
+ "units": [
157
+ { "key": "v_m", "label": "V/m", "nm": 1 }
158
+ ]
159
+ },
160
+ {
161
+ "type": "numeric",
162
+ "field": "energy",
163
+ "label": "Energy",
164
+ "default": "",
165
+ "position": 88,
166
+ "placeholder": "Joule",
167
+ "units": [
168
+ { "key": "j", "label": "J", "nm": 1000 },
169
+ { "key": "k_j", "label": "kJ", "nm": 1 }
170
+ ]
171
+ },
172
+ {
173
+ "type": "numeric",
174
+ "field": "enzyme_activity",
175
+ "label": "Enzyme activity",
176
+ "default": "",
177
+ "position": 90,
178
+ "placeholder": "Enzyme activity",
179
+ "units": [
180
+ { "key": "u_l", "label": "U/L", "nm": 1 },
181
+ { "key": "u_ml", "label": "U/mL", "nm": 1000 }
182
+ ]
183
+ },
184
+ {
185
+ "type": "numeric",
186
+ "field": "flow_rate",
187
+ "label": "Flow rate",
188
+ "default": "",
189
+ "position": 100,
190
+ "placeholder": "Flow rate",
191
+ "units": [
192
+ { "key": "ul_min", "label": "µl/min", "nm": 1000000 },
193
+ { "key": "ml_min", "label": "ml/min", "nm": 1000 },
194
+ { "key": "l_m", "label": "l/m", "nm": 1 }
195
+ ]
196
+ },
197
+ {
198
+ "type": "numeric",
199
+ "field": "frequency",
200
+ "label": "Frequency",
201
+ "default": "",
202
+ "position": 100,
203
+ "placeholder": "frequency",
204
+ "units": [
205
+ { "key": "hz", "label": "Hz", "nm": 1000 },
206
+ { "key": "khz", "label": "kHz", "nm": 1 }
207
+ ]
208
+ },
209
+ {
210
+ "type": "numeric",
211
+ "field": "heating_rate",
212
+ "label": "Heating rate",
213
+ "default": "",
214
+ "position": 106,
215
+ "placeholder": "heating rate",
216
+ "units": [
217
+ { "key": "k_min", "label": "K/min", "nm": 1 }
218
+ ]
219
+ },
220
+ {
221
+ "type": "numeric",
222
+ "field": "length",
223
+ "label": "Length",
224
+ "default": "",
225
+ "position": 110,
226
+ "placeholder": "length",
227
+ "units": [
228
+ { "key": "pm", "label": "pm", "nm": 100000 },
229
+ { "key": "nm", "label": "nm", "nm": 10000 },
230
+ { "key": "mm", "label": "mm", "nm": 1000 },
231
+ { "key": "cm", "label": "cm", "nm": 100 },
232
+ { "key": "m", "label": "m", "nm": 1 }
233
+ ]
234
+ },
235
+ {
236
+ "type": "numeric",
237
+ "field": "magnetic_flux_density",
238
+ "label": "Magnetic flux density/inductivity",
239
+ "default": "",
240
+ "position": 120,
241
+ "placeholder": "",
242
+ "units": [
243
+ { "key": "T", "label": "T", "nm": 1 }
244
+ ]
245
+ },
246
+ {
247
+ "type": "numeric",
248
+ "field": "mass",
249
+ "label": "Mass",
250
+ "default": "",
251
+ "position": 120,
252
+ "placeholder": "mass",
253
+ "units": [
254
+ { "key": "g", "label": "g", "nm": 1 },
255
+ { "key": "mg", "label": "mg", "nm": 1000 },
256
+ { "key": "ug", "label": "µg", "nm": 1000000 }
257
+ ]
258
+ },
259
+ {
260
+ "type": "numeric",
261
+ "field": "mass_molecule",
262
+ "label": "Mass of molecule",
263
+ "default": "",
264
+ "position": 126,
265
+ "placeholder": "mass of molecule",
266
+ "units": [
267
+ { "key": "dalton", "label": "D", "nm": 1000 },
268
+ { "key": "kilo_dalton", "label": "kD", "nm": 1 }
269
+ ]
270
+ },
271
+ {
272
+ "type": "numeric",
273
+ "field": "molecular_weight",
274
+ "label": "Molecular weight",
275
+ "default": "",
276
+ "position": 130,
277
+ "placeholder": "Molecular weight",
278
+ "units": [
279
+ { "key": "g_mol", "label": "g/mol" }
280
+ ]
281
+ },
282
+ {
283
+ "type": "numeric",
284
+ "field": "percentage",
285
+ "label": "Percentage",
286
+ "default": "",
287
+ "position": 136,
288
+ "placeholder": "percentage",
289
+ "units": [
290
+ { "key": "p", "label": "%", "nm": 1 }
291
+ ]
292
+ },
293
+ {
294
+ "type": "numeric",
295
+ "field": "pressure",
296
+ "label": "Pressure",
297
+ "default": "",
298
+ "position": 140,
299
+ "placeholder": "pressure",
300
+ "units": [
301
+ { "key": "atm", "label": "atm", "nm": 1 },
302
+ { "key": "pa", "label": "Pa", "nm": 101325 },
303
+ { "key": "torr", "label": "Torr", "nm": 760 }
304
+ ]
305
+ },
306
+ {
307
+ "type": "numeric",
308
+ "field": "reaction_rate",
309
+ "label": "Reaction rate",
310
+ "default": "",
311
+ "position": 150,
312
+ "placeholder": "Reaction rate",
313
+ "units": [
314
+ { "key": "mol_lmin", "label": "mol/Lmin", "nm": 1 },
315
+ { "key": "mol_lsec", "label": "mol/Ls", "nm": 60 }
316
+ ]
317
+ },
318
+ {
319
+ "type": "numeric",
320
+ "field": "specific_volume",
321
+ "label": "Specific Volume",
322
+ "default": "",
323
+ "position": 160,
324
+ "placeholder": "Specific Volume",
325
+ "units": [
326
+ { "key": "cm3_g", "label": "cm<sup>3</sup>/g", "nm": 1 }
327
+ ]
328
+ },
329
+ {
330
+ "type": "numeric",
331
+ "field": "speed",
332
+ "label": "Speed",
333
+ "default": "",
334
+ "position": 165,
335
+ "placeholder": "speed",
336
+ "units": [
337
+ { "key": "cm_s", "label": "cm/s", "nm": 1 },
338
+ { "key": "mm_s", "label": "mm/s", "nm": 10 },
339
+ { "key": "cm_h", "label": "cm/h", "nm": 3600 },
340
+ { "key": "mm_h", "label": "mm/h", "nm": 36000 }
341
+ ]
342
+ },
343
+ {
344
+ "type": "numeric",
345
+ "field": "surface",
346
+ "label": "Surface",
347
+ "default": "",
348
+ "position": 170,
349
+ "placeholder": "surface",
350
+ "units": [
351
+ { "key": "a_2", "label": "A<sup>2</sup>" },
352
+ { "key": "mm_2", "label": "mm<sup>2</sup>" },
353
+ { "key": "cm_2", "label": "cm<sup>2</sup>" }
354
+ ]
355
+ },
356
+ {
357
+ "type": "numeric",
358
+ "field": "temperature",
359
+ "label": "Temperature",
360
+ "default": "",
361
+ "position": 180,
362
+ "placeholder": "temperature",
363
+ "units": [
364
+ { "key": "C", "label": "°C" },
365
+ { "key": "F", "label": "°F" },
366
+ { "key": "K", "label": "°K" }
367
+ ]
368
+ },
369
+ {
370
+ "type": "numeric",
371
+ "field": "turnover_number",
372
+ "label": "Turnover number",
373
+ "default": "",
374
+ "position": 190,
375
+ "placeholder": "Turnover number",
376
+ "units": [
377
+ { "key": "1_s", "label": "1/s" }
378
+ ]
379
+ },
380
+ {
381
+ "type": "numeric",
382
+ "field": "viscosity",
383
+ "label": "Dynamic Viscosity",
384
+ "default": "",
385
+ "position": 200,
386
+ "placeholder": "Dynamic Viscosity",
387
+ "units": [
388
+ { "key": "pas", "label": "Pas", "nm": 1 },
389
+ { "key": "mpas", "label": "mPas", "nm": 1000 }
390
+ ]
391
+ },
392
+ {
393
+ "type": "numeric",
394
+ "field": "kinematic_viscosity",
395
+ "label": "Kinematic Viscosity",
396
+ "default": "",
397
+ "position": 205,
398
+ "placeholder": "Kinematic Viscosity",
399
+ "units": [
400
+ { "key": "m2_s", "label": "m<sup>2</sup>/s", "nm": 1 }
401
+ ]
402
+ },
403
+ {
404
+ "type": "numeric",
405
+ "field": "voltage",
406
+ "label": "Voltage",
407
+ "default": "",
408
+ "position": 200,
409
+ "placeholder": "voltage",
410
+ "units": [
411
+ { "key": "mv", "label": "mV", "nm": 1000 },
412
+ { "key": "v", "label": "V", "nm": 1 }
413
+ ]
414
+ },
415
+ {
416
+ "type": "numeric",
417
+ "field": "volumes",
418
+ "label": "Volumes",
419
+ "default": "",
420
+ "position": 210,
421
+ "placeholder": "volume",
422
+ "units": [
423
+ { "key": "l", "label": "l", "nm": 1 },
424
+ { "key": "ml", "label": "ml", "nm": 1000 },
425
+ { "key": "ul", "label": "µl", "nm": 1000000},
426
+ { "key": "nl", "label": "nl", "nm": 1000000000 }
427
+ ]
428
+ }
429
+ ]
430
+ }
File without changes
package/src/index.html ADDED
@@ -0,0 +1 @@
1
+ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/> <meta name="theme-color" content="#000000"/> <title>React with Webpack and Babel</title> </head> <body> <noscript> You need to enable JavaScript to run this app. </noscript> <div id="root"> </div> </body> </html>
package/src/index.js ADDED
@@ -0,0 +1,45 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import React from 'react';
3
+ import ReactDOM from 'react-dom';
4
+ // import 'bootstrap/dist/css/bootstrap.min.css';
5
+ import './index.css';
6
+ //import 'bootstrap/dist/css/bootstrap.min.css';
7
+ import 'bootstrap/dist/css/bootstrap.css';
8
+
9
+
10
+ // import 'bootstrap/dist/css/bootstrap.css';
11
+ // import 'bootstrap/dist/css/bootstrap-theme.css';
12
+
13
+ // import 'bootstrap/dist/css/bootstrap.min.css';
14
+ // import App from './App';
15
+ // import reportWebVitals from './reportWebVitals';
16
+
17
+ // import { ElementManager, GenPropertiesText } from './components/admin/ElementManager';
18
+ import { ElementManager, GenDSMisType, GenericDSDetails, SegmentDetails } from './app';
19
+ import SimuDS from './simulations/SimuDS';
20
+ import SimuSG from './simulations/SimuSG';
21
+
22
+ // export { ElementManager, GenPropertiesText };
23
+
24
+ ReactDOM.render(
25
+ <div>
26
+ <ElementManager elements={[]} element={{}} />
27
+ <GenDSMisType uiCtrl />
28
+ <SimuDS />
29
+ <SimuSG />
30
+ </div>
31
+ ,
32
+ document.getElementById('root')
33
+ );
34
+
35
+ module.hot.accept();
36
+ // function App() {
37
+ // return (
38
+ // <div>
39
+ // Project A
40
+ // <ElementManager />
41
+ // </div>
42
+ // );
43
+ // }
44
+
45
+ // export default App;
File without changes
@@ -0,0 +1,52 @@
1
+ import React, { Component } from 'react';
2
+ import GenericDSDetails from '../components/details/GenDSDetails';
3
+
4
+ class SimuDS extends Component {
5
+ constructor(props) {
6
+ super(props);
7
+ this.state = {
8
+ genericDS: {}, klass: {}
9
+ };
10
+ this.handleChange = this.handleChange.bind(this);
11
+ }
12
+
13
+ componentDidMount() {
14
+ fetch('public/ds_details.json', { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } })
15
+ .then(response => response.json()).then((json) => {
16
+ fetch('public/ds_klass.json', { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } })
17
+ .then(response => response.json()).then((kjson) => {
18
+ this.setState({ genericDS: json, klass: kjson });
19
+ })
20
+ .catch((errorMessage) => {
21
+ console.log(errorMessage);
22
+ });
23
+ })
24
+ .catch((errorMessage) => {
25
+ console.log(errorMessage);
26
+ });
27
+ }
28
+
29
+ handleChange(newObj) {
30
+ this.setState({ genericDS: newObj });
31
+ }
32
+
33
+ render() {
34
+ const { genericDS, klass } = this.state;
35
+ return (
36
+ <div>
37
+ <h2>GenericDSDetails</h2>
38
+ <div>
39
+ <GenericDSDetails
40
+ uiCtrl
41
+ genericDS={genericDS}
42
+ klass={klass}
43
+ kind="1H NMR"
44
+ onChange={this.handleChange}
45
+ />
46
+ </div>
47
+ </div>
48
+ );
49
+ }
50
+ }
51
+
52
+ export default SimuDS;
@@ -0,0 +1,54 @@
1
+ import React, { Component } from 'react';
2
+ import { DragDropContext } from 'react-dnd';
3
+ import HTML5Backend from 'react-dnd-html5-backend';
4
+ import SegmentDetails from '../components/details/GenSgDetails';
5
+
6
+ class SimuSG extends Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.state = {
10
+ segment: {}, klass: {}
11
+ };
12
+ this.handleChange = this.handleChange.bind(this);
13
+ }
14
+
15
+ componentDidMount() {
16
+ fetch('public/sg_details.json', { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } })
17
+ .then(response => response.json()).then((json) => {
18
+ console.log(json);
19
+ fetch('public/sg_klass.json', { headers: { 'Content-Type': 'application/json', Accept: 'application/json' } })
20
+ .then(response => response.json()).then((kjson) => {
21
+ this.setState({ segment: json, klass: kjson });
22
+ })
23
+ .catch((errorMessage) => {
24
+ console.log(errorMessage);
25
+ });
26
+ })
27
+ .catch((errorMessage) => {
28
+ console.log(errorMessage);
29
+ });
30
+ }
31
+
32
+ handleChange(newObj) {
33
+ this.setState({ segment: newObj });
34
+ }
35
+
36
+ render() {
37
+ const { segment, klass } = this.state;
38
+ return (
39
+ <div>
40
+ <h2>SegmentDetails</h2>
41
+ <div>
42
+ <SegmentDetails
43
+ uiCtrl
44
+ segment={segment}
45
+ klass={klass}
46
+ onChange={this.handleChange}
47
+ />
48
+ </div>
49
+ </div>
50
+ );
51
+ }
52
+ }
53
+
54
+ export default DragDropContext(HTML5Backend)(SimuSG);
@@ -0,0 +1,52 @@
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
4
+ const HtmlWebpackPlugin = require('html-webpack-plugin')
5
+
6
+
7
+ module.exports = {
8
+ entry: {
9
+ index: [
10
+ './src/index.js',
11
+ 'bootstrap/dist/css/bootstrap.css'
12
+ ]
13
+ },
14
+ module: {
15
+ rules: [
16
+ {
17
+ test: /\.(js|jsx)$/,
18
+ exclude: /node_modules/,
19
+ use: {
20
+ loader: "babel-loader",
21
+ options: {
22
+ presets: ['@babel/preset-env', '@babel/preset-react']
23
+ }
24
+ }
25
+ },
26
+ {
27
+ test: /\.css$/,
28
+ use: [
29
+ 'style-loader',
30
+ 'css-loader',
31
+ 'sass-loader'
32
+ ]
33
+ },
34
+ {
35
+ test: /\.(json)$/,
36
+ loader: 'file-loader',
37
+ },
38
+ ],
39
+ },
40
+ resolve: {
41
+ extensions: ['*', '.js', '.jsx'],
42
+ },
43
+ output: {
44
+ path: path.resolve(__dirname, './dist'),
45
+ filename: 'bundle.js',
46
+ },
47
+ plugins: [new HtmlWebpackPlugin({ template: './src/index.html' })],
48
+ devServer: {
49
+ static: path.resolve(__dirname, './dist'),
50
+ hot: true,
51
+ },
52
+ };