@@ -25,123 +25,6 @@ interface PropsPropsInt extends PropsInt {
25
25
} ) : void ;
26
26
}
27
27
28
- const styles = ( ) => ( {
29
- root : {
30
- display : 'flex' ,
31
- justifyContent : 'center' ,
32
- flexWrap : 'wrap'
33
- } ,
34
- chip : {
35
- color : '#eee' ,
36
- backgroundColor : '#333333'
37
- } ,
38
- column : {
39
- display : 'inline-flex' ,
40
- alignItems : 'baseline'
41
- } ,
42
- icon : {
43
- fontSize : '20px' ,
44
- color : '#eee' ,
45
- opacity : '0.7' ,
46
- transition : 'all .2s ease' ,
47
-
48
- '&:hover' : {
49
- color : 'red'
50
- }
51
- } ,
52
- cssLabel : {
53
- color : 'white' ,
54
-
55
- '&$cssFocused' : {
56
- color : 'green'
57
- }
58
- } ,
59
- propHeader : {
60
- fontSize : '35px' ,
61
- fontWeight : '900' ,
62
- marginLeft : '1rem' ,
63
- paddingTop : '10px'
64
- } ,
65
- dataTableHeader : {
66
- fontSize : '35px' ,
67
- fontWeight : '900' ,
68
- marginLeft : '22rem' ,
69
- marginTop : '15px' ,
70
- paddingTop : '10px'
71
- } ,
72
- cssFocused : { } ,
73
- input : {
74
- color : '#fff' ,
75
- marginBottom : '10px' ,
76
- width : '160px' ,
77
- backgroundColor : 'none' ,
78
- borderRadius : '5px' ,
79
- height : '40%' ,
80
- paddingLeft : '15px' ,
81
- paddingTop : '5px' ,
82
- paddingBottom : '5px' ,
83
- paddingRight : '10px' ,
84
- fontSize : '1.2rem' ,
85
- whiteSpace : 'nowrap' ,
86
- overflowX : 'hidden' ,
87
- textOverflow : 'ellipsis' ,
88
- border : '1px solid #33eb91'
89
- } ,
90
- inputLabel : {
91
- fontSize : '16px' ,
92
- zIndex : '20' ,
93
- color : '#fff' ,
94
- marginLeft : '10px'
95
- } ,
96
- select : {
97
- color : '#fff' ,
98
- marginBottom : '10px' ,
99
- width : '120px' ,
100
- backgroundColor : 'rgba(0, 0, 0, 0.3)' ,
101
- borderRadius : '5px' ,
102
- height : '40%' ,
103
- overflowWrap : 'break-word' ,
104
- paddingLeft : '15px' ,
105
- paddingTop : '5px' ,
106
- paddingBottom : '5px' ,
107
- fontSize : '1.2rem' ,
108
- border : '1px solid #33eb91'
109
- } ,
110
- selectLabel : {
111
- fontSize : '16px' ,
112
- zIndex : '20' ,
113
- color : '#fff' ,
114
- marginLeft : '10px'
115
- } ,
116
- addProp : {
117
- width : '15rem' ,
118
- marginLeft : '3rem' ,
119
- height : '4rem' ,
120
- transition : 'all 0.1s ease-out' ,
121
- border : '2px solid #33eb91' ,
122
- background : 'transparent' ,
123
- color : '#fff' ,
124
- '&:hover' : {
125
- transform : 'scale(1.1)' ,
126
- fontSize : '1.2rem' ,
127
- backgroundColor : '#33eb91' ,
128
- color : '#006400'
129
- }
130
- } ,
131
- dataTable : {
132
- border : '1px solid red' ,
133
- backgroundColor : 'red' ,
134
- width : '60%'
135
- } ,
136
- light : {
137
- color : '#eee'
138
- } ,
139
- avatar : {
140
- color : '#eee' ,
141
- fontSize : '10px'
142
- }
143
- } ) ;
144
-
145
28
const mapDispatchToProps = ( dispatch : any ) => ( {
146
29
addProp : ( prop : PropInt ) => dispatch ( addProp ( prop ) ) ,
147
30
deleteProp : ( propId : number ) => dispatch ( deleteProp ( propId ) ) ,
@@ -159,17 +42,14 @@ const mapStateToProps = (store: any) => ({
159
42
focusChild : store . workspace . focusChild
160
43
} ) ;
161
44
162
- // available types for select drop-down for button types
45
+ // available TypeScript types for select drop-down next to Props input
163
46
const availablePropTypes = {
164
47
string : 'STR' ,
165
48
number : 'NUM' ,
166
49
object : 'OBJ' ,
167
50
array : 'ARR' ,
168
51
boolean : 'BOOL' ,
169
52
function : 'FUNC' ,
170
- // symbol: 'SYM',
171
- // node: 'NODE',
172
- // element: 'ELEM',
173
53
any : 'ANY' ,
174
54
tuple : 'TUP' ,
175
55
enum : 'ENUM'
@@ -228,7 +108,7 @@ class Props extends Component<PropsPropsInt, StateInt> {
228
108
// function that handles the addition of props to a given componnent
229
109
// added regex to strip usr input from non alpha numeric properties
230
110
// presence of these characters crashes the app and should not be a valid input anyways
231
- handleAddProp = ( event : MouseEvent ) => {
111
+ handleAddProp = ( event : React . ChangeEvent < HTMLFormElement > ) => {
232
112
event . preventDefault ( ) ;
233
113
234
114
// destructuring from local state
@@ -286,7 +166,10 @@ class Props extends Component<PropsPropsInt, StateInt> {
286
166
} ) ) ;
287
167
288
168
return (
289
- < div className = { 'htmlattr' } >
169
+ < div
170
+ className = { 'htmlattr' }
171
+ style = { { overflowY : 'auto' , height : '85%' , marginTop : '1rem' } }
172
+ >
290
173
{ ' ' }
291
174
{ /* if no focus component in state, then render message */ }
292
175
{ Object . keys ( focusComponent ) . length < 1 ? (
@@ -333,7 +216,6 @@ class Props extends Component<PropsPropsInt, StateInt> {
333
216
< FormControl >
334
217
< TextField
335
218
type = "text"
336
- // native commented out due to overload error with material
337
219
id = "propVariable"
338
220
label = "Prop"
339
221
margin = "none"
@@ -355,22 +237,6 @@ class Props extends Component<PropsPropsInt, StateInt> {
355
237
/>
356
238
</ FormControl >
357
239
</ Grid >
358
- { /* code for */ }
359
- { /* <Grid item xs={6}>
360
- <TextField
361
- id='propValue'
362
- label='Value'
363
- margin='normal'
364
- onChange={this.handleChange}
365
- InputProps={{
366
- className: classes.input,
367
- }}
368
- InputLabelProps={{
369
- className: classes.input,
370
- }}
371
- value={this.state.propValue}
372
- />
373
- </Grid> */ }
374
240
< Grid item xs = { 6 } >
375
241
< FormControl required >
376
242
< InputLabel
@@ -429,10 +295,12 @@ class Props extends Component<PropsPropsInt, StateInt> {
429
295
item
430
296
xs = { 8 }
431
297
style = { {
432
- height : '17rem' ,
433
- overflow : 'scroll' ,
298
+ height : '100%' ,
299
+ overflowY : 'auto' ,
300
+ overflowX : 'auto' ,
434
301
marginTop : '1rem' ,
435
- paddingBottom : '1rem' ,
302
+ // paddingBottom: '1rem',
303
+ marginLeft : '6rem' ,
436
304
paddingTop : '0'
437
305
} }
438
306
>
@@ -455,6 +323,123 @@ class Props extends Component<PropsPropsInt, StateInt> {
455
323
}
456
324
}
457
325
326
+ const styles = ( ) => ( {
327
+ root : {
328
+ display : 'flex' ,
329
+ justifyContent : 'center' ,
330
+ flexWrap : 'wrap'
331
+ } ,
332
+ chip : {
333
+ color : '#eee' ,
334
+ backgroundColor : '#333333'
335
+ } ,
336
+ column : {
337
+ display : 'inline-flex' ,
338
+ alignItems : 'baseline'
339
+ } ,
340
+ icon : {
341
+ fontSize : '20px' ,
342
+ color : '#eee' ,
343
+ opacity : '0.7' ,
344
+ transition : 'all .2s ease' ,
345
+
346
+ '&:hover' : {
347
+ color : 'red'
348
+ }
349
+ } ,
350
+ cssLabel : {
351
+ color : 'white' ,
352
+
353
+ '&$cssFocused' : {
354
+ color : 'green'
355
+ }
356
+ } ,
357
+ propHeader : {
358
+ fontSize : '35px' ,
359
+ fontWeight : '900' ,
360
+ marginLeft : '1rem' ,
361
+ paddingTop : '10px'
362
+ } ,
363
+ dataTableHeader : {
364
+ fontSize : '35px' ,
365
+ fontWeight : '900' ,
366
+ marginLeft : '22rem' ,
367
+ marginTop : '15px' ,
368
+ paddingTop : '10px'
369
+ } ,
370
+ cssFocused : { } ,
371
+ input : {
372
+ color : '#fff' ,
373
+ marginBottom : '10px' ,
374
+ width : '160px' ,
375
+ backgroundColor : 'none' ,
376
+ borderRadius : '5px' ,
377
+ height : '40%' ,
378
+ paddingLeft : '15px' ,
379
+ paddingTop : '5px' ,
380
+ paddingBottom : '5px' ,
381
+ paddingRight : '10px' ,
382
+ fontSize : '1.2rem' ,
383
+ whiteSpace : 'nowrap' ,
384
+ overflowX : 'hidden' ,
385
+ textOverflow : 'ellipsis' ,
386
+ border : '1px solid #33eb91'
387
+ } ,
388
+ inputLabel : {
389
+ fontSize : '16px' ,
390
+ zIndex : '20' ,
391
+ color : '#fff' ,
392
+ marginLeft : '10px'
393
+ } ,
394
+ select : {
395
+ color : '#fff' ,
396
+ marginBottom : '10px' ,
397
+ width : '120px' ,
398
+ backgroundColor : 'rgba(0, 0, 0, 0.3)' ,
399
+ borderRadius : '5px' ,
400
+ height : '40%' ,
401
+ overflowWrap : 'break-word' ,
402
+ paddingLeft : '15px' ,
403
+ paddingTop : '5px' ,
404
+ paddingBottom : '5px' ,
405
+ fontSize : '1.2rem' ,
406
+ border : '1px solid #33eb91'
407
+ } ,
408
+ selectLabel : {
409
+ fontSize : '16px' ,
410
+ zIndex : '20' ,
411
+ color : '#fff' ,
412
+ marginLeft : '10px'
413
+ } ,
414
+ addProp : {
415
+ width : '15rem' ,
416
+ marginLeft : '3rem' ,
417
+ height : '4rem' ,
418
+ transition : 'all 0.1s ease-out' ,
419
+ border : '2px solid #33eb91' ,
420
+ background : 'transparent' ,
421
+ color : '#fff' ,
422
+ '&:hover' : {
423
+ transform : 'scale(1.1)' ,
424
+ fontSize : '1.2rem' ,
425
+ backgroundColor : '#33eb91' ,
426
+ color : '#006400'
427
+ }
428
+ } ,
429
+ dataTable : {
430
+ border : '1px solid red' ,
431
+ backgroundColor : 'red' ,
432
+ width : '60%'
433
+ } ,
434
+ light : {
435
+ color : '#eee'
436
+ } ,
437
+ avatar : {
438
+ color : '#eee' ,
439
+ fontSize : '10px'
440
+ }
441
+ } ) ;
442
+
458
443
export default connect (
459
444
mapStateToProps ,
460
445
mapDispatchToProps
0 commit comments