Best JavaScript code snippet using playwright-internal
SheetsComponent.js
Source:SheetsComponent.js
1import React from 'react';2import {Text, View, StyleSheet, SafeAreaView, ScrollView, TextInput} from "react-native";3import {Color, DefaultStyle} from "../../utils/Constant";4const styles = StyleSheet.create({5 container: {6 flexDirection: 'column',7 alignItems: 'center',8 },9 rowResult: {10 width: '95%',11 // marginTop: 20,12 // borderWidth: 1,13 // paddingTop: 5,14 // paddingBottom: 5,15 // borderColor: Color.Silver,16 backgroundColor:"white",17 marginTop: 20,18 borderRadius:5,19 padding:10,20 elevation:10,21 shadowColor: '#000',22 shadowOffset: { width: 0, height: 3 },23 shadowOpacity: 0.5,24 shadowRadius: 5,25 },26 row: {27 width: '100%',28 flexDirection: 'row',29 marginTop: 5,30 marginBottom: 5,31 },32 result: {33 width: '20%',34 justifyContent: 'center',35 alignItems: 'center',36 backgroundColor: Color.Yellow,37 paddingTop: 7,38 paddingBottom: 7,39 },40 rowItem: {41 width: '20%',42 justifyContent: 'center',43 alignItems: 'center',44 },45 textInput: {46 width: 55,47 textAlign: 'center',48 height: 35,49 fontSize: 18,50 backgroundColor: Color.Sliver3,51 color: Color.Black,52 fontWeight: 'bold',53 },54 textResult: {55 fontWeight: 'bold',56 fontSize: 18,57 }58})59export default class SheetsComponent extends React.Component60{61 render() {62 return (63 <View>64 <View style={styles.container}>65 <View style={styles.rowResult}>66 <View style={[styles.row, {alignItems: 'center', justifyContent: 'center'}]}>67 <Text style={{textAlign: 'center', fontSize: 22, fontWeight: 'bold'}}>Trang Tinh 1</Text>68 </View>69 <View style={[styles.row]}>70 <View style={[styles.result]}>71 <Text style={styles.textResult}>C1</Text>72 </View>73 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>74 <Text style={styles.textResult}>C2</Text>75 </View>76 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>77 <Text style={styles.textResult}>C3</Text>78 </View>79 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>80 <Text style={styles.textResult}>C4</Text>81 </View>82 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>83 <Text style={styles.textResult}>C5</Text>84 </View>85 </View>86 <View style={[styles.row]}>87 <View style={[styles.rowItem]}>88 <TextInput89 style={[DefaultStyle.InputNumber, styles.textInput]}90 keyboardType='numeric'91 />92 </View>93 <View style={styles.rowItem}>94 <TextInput95 style={[DefaultStyle.InputNumber, styles.textInput]}96 keyboardType='numeric'97 />98 </View>99 <View style={styles.rowItem}>100 <TextInput101 style={[DefaultStyle.InputNumber, styles.textInput]}102 keyboardType='numeric'103 />104 </View>105 <View style={styles.rowItem}>106 <TextInput107 style={[DefaultStyle.InputNumber, styles.textInput]}108 keyboardType='numeric'109 />110 </View>111 <View style={styles.rowItem}>112 <TextInput113 style={[DefaultStyle.InputNumber, styles.textInput]}114 keyboardType='numeric'115 />116 </View>117 </View>118 <View style={[styles.row]}>119 <View style={[styles.rowItem]}>120 <TextInput121 style={[DefaultStyle.InputNumber, styles.textInput]}122 keyboardType='numeric'123 />124 </View>125 <View style={styles.rowItem}>126 <TextInput127 style={[DefaultStyle.InputNumber, styles.textInput]}128 keyboardType='numeric'129 />130 </View>131 <View style={styles.rowItem}>132 <TextInput133 style={[DefaultStyle.InputNumber, styles.textInput]}134 keyboardType='numeric'135 />136 </View>137 <View style={styles.rowItem}>138 <TextInput139 style={[DefaultStyle.InputNumber, styles.textInput]}140 keyboardType='numeric'141 />142 </View>143 <View style={styles.rowItem}>144 <TextInput145 style={[DefaultStyle.InputNumber, styles.textInput]}146 keyboardType='numeric'147 />148 </View>149 </View>150 <View style={[styles.row]}>151 <View style={[styles.rowItem]}>152 <TextInput153 style={[DefaultStyle.InputNumber, styles.textInput]}154 keyboardType='numeric'155 />156 </View>157 <View style={styles.rowItem}>158 <TextInput159 style={[DefaultStyle.InputNumber, styles.textInput]}160 keyboardType='numeric'161 />162 </View>163 <View style={styles.rowItem}>164 <TextInput165 style={[DefaultStyle.InputNumber, styles.textInput]}166 keyboardType='numeric'167 />168 </View>169 <View style={styles.rowItem}>170 <TextInput171 style={[DefaultStyle.InputNumber, styles.textInput]}172 keyboardType='numeric'173 />174 </View>175 <View style={styles.rowItem}>176 <TextInput177 style={[DefaultStyle.InputNumber, styles.textInput]}178 keyboardType='numeric'179 />180 </View>181 </View>182 <View style={[styles.row]}>183 <View style={[styles.rowItem]}>184 <TextInput185 style={[DefaultStyle.InputNumber, styles.textInput]}186 keyboardType='numeric'187 />188 </View>189 <View style={styles.rowItem}>190 <TextInput191 style={[DefaultStyle.InputNumber, styles.textInput]}192 keyboardType='numeric'193 />194 </View>195 <View style={styles.rowItem}>196 <TextInput197 style={[DefaultStyle.InputNumber, styles.textInput]}198 keyboardType='numeric'199 />200 </View>201 <View style={styles.rowItem}>202 <TextInput203 style={[DefaultStyle.InputNumber, styles.textInput]}204 keyboardType='numeric'205 />206 </View>207 <View style={styles.rowItem}>208 <TextInput209 style={[DefaultStyle.InputNumber, styles.textInput]}210 keyboardType='numeric'211 />212 </View>213 </View>214 <View style={[styles.row]}>215 <View style={[styles.rowItem]}>216 <TextInput217 style={[DefaultStyle.InputNumber, styles.textInput]}218 keyboardType='numeric'219 />220 </View>221 <View style={styles.rowItem}>222 <TextInput223 style={[DefaultStyle.InputNumber, styles.textInput]}224 keyboardType='numeric'225 />226 </View>227 <View style={styles.rowItem}>228 <TextInput229 style={[DefaultStyle.InputNumber, styles.textInput]}230 keyboardType='numeric'231 />232 </View>233 <View style={styles.rowItem}>234 <TextInput235 style={[DefaultStyle.InputNumber, styles.textInput]}236 keyboardType='numeric'237 />238 </View>239 <View style={styles.rowItem}>240 <TextInput241 style={[DefaultStyle.InputNumber, styles.textInput]}242 keyboardType='numeric'243 />244 </View>245 </View>246 <View style={[styles.row]}>247 <View style={[styles.result]}>248 <Text style={styles.textResult}>100</Text>249 </View>250 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>251 <Text style={styles.textResult}>100</Text>252 </View>253 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>254 <Text style={styles.textResult}>100</Text>255 </View>256 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>257 <Text style={styles.textResult}>100</Text>258 </View>259 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>260 <Text style={styles.textResult}>1245.8</Text>261 </View>262 </View>263 </View>264 <View style={styles.rowResult}>265 <View style={[styles.row, {alignItems: 'center', justifyContent: 'center'}]}>266 <Text style={{textAlign: 'center', fontSize: 22, fontWeight: 'bold'}}>Trang Tinh 1</Text>267 </View>268 <View style={[styles.row]}>269 <View style={[styles.result]}>270 <Text style={styles.textResult}>C1</Text>271 </View>272 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>273 <Text style={styles.textResult}>C2</Text>274 </View>275 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>276 <Text style={styles.textResult}>C3</Text>277 </View>278 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>279 <Text style={styles.textResult}>C4</Text>280 </View>281 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>282 <Text style={styles.textResult}>C5</Text>283 </View>284 </View>285 <View style={[styles.row]}>286 <View style={[styles.rowItem]}>287 <TextInput288 style={[DefaultStyle.InputNumber, styles.textInput]}289 keyboardType='numeric'290 />291 </View>292 <View style={styles.rowItem}>293 <TextInput294 style={[DefaultStyle.InputNumber, styles.textInput]}295 keyboardType='numeric'296 />297 </View>298 <View style={styles.rowItem}>299 <TextInput300 style={[DefaultStyle.InputNumber, styles.textInput]}301 keyboardType='numeric'302 />303 </View>304 <View style={styles.rowItem}>305 <TextInput306 style={[DefaultStyle.InputNumber, styles.textInput]}307 keyboardType='numeric'308 />309 </View>310 <View style={styles.rowItem}>311 <TextInput312 style={[DefaultStyle.InputNumber, styles.textInput]}313 keyboardType='numeric'314 />315 </View>316 </View>317 <View style={[styles.row]}>318 <View style={[styles.rowItem]}>319 <TextInput320 style={[DefaultStyle.InputNumber, styles.textInput]}321 keyboardType='numeric'322 />323 </View>324 <View style={styles.rowItem}>325 <TextInput326 style={[DefaultStyle.InputNumber, styles.textInput]}327 keyboardType='numeric'328 />329 </View>330 <View style={styles.rowItem}>331 <TextInput332 style={[DefaultStyle.InputNumber, styles.textInput]}333 keyboardType='numeric'334 />335 </View>336 <View style={styles.rowItem}>337 <TextInput338 style={[DefaultStyle.InputNumber, styles.textInput]}339 keyboardType='numeric'340 />341 </View>342 <View style={styles.rowItem}>343 <TextInput344 style={[DefaultStyle.InputNumber, styles.textInput]}345 keyboardType='numeric'346 />347 </View>348 </View>349 <View style={[styles.row]}>350 <View style={[styles.rowItem]}>351 <TextInput352 style={[DefaultStyle.InputNumber, styles.textInput]}353 keyboardType='numeric'354 />355 </View>356 <View style={styles.rowItem}>357 <TextInput358 style={[DefaultStyle.InputNumber, styles.textInput]}359 keyboardType='numeric'360 />361 </View>362 <View style={styles.rowItem}>363 <TextInput364 style={[DefaultStyle.InputNumber, styles.textInput]}365 keyboardType='numeric'366 />367 </View>368 <View style={styles.rowItem}>369 <TextInput370 style={[DefaultStyle.InputNumber, styles.textInput]}371 keyboardType='numeric'372 />373 </View>374 <View style={styles.rowItem}>375 <TextInput376 style={[DefaultStyle.InputNumber, styles.textInput]}377 keyboardType='numeric'378 />379 </View>380 </View>381 <View style={[styles.row]}>382 <View style={[styles.rowItem]}>383 <TextInput384 style={[DefaultStyle.InputNumber, styles.textInput]}385 keyboardType='numeric'386 />387 </View>388 <View style={styles.rowItem}>389 <TextInput390 style={[DefaultStyle.InputNumber, styles.textInput]}391 keyboardType='numeric'392 />393 </View>394 <View style={styles.rowItem}>395 <TextInput396 style={[DefaultStyle.InputNumber, styles.textInput]}397 keyboardType='numeric'398 />399 </View>400 <View style={styles.rowItem}>401 <TextInput402 style={[DefaultStyle.InputNumber, styles.textInput]}403 keyboardType='numeric'404 />405 </View>406 <View style={styles.rowItem}>407 <TextInput408 style={[DefaultStyle.InputNumber, styles.textInput]}409 keyboardType='numeric'410 />411 </View>412 </View>413 <View style={[styles.row]}>414 <View style={[styles.rowItem]}>415 <TextInput416 style={[DefaultStyle.InputNumber, styles.textInput]}417 keyboardType='numeric'418 />419 </View>420 <View style={styles.rowItem}>421 <TextInput422 style={[DefaultStyle.InputNumber, styles.textInput]}423 keyboardType='numeric'424 />425 </View>426 <View style={styles.rowItem}>427 <TextInput428 style={[DefaultStyle.InputNumber, styles.textInput]}429 keyboardType='numeric'430 />431 </View>432 <View style={styles.rowItem}>433 <TextInput434 style={[DefaultStyle.InputNumber, styles.textInput]}435 keyboardType='numeric'436 />437 </View>438 <View style={styles.rowItem}>439 <TextInput440 style={[DefaultStyle.InputNumber, styles.textInput]}441 keyboardType='numeric'442 />443 </View>444 </View>445 <View style={[styles.row]}>446 <View style={[styles.result]}>447 <Text style={styles.textResult}>100</Text>448 </View>449 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>450 <Text style={styles.textResult}>100</Text>451 </View>452 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>453 <Text style={styles.textResult}>100</Text>454 </View>455 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>456 <Text style={styles.textResult}>100</Text>457 </View>458 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>459 <Text style={styles.textResult}>1245.8</Text>460 </View>461 </View>462 </View>463 <View style={styles.rowResult}>464 <View style={[styles.row, {alignItems: 'center', justifyContent: 'center'}]}>465 <Text style={{textAlign: 'center', fontSize: 22, fontWeight: 'bold'}}>Trang Tinh 1</Text>466 </View>467 <View style={[styles.row]}>468 <View style={[styles.result]}>469 <Text style={styles.textResult}>C1</Text>470 </View>471 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>472 <Text style={styles.textResult}>C2</Text>473 </View>474 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>475 <Text style={styles.textResult}>C3</Text>476 </View>477 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>478 <Text style={styles.textResult}>C4</Text>479 </View>480 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>481 <Text style={styles.textResult}>C5</Text>482 </View>483 </View>484 <View style={[styles.row]}>485 <View style={[styles.rowItem]}>486 <TextInput487 style={[DefaultStyle.InputNumber, styles.textInput]}488 keyboardType='numeric'489 />490 </View>491 <View style={styles.rowItem}>492 <TextInput493 style={[DefaultStyle.InputNumber, styles.textInput]}494 keyboardType='numeric'495 />496 </View>497 <View style={styles.rowItem}>498 <TextInput499 style={[DefaultStyle.InputNumber, styles.textInput]}500 keyboardType='numeric'501 />502 </View>503 <View style={styles.rowItem}>504 <TextInput505 style={[DefaultStyle.InputNumber, styles.textInput]}506 keyboardType='numeric'507 />508 </View>509 <View style={styles.rowItem}>510 <TextInput511 style={[DefaultStyle.InputNumber, styles.textInput]}512 keyboardType='numeric'513 />514 </View>515 </View>516 <View style={[styles.row]}>517 <View style={[styles.rowItem]}>518 <TextInput519 style={[DefaultStyle.InputNumber, styles.textInput]}520 keyboardType='numeric'521 />522 </View>523 <View style={styles.rowItem}>524 <TextInput525 style={[DefaultStyle.InputNumber, styles.textInput]}526 keyboardType='numeric'527 />528 </View>529 <View style={styles.rowItem}>530 <TextInput531 style={[DefaultStyle.InputNumber, styles.textInput]}532 keyboardType='numeric'533 />534 </View>535 <View style={styles.rowItem}>536 <TextInput537 style={[DefaultStyle.InputNumber, styles.textInput]}538 keyboardType='numeric'539 />540 </View>541 <View style={styles.rowItem}>542 <TextInput543 style={[DefaultStyle.InputNumber, styles.textInput]}544 keyboardType='numeric'545 />546 </View>547 </View>548 <View style={[styles.row]}>549 <View style={[styles.rowItem]}>550 <TextInput551 style={[DefaultStyle.InputNumber, styles.textInput]}552 keyboardType='numeric'553 />554 </View>555 <View style={styles.rowItem}>556 <TextInput557 style={[DefaultStyle.InputNumber, styles.textInput]}558 keyboardType='numeric'559 />560 </View>561 <View style={styles.rowItem}>562 <TextInput563 style={[DefaultStyle.InputNumber, styles.textInput]}564 keyboardType='numeric'565 />566 </View>567 <View style={styles.rowItem}>568 <TextInput569 style={[DefaultStyle.InputNumber, styles.textInput]}570 keyboardType='numeric'571 />572 </View>573 <View style={styles.rowItem}>574 <TextInput575 style={[DefaultStyle.InputNumber, styles.textInput]}576 keyboardType='numeric'577 />578 </View>579 </View>580 <View style={[styles.row]}>581 <View style={[styles.rowItem]}>582 <TextInput583 style={[DefaultStyle.InputNumber, styles.textInput]}584 keyboardType='numeric'585 />586 </View>587 <View style={styles.rowItem}>588 <TextInput589 style={[DefaultStyle.InputNumber, styles.textInput]}590 keyboardType='numeric'591 />592 </View>593 <View style={styles.rowItem}>594 <TextInput595 style={[DefaultStyle.InputNumber, styles.textInput]}596 keyboardType='numeric'597 />598 </View>599 <View style={styles.rowItem}>600 <TextInput601 style={[DefaultStyle.InputNumber, styles.textInput]}602 keyboardType='numeric'603 />604 </View>605 <View style={styles.rowItem}>606 <TextInput607 style={[DefaultStyle.InputNumber, styles.textInput]}608 keyboardType='numeric'609 />610 </View>611 </View>612 <View style={[styles.row]}>613 <View style={[styles.rowItem]}>614 <TextInput615 style={[DefaultStyle.InputNumber, styles.textInput]}616 keyboardType='numeric'617 />618 </View>619 <View style={styles.rowItem}>620 <TextInput621 style={[DefaultStyle.InputNumber, styles.textInput]}622 keyboardType='numeric'623 />624 </View>625 <View style={styles.rowItem}>626 <TextInput627 style={[DefaultStyle.InputNumber, styles.textInput]}628 keyboardType='numeric'629 />630 </View>631 <View style={styles.rowItem}>632 <TextInput633 style={[DefaultStyle.InputNumber, styles.textInput]}634 keyboardType='numeric'635 />636 </View>637 <View style={styles.rowItem}>638 <TextInput639 style={[DefaultStyle.InputNumber, styles.textInput]}640 keyboardType='numeric'641 />642 </View>643 </View>644 <View style={[styles.row]}>645 <View style={[styles.result]}>646 <Text style={styles.textResult}>100</Text>647 </View>648 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>649 <Text style={styles.textResult}>100</Text>650 </View>651 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>652 <Text style={styles.textResult}>100</Text>653 </View>654 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>655 <Text style={styles.textResult}>100</Text>656 </View>657 <View style={[styles.result, {borderLeftWidth: 1, borderLeftColor: Color.White}]}>658 <Text style={styles.textResult}>1245.8</Text>659 </View>660 </View>661 </View>662 </View>663 </View>664 )665 }...
MailleSolide.js
Source:MailleSolide.js
1import React, { Component } from "react";2import {StyleSheet,View, Text,TextInput,ScrollView,FlatList} from 'react-native';3export default class MailleSolide extends React.Component4{5 render(){6 return(7 8 <ScrollView horizontal >9 <ScrollView >10 <View style={styles.veiw} > 11 <Text style ={styles.do}> Dégradation</Text>12 <Text style ={styles.do}> Léger </Text>13 <Text style ={styles.do}> Moyen</Text>14 <Text style ={styles.do}> Elevé</Text>15 </View>16 <View style={styles.veiw} > 17 <Text style ={styles.do}> Flache</Text>18 <TextInput placeholder ={'m'} style ={styles.do} keyboardType={'numeric'}></TextInput>19 <TextInput placeholder ={'m'}style ={styles.do} keyboardType={'numeric'}></TextInput>20 <TextInput placeholder ={'m'}style ={styles.do} keyboardType={'numeric'}></TextInput>21 </View>22 <View style={styles.veiw} > 23 <Text style ={styles.do}> Orniere frayée</Text>24 <TextInput style ={styles.do } placeholder ={'m²'} keyboardType={'numeric'}></TextInput>25 <TextInput style ={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>26 <TextInput style ={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>27 </View>28 <View style={styles.veiw} > 29 <Text style ={styles.do}> Fissure de fatigue</Text>30 <TextInput style ={styles.do} placeholder ={'m'} keyboardType={'numeric'}></TextInput>31 <TextInput style ={styles.do} placeholder ={'m'} keyboardType={'numeric'}></TextInput>32 <TextInput style ={styles.do} placeholder ={'m'} keyboardType={'numeric'}></TextInput>33 </View>34 <View style={styles.veiw} > 35 <Text style ={styles.do}> Faiençage de fatigue </Text>36 <TextInput style ={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>37 <TextInput style ={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>38 <TextInput style ={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>39 </View>40 <View style={styles.veiw} > 41 <Text style ={styles.do}> Desenrobage/brulure/pelade</Text>42 <TextInput style ={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>43 <TextInput style ={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>44 <TextInput style ={styles.do} placeholder ={'m²'} keyboardType={'numeric'} ></TextInput>45 </View>46 <View style={styles.veiw} > 47 <Text style={styles.do} > fissure de joint</Text>48 <TextInput style={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>49 <TextInput style={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>50 <TextInput style={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>51 </View>52 53 <View style={styles.veiw} > 54 <Text style={styles.do} > Fissure de retrait</Text>55 <TextInput style={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>56 <TextInput style={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>57 <TextInput style={styles.do} placeholder ={'ml'} keyboardType={'numeric'}></TextInput>58 </View>59 <View style={styles.veiw} > 60 <Text style={styles.do} > Faiençage de retrait</Text>61 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>62 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>63 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>64 </View>65 <View style={styles.veiw} > 66 <Text style={styles.do} > Déformation en W</Text>67 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>68 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>69 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>70 </View>71 72 <View style={styles.veiw} > 73 <Text style={styles.do} > Gonfelement-Bourrelet</Text>74 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>75 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>76 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>77 </View>78 <View style={styles.veiw} > 79 <Text style={styles.do} > Terrassement différentiel/marche </Text>80 <TextInput style={styles.do} placeholder ={'m'} keyboardType={'numeric'}></TextInput>81 <TextInput style={styles.do} placeholder ={'m'} keyboardType={'numeric'}></TextInput>82 <TextInput style={styles.do} placeholder ={'m'} keyboardType={'numeric'}></TextInput>83 </View>84 <View style={styles.veiw} > 85 <Text style={styles.do} > Répartition ponctuelle dégradée </Text>86 <TextInput style={styles.do} placeholder ={'m²'}keyboardType={'numeric'} ></TextInput>87 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>88 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>89 </View>90 <View style={styles.veiw} > 91 <Text style={styles.do} > Fissure parabolique</Text>92 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>93 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>94 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>95 </View>96 <View style={styles.veiw} > 97 <Text style={styles.do} > Empreinte/poinçennement</Text>98 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>99 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>100 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>101 </View>102 <View style={styles.veiw} > 103 <Text style={styles.do} > Nid de poule </Text>104 <TextInput style={styles.do} placeholder ={'U'} keyboardType={'numeric'}></TextInput>105 </View>106 <View style={styles.veiw} > 107 <Text style={styles.do} > Contamination</Text>108 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>109 </View>110 <View style={styles.veiw} > 111 <Text style={styles.do} > Dépot de gomme</Text>112 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>113 </View>114 <View style={styles.veiw} > 115 <Text style={styles.do} > Enobré poreux</Text>116 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>117 </View>118 <View style={styles.veiw} > 119 <Text style={styles.do} > Remontée d'eau </Text>120 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>121 </View>122 <View style={styles.veiw} > 123 <Text style={styles.do} > Remontée de fine </Text>124 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>125 126 </View>127 <View style={styles.veiw} > 128 <Text style={styles.do} > Ressuage </Text>129 <TextInput style={styles.do} placeholder ={'m²'} keyboardType={'numeric'}></TextInput>130 131 </View>132 </ScrollView>133 </ScrollView>134 );135 }136}137const styles = StyleSheet.create({138 veiw :{139 height: 70,140 flexDirection: "row",141 flex: 1,142 //borderWidth: 1,143 padding: 2,144 justifyContent: "flex-start"145 },146 scroll :{147 padding : 5,148 },149 do: { 150 width : 120,151 alignItems: "center",152 justifyContent: "center",153 borderWidth: 1,154 color :'black',155 }...
delicacyModuleCalc.js
Source:delicacyModuleCalc.js
1import React, {useState} from 'react';2import { StyleSheet, Text, View, Button, TextInput, ScrollView, ImageBackground} from 'react-native';3import { TouchableOpacity } from 'react-native-gesture-handler';4import { globalStyles } from '../styles/global';5export default function DelicacyModuleCalc({navigation, route})6{7 8const percent1 = route.params.paramPerStone1/100;9const percent2 = route.params.paramPerStone2/100;10const percent3 = route.params.paramPerStone3/100;11const background = require("../assets/background.jpg");12const [value, setValue] = useState(0);13const [x, setX] = useState(0);14const [result, setResult] = useState(0);15//3 deÄeri de ayrı ayrı hesaplayabilirsin diye düÅündün.16const calculate = (sandType) => {17 if(sandType == 1){18 setX(x + (value*percent1));19 }20 21 else if (sandType == 2){22 setX(x + (value*percent2));23 }24 else if(sandType == 3){25 setX(x + (value*percent3));26 }27}28const calculateResult = (x) => {29 setResult((800-x) / 100);30}31return (32 <ImageBackground source={background} style={{width:'100%', height:'100%'}}>33<View >34<View style={styles.tableContainer}>35<View style={styles.header}>36 <View style={{flex:0.3, borderWidth:1, alignItems:'center', justifyContent:'center', borderColor:'white',}}><Text style={styles.bigText}>Elek no (mm)</Text></View>37 <View style={{flex:0.7, borderWidth:1, alignItems:'center', justifyContent:'center', borderColor:'white', flexDirection:'row'}}>38 <View >39 <Text style={styles.bigText}>Elekten Geçen Malzemeler(%)</Text>40 <Text style={styles.bigText}>Mıcır I Mıcır II Kum</Text>41 </View>42 43 44 </View>45 46 47 48 49</View>50<View style={styles.row}>51 <View style={styles.cell,{flex:0.305}}>52 <Text style={styles.bigText}>32</Text>53 </View>54 <View style={styles.cell}> 55 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>56 </View>57 <View style={styles.cell}>58 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>59 </View>60 <View style={styles.cell}>61 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>62 </View>63 64 65</View>66<View style={styles.row}>67 <View style={styles.cell,{flex:0.305}}>68 <Text style={styles.bigText}>16</Text>69 </View>70 <View style={styles.cell}> 71 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>72 </View>73 <View style={styles.cell}>74 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>75 </View>76 <View style={styles.cell}>77 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>78 </View>79 80 81</View><View style={styles.row}>82 <View style={styles.cell,{flex:0.305}}>83 <Text style={styles.bigText}>8</Text>84 </View>85 <View style={styles.cell}> 86 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>87 </View>88 <View style={styles.cell}>89 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>90 </View>91 <View style={styles.cell}>92 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>93 </View>94 95 96</View><View style={styles.row}>97 <View style={styles.cell,{flex:0.305}}>98 <Text style={styles.bigText}>4</Text>99 </View>100 <View style={styles.cell}> 101 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>102 </View>103 <View style={styles.cell}>104 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>105 </View>106 <View style={styles.cell}>107 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>108 </View>109 110 111</View><View style={styles.row}>112 <View style={styles.cell,{flex:0.305}}>113 <Text style={styles.bigText}>2</Text>114 </View>115 <View style={styles.cell}> 116 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>117 </View>118 <View style={styles.cell}>119 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>120 </View>121 <View style={styles.cell}>122 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>123 </View>124 125 126</View><View style={styles.row}>127 <View style={styles.cell,{flex:0.305}}>128 <Text style={styles.bigText}>1</Text>129 </View>130 <View style={styles.cell}> 131 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>132 </View>133 <View style={styles.cell}>134 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>135 </View>136 <View style={styles.cell}>137 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>138 </View>139 140 141</View><View style={styles.row}>142 <View style={styles.cell,{flex:0.305}}>143 <Text style={styles.bigText}>0.5</Text>144 </View>145 <View style={styles.cell}> 146 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>147 </View>148 <View style={styles.cell}>149 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>150 </View>151 <View style={styles.cell}>152 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>153 </View>154 155 156</View><View style={styles.row}>157 <View style={styles.cell,{flex:0.305}}>158 <Text style={styles.bigText}>0.25</Text>159 </View>160 <View style={styles.cell}> 161 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(1)}/>162 </View>163 <View style={styles.cell}>164 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(2)}/>165 </View>166 <View style={styles.cell}>167 <TextInput keyboardType="numeric" style={styles.input} onChangeText={(val) => setValue(val)} onBlur={() => calculate(3)}/>168 </View>169 170 171</View>172 <View style={{width:250, marginTop:30, marginLeft:30}}>173 <TouchableOpacity style={styles.button} title="Hesapla" onPress={() => calculateResult(x)}>174 <Text >Hesapla</Text>175 </TouchableOpacity>176 </View>177 178 <View><Text style={{fontSize:20, textAlign:'center', marginTop:30, color:'white'}}>Ä°ncelik modül sonucu: {(Math.round(result*100)/100)}</Text></View>179</View>180 <View style={{width:250, marginTop:160, marginLeft:'auto', marginRight:'auto'}}>181 <Button title="geri git" onPress={() => navigation.navigate('Data Input', {dmResult : result})}/> 182 </View>183 </View>184 185 </ImageBackground>186)187}188const styles = StyleSheet.create({189 tableContainer:{190 width : '90%',191 height:450,192 borderWidth:0.25,193 marginLeft:'auto',194 marginRight:'auto',195 marginTop:50,196 borderWidth:1,197 borderColor:'white',198 },199 header:{200 borderWidth:0.5,201 height:'20%',202 flexDirection:'row',203 borderColor:'white',204 205 },206 row:{207 borderWidth:1,208 height:'10%',209 flexDirection:'row',210 borderColor:'white',211 },212 cell :{213 214 borderLeftWidth:1.5,215 flex:0.233,216 borderColor:'white',217 },218 input:{219 borderRadius:10,220 flex:1,221 fontSize:18,222 color:'white',223 textAlign:'center',224 },225 bigText:{226 textAlign:'center',227 marginTop:'auto',228 marginBottom:'auto',229 fontSize: 18, 230 color:'white',231 },232 button : {233 backgroundColor:"white",234 width:100,235 height:40,236 justifyContent:'center',237 alignItems:'center',238 marginLeft:100,239 backgroundColor:'#7AC',240 241 }...
textInputProps.js
Source:textInputProps.js
1import { Platform } from "react-native";2export default {3 addressLine: {4 autoCapitalize: "words",5 autoCorrect: true,6 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android7 keyboardType: Platform.select({ android: undefined, ios: "default" })8 },9 email: {10 autoCapitalize: "none",11 autoComplete: "email",12 autoCorrect: Platform.OS === "ios", // Must be on for textContentType to work!13 keyboardType: "email-address",14 textContentType: "emailAddress"15 },16 firstName: {17 autoCapitalize: "words",18 autoComplete: "name",19 autoCorrect: true,20 textContentType: "givenName",21 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android22 keyboardType: Platform.select({ android: undefined, ios: "name-phone-pad" })23 },24 lastName: {25 autoCapitalize: "words",26 autoComplete: "name",27 autoCorrect: true,28 textContentType: "familyName",29 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android30 keyboardType: Platform.select({ android: undefined, ios: "name-phone-pad" })31 },32 jobTitle: {33 autoCapitalize: "words",34 autoComplete: "name",35 autoCorrect: true,36 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android37 keyboardType: Platform.select({ android: undefined, ios: "default" })38 },39 mobileNumber: {40 autoCapitalize: "none",41 autoComplete: "tel",42 autoCorrect: Platform.OS === "ios", // Must be on for textContentType to work!43 textContentType: "telephoneNumber",44 keyboardType: Platform.select({ android: "phone-pad", ios: "number-pad" })45 },46 password: {47 autoCapitalize: "none",48 autoCorrect: false,49 secureTextEntry: true,50 selectTextOnFocus: false,51 textContentType: "password"52 },53 postalCode: {54 autoCapitalize: "characters",55 autoComplete: "postal-code",56 autoCorrect: true,57 textContentType: "postalCode",58 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android59 keyboardType: Platform.select({ android: undefined, ios: "default" })60 },61 organisation: {62 autoCapitalize: "words",63 autoCorrect: true,64 textContentType: "none",65 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android66 keyboardType: Platform.select({ android: undefined, ios: "default" })67 },68 address1: {69 autoCapitalize: "words",70 autoCorrect: true,71 textContentType: "streetAddressLine1",72 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android73 keyboardType: Platform.select({ android: undefined, ios: "default" })74 },75 address2: {76 autoCapitalize: "words",77 autoCorrect: true,78 textContentType: "streetAddressLine2",79 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android80 keyboardType: Platform.select({ android: undefined, ios: "default" })81 },82 city: {83 autoCapitalize: "words",84 autoCorrect: true,85 textContentType: "addressCity",86 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android87 keyboardType: Platform.select({ android: undefined, ios: "default" })88 },89 stateProvince: {90 autoCapitalize: "words",91 autoCorrect: true,92 textContentType: "addressState",93 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android94 keyboardType: Platform.select({ android: undefined, ios: "default" })95 },96 website: {97 autoCapitalize: "none",98 autoCorrect: true,99 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android100 keyboardType: Platform.select({ android: undefined, ios: "default" }),101 textContentType: "URL"102 },103 country: {104 autoCapitalize: "words",105 autoCorrect: true,106 textContentType: "countryName",107 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android108 keyboardType: Platform.select({ android: undefined, ios: "default" })109 },110 organisationName: {111 autoCapitalize: "words",112 autoCorrect: true,113 textContentType: "none",114 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android115 keyboardType: Platform.select({ android: undefined, ios: "default" })116 },117 organisationDescription: {118 autoCapitalize: "none",119 autoCorrect: true,120 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android121 keyboardType: Platform.select({ android: undefined, ios: "default" }),122 multiline: true,123 textAlignVertical: "top"124 },125 projectName: {126 autoCapitalize: "words",127 autoCorrect: true,128 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android129 keyboardType: Platform.select({ android: undefined, ios: "default" })130 },131 integer: {132 autoCapitalize: "none",133 autoCorrect: false,134 keyboardType: Platform.select({ android: "phone-pad", ios: "number-pad" }),135 numberFormat: {136 maximumFractionDigits: 0137 }138 },139 decimal: {140 autoCapitalize: "none",141 autoCorrect: false,142 keyboardType: Platform.select({ android: "phone-pad", ios: "decimal-pad" }),143 numberFormat: {144 maximumFractionDigits: 2145 }146 },147 text: {148 autoCapitalize: "words",149 autoCorrect: true,150 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android151 keyboardType: Platform.select({ android: undefined, ios: "default" })152 },153 multiLineText: {154 autoCapitalize: "none",155 autoCorrect: true,156 // Work around https://github.com/facebook/react-native/issues/8932 by definined undefined keyboard on Android157 keyboardType: Platform.select({ android: undefined, ios: "default" }),158 multiline: true,159 textAlignVertical: "top"160 }...
TSTextInput.js
Source:TSTextInput.js
1'use strict';2import React from 'react';3import {4 StyleSheet,5 View,6 Text,7 TextInput8} from 'react-native';9var WithLabel = React.createClass({10 render: function () {11 //console.log(this.props);12 return (13 <View style={styles.row}>14 <View style={!this.props.inline && styles.labelContainer}>15 {this.props.extra}16 <Text style={[styles.label, this.props.color && {color: this.props.color}, this.props.inline && {fontWeight: 'normal', marginRight: 0}]}>{this.props.label}</Text>17 </View>18 <View style={this.props.inline ? styles.flex1 : styles.textContainer}>19 <View style={styles.row}>20 <TextInput style={[styles.textInput, this.props.color && {color: this.props.color}]}21 keyboardType={this.props.keyboardType}22 placeholder={this.props.placeholder}23 editable={this.props.hasOwnProperty("editable") ? this.props.editable : true}24 value={this.props.value}25 secureTextEntry={this.props.secureTextEntry}26 autoFocus={this.props.autoFocus}27 autoCapitalize="none"28 autoCorrect={false}29 onChangeText={this.props.onChangeText}/>30 {this.props.hint && <Text style={styles.hint}>{this.props.hint}</Text>}31 </View>32 </View>33 </View>34 );35 },36});37var WithoutLabel = React.createClass({38 render: function () {39 return (40 <View style={styles.row}>41 <TextInput style={[styles.textInput,42 this.props.subItem && styles.subTextInput,43 this.props.width && {width: Number(this.props.width)},44 (this.props.keyboardType == 'decimal-pad' || this.props.keyboardType == 'numeric') && styles.textAlignRight,45 this.props.backgroundColor && {backgroundColor: this.props.backgroundColor}]}46 keyboardType={this.props.keyboardType}47 placeholder={this.props.placeholder}48 editable={this.props.hasOwnProperty("editable") ? this.props.editable : true}49 secureTextEntry={this.props.secureTextEntry}50 value={this.props.value}51 autoFocus={this.props.autoFocus}52 autoCapitalize="none"53 autoCorrect={false}54 onChangeText={this.props.onChangeText}/>55 {this.props.hint && <Text style={styles.hint}>{this.props.hint}</Text>}56 </View>57 )58 }59});60module.exports = React.createClass({61 render() {62 var fieldRender;63 var keyboardType = this.props.keyboardType;64 if (keyboardType == null || keyboardType == '') {65 keyboardType = 'default';66 }67 if (this.props.label == null || this.props.label == '') {68 fieldRender = <WithoutLabel subItem={this.props.subItem}69 width={this.props.width}70 editable={this.props.editable}71 keyboardType={keyboardType}72 secureTextEntry={this.props.secureTextEntry}73 placeholder={this.props.placeholder}74 hint={this.props.hint}75 value={this.props.value}76 backgroundColor={this.props.backgroundColor}77 onChangeText={this.props.onChangeText}/>;78 } else {79 fieldRender = <WithLabel label={this.props.label}80 extra={this.props.extra}81 color={this.props.color}82 editable={this.props.editable}83 keyboardType={keyboardType}84 secureTextEntry={this.props.secureTextEntry}85 placeholder={this.props.placeholder}86 hint={this.props.hint}87 value={this.props.value}88 inline={this.props.inline}89 onChangeText={this.props.onChangeText}/>;90 }91 return (92 <View>{fieldRender}</View>93 );94 }95});96var styles = StyleSheet.create({97 row: {98 flexDirection: 'row',99 alignItems: 'center',100 },101 flex1: {102 flex: 1,103 },104 labelContainer: {105 flexDirection: 'row',106 justifyContent: 'flex-end',107 flex: 3,108 },109 label: {110 marginRight: 2,111 marginLeft: 4,112 fontSize: 18,113 fontWeight: 'bold',114 color: '#5A5B5D',115 textAlign: 'right',116 },117 hint: {118 marginRight: 10,119 marginLeft: 6,120 fontSize: 18,121 color: '#5A5B5D',122 textAlign: 'right',123 },124 textContainer: {125 flex: 7,126 //alignItems: 'center',127 },128 textInput: {129 flex: 1,130 color: '#5A5B5D',131 height: 35,132 borderWidth: 1,133 borderColor: '#A9B1B9',134 fontSize: 18,135 padding: 4,136 margin: 2,137 },138 textAlignRight: {139 textAlign: 'right',140 },141 subTextInput: {142 color: '#8A7D88',143 fontWeight: 'normal',144 fontSize: 16,145 },146});...
formData.js
Source:formData.js
1import { validateEmail, validateRequired, validateCPF, validateMobile } from '../../../utils';2import { Dimensions } from 'react-native';3const { width: winWidth } = Dimensions.get('window');4export const formData = [5 {6 name: 'nome',7 label: 'Nome Completo',8 width: '100%',9 required: true,10 validate: [validateRequired],11 next: true,12 keyboardType: 'default',13 textContentType: 'none',14 autoCapitalize: 'words',15 inputType: 'text',16 group: 'dados_pessoais'17 },18 {19 name: 'cpf',20 label: 'CPF',21 width: '100%',22 required: true,23 maxLength: 14,24 format: 'cpf',25 validate: [validateRequired, validateCPF],26 next: false,27 hint: 'Digite apenas números',28 keyboardType: 'numeric',29 textContentType: 'none',30 disabledOnEdit: false,31 inputType: 'text',32 group: 'dados_pessoais'33 },34 {35 name: 'estado_civil',36 label: 'Estado Civil',37 width: '100%',38 required: true,39 validate: [validateRequired],40 group: 'dados_pessoais',41 inputType: 'select',42 options: 'estadoCivilList'43 },44 {45 name: 'nacionalidade',46 label: 'Nacionalidade',47 width: '100%',48 required: true,49 validate: [validateRequired],50 group: 'dados_pessoais',51 inputType: 'select',52 options: 'nacionalidadeList'53 },54 {55 name: 'profissao',56 label: 'Profissão',57 width: '100%',58 required: true,59 validate: [validateRequired],60 group: 'dados_pessoais',61 inputType: 'autocomplete'62 },63 {64 name: 'sexo',65 label: 'Sexo',66 width: '100%',67 required: true,68 validate: [validateRequired],69 group: 'dados_pessoais',70 inputType: 'select',71 options: 'sexoList'72 },73 {74 name: 'celular',75 label: 'DDD e Celular',76 width: winWidth <= 360 ? '100%' : '50%',77 required: true,78 maxLength: 15,79 format: 'ddd-mobile',80 validate: [validateRequired],81 next: true,82 hint: '(99) 99999 9999',83 keyboardType: 'numeric',84 textContentType: 'none',85 inputType: 'text',86 group: 'dados_pessoais'87 },88 {89 name: 'telefone_fixo',90 label: 'DDD e Tel. Fixo',91 width: winWidth <= 360 ? '100%' : '47%',92 required: false,93 maxLength: 14,94 format: 'ddd-phone',95 validate: false,96 next: true,97 hint: '(22) 2222 2222',98 keyboardType: 'numeric',99 textContentType: 'none',100 inputType: 'text',101 group: 'dados_pessoais'102 },103 {104 name: 'email',105 label: 'Email',106 width: '100%',107 required: false,108 validate: [validateEmail],109 next: true,110 keyboardType: 'email-address',111 textContentType: 'emailAddress',112 autoCapitalize: 'none',113 parse: 'trim',114 inputType: 'text',115 group: 'dados_pessoais'116 },117 {118 name: 'rg',119 label: 'RG',120 width: winWidth <= 360 ? '100%' : '48%',121 required: false,122 maxLength: 15,123 validate: false,124 next: true,125 hint: 'Digite apenas números',126 keyboardType: 'numeric',127 textContentType: 'none',128 inputType: 'text',129 group: 'dados_pessoais'130 },131 {132 name: 'data_nascimento',133 label: 'Data de Nasc.',134 width: winWidth <= 360 ? '100%' : '48%',135 required: false,136 maxLength: 10,137 format: 'dt-br',138 validate: false,139 next: true,140 hint: 'DD/MM/YYYY',141 keyboardType: 'numeric',142 textContentType: 'none',143 inputType: 'text',144 group: 'dados_pessoais'145 },146 {147 name: 'cep',148 label: 'CEP',149 width: '100%',150 required: false,151 maxLength: 8,152 validate: false,153 next: true,154 hint: 'Digite apenas números.',155 keyboardType: 'numeric',156 textContentType: 'none',157 inputType: 'text',158 group: 'endereco'159 },160 {161 name: 'logradouro',162 label: 'Endereço',163 width: '100%',164 required: false,165 validate: false,166 next: true,167 keyboardType: 'default',168 textContentType: 'none',169 autoCapitalize: 'words',170 inputType: 'text',171 group: 'endereco'172 },173 {174 name: 'numero',175 label: 'Número',176 width: '33%',177 required: false,178 validate: false,179 next: true,180 keyboardType: 'numeric',181 textContentType: 'none',182 inputType: 'text',183 group: 'endereco'184 },185 {186 name: 'complemento',187 label: 'Complemento',188 width: '63%',189 next: true,190 keyboardType: 'default',191 textContentType: 'none',192 autoCapitalize: 'words',193 inputType: 'text',194 group: 'endereco'195 },196 {197 name: 'bairro',198 label: 'Bairro',199 width: '100%',200 required: false,201 validate: false,202 next: true,203 keyboardType: 'default',204 textContentType: 'none',205 inputType: 'text',206 group: 'endereco'207 },208 {209 name: 'cidade',210 label: 'Cidade',211 width: '63%',212 required: false,213 validate: false,214 next: true,215 keyboardType: 'default',216 textContentType: 'none',217 inputType: 'text',218 group: 'endereco'219 },220 {221 name: 'estado',222 label: 'UF',223 width: '33%',224 required: false,225 next: false,226 maxLength: 2,227 validate: false,228 keyboardType: 'default',229 textContentType: 'none',230 inputType: 'text',231 group: 'endereco'232 }...
TSLongTextInput.js
Source:TSLongTextInput.js
1'use strict';2import React from 'react';3import {4 StyleSheet,5 View,6 Text,7 TextInput,8} from 'react-native';9var WithLabel = React.createClass({10 render: function () {11 return (12 <View style={styles.fieldContainer}>13 <Text style={styles.label}>{this.props.label}</Text>14 <TextInput style={styles.textInput}15 keyboardType={this.props.keyboardType}16 placeholder={this.props.placeholder}17 multiline={true}18 value={this.props.value}19 onChangeText={this.props.onChangeText}/>20 </View>21 );22 },23});24var WithoutLabel = React.createClass({25 render: function () {26 return (27 <View style={styles.fieldContainer}>28 <TextInput style={[styles.textInput,29 this.props.subItem=='Y' && styles.subTextInput,30 (this.props.keyboardType == 'decimal-pad' || this.props.keyboardType == 'numeric') && styles.textAlignRight]}31 keyboardType={this.props.keyboardType}32 placeholder={this.props.placeholder}33 multiline={true}34 value={this.props.value}35 onChangeText={this.props.onChangeText}/>36 </View>37 )38 }39});40module.exports = React.createClass({41 render() {42 var fieldRender;43 var keyboardType = this.props.keyboardType;44 if (keyboardType == null || keyboardType == '') {45 keyboardType = 'default';46 }47 if (this.props.label == null || this.props.label == '') {48 fieldRender = <WithoutLabel subItem={this.props.subItem}49 keyboardType={keyboardType}50 placeholder={this.props.placeholder}51 value={this.props.value}52 onChangeText={this.props.onChangeText}/>;53 } else {54 fieldRender = <WithLabel label={this.props.label}55 keyboardType={keyboardType}56 placeholder={this.props.placholder}57 value={this.props.value}58 onChangeText={this.props.onChangeText}/>;59 }60 return (61 <View>{fieldRender}</View>62 );63 }64});65var styles = StyleSheet.create({66 fieldContainer: {67 flexDirection: 'column',68 },69 label: {70 marginTop: 5,71 marginLeft: 4,72 fontSize: 18,73 fontWeight: 'bold',74 color: '#5A5B5D',75 textAlign: 'left',76 },77 textInput: {78 flex: 1,79 color: '#5A5B5D',80 height: 100,81 borderWidth: 1,82 borderColor: '#A9B1B9',83 fontSize: 18,84 padding: 4,85 margin: 2,86 },87 textAlignRight: {88 textAlign: 'right',89 },90 subTextInput: {91 color: '#8A7D88',92 },...
KeyboardType.js
Source:KeyboardType.js
1/**2 * @namespace ui 3 * @requires 4 * @class KeyboardType5 * @author Yehia Shouman6 */7var KeyboardType = function() {8 this.__getClassType = function() {9 return "KeyboardType";10 };11};12KeyboardType.prototype = new Object();13KeyboardType.constructor = KeyboardType;14KeyboardType.ALPHANUMERIC = "alphanumeric";15KeyboardType.KEYPAD = "keypad";...
Using AI Code Generation
1const { webkit } = require('playwright');2(async () => {3 const browser = await webkit.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.keyboard().type('Hello World');7 await browser.close();8})();9const { webkit } = require('playwright');10(async () => {11 const browser = await webkit.launch();12 const context = await browser.newContext();13 const page = await context.newPage();14 await page.keyboard().press('ArrowDown');15 await browser.close();16})();17const { webkit } = require('playwright');18(async () => {19 const browser = await webkit.launch();20 const context = await browser.newContext();21 const page = await context.newPage();22 const text = await page.$eval('a', element => element.textContent);23 console.log(text);24 await browser.close();25})();26const { webkit } = require('playwright');27(async () => {28 const browser = await webkit.launch();29 const context = await browser.newContext();30 const page = await context.newPage();31 const value = await page.$eval('input', element => element.value);32 console.log(value);33 await browser.close();34})();
Using AI Code Generation
1const { webkit } = require('playwright');2(async () => {3 const browser = await webkit.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.keyboard.type('Hello World');7 await browser.close();8})();9const { webkit } = require('playwright');10(async () => {11 const browser = await webkit.launch();12 const context = await browser.newContext();13 const page = await context.newPage();14 await page.type('Hello World');15 await browser.close();16})();17const { webkit } = require('playwright');18(async () => {19 const browser = await webkit.launch();20 const context = await browser.newContext();21 const page = await context.newPage();22 await page.click('Hello World');23 await browser.close();24})();25const { webkit } = require('playwright');26(async () => {27 const browser = await webkit.launch();28 const context = await browser.newContext();29 const page = await context.newPage();30 await page.fill('Hello World');31 await browser.close();32})();
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch({headless: false});4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.keyboard.type('Hello World');7 await browser.close();8})();9const {chromium} = require('playwright');10(async () => {11 const browser = await chromium.launch({headless: false});12 const context = await browser.newContext();13 const page = await context.newPage();14 await page.type('input[name="q"]', 'Hello World');15 await browser.close();16})();17const {chromium} = require('playwright');18(async () => {19 const browser = await chromium.launch({headless: false});20 const context = await browser.newContext();21 const page = await context.newPage();22 await page.fill('input[name="q"]', 'Hello World');23 await browser.close();24})();25const {chromium} = require('playwright');26(async () => {27 const browser = await chromium.launch({headless: false});28 const context = await browser.newContext();29 const page = await context.newPage();30 await page.fill('input[name="q"]', 'Hello World');31 await page.press('input[name="q"]', 'Enter');32 await browser.close();33})();34const {chromium} = require('playwright');35(async () => {36 const browser = await chromium.launch({headless: false});37 const context = await browser.newContext();38 const page = await context.newPage();39 await page.click('input[name="q"]');40 await browser.close();41})();42const {chromium} = require('playwright');
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.press('input[name="q"]', 'ArrowDown');7 await page.keyboard.type('Hello World');8 await page.screenshot({ path: 'example.png' });9 await browser.close();10})();11const { chromium } = require('playwright');12(async () => {13 const browser = await chromium.launch();14 const context = await browser.newContext();15 const page = await context.newPage();16 await page.type('input[name="q"]', 'Hello World');17 await page.screenshot({ path: 'example.png' });18 await browser.close();19})();20const { chromium } = require('playwright');21(async () => {22 const browser = await chromium.launch();23 const context = await browser.newContext();24 const page = await context.newPage();25 await page.keyboard.press('ArrowDown');26 await page.keyboard.type('Hello World');27 await page.screenshot({ path: 'example.png' });28 await browser.close();29})();30const { chromium } = require('playwright');31(async () => {32 const browser = await chromium.launch();33 const context = await browser.newContext();34 const page = await context.newPage();35 await page.type('input[name="q"]', 'Hello World');36 await page.screenshot({ path: 'example.png' });37 await browser.close();38})();39const { chromium } = require('playwright');40(async () => {41 const browser = await chromium.launch();42 const context = await browser.newContext();43 const page = await context.newPage();44 await page.type('input[name="q"]', 'Hello World');
Using AI Code Generation
1const { webkit } = require('playwright');2(async () => {3 const browser = await webkit.launch();4 const context = await browser.newContext({5 userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36',6 extraHTTPHeaders: {},7 proxy: {8 }9 });10 const page = await context.newPage();11 await page.keyboard().type('Hello World!');12 await browser.close();13})();14const { webkit } = require('playwright');15(async () => {16 const browser = await webkit.launch();17 const context = await browser.newContext({18 userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36',19 extraHTTPHeaders: {},20 proxy: {21 }22 });23 const page = await context.newPage();
Using AI Code Generation
1const { webkit } = require('playwright');2(async () => {3 const browser = await webkit.launch();4 const context = await browser.newContext({5 recordVideo: {6 size: { width: 1280, height: 720 },7 },8 });9 const page = await context.newPage();10 await page.keyboard().type('Hello World');11 await page.screenshot({ path: 'example.png' });12 await browser.close();13})();
Using AI Code Generation
1const {chromium, devices} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext({5 geolocation: { longitude: 12.492507, latitude: 41.889938 },6 });7 const page = await context.newPage();8 await page.click('text="Your location"');9 await page.keyboard.type('San Francisco');10 await page.keyboard.press('Enter');11 await page.screenshot({ path: `example.png` });12 await browser.close();13})();
Using AI Code Generation
1const {keyboardType} = require("@playwright/test/lib/server/keyboard");2const {keyboardDown} = require("@playwright/test/lib/server/keyboard");3const {keyboardUp} = require("@playwright/test/lib/server/keyboard");4const {mouseMove} = require("@playwright/test/lib/server/mouse");5const {mouseDown} = require("@playwright/test/lib/server/mouse");6const {mouseUp} = require("@playwright/test/lib/server/mouse");7const {mouseClick} = require("@playwright/test/lib/server/mouse");8const {touchscreenTap} = require("@playwright/test/lib/server/touchscreen");9const {touchscreenDown} = require("@playwright/test/lib/server/touchscreen");10const {touchscreenUp} = require("@playwright/test/lib/server/touchscreen");11const {touchscreenMove} = require("@playwright/test/lib/server/touchscreen");12const {touchscreenScroll} = require("@playwright/test/lib/server/touchscreen");13const {touchscreenMultiTap} = require("@playwright/test/lib/server/touchscreen");14const {touchscreenDoubleTap} = require("@playwright/test/lib/server/touchscreen");15const {touchscreenPress} = require("@playwright/test/lib/server/touchscreen");16const {touchscreenSwipe} = require("@playwright/test/lib/server/touchscreen");17const {touchscreenPinch} = require
Using AI Code Generation
1const {keyboardType} = require('playwright/lib/cjs/server/keyboardLayout.js');2const {keyDefinitions} = require('playwright/lib/cjs/server/keyboardLayout.js');3const {chromium} = require('playwright');4(async () => {5 const browser = await chromium.launch();6 const context = await browser.newContext();7 const page = await context.newPage();8 await page.keyboard.press('Shift');9 await page.keyboard.type('hello');10 await page.waitForTimeout(1000);11 await page.keyboard.down('Shift');12 await page.keyboard.press('KeyH');13 await page.keyboard.up('Shift');14 await page.waitForTimeout(1000);15 await page.keyboard.press('KeyH');16 await page.waitForTimeout(1000);17 await page.keyboard.down('Shift');18 await page.keyboard.press('h');19 await page.keyboard.up('Shift');20 await page.waitForTimeout(1000);21 await page.keyboard.press('h');22 await page.waitForTimeout(1000);23 await page.keyboard.press('Shift');24 await page.keyboard.type('hello');25 await page.waitForTimeout(1000);26 await page.keyboard.press('Shift');27 await page.keyboard.type('hello');28 await page.waitForTimeout(1000);29 await page.keyboard.down('Shift');30 await page.keyboard.press('h');31 await page.keyboard.up('Shift');32 await page.waitForTimeout(1000);33 await page.keyboard.press('h');34 await page.waitForTimeout(1000);35 await page.keyboard.press('Shift');36 await page.keyboard.type('hello');37 await page.waitForTimeout(1000);38 await page.keyboard.press('Shift');39 await page.keyboard.type('hello');40 await page.waitForTimeout(1000);41 await page.keyboard.down('Shift');42 await page.keyboard.press('h');43 await page.keyboard.up('Shift');44 await page.waitForTimeout(1000);45 await page.keyboard.press('h');46 await page.waitForTimeout(1000);47 await page.keyboard.press('Shift');48 await page.keyboard.type('hello');49 await page.waitForTimeout(1000);50 await page.keyboard.press('Shift');51 await page.keyboard.type('hello');52 await page.waitForTimeout(1000);53 await page.keyboard.down('Shift');54 await page.keyboard.press('h');
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!