Best JavaScript code snippet using playwright-internal
FormTemplate.js
Source:FormTemplate.js
1import React from 'react';2import MainContext from '../../context/MainContext'3function test() {4 //const {basicData,setBasicData}=React.useContext(MainContext)5}6const testForm={7 id:{8 lb:'รหัส', 9 templateType:"string" , 10 cName:"xc6 sc12 p-1 bd-lightGray", 11 subCName:["xc4 div-center","xc8 p-2 div-start"], 12 inputType:"number", 13 placeholder:'', 14 autoFocus:"autoFocus"15 },16 date:{17 lb:'วัà¸à¸à¸µà¹', 18 templateType:"string" , 19 cName:"xc3 sc12 p-1 bd-lightGray", 20 subCName:["xc4 div-center","xc8 div-start"], 21 inputType:"thaiDate", 22 placeholder:'', 23 },24 title:{25 lb:'à¸à¸³à¸à¸³à¸«à¸à¹à¸²', 26 templateType:"string" , 27 cName:"xc3 sc12 p-1 bd-lightGray", 28 subCName:["xc4 div-center","xc8 p-2 div-start"], 29 inputType:"select", 30 placeholder:'', 31 selectDataKey:"basicData",32 selectObj:'title'33 },34 name:{35 lb:'à¸à¸·à¹à¸', 36 templateType:"string" , 37 cName:"xc3 sc12 p-1 bd-lightGray", 38 subCName:["xc4 div-center","xc8 p-2 div-start"], 39 inputType:"text", 40 placeholder:'', 41 },42 password:43 { lb:'รหัสรà¹à¸²à¸', 44 templateType:"string" , 45 cName:"xc6 sc12 p-2 bd-lightGray", 46 subCName:["xc4 div-center","xc8 p-2 div-start"], 47 inputType:"password", 48 placeholder:'', 49 },50 icon:{51 lb:"à¸à¸¥à¸¸à¹à¸¡à¸à¸¹à¹à¸à¹à¸²",52 templateType:"icon",53 cName:"xc4 sc12 p-1", 54 subCName:["xc6 div-center","xc6 div-start"], 55 inputType:"searchIcon",56 iconActionIdx:0,57 },58 groupId:{59 lb:'รหัสà¸à¸¥à¸¸à¹à¸¡', 60 templateType:"string" , 61 cName:"xc4 sc12 p-1 bd-lightGray", 62 subCName:["xc4 div-center","xc8 div-start"], 63 inputType:"number", 64 placeholder:'', 65 },66 groupName:{67 lb:'à¸à¸£à¸°à¹à¸ à¸à¸à¸¥à¸¸à¹à¸¡', 68 templateType:"string" , 69 cName:"xc3 sc12 p-1 bd-lightGray", 70 subCName:["xc4 div-center","xc8 div-start"], 71 inputType:"text", 72 placeholder:'', 73 unchangeable:true74 },75 isRawMat:{76 lb:'à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸', 77 templateType:"string" , 78 cName:"xc3 sc12 p-1 bd-lightGray", 79 subCName:["xc4 div-center","xc8 p-2 div-start"], 80 inputType:"checkbox", 81 placeholder:'', 82 },83 remark:{84 lb:'หมายà¹à¸«à¸à¸¸', 85 templateType:"string" , 86 cName:"xc12 sc12 p-1 bd-lightGray", 87 subCName:["xc2 alignSelfStart","xc10 div-start"], 88 inputType:"textarea", 89 placeholder:'', 90 textRow:391 },92 phone:{93 lb:'à¹à¸à¸£à¸¨à¸±à¸à¸à¹', 94 templateType:"array" , 95 cName:"xc3 sc12 p-1 bd-lightGray", 96 subCName:["xc4 div-center","xc8 p-2 div-start"], 97 inputType:"text", 98 placeholder:'', 99 },100 address:{101 lb:'à¸à¸µà¹à¸à¸¢à¸¹à¹à¸£à¸à¸', 102 templateType:"arrayObject", 103 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 104 cName:"xc6 sc12 p-1 bd-lightGray", 105 subCName:["xc12 div-center","xc12 p-2 div-start"], 106 placeholder:'',107 subFormTemplate:{108 number:{109 lb:'à¹à¸¥à¸à¸à¸µà¹', 110 templateType:"string" , 111 cName:"xc12 sc12 p-1 bd-lightGray", 112 subCName:["xc4 div-center","xc8 p-2 div-start"], 113 inputType:"text", 114 placeholder:'', 115 },116 tambon:{117 lb:'à¸à¸³à¸à¸¥', 118 templateType:"string" , 119 cName:"xc12 sc12 p-1 bd-lightGray", 120 subCName:["xc4 div-center","xc8 p-2 div-start"], 121 inputType:"text", 122 placeholder:'', 123 }124 125 }126 127 }, 128 mainaddress:{129 lb:'à¸à¸µà¹à¸à¸¢à¸¹à¹à¸«à¸¥à¸±à¸', 130 templateType:"object", 131 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 132 cName:"xc6 sc12 p-1 bd-lightGray", 133 subCName:["xc12 div-center","xc12 p-2 div-start"], 134 placeholder:'',135 subFormTemplate:{136 number:{137 lb:'à¹à¸¥à¸à¸à¸µà¹', 138 templateType:"string" , 139 cName:"xc12 sc12 p-1 bd-lightGray", 140 subCName:["xc4 div-center","xc8 p-2 div-start"], 141 inputType:"text", 142 placeholder:'', 143 },144 tambon:{145 lb:'à¸à¸³à¸à¸¥', 146 templateType:"string" , 147 cName:"xc12 sc12 p-1 bd-lightGray", 148 subCName:["xc4 div-center","xc8 p-2 div-start"], 149 inputType:"text", 150 placeholder:'', 151 }152 }153 154 }, 155 detail:{156 lb: "รายละà¹à¸à¸µà¸¢à¸",157 templateType:"arrayObjectInTable",158 cName:"",159 subFormTemplate:{160 161 icon:{162 templateType:"icon",163 subCName:[60],164 inputType:"icon",165 iconActionIdx:1,166 },167 168 id:{169 lb:"à¹à¸à¸à¸µ",170 templateType:"number",171 subCName:[60,""],172 inputType:"number",173 placeholder:"",174 aotuFocus:"autoFocus"175 },176 barcode:{177 lb:"à¸à¸²à¸£à¹à¹à¸à¹à¸",178 templateType:"string",179 subCName:[100,""],180 inputType:"text",181 placeholder:"", 182 nextEnter:{nextKey1:["detail",0,"quantity"],lastKey:null}183 },184 name:{185 lb:"à¸à¸·à¹à¸",186 templateType:"string",187 subCName:[240,""],188 inputType:"text",189 placeholder:"", 190 },191 groupId:{192 lb:"à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡",193 templateType:"number",194 subCName:[60,""],195 inputType:"number",196 placeholder:"",197 aotuFocus:"autoFocus"198 },199 groupName:{200 lb:"à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡",201 templateType:"string",202 subCName:[90,""],203 inputType:"text",204 placeholder:"", 205 },206 quantity:{207 lb:"à¸à¸³à¸à¸§à¸",208 templateType:"string",209 subCName:[60,""],210 inputType:"number",211 placeholder:"", 212 nextEnter:{nextKey1:["detail",1,"barcode"],lastKey:"endForm"}213 },214 unit:{215 lb:"หà¸à¹à¸§à¸¢",216 templateType:"string",217 subCName:[80,""],218 inputType:"select",219 placeholder:"", 220 //selectObj:["à¸à¸²à¸¢","à¸à¸²à¸"]221 selectDataKey:"basicData",222 selectObj:'unit'223 },224 price:{225 lb:"ราà¸à¸²",226 templateType:"string",227 subCName:[100,""],228 inputType:"number",229 placeholder:"", 230 },231 result:{232 lb:"รวม",233 templateType:"string",234 subCName:[100,""],235 inputType:"number",236 placeholder:"", 237 },238 remark:{239 lb:"หมายà¹à¸«à¸à¸¸",240 templateType:"string",241 subCName:[200,""],242 inputType:"text",243 placeholder:"", 244 },245 isRawMat:{246 lb:"à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸",247 templateType:"boolean",248 subCName:[40,""],249 inputType:"checkbox",250 placeholder:"", 251 }252 }253 }254}255const shopSignUpForm={256 shopName:257 { lb:'à¸à¸·à¹à¸à¸£à¹à¸²à¸', 258 templateType:"string" , 259 cName:"xc6 sc12 p-2 bd-lightGray", 260 subCName:["xc4 div-center","xc8 p-2 div-start"], 261 inputType:"text", 262 placeholder:'', 263 autoFocus:"autoFocus"264 },265 password:266 { lb:'รหัสรà¹à¸²à¸', 267 templateType:"string" , 268 cName:"xc6 sc12 p-2 bd-lightGray", 269 subCName:["xc4 div-center","xc8 p-2 div-start"], 270 inputType:"password", 271 placeholder:'', 272 },273 ownerName:274 { lb:'à¸à¸·à¹à¸à¸à¸¹à¹à¹à¸à¹', 275 templateType:"string" , 276 cName:"xc6 sc12 p-2 bd-lightGray", 277 subCName:["xc4 div-center","xc8 p-2 div-start"], 278 inputType:"text", 279 placeholder:'', 280 },281 ownerPassword:282 { lb:'รหัสà¸à¸¹à¹à¹à¸à¹', 283 templateType:"string" , 284 cName:"xc6 sc12 p-2 bd-lightGray", 285 subCName:["xc4 div-center","xc8 p-2 div-start"], 286 inputType:"password", 287 placeholder:'', 288 },289 ownerEmail: { 290 lb:'à¸à¸µà¹à¸¡à¸¥à¸à¸¹à¹à¹à¸à¹', 291 templateType:"string" , 292 cName:"xc6 sc12 p-2 bd-lightGray", 293 subCName:["xc4 div-center","xc8 p-2 div-start"], 294 inputType:"text", 295 placeholder:'', 296 }, 297}298//====================299const shopLogInForm={300 shopName:301 { lb:'à¸à¸·à¹à¸à¸£à¹à¸²à¸', 302 templateType:"string" , 303 cName:"xc6 sc12 p-1 bd-lightGray", 304 subCName:["xc4 div-center","xc8 p-2 div-start"], 305 inputType:"text", 306 placeholder:'', 307 autoFocus:"autoFocus"308 },309 password:310 { lb:'รหัสรà¹à¸²à¸', 311 templateType:"string" , 312 cName:"xc6 sc12 p-1 bd-lightGray", 313 subCName:["xc4 div-center","xc8 p-2 div-start"], 314 inputType:"password", 315 placeholder:'', 316 },317}318//=======================319const shopChangePasswordForm={320 shopName:321 { lb:'à¸à¸·à¹à¸à¸£à¹à¸²à¸', 322 templateType:"string" , 323 cName:"xc6 sc12 p-1 bd-lightGray", 324 subCName:["xc4 div-center","xc8 p-2 div-start"], 325 inputType:"text", 326 placeholder:'', 327 autoFocus:"autoFocus"328 },329 password:330 { lb:'รหัสรà¹à¸²à¸', 331 templateType:"string" , 332 cName:"xc6 sc12 p-1 bd-lightGray", 333 subCName:["xc4 div-center","xc8 p-2 div-start"], 334 inputType:"password", 335 placeholder:'', 336 },337 newPassword1:338 { lb:'รหัสรà¹à¸²à¸à¹à¸«à¸¡à¹', 339 templateType:"string" , 340 cName:"xc6 sc12 p-1 bd-lightGray", 341 subCName:["xc4 div-center","xc8 p-2 div-start"], 342 inputType:"password", 343 placeholder:'', 344 },345 newPassword2:346 { lb:'ยืà¸à¸¢à¸±à¸à¸£à¸«à¸±à¸ªà¸£à¹à¸²à¸à¹à¸«à¸¡à¹', 347 templateType:"string" , 348 cName:"xc6 sc12 p-1 bd-lightGray", 349 subCName:["xc4 div-center","xc8 p-2 div-start"], 350 inputType:"password", 351 placeholder:'', 352 },353}354const addUserForm={355 id:{356 lb:'รหัส', 357 templateType:"string" , 358 cName:"xc6 sc12 p-1 bd-lightGray", 359 subCName:["xc4 div-center","xc8 p-2 div-start"], 360 inputType:"number", 361 placeholder:'', 362 autoFocus:"autoFocus"363 },364 username:{365 lb:'ยูสà¹à¸à¸à¸£à¹à¹à¸à¸¡', 366 templateType:"string" , 367 cName:"xc6 sc12 p-1 bd-lightGray", 368 subCName:["xc4 div-center","xc8 p-2 div-start"], 369 inputType:"text", 370 placeholder:''371 },372 password:{373 lb:'รหัส', 374 templateType:"string" , 375 cName:"xc6 sc12 p-1 bd-lightGray", 376 subCName:["xc4 div-center","xc8 p-2 div-start"], 377 inputType:"password", 378 placeholder:'', 379 },380 userLevel:{381 lb:'ระà¸à¸±à¸à¸à¸¹à¹à¹à¸à¹', 382 templateType:"string" , 383 cName:"xc6 sc12 p-1 bd-lightGray", 384 subCName:["xc4 div-center","xc8 p-2 div-start"], 385 inputType:"select", 386 placeholder:'', 387 //selectObj:["à¸à¸²à¸¢","à¸à¸²à¸"]388 selectDataKey:"basicData",389 selectObj:'userLevel'390 },391 name:{392 lb:'à¸à¸·à¹à¸à¸à¸£à¸´à¸', 393 templateType:"string" , 394 cName:"xc6 sc12 p-1 bd-lightGray", 395 subCName:["xc4 div-center","xc8 p-2 div-start"], 396 inputType:"text", 397 placeholder:'', 398 },399 surname:{400 lb:'à¸à¸²à¸¡à¸ªà¸à¸¸à¸¥', 401 templateType:"string" , 402 cName:"xc6 sc12 p-1 bd-lightGray", 403 subCName:["xc4 div-center","xc8 p-2 div-start"], 404 inputType:"text", 405 placeholder:'', 406 }407}408const logInForm={409 username:{410 lb:'ยูสà¹à¸à¸à¸£à¹à¹à¸à¸¡', 411 templateType:"string" , 412 cName:"xc6 sc12 p-1 bd-lightGray", 413 subCName:["xc4 div-center","xc8 p-2 div-start"], 414 inputType:"text", 415 placeholder:'',416 autoFocus:"autoFocus"417 },418 password:{419 lb:'รหัส', 420 templateType:"string" , 421 cName:"xc6 sc12 p-1 bd-lightGray", 422 subCName:["xc4 div-center","xc8 p-2 div-start"], 423 inputType:"password", 424 placeholder:'', 425 } 426}427const changePasswordForm={428 username:{429 lb:'ยูสà¹à¸à¸à¸£à¹à¹à¸à¸¡', 430 templateType:"string" , 431 cName:"xc6 sc12 p-1 bd-lightGray", 432 subCName:["xc4 div-center","xc8 p-2 div-start"], 433 inputType:"text", 434 placeholder:'', 435 autoFocus:"autoFocus"436 },437 password:{438 lb:'รหัส', 439 templateType:"string" , 440 cName:"xc6 sc12 p-1 bd-lightGray", 441 subCName:["xc4 div-center","xc8 p-2 div-start"], 442 inputType:"password", 443 placeholder:'', 444 },445 newPassword1:{ 446 lb:'รหัสà¹à¸«à¸¡à¹', 447 templateType:"string" , 448 cName:"xc6 sc12 p-1 bd-lightGray", 449 subCName:["xc4 div-center","xc8 p-2 div-start"], 450 inputType:"password", 451 placeholder:'', 452 },453 newPassword2:{ 454 lb:'ยืà¸à¸¢à¸±à¸à¸£à¸«à¸±à¸ªà¹à¸«à¸¡à¹', 455 templateType:"string" , 456 cName:"xc6 sc12 p-1 bd-lightGray", 457 subCName:["xc4 div-center","xc8 p-2 div-start"], 458 inputType:"password", 459 placeholder:'', 460 },461}462const partnerForm={463 id:{464 lb:'à¹à¸à¸à¸µ', 465 templateType:"string" , 466 cName:"xc3 sc12 p-1 bd-lightGray", 467 subCName:["xc4 div-center","xc8 p-2 div-start"], 468 inputType:"number", 469 placeholder:'', 470 autoFocus:"autoFocus",471 //calculation:{method:"autoId"},472 },473 title:{474 lb:'à¸à¸³à¸à¸³à¸«à¸à¹à¸²', 475 templateType:"string" , 476 cName:"xc3 sc12 p-1 bd-lightGray", 477 subCName:["xc4 div-center","xc8 p-2 div-start"], 478 inputType:"select", 479 placeholder:'', 480 selectDataKey:"basicData",481 selectObj:'title'482 },483 name:{484 lb:'à¸à¸·à¹à¸', 485 templateType:"string" , 486 cName:"xc3 sc12 p-1 bd-lightGray", 487 subCName:["xc4 div-center","xc8 p-2 div-start"], 488 inputType:"text", 489 placeholder:'', 490 },491 phone:{492 lb:'à¹à¸à¸£à¸¨à¸±à¸à¸à¹', 493 templateType:"array" , 494 cName:"xc3 sc12 p-1 bd-lightGray", 495 subCName:["xc4 div-center","xc8 p-2 div-start"], 496 inputType:"text", 497 placeholder:'', 498 },499 //=====================500 icon:{501 lb:"à¸à¸¥à¸¸à¹à¸¡à¸à¸¹à¹à¸à¹à¸²",502 templateType:"icon",503 cName:"xc4 sc12 p-1", 504 subCName:["xc6 div-center","xc6 div-start"], 505 inputType:"searchIcon",506 iconActionIdx:0,507 },508 partnerType:{509 lb:'à¸à¸£à¸°à¹à¸ à¸à¸à¸¹à¹à¸à¹à¸²', 510 templateType:"string" , 511 cName:"xc4 sc12 p-1 bd-lightGray", 512 subCName:["xc4 div-center","xc8 p-2 div-start"], 513 inputType:"select", 514 placeholder:'', 515 selectDataKey:"basicData",516 selectObj:'partnerType'517 //disabled:"disabled"518 },519 //==============================520 remark:{521 lb:'หมายà¹à¸«à¸à¸¸', 522 templateType:"string" , 523 cName:"xc12 sc12 p-1 bd-lightGray", 524 subCName:["xc2 alignSelfStart","xc10 div-start"], 525 inputType:"textarea", 526 placeholder:'', 527 textRow:3528 },529 address:{530 lb:'à¸à¸µà¹à¸à¸¢à¸¹à¹', 531 templateType:"arrayObject", 532 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 533 cName:"xc6 sc12 p-1 bd-lightGray", 534 subCName:["xc12 div-center","xc12 p-2 div-start"], 535 placeholder:'',536 subFormTemplate:{537 number:{538 lb:'à¹à¸¥à¸à¸à¸µà¹', 539 templateType:"string" , 540 cName:"xc12 sc12 p-1 bd-lightGray", 541 subCName:["xc4 div-center","xc8 p-2 div-start"], 542 inputType:"text", 543 placeholder:'', 544 },545 tambon:{546 lb:'à¸à¸³à¸à¸¥', 547 templateType:"string" , 548 cName:"xc12 sc12 p-1 bd-lightGray", 549 subCName:["xc4 div-center","xc8 p-2 div-start"], 550 inputType:"text", 551 placeholder:'', 552 },553 district:{554 lb:'à¸à¸³à¹à¸ à¸', 555 templateType:"string" , 556 cName:"xc12 sc12 p-1 bd-lightGray", 557 subCName:["xc4 div-center","xc8 p-2 div-start"], 558 inputType:"text", 559 placeholder:'', 560 },561 province:{562 lb:'à¸à¸±à¸à¸«à¸§à¸±à¸', 563 templateType:"string" , 564 cName:"xc12 sc12 p-1 bd-lightGray", 565 subCName:["xc4 div-center","xc8 p-2 div-start"], 566 inputType:"text", 567 placeholder:'', 568 },569 postcode:{570 lb:'รหัสà¹à¸à¸£à¸©à¸à¸µà¸¢à¹', 571 templateType:"string" , 572 cName:"xc12 sc12 p-1 bd-lightGray", 573 subCName:["xc4 div-center","xc8 p-2 div-start"], 574 inputType:"text", 575 placeholder:'', 576 },577 }578 579 }, 580}581const groupForm={582 id:{583 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²', 584 templateType:"string" , 585 cName:"xc6 sc12 p-1 bd-lightGray", 586 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 587 inputType:"number", 588 placeholder:'', 589 autoFocus:"autoFocus"590 },591 groupName:{592 lb:'à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²', 593 templateType:"string" , 594 cName:"xc6 sc12 p-1 bd-lightGray", 595 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 596 inputType:"text", 597 placeholder:'', 598 },599 /*600 children:{601 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¸¢à¹à¸à¸¢', 602 templateType:"array" , 603 cName:"xc6 sc12 p-1 bd-lightGray", 604 subCName:["xc4 div-center","xc8 div-start"], 605 inputType:"number", 606 placeholder:'', 607 },*/608 parentId:{609 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¹à¸¡à¹', 610 templateType:"string" , 611 cName:"xc6 sc12 p-1 bd-lightGray", 612 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 613 inputType:"number", 614 placeholder:'', 615 //disabled:"disabled"616 },617}618//===============================619const groupEditForm={620 id:{621 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²', 622 templateType:"string" , 623 cName:"xc6 sc12 p-1 bd-lightGray", 624 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 625 inputType:"number", 626 placeholder:'', 627 autoFocus:"autoFocus",628 disabled:"disabled"629 },630 newId:{631 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²à¹à¸«à¸¡à¹', 632 templateType:"string" , 633 cName:"xc6 sc12 p-1 bd-lightGray", 634 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 635 inputType:"number", 636 placeholder:'', 637 },638 groupName:{639 lb:'à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²', 640 templateType:"string" , 641 cName:"xc6 sc12 p-1 bd-lightGray", 642 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 643 inputType:"text", 644 placeholder:'', 645 },646 /*647 children:{648 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¸¢à¹à¸à¸¢', 649 templateType:"array" , 650 cName:"xc6 sc12 p-1 bd-lightGray", 651 subCName:["xc4 div-center","xc8 div-start"], 652 inputType:"number", 653 placeholder:'', 654 },*/655 parentId:{656 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¹à¸¡à¹', 657 templateType:"string" , 658 cName:"xc6 sc12 p-1 bd-lightGray", 659 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 660 inputType:"number", 661 placeholder:'', 662 disabled:"disabled"663 },664 newParentId:{665 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡à¹à¸¡à¹à¹à¸«à¸¡à¹', 666 templateType:"string" , 667 cName:"xc6 sc12 p-1 bd-lightGray", 668 subCName:["xc4 p-2 div-center","xc8 p-2 div-start"], 669 inputType:"number", 670 placeholder:'', 671 },672}673//================================674const productWithoutDetailForm={675 id:{676 lb:'à¹à¸à¸à¸µ', 677 templateType:"string" , 678 cName:"xc6 sc12 p-1 bd-lightGray", 679 subCName:["xc4 div-center","xc8 p-2 div-start"], 680 inputType:"number", 681 placeholder:'', 682 autoFocus:"autoFocus"683 },684 barcode:{685 lb:'à¸à¸²à¸£à¹à¹à¸à¹à¸', 686 templateType:"string" , 687 cName:"xc6 sc12 p-1 bd-lightGray", 688 subCName:["xc4 div-center","xc8 p-2 div-start"], 689 inputType:"text", 690 placeholder:'', 691 },692 name:{693 lb:'à¸à¸·à¹à¸', 694 templateType:"string" , 695 cName:"xc6 sc12 p-1 bd-lightGray", 696 subCName:["xc4 div-center","xc8 p-2 div-start"], 697 inputType:"text", 698 placeholder:'', 699 },700 groupId:{701 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡', 702 templateType:"string" , 703 cName:"xc6 sc12 p-1 bd-lightGray", 704 subCName:["xc4 div-center","xc8 p-2 div-start"], 705 inputType:"number", 706 placeholder:'', 707 //disabled:"disabled"708 },709 groupName:{710 lb:'à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡', 711 templateType:"string" , 712 cName:"xc6 sc12 p-1 bd-lightGray", 713 subCName:["xc4 div-center","xc8 p-2 div-start"], 714 inputType:"text", 715 placeholder:'', 716 //disabled:"disabled"717 },718 unit:{719 lb:'หà¸à¹à¸§à¸¢', 720 templateType:"string" , 721 cName:"xc6 sc12 p-1 bd-lightGray", 722 subCName:["xc4 div-center","xc8 p-2 div-start"], 723 inputType:"select", 724 placeholder:'', 725 selectDataKey:"basicData",726 selectObj:'unit'727 },728 isRawMat:{729 lb:'à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸', 730 templateType:"string" , 731 cName:"xc6 sc12 p-1 bd-lightGray", 732 subCName:["xc4 div-center","xc8 p-2 div-start"], 733 inputType:"checkbox", 734 placeholder:'', 735 },736 737 stock:{738 lb:'ยà¸à¸à¸ªà¸à¹à¸à¸', 739 templateType:"string" , 740 cName:"xc6 sc12 p-1 bd-lightGray", 741 subCName:["xc4 div-center","xc8 p-2 div-start"], 742 inputType:"number", 743 placeholder:'', 744 //disabled:"disabled"745 },746 order:{747 lb:'ยà¸à¸à¸à¸à¸', 748 templateType:"string" , 749 cName:"xc6 sc12 p-1 bd-lightGray", 750 subCName:["xc4 div-center","xc8 p-2 div-start"], 751 inputType:"number", 752 placeholder:'', 753 //disabled:"disabled"754 },755 price:{756 lb:'ราà¸à¸²à¸à¹à¸à¸«à¸à¹à¸§à¸¢', 757 templateType:"arrayObject", 758 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 759 cName:"xc6 sc12 p-1 bd-lightGray", 760 subCName:["xc12 div-center","xc12 p-2 div-start"], 761 placeholder:'',762 subFormTemplate:{763 price:{764 lb:'ราà¸à¸²', 765 templateType:"string" , 766 cName:"xc12 sc12 p-1 bd-lightGray", 767 subCName:["xc4 div-center","xc8 p-2 div-start"], 768 inputType:"number", 769 placeholder:'', 770 },771 remark:{772 lb:'หมายà¹à¸«à¸à¸¸', 773 templateType:"string" , 774 cName:"xc12 sc12 p-1 bd-lightGray", 775 subCName:["xc4 div-center","xc8 p-2 div-start"], 776 inputType:"text", 777 placeholder:'', 778 },779 }}, 780 remark:{781 lb:'หมายà¹à¸«à¸à¸¸', 782 templateType:"string" , 783 cName:"xc12 sc12 p-1 bd-lightGray", 784 subCName:["xc2 alignSelfStart","xc10 div-start"], 785 inputType:"textarea", 786 placeholder:'', 787 textRow:3788 }, 789}790//======================================791const productForm={792 793 id:{794 lb:'à¹à¸à¸à¸µ', 795 templateType:"string" , 796 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 797 subCName:["xc4 div-center","xc8 p-2 div-start"], 798 inputType:"number", 799 placeholder:'', 800 autoFocus:"autoFocus",801 //calculation:{method:"autoId"},802 },803 barcode:{804 lb:'à¸à¸²à¸£à¹à¹à¸à¹à¸', 805 templateType:"string" , 806 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 807 subCName:["xc4 div-center","xc8 p-2 div-start"], 808 inputType:"text", 809 placeholder:'', 810 },811 name:{812 lb:'à¸à¸·à¹à¸', 813 templateType:"string" , 814 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 815 subCName:["xc4 div-center","xc8 p-2 div-start"], 816 inputType:"text", 817 placeholder:'', 818 },819 isRawMat:{820 lb:'à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸', 821 templateType:"string" , 822 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 823 subCName:["xc4 div-center","xc8 p-2 div-start"], 824 inputType:"checkbox", 825 placeholder:'', 826 },827 //==================828 icon:{829 lb:"à¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²",830 templateType:"icon",831 cName:"xc6 lc6 sc12 p-1", 832 subCName:["xc6 div-center","xc6 div-start"], 833 inputType:"searchIcon",834 iconActionIdx:0,835 },836 groupId:{837 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡', 838 templateType:"string" , 839 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 840 subCName:["xc4 div-center","xc8 p-2 div-start"], 841 inputType:"number", 842 placeholder:'', 843 //unchangeable:true844 //disabled:"disabled"845 },846 groupName:{847 lb:'à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡', 848 templateType:"string" , 849 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 850 subCName:["xc4 div-center","xc8 p-2 div-start"], 851 inputType:"text", 852 placeholder:'', 853 //unchangeable:true854 //disabled:"disabled"855 },856 //==========================857 price:{858 lb:'ราà¸à¸²', 859 templateType:"string" , 860 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 861 subCName:["xc4 div-center","xc8 p-2 div-start"], 862 inputType:"number", 863 placeholder:'', 864 },865 unit:{866 lb:'หà¸à¹à¸§à¸¢', 867 templateType:"string" , 868 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 869 subCName:["xc4 div-center","xc8 p-2 div-start"], 870 inputType:"select", 871 placeholder:'', 872 selectDataKey:"basicData",873 selectObj:'unit'874 },875 876 stock:{877 lb:'ยà¸à¸à¸ªà¸à¹à¸à¸', 878 templateType:"string" , 879 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 880 subCName:["xc4 div-center","xc8 p-2 div-start"], 881 inputType:"number", 882 placeholder:'', 883 //disabled:"disabled"884 },885 order:{886 lb:'ยà¸à¸à¸à¸à¸', 887 templateType:"string" , 888 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 889 subCName:["xc4 div-center","xc8 p-2 div-start"], 890 inputType:"number", 891 placeholder:'', 892 //disabled:"disabled"893 },894 plan:{895 lb:'ยà¸à¸à¹à¸à¸', 896 templateType:"string" , 897 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 898 subCName:["xc4 div-center","xc8 p-2 div-start"], 899 inputType:"number", 900 placeholder:'', 901 //disabled:"disabled"902 },903 //========================904 priceLevel:{905 lb:'ระà¸à¸±à¸à¸£à¸²à¸à¸²', 906 templateType:"arrayObject", 907 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 908 cName:"xc6 lc6 sc12 p-1 bd-lightGray", 909 subCName:["xc12 div-center","xc12 p-2 div-start"], 910 placeholder:'',911 subFormTemplate:{912 price:{913 lb:'ราà¸à¸²', 914 templateType:"string" , 915 cName:"xc12 sc12 p-1 bd-lightGray", 916 subCName:["xc4 div-center","xc8 div-start"], 917 inputType:"number", 918 placeholder:'', 919 },920 remark:{921 lb:'หมายà¹à¸«à¸à¸¸', 922 templateType:"string" , 923 cName:"xc12 sc12 p-1 bd-lightGray", 924 subCName:["xc4 alignSelfStart","xc8 div-start"], 925 inputType:"textarea", 926 placeholder:'', 927 textRow:1928 }, 929 }930 },931 remark:{932 lb:'หมายà¹à¸«à¸à¸¸', 933 templateType:"string" , 934 cName:"xc12 lc12 sc12 p-1 bd-lightGray", 935 subCName:["xc2 alignSelfStart","xc10 div-start"], 936 inputType:"textarea", 937 placeholder:'', 938 textRow:5939 }, 940 //======================941 942 detail:{943 lb: "รายละà¹à¸à¸µà¸¢à¸",944 templateType:"arrayObjectInTable",945 cName:"xc12 lc12 sc12",946 subFormTemplate:{947 icon:{948 templateType:"icon",949 subCName:[60],950 inputType:"icon",951 iconActionIdx:1,952 },953 id:{954 lb:"à¹à¸à¸à¸µ",955 templateType:"number",956 subCName:[60,""],957 inputType:"number",958 placeholder:"",959 aotuFocus:"autoFocus"960 },961 barcode:{962 lb:"à¸à¸²à¸£à¹à¹à¸à¹à¸",963 templateType:"string",964 subCName:[100,""],965 inputType:"text",966 placeholder:"", 967 nextEnter:{nextKey1:["detail",0,"quantity"],lastKey:null}968 },969 name:{970 lb:"à¸à¸·à¹à¸",971 templateType:"string",972 subCName:[240,""],973 inputType:"text",974 placeholder:"", 975 },976 groupId:{977 lb:"à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡",978 templateType:"number",979 subCName:[60,""],980 inputType:"number",981 placeholder:"",982 aotuFocus:"autoFocus"983 },984 groupName:{985 lb:"à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡",986 templateType:"string",987 subCName:[90,""],988 inputType:"text",989 placeholder:"", 990 },991 quantity:{992 lb:"à¸à¸³à¸à¸§à¸",993 templateType:"string",994 subCName:[60,""],995 inputType:"number",996 placeholder:"", 997 nextEnter:{nextKey1:["detail",1,"barcode"],lastKey:"endForm"}998 },999 unit:{1000 lb:"หà¸à¹à¸§à¸¢",1001 templateType:"string",1002 subCName:[80,""],1003 inputType:"select",1004 placeholder:"", 1005 //selectObj:["à¸à¸²à¸¢","à¸à¸²à¸"]1006 selectDataKey:"basicData",1007 selectObj:'unit'1008 },1009 price:{1010 lb:"ราà¸à¸²",1011 templateType:"string",1012 subCName:[100,""],1013 inputType:"number",1014 placeholder:"", 1015 },1016 result:{1017 lb:"รวม",1018 templateType:"string",1019 subCName:[100,""],1020 inputType:"number",1021 placeholder:"", 1022 },1023 remark:{1024 lb:"หมายà¹à¸«à¸à¸¸",1025 templateType:"string",1026 subCName:[200,""],1027 inputType:"text",1028 placeholder:"", 1029 },1030 isRawMat:{1031 lb:"à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸",1032 templateType:"boolean",1033 subCName:[40,""],1034 inputType:"checkbox",1035 placeholder:"", 1036 }1037 }1038 }1039}1040//====================================1041const {id,...remaining}=productForm1042const productEditForm = {1043 id,1044 newId:{1045 lb:'à¹à¸à¸à¸µà¹à¸«à¸¡à¹', 1046 templateType:"string" , 1047 cName:"xc3 sc12 p-1 bd-lightGray", 1048 subCName:["xc4 div-center","xc8 p-2 div-start"], 1049 inputType:"number", 1050 placeholder:'', 1051 },1052 barcode:productForm.barcode,1053 name:productForm.name,1054 isRawMat:productForm.isRawMat,1055 icon:productForm.icon,1056 groupId:productForm.groupId,1057 groupName:productForm.groupName,1058 price:productForm.price,1059 unit:productForm.unit,1060 stock:productForm.stock,1061 order:productForm.order,1062 plan:productForm.plan,1063 remark:productForm.remark,1064 detail:productForm.detail,1065} 1066//====================================1067const productDetailForm={1068 1069 icon:{1070 lb:"à¸à¹à¸à¸«à¸²à¸ªà¸´à¸à¸à¹à¸²",1071 templateType:"icon",1072 cName:"xc12 sc12 p-1 bd-lightGray", 1073 subCName:["xc2 div-center","xc10 div-start"], 1074 inputType:"searchIcon",1075 iconActionIdx:0,1076 1077 },1078 id:{1079 lb:'à¹à¸à¸à¸µ', 1080 templateType:"string" , 1081 cName:"xc6 sc12 p-1 bd-lightGray", 1082 subCName:["xc4 div-center","xc8 p-2 div-start"], 1083 inputType:"number", 1084 placeholder:'', 1085 autoFocus:"autoFocus",1086 //disabled:"disabled"1087 },1088 barcode:{1089 lb:'à¸à¸²à¸£à¹à¹à¸à¹à¸', 1090 templateType:"string" , 1091 cName:"xc6 sc12 p-1 bd-lightGray", 1092 subCName:["xc4 div-center","xc8 p-2 div-start"], 1093 inputType:"text", 1094 placeholder:'', 1095 //disabled:"disabled"1096 },1097 name:{1098 lb:'à¸à¸·à¹à¸', 1099 templateType:"string" , 1100 cName:"xc6 sc12 p-1 bd-lightGray", 1101 subCName:["xc4 div-center","xc8 p-2 div-start"], 1102 inputType:"text", 1103 placeholder:'', 1104 //disabled:"disabled"1105 },1106 groupId:{1107 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡', 1108 templateType:"string" , 1109 cName:"xc6 sc12 p-1 bd-lightGray", 1110 subCName:["xc4 div-center","xc8 p-2 div-start"], 1111 inputType:"number", 1112 placeholder:'', 1113 //disabled:"disabled"1114 },1115 groupName:{1116 lb:'à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡', 1117 templateType:"string" , 1118 cName:"xc6 sc12 p-1 bd-lightGray", 1119 subCName:["xc4 div-center","xc8 p-2 div-start"], 1120 inputType:"text", 1121 placeholder:'', 1122 //disabled:"disabled"1123 },1124 unit:{1125 lb:'หà¸à¹à¸§à¸¢', 1126 templateType:"string" , 1127 cName:"xc6 sc12 p-1 bd-lightGray", 1128 subCName:["xc4 div-center","xc8 p-2 div-start"], 1129 inputType:"select", 1130 placeholder:'', 1131 selectDataKey:"basicData",1132 selectObj:'unit',1133 //disabled:"disabled"1134 },1135 isRawMat:{1136 lb:'à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸', 1137 templateType:"string" , 1138 cName:"xc6 sc12 p-1 bd-lightGray", 1139 subCName:["xc4 div-center","xc8 p-2 div-start"], 1140 inputType:"checkbox", 1141 placeholder:'', 1142 //disabled:"disabled"1143 },1144 quantity:{1145 lb:"à¸à¸³à¸à¸§à¸", 1146 templateType:"string" , 1147 cName:"xc6 sc12 p-1 bd-lightGray", 1148 subCName:["xc4 div-center","xc8 p-2 div-start"], 1149 inputType:"number", 1150 placeholder:'', 1151 //disabled:"disabled"1152 },1153 remark:{1154 lb:'หมายà¹à¸«à¸à¸¸', 1155 templateType:"string" , 1156 cName:"xc12 sc12 p-1 bd-lightGray", 1157 subCName:["xc2 alignSelfStart","xc10 div-start"], 1158 inputType:"textarea", 1159 placeholder:'', 1160 textRow:31161 }1162}1163const basicDataForm={1164 title:{1165 lb:'à¸à¸³à¸à¸³à¸«à¸à¹à¸²', 1166 templateType:"array" , 1167 cName:"xc6 sc12 p-1 bd-lightGray", 1168 subCName:["xc4 div-center","xc8 div-start"], 1169 inputType:"text", 1170 placeholder:'', 1171 }, 1172 unit:{1173 lb:'หà¸à¹à¸§à¸¢', 1174 templateType:"array" , 1175 cName:"xc6 sc12 p-1 bd-lightGray", 1176 subCName:["xc4 div-center","xc8 div-start"], 1177 inputType:"text", 1178 placeholder:'', 1179 }, 1180 userLevel:{1181 lb:'ระà¸à¸±à¸à¸à¸¹à¹à¹à¸à¹', 1182 templateType:"array" , 1183 cName:"xc6 sc12 p-1 bd-lightGray", 1184 subCName:["xc4 div-center","xc8 div-start"], 1185 inputType:"text", 1186 placeholder:'', 1187 },1188 partnerType:{1189 lb:'à¸à¸£à¸°à¹à¸ à¸à¸à¸¹à¹à¸à¹à¸²', 1190 templateType:"array" , 1191 cName:"xc6 sc12 p-1 bd-lightGray", 1192 subCName:["xc4 div-center","xc8 div-start"], 1193 inputType:"text", 1194 placeholder:'', 1195 },1196 transactionType:{1197 lb:'à¸à¸£à¸°à¹à¸ à¸à¸à¸¸à¸£à¸à¸£à¸£à¸¡', 1198 templateType:"arrayObject", 1199 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 1200 cName:"xc6 sc12 p-1 bd-lightGray", 1201 subCName:["xc12 div-center","xc12 p-2 div-start"], 1202 placeholder:'',1203 subFormTemplate:{1204 groupId:{1205 lb:"รหัสà¸à¸¥à¸¸à¹à¸¡", 1206 templateType:"string" , 1207 cName:"xc6 sc12 p-1 bd-lightGray", 1208 subCName:["xc4 div-center","xc8 p-2 div-start"], 1209 inputType:"number", 1210 placeholder:'', 1211 //disabled:"disabled"1212 },1213 groupName:{1214 lb:"à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡", 1215 templateType:"string" , 1216 cName:"xc6 sc12 p-1 bd-lightGray", 1217 subCName:["xc4 div-center","xc8 p-2 div-start"], 1218 inputType:"text", 1219 placeholder:'', 1220 //disabled:"disabled"1221 },1222 effectOrder:{1223 lb:"à¸à¸£à¸°à¸à¸à¸à¸à¸", 1224 templateType:"string" , 1225 cName:"xc6 sc12 p-1 bd-lightGray", 1226 subCName:["xc4 div-center","xc8 p-2 div-start"], 1227 inputType:"text", 1228 placeholder:'', 1229 //disabled:"disabled"1230 },1231 effectPlan:{1232 lb:"à¸à¸£à¸°à¸à¸à¹à¸à¸", 1233 templateType:"string" , 1234 cName:"xc6 sc12 p-1 bd-lightGray", 1235 subCName:["xc4 div-center","xc8 p-2 div-start"], 1236 inputType:"text", 1237 placeholder:'', 1238 //disabled:"disabled"1239 },1240 effectStock:{1241 lb:"à¸à¸£à¸°à¸à¸à¸ªà¸à¹à¸à¸", 1242 templateType:"string" , 1243 cName:"xc6 sc12 p-1 bd-lightGray", 1244 subCName:["xc4 div-center","xc8 p-2 div-start"], 1245 inputType:"text", 1246 placeholder:'', 1247 //disabled:"disabled"1248 },1249 }1250 },1251}1252const routeAuthForm={1253 id:{1254 lb:'รหัส', 1255 templateType:"string" , 1256 cName:"xc6 sc12 p-1 bd-lightGray", 1257 subCName:["xc4 div-center","xc8 div-start"], 1258 inputType:"number", 1259 placeholder:'', 1260 autoFocus:"autoFocus"1261 },1262 routeAddress:{1263 lb:'url', 1264 templateType:"string" , 1265 cName:"xc6 sc12 p-1 bd-lightGray", 1266 subCName:["xc4 div-center","xc8 div-start"], 1267 inputType:"text", 1268 placeholder:'', 1269 },1270 routeName:{1271 lb:'à¸à¸·à¹à¸à¸ªà¸´à¸à¸à¸´à¹', 1272 templateType:"string" , 1273 cName:"xc6 sc12 p-1 bd-lightGray", 1274 subCName:["xc4 div-center","xc8 div-start"], 1275 inputType:"text", 1276 placeholder:'', 1277 },1278 userLevel:{1279 lb:'ระà¸à¸±à¸à¸à¸¹à¹à¹à¸à¹', 1280 templateType:"array" , 1281 cName:"xc6 sc12 p-1 bd-lightGray", 1282 subCName:["xc4 div-center","xc8 div-start"], 1283 //inputType:"text",1284 inputType:"select", 1285 placeholder:'', 1286 selectDataKey:"basicData",1287 selectObj:'userLevel'1288 }1289}1290const transactionForm={1291 iconTransactiontype:{1292 lb:"à¸à¹à¸à¸«à¸²à¸à¸£à¸°à¹à¸ à¸à¸à¸¸à¸£à¸à¸£à¸£à¸¡",1293 templateType:"icon",1294 cName:"xc3 sc12 p-1", 1295 subCName:["xc7 div-center","xc4 div-start"], 1296 inputType:"searchIcon",1297 iconActionIdx:0,1298 },1299 groupName:{1300 lb:'à¸à¸£à¸°à¹à¸ à¸à¸à¸¸à¸£à¸à¸£à¸£à¸¡', 1301 templateType:"string" , 1302 cName:"xc3 sc12 p-1 bd-lightGray", 1303 subCName:["xc6 div-center","xc6 div-start"], 1304 inputType:"text", 1305 placeholder:'', 1306 disabled:"disabled"1307 //calculation:{method:"autoId"},1308 },1309 id:{1310 lb:'à¹à¸à¸à¸µ', 1311 templateType:"string" , 1312 cName:"xc3 sc12 p-1 bd-lightGray", 1313 subCName:["xc4 div-center","xc8 div-start"], 1314 inputType:"number", 1315 placeholder:'', 1316 autoFocus:"autoFocus",1317 //calculation:{method:"autoId"},1318 },1319 date:{1320 lb:'วัà¸à¸à¸µà¹', 1321 templateType:"string" , 1322 cName:"xc3 sc12 p-1 bd-lightGray", 1323 subCName:["xc4 div-center","xc8 div-start"], 1324 inputType:"date", 1325 placeholder:'', 1326 },1327 /*1328 groupId:{1329 lb:'รหัส', 1330 templateType:"string" , 1331 cName:"xc4 sc12 p-1 bd-lightGray", 1332 subCName:["xc4 div-center","xc8 div-start"], 1333 inputType:"number", 1334 placeholder:'', 1335 },1336 */1337 /*1338 transactionStatus:{ 1339 lb:'สà¸à¸²à¸à¸°', 1340 templateType:"string" , 1341 cName:"xc3 sc12 p-1 bd-lightGray", 1342 subCName:["xc4 div-center","xc8 div-start"], 1343 inputType:"select", 1344 placeholder:'', 1345 selectDataKey:"basicData",1346 selectObj:'transactionStatus'1347 //inputType:"text", 1348 //placeholder:'', 1349 },1350 */1351 iconPartner:{1352 lb:"à¸à¹à¸à¸«à¸²à¸à¸¹à¹à¸à¹à¸²2",1353 templateType:"icon",1354 cName:"xc3 sc12 p-1", 1355 subCName:["xc7 div-center","xc4 div-start"], 1356 inputType:"searchIcon",1357 iconActionIdx:1,1358 },1359 partnerId:{1360 lb:'à¹à¸à¸à¸µà¸à¸¹à¹à¸à¹à¸²', 1361 templateType:"string" , 1362 cName:"xc3 sc12 p-1 bd-lightGray", 1363 subCName:["xc4 div-center","xc8 p-2 div-start"], 1364 inputType:"number", 1365 placeholder:'', 1366 //autoFocus:"autoFocus"1367 },1368 title:{1369 lb:'à¸à¸³à¸à¸³à¸«à¸à¹à¸²', 1370 templateType:"string" , 1371 cName:"xc3 sc12 p-1 bd-lightGray", 1372 subCName:["xc4 div-center","xc8 p-2 div-start"], 1373 inputType:"select", 1374 placeholder:'', 1375 selectDataKey:"basicData",1376 selectObj:'title'1377 },1378 name:{1379 lb:'à¸à¸·à¹à¸', 1380 templateType:"string" , 1381 cName:"xc3 sc12 p-1 bd-lightGray", 1382 subCName:["xc4 div-center","xc8 p-2 div-start"], 1383 inputType:"text", 1384 placeholder:'', 1385 },1386 phone:{1387 lb:'à¹à¸à¸£à¸¨à¸±à¸à¸à¹', 1388 templateType:"array" , 1389 cName:"xc6 sc12 p-1 bd-lightGray", 1390 subCName:["xc4 div-center","xc8 p-2 div-start"], 1391 inputType:"text", 1392 placeholder:'', 1393 },1394 address:{1395 lb:'à¸à¸µà¹à¸à¸¢à¸¹à¹', 1396 templateType:"arrayObject", 1397 //cName:["xc12 p-1 bd-lightGray","form-row flex-justify-start flex-align-stretch"], 1398 cName:"xc6 sc12 p-1 bd-lightGray", 1399 subCName:["xc12 div-center","xc12 p-2 div-start"], 1400 placeholder:'',1401 subFormTemplate:{1402 number:{1403 lb:'à¹à¸¥à¸à¸à¸µà¹', 1404 templateType:"string" , 1405 cName:"xc4 sc12 p-1 bd-lightGray", 1406 subCName:["xc4 div-center","xc8 p-2 div-start"], 1407 inputType:"text", 1408 placeholder:'', 1409 },1410 tambon:{1411 lb:'à¸à¸³à¸à¸¥', 1412 templateType:"string" , 1413 cName:"xc4 sc12 p-1 bd-lightGray", 1414 subCName:["xc4 div-center","xc8 p-2 div-start"], 1415 inputType:"text", 1416 placeholder:'', 1417 },1418 district:{1419 lb:'à¸à¸³à¹à¸ à¸', 1420 templateType:"string" , 1421 cName:"xc4 sc12 p-1 bd-lightGray", 1422 subCName:["xc4 div-center","xc8 p-2 div-start"], 1423 inputType:"text", 1424 placeholder:'', 1425 },1426 province:{1427 lb:'à¸à¸±à¸à¸«à¸§à¸±à¸', 1428 templateType:"string" , 1429 cName:"xc4 sc12 p-1 bd-lightGray", 1430 subCName:["xc4 div-center","xc8 p-2 div-start"], 1431 inputType:"text", 1432 placeholder:'', 1433 },1434 postcode:{1435 lb:'รหัสà¹à¸à¸£à¸©à¸à¸µà¸¢à¹', 1436 templateType:"string" , 1437 cName:"xc4 sc12 p-1 bd-lightGray", 1438 subCName:["xc6 div-center","xc6 p-2 div-start"], 1439 inputType:"text", 1440 placeholder:'', 1441 },1442 }1443 1444 }, 1445 remark:{1446 lb:'หมายà¹à¸«à¸à¸¸', 1447 templateType:"string" , 1448 cName:"xc12 sc12 p-1 bd-lightGray", 1449 subCName:["xc2 alignSelfStart","xc10 div-start"], 1450 inputType:"textarea", 1451 placeholder:'', 1452 textRow:31453 },1454 total:{1455 lb:'รวม', 1456 templateType:"string" , 1457 cName:"xc4 sc12 p-1 bd-lightGray", 1458 subCName:["xc4 div-center","xc8 p-2 div-start"], 1459 inputType:"number", 1460 placeholder:'', 1461 unchangeable:true,1462 //calculation:{method:"total",param:["detail","price","quantity"]},1463 //autoFocus:"autoFocus"1464 },1465 reduction:{1466 lb:'สà¹à¸§à¸à¸¥à¸', 1467 templateType:"string" , 1468 cName:"xc4 sc12 p-1 bd-lightGray", 1469 subCName:["xc4 div-center","xc8 p-2 div-start"], 1470 inputType:"number", 1471 placeholder:'', 1472 //autoFocus:"autoFocus"1473 },1474 grandTotal:{1475 lb:'สุà¸à¸à¸´', 1476 templateType:"string" , 1477 cName:"xc4 sc12 p-1 bd-lightGray", 1478 subCName:["xc4 div-center","xc8 p-2 div-start"], 1479 inputType:"number", 1480 placeholder:'', 1481 unchangeable:true1482 //calculation:{method:"grandTotal",param:["detail","price","quantity","reduction"]},1483 //autoFocus:"autoFocus"1484 },1485 //=================1486 //=================1487 //=================1488 detail:{1489 lb: "รายละà¹à¸à¸µà¸¢à¸",1490 templateType:"arrayObjectInTable",1491 cName:"",1492 subFormTemplate:{1493 icon:{1494 //templateType:"icon",1495 //subCName:[60],1496 inputType:"icon",1497 iconActionIdx:2,1498 },1499 id:{1500 //lb:"à¹à¸à¸à¸µ",1501 //templateType:"number",1502 //subCName:[60,""],1503 inputType:"number",1504 placeholder:"",1505 aotuFocus:"autoFocus"1506 },1507 barcode:{1508 //lb:"à¸à¸²à¸£à¹à¹à¸à¹à¸",1509 //templateType:"string",1510 //subCName:[100,""],1511 inputType:"text",1512 placeholder:"", 1513 nextEnter:{nextKey1:["detail",0,"quantity"],lastKey:null}1514 },1515 name:{1516 //lb:"à¸à¸·à¹à¸",1517 //templateType:"string",1518 //subCName:[240,""],1519 inputType:"text",1520 placeholder:"", 1521 },1522 unit:{1523 //lb:"หà¸à¹à¸§à¸¢",1524 //templateType:"string",1525 //subCName:[80,""],1526 inputType:"select",1527 placeholder:"", 1528 //selectObj:["à¸à¸²à¸¢","à¸à¸²à¸"]1529 selectDataKey:"basicData",1530 selectObj:'unit'1531 },1532 groupId:{1533 //lb:"à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡",1534 //templateType:"number",1535 //subCName:[60,""],1536 inputType:"number",1537 placeholder:"",1538 aotuFocus:"autoFocus"1539 },1540 groupName:{1541 //lb:"à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡",1542 //templateType:"string",1543 //subCName:[90,""],1544 inputType:"text",1545 placeholder:"", 1546 },1547 quantity:{1548 //lb:"à¸à¸³à¸à¸§à¸",1549 //templateType:"string",1550 //subCName:[60,""],1551 inputType:"number",1552 placeholder:"", 1553 nextEnter:{nextKey1:["detail",1,"barcode"],lastKey:"endForm"}1554 },1555 price:{1556 //lb:"ราà¸à¸²",1557 //templateType:"number",1558 //subCName:[100,""],1559 inputType:"number",1560 placeholder:"", 1561 },1562 result:{1563 //lb:"รวม",1564 //templateType:"number",1565 //subCName:[100,""],1566 inputType:"number",1567 placeholder:"", 1568 unchangeable:true,1569 //calculation:{method:"multiply",param:["price","quantity"]},1570 //disabled:"disabled"1571 },1572 remark:{1573 //lb:"หมายà¹à¸«à¸à¸¸",1574 //templateType:"string",1575 //subCName:[200,""],1576 inputType:"text",1577 placeholder:"", 1578 },1579 isRawMat:{1580 //lb:"à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸",1581 //templateType:"boolean",1582 //subCName:[40,""],1583 inputType:"checkbox",1584 placeholder:"", 1585 }1586 }1587 }1588}1589const transactionDetailForm={1590 1591 icon:{1592 lb:"à¸à¹à¸à¸«à¸²à¸ªà¸´à¸à¸à¹à¸²",1593 templateType:"icon",1594 cName:"xc12 sc12 p-1 bd-lightGray", 1595 subCName:["xc2 div-center","xc10 div-start"], 1596 inputType:"searchIcon",1597 iconActionIdx:0,1598 },1599 id:{1600 lb:'à¹à¸à¸à¸µ', 1601 templateType:"string" , 1602 cName:"xc6 sc12 p-1 bd-lightGray", 1603 subCName:["xc4 div-center","xc8 p-2 div-start"], 1604 inputType:"number", 1605 placeholder:'', 1606 autoFocus:"autoFocus",1607 //disabled:"disabled"1608 },1609 barcode:{1610 lb:'à¸à¸²à¸£à¹à¹à¸à¹à¸', 1611 templateType:"string" , 1612 cName:"xc6 sc12 p-1 bd-lightGray", 1613 subCName:["xc4 div-center","xc8 p-2 div-start"], 1614 inputType:"text", 1615 placeholder:'', 1616 //disabled:"disabled"1617 },1618 name:{1619 lb:'à¸à¸·à¹à¸', 1620 templateType:"string" , 1621 cName:"xc6 sc12 p-1 bd-lightGray", 1622 subCName:["xc4 div-center","xc8 p-2 div-start"], 1623 inputType:"text", 1624 placeholder:'', 1625 //disabled:"disabled"1626 },1627 groupId:{1628 lb:'à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡', 1629 templateType:"string" , 1630 cName:"xc6 sc12 p-1 bd-lightGray", 1631 subCName:["xc4 div-center","xc8 p-2 div-start"], 1632 inputType:"number", 1633 placeholder:'', 1634 //disabled:"disabled"1635 },1636 groupName:{1637 lb:'à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡', 1638 templateType:"string" , 1639 cName:"xc6 sc12 p-1 bd-lightGray", 1640 subCName:["xc4 div-center","xc8 p-2 div-start"], 1641 inputType:"text", 1642 placeholder:'', 1643 //disabled:"disabled"1644 },1645 unit:{1646 lb:'หà¸à¹à¸§à¸¢', 1647 templateType:"string" , 1648 cName:"xc6 sc12 p-1 bd-lightGray", 1649 subCName:["xc4 div-center","xc8 p-2 div-start"], 1650 inputType:"select", 1651 placeholder:'', 1652 selectDataKey:"basicData",1653 selectObj:'unit',1654 //disabled:"disabled"1655 },1656 price:{1657 lb:"ราà¸à¸²", 1658 templateType:"string" , 1659 cName:"xc6 sc12 p-1 bd-lightGray", 1660 subCName:["xc4 div-center","xc8 p-2 div-start"], 1661 inputType:"number", 1662 placeholder:'', 1663 //disabled:"disabled"1664 },1665 isRawMat:{1666 lb:'à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸', 1667 templateType:"string" , 1668 cName:"xc6 sc12 p-1 bd-lightGray", 1669 subCName:["xc4 div-center","xc8 p-2 div-start"], 1670 inputType:"checkbox", 1671 placeholder:'', 1672 //disabled:"disabled"1673 },1674 quantity:{1675 lb:"à¸à¸³à¸à¸§à¸", 1676 templateType:"string" , 1677 cName:"xc6 sc12 p-1 bd-lightGray", 1678 subCName:["xc4 div-center","xc8 p-2 div-start"], 1679 inputType:"number", 1680 placeholder:'', 1681 //disabled:"disabled"1682 },1683 remark:{1684 lb:'หมายà¹à¸«à¸à¸¸', 1685 templateType:"string" , 1686 cName:"xc12 sc12 p-1 bd-lightGray", 1687 subCName:["xc2 alignSelfStart","xc10 div-start"], 1688 inputType:"textarea", 1689 placeholder:'', 1690 textRow:31691 }1692}1693const FormTemplate={testForm,1694 shopSignUpForm,shopLogInForm,shopChangePasswordForm,1695 addUserForm,logInForm,changePasswordForm,1696 partnerForm,1697 groupForm,groupEditForm,1698 productForm,productEditForm,productDetailForm,1699 basicDataForm,1700 routeAuthForm,1701 transactionForm,transactionDetailForm1702}1703export default FormTemplate...
FilterTemplate.js
Source:FilterTemplate.js
1import React from 'react';2const genRef=()=>{3 return [1,2,3].map(i=>React.createRef())4}5const cName="xc12 h-100"6const subCNameMinMax = ["xc1 h-100",7 "xc3 h-100",8 "xc8 h-100"]9 10const subCNameInput= subCNameMinMax11let partnerFilter=[12 { 13 templateType:"number",14 lb:"id",15 cName, 16 subCName:subCNameMinMax,17 keyName:"id",18 refInput:genRef(),19 inputType:"number",20 filterCommand:["id"]21 },22 //==============23 //title24 { 25 templateType:"string",26 lb:"à¸à¸³à¸à¸³à¸«à¸à¹à¸²",27 cName, 28 subCName:subCNameInput, 29 keyName:"title",30 refInput:genRef(),31 inputType:"text",32 filterCommand:["title"]33 },34 //name35 { 36 templateType:"string",37 lb:"à¸à¸·à¹à¸",38 cName, 39 subCName:subCNameInput, 40 keyName:"name",41 refInput:genRef(),42 inputType:"text",43 filterCommand:["name"]44 },45 //phone46 { 47 templateType:"arrayString",48 lb:"à¹à¸à¸£à¸¨à¸±à¸à¸à¹",49 cName, 50 subCName:subCNameInput, 51 keyName:"phone",52 refInput:genRef(),53 inputType:"text",54 filterCommand:["phone"]55 },56 //partnerType57 { 58 templateType:"string",59 lb:"à¸à¸£à¸°à¹à¸ à¸à¸à¸¹à¹à¸à¹à¸²",60 cName, 61 subCName:subCNameInput, 62 keyName:"partnerType",63 refInput:genRef(),64 inputType:"text",65 filterCommand:["partnerType"]66 },67 //remark68 { 69 templateType:"string",70 lb:"หมายà¹à¸«à¸à¸¸",71 cName, 72 subCName:subCNameInput, 73 keyName:"remark",74 refInput:genRef(),75 inputType:"text",76 filterCommand:["remark"]77 },78 //address:{number,tambon,district:province,postcode:},79 //address.number80 { 81 templateType:"arrayObjectString",82 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¹à¸¥à¸à¸à¸µà¹",83 cName, 84 subCName:subCNameInput,85 keyName:"address_number",86 refInput:genRef(),87 inputType:"text",88 filterCommand:["address","number"]89 },90 { 91 templateType:"arrayObjectString",92 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¸à¸³à¸à¸¥",93 cName, 94 subCName:subCNameInput,95 keyName:"address_tambon",96 refInput:genRef(),97 inputType:"text",98 filterCommand:["address","tambon"]99 },100 { 101 templateType:"arrayObjectString",102 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¸à¸³à¹à¸ à¸",103 cName, 104 subCName:subCNameInput,105 keyName:"address_district",106 refInput:genRef(),107 inputType:"text",108 filterCommand:["address","district"]109 },110 { 111 templateType:"arrayObjectString",112 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¸à¸±à¸à¸«à¸§à¸±à¸",113 cName, 114 subCName:subCNameInput,115 keyName:"address_province",116 refInput:genRef(),117 inputType:"text",118 filterCommand:["address","province"]119 },120 { 121 templateType:"arrayObjectString",122 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|รหัสà¹à¸à¸£à¸©à¸à¸µà¸¢à¹",123 cName, 124 subCName:subCNameInput,125 keyName:"address_postcode",126 refInput:genRef(),127 inputType:"text",128 filterCommand:["address","postcode"]129 }, 130]131let productFilter=[132 //id133 { 134 templateType:"number",135 lb:"à¹à¸à¸à¸µ",136 cName, 137 subCName:subCNameMinMax,138 keyName:"id",139 refInput:genRef(),140 inputType:"number",141 filterCommand:["id"]142 },143 //barcode144 { 145 templateType:"string",146 lb:"à¸à¸²à¸£à¹à¹à¸à¹à¸",147 cName, 148 subCName:subCNameInput, 149 keyName:"barcode",150 refInput:genRef(),151 inputType:"text",152 filterCommand:["barcode"]153 },154 //name155 { 156 templateType:"string",157 lb:"à¸à¸·à¹à¸",158 cName, 159 subCName:subCNameInput, 160 keyName:"name",161 refInput:genRef(),162 inputType:"text",163 filterCommand:["name"]164 },165 //groupId166 { 167 templateType:"number",168 lb:"à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡",169 cName, 170 subCName:subCNameMinMax,171 keyName:"groupId",172 refInput:genRef(),173 inputType:"number",174 filterCommand:["groupId"]175 },176 //groupName177 { 178 templateType:"string",179 lb:"à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡",180 cName, 181 subCName:subCNameMinMax,182 keyName:"groupName",183 refInput:genRef(),184 inputType:"text",185 filterCommand:["groupName"]186 },187 //unit188 { 189 templateType:"string",190 lb:"หà¸à¹à¸§à¸¢",191 cName, 192 subCName:subCNameInput, 193 keyName:"unit",194 refInput:genRef(),195 inputType:"text",196 filterCommand:["unit"]197 },198 //price199 { 200 templateType:"number",201 lb:"ราà¸à¸²",202 cName, 203 subCName:subCNameInput, 204 keyName:"price",205 refInput:genRef(),206 inputType:"number",207 filterCommand:["price"]208 },209 //=================210 //isRawMat211 { 212 templateType:"boolean",213 lb:"à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸",214 cName, 215 subCName:subCNameInput, 216 keyName:"isRawMat",217 refInput:genRef(),218 inputType:"checkbox",219 filterCommand:["isRawMat"]220 },221 //stock222 { 223 templateType:"number",224 lb:"ยà¸à¸à¸ªà¸à¹à¸à¸",225 cName, 226 subCName:subCNameMinMax,227 keyName:"stock",228 refInput:genRef(),229 inputType:"number",230 filterCommand:["stock"]231 },232 //order 233 { 234 templateType:"number",235 lb:"ยà¸à¸à¸à¸à¸",236 cName, 237 subCName:subCNameMinMax,238 keyName:"order",239 refInput:genRef(),240 inputType:"number",241 filterCommand:["order"]242 }, 243 //=================244 //plan245 { 246 templateType:"number",247 lb:"ยà¸à¸à¹à¸à¸",248 cName, 249 subCName:subCNameMinMax,250 keyName:"plan",251 refInput:genRef(),252 inputType:"number",253 filterCommand:["plan"]254 }, 255 //remark256 { 257 templateType:"string",258 lb:"หมายà¹à¸«à¸à¸¸",259 cName, 260 subCName:subCNameInput, 261 keyName:"remark",262 refInput:genRef(),263 inputType:"text",264 filterCommand:["remark"]265 },266]267let jobFilter=[268 //id269 { 270 templateType:"number",271 lb:"id",272 cName, 273 subCName:subCNameMinMax,274 keyName:"id",275 refInput:genRef(),276 inputType:"number",277 filterCommand:["id"]278 },279 //dateIn280 { 281 templateType:"number",282 lb:"วัà¸à¸ªà¸±à¹à¸à¸à¸²à¸",283 cName, 284 subCName:subCNameMinMax,285 keyName:"dateIn",286 refInput:genRef(),287 inputType:"date",288 filterCommand:["dateIn"]289 },290 //dateOut291 { 292 templateType:"number",293 lb:"วัà¸à¸£à¸±à¸à¸à¸£à¸´à¸",294 cName, 295 subCName:subCNameMinMax,296 keyName:"dateOut",297 refInput:genRef(),298 inputType:"date",299 filterCommand:["dateOut"]300 },301 //dateTarget302 { 303 templateType:"number",304 lb:"วัà¸à¸à¸±à¸à¸£à¸±à¸",305 cName, 306 subCName:subCNameMinMax,307 keyName:"dateTarget",308 refInput:genRef(),309 inputType:"date",310 filterCommand:["dateTarget"]311 },312 //jobType313 { 314 templateType:"string",315 lb:"à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸",316 cName, 317 subCName:subCNameInput, 318 keyName:"jobType",319 refInput:genRef(),320 inputType:"text",321 filterCommand:["jobType"]322 },323 //jobStatus324 { 325 templateType:"string",326 lb:"สà¸à¸²à¸à¸°à¸à¸²à¸",327 cName, 328 subCName:subCNameInput, 329 keyName:"jobStatus",330 refInput:genRef(),331 inputType:"text",332 filterCommand:["jobStatus"]333 },334 //customerId335 { 336 templateType:"number",337 lb:"idลูà¸à¸à¹à¸²",338 cName, 339 subCName:subCNameMinMax,340 keyName:"customerId",341 refInput:genRef(),342 inputType:"number",343 filterCommand:["customerId"]344 },345 //title346 { 347 templateType:"string",348 lb:"à¸à¸³à¸à¸³à¸«à¸à¹à¸²",349 cName, 350 subCName:subCNameInput, 351 keyName:"title",352 refInput:genRef(),353 inputType:"text",354 filterCommand:["title"]355 },356 //name357 { 358 templateType:"string",359 lb:"à¸à¸·à¹à¸",360 cName, 361 subCName:subCNameInput, 362 keyName:"name",363 refInput:genRef(),364 inputType:"text",365 filterCommand:["name"]366 },367 //surname368 { 369 templateType:"string",370 lb:"à¸à¸²à¸¡à¸ªà¸à¸¸à¸¥",371 cName, 372 subCName:subCNameInput, 373 keyName:"surname",374 refInput:genRef(),375 inputType:"text",376 filterCommand:["surname"]377 },378 //phone379 { 380 templateType:"arrayString",381 lb:"à¹à¸à¸£à¸¨à¸±à¸à¸à¹",382 cName, 383 subCName:subCNameInput, 384 keyName:"phone",385 refInput:genRef(),386 inputType:"text",387 filterCommand:["phone"]388 },389 //remark390 { 391 templateType:"string",392 lb:"หมายà¹à¸«à¸à¸¸",393 cName, 394 subCName:subCNameInput, 395 keyName:"remark",396 refInput:genRef(),397 inputType:"text",398 filterCommand:["remark"]399 }400]401let transactionFilter=[402 //id403 { 404 templateType:"number",405 lb:"id",406 cName, 407 subCName:subCNameMinMax,408 keyName:"id",409 refInput:genRef(),410 inputType:"number",411 filterCommand:["id"]412 },413 //date414 { 415 templateType:"number",416 lb:"วัà¸à¸à¸µà¹",417 cName, 418 subCName:subCNameMinMax,419 keyName:"date",420 refInput:genRef(),421 inputType:"date",422 filterCommand:["date"]423 },424 //groupName425 { 426 templateType:"string",427 lb:"à¸à¸·à¹à¸à¹à¸à¸à¸ªà¸²à¸£",428 cName, 429 subCName:subCNameInput, 430 keyName:"groupName",431 refInput:genRef(),432 inputType:"text",433 filterCommand:["groupName"]434 },435 //groupId436 { 437 templateType:"string",438 lb:"รหัสà¹à¸à¸à¸ªà¸²à¸£",439 cName, 440 subCName:subCNameInput, 441 keyName:"groupId",442 refInput:genRef(),443 inputType:"text",444 filterCommand:["groupId"]445 },446 //transactionStatus447 /*448 { 449 templateType:"string",450 lb:"สà¸à¸²à¸à¸°à¹à¸à¸à¸ªà¸²à¸£",451 cName, 452 subCName:subCNameInput, 453 keyName:"transactionStatus",454 refInput:genRef(),455 inputType:"text",456 filterCommand:["transactionStatus"]457 },458 */459 //transactionType460 /*461 { 462 templateType:"string",463 lb:"à¸à¸£à¸°à¹à¸ à¸à¹à¸à¸à¸ªà¸²à¸£",464 cName, 465 subCName:subCNameInput, 466 keyName:"transactionType",467 refInput:genRef(),468 inputType:"text",469 filterCommand:["transactionType"]470 },471 //effectStock472 { 473 templateType:"string",474 lb:"à¸à¸£à¸°à¸à¸à¸ªà¸à¹à¸à¸",475 cName, 476 subCName:subCNameInput, 477 keyName:"effectStock",478 refInput:genRef(),479 inputType:"text",480 filterCommand:["effectStock"]481 },482 //effectOrder483 { 484 templateType:"string",485 lb:"à¸à¸£à¸°à¸à¸à¸à¸à¸",486 cName, 487 subCName:subCNameInput, 488 keyName:"effectOrder",489 refInput:genRef(),490 inputType:"text",491 filterCommand:["effectOrder"]492 },493 */494 //partnerId495 { 496 templateType:"number",497 lb:"à¹à¸à¸à¸µà¸à¸¹à¹à¸à¹à¸²",498 cName, 499 subCName:subCNameMinMax,500 keyName:"partnerId",501 refInput:genRef(),502 inputType:"number",503 filterCommand:["partnerId"]504 },505 //title506 { 507 templateType:"string",508 lb:"à¸à¸³à¸à¸³à¸«à¸à¹à¸²",509 cName, 510 subCName:subCNameInput, 511 keyName:"title",512 refInput:genRef(),513 inputType:"text",514 filterCommand:["title"]515 },516 //name517 { 518 templateType:"string",519 lb:"à¸à¸·à¹à¸",520 cName, 521 subCName:subCNameInput, 522 keyName:"name",523 refInput:genRef(),524 inputType:"text",525 filterCommand:["name"]526 },527 //phone528 { 529 templateType:"arrayString",530 lb:"à¹à¸à¸£à¸¨à¸±à¸à¸à¹",531 cName, 532 subCName:subCNameInput, 533 keyName:"phone",534 refInput:genRef(),535 inputType:"text",536 filterCommand:["phone"]537 },538 //address:{number,tambon,district:province,postcode:},539 //address.number540 { 541 templateType:"arrayObjectString",542 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¹à¸¥à¸à¸à¸µà¹",543 cName, 544 subCName:subCNameInput,545 keyName:"address_number",546 refInput:genRef(),547 inputType:"text",548 filterCommand:["address","number"]549 },550 { 551 templateType:"arrayObjectString",552 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¸à¸³à¸à¸¥",553 cName, 554 subCName:subCNameInput,555 keyName:"address_tambon",556 refInput:genRef(),557 inputType:"text",558 filterCommand:["address","tambon"]559 },560 { 561 templateType:"arrayObjectString",562 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¸à¸³à¹à¸ à¸",563 cName, 564 subCName:subCNameInput,565 keyName:"address_district",566 refInput:genRef(),567 inputType:"text",568 filterCommand:["address","district"]569 },570 { 571 templateType:"arrayObjectString",572 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|à¸à¸±à¸à¸«à¸§à¸±à¸",573 cName, 574 subCName:subCNameInput,575 keyName:"address_province",576 refInput:genRef(),577 inputType:"text",578 filterCommand:["address","province"]579 },580 { 581 templateType:"arrayObjectString",582 lb:"à¸à¸µà¹à¸à¸¢à¸¹à¹|รหัสà¹à¸à¸£à¸©à¸à¸µà¸¢à¹",583 cName, 584 subCName:subCNameInput,585 keyName:"address_postcode",586 refInput:genRef(),587 inputType:"text",588 filterCommand:["address","postcode"]589 }, 590 //remark591 { 592 templateType:"string",593 lb:"หมายà¹à¸«à¸à¸¸",594 cName, 595 subCName:subCNameInput, 596 keyName:"remark",597 refInput:genRef(),598 inputType:"text",599 filterCommand:["remark"]600 },601 //total602 { 603 templateType:"number",604 lb:"รวม",605 cName, 606 subCName:subCNameMinMax,607 keyName:"total",608 refInput:genRef(),609 inputType:"number",610 filterCommand:["total"]611 },612 //reduction613 { 614 templateType:"number",615 lb:"สà¹à¸§à¸à¸¥à¸",616 cName, 617 subCName:subCNameMinMax,618 keyName:"reduction",619 refInput:genRef(),620 inputType:"number",621 filterCommand:["reduction"]622 },623 //grandTotal624 { 625 templateType:"number",626 lb:"สุà¸à¸à¸´",627 cName, 628 subCName:subCNameMinMax,629 keyName:"grandTotal",630 refInput:genRef(),631 inputType:"number",632 filterCommand:["granTotal"]633 },634 //detail:{id,productId,barcode,name,groupId,groupName,unit,price,quantity,remark,isRawMat},635 //636 { 637 templateType:"arrayObjectString",638 lb:"รายละà¹à¸à¸µà¸¢à¸|à¹à¸à¸à¸µà¸ªà¸´à¸à¸à¹à¸²",639 cName, 640 subCName:subCNameInput,641 keyName:"detail_id",642 refInput:genRef(),643 inputType:"number",644 filterCommand:["detail","id"]645 },646 { 647 templateType:"arrayObjectString",648 lb:"รายละà¹à¸à¸µà¸¢à¸|à¸à¸²à¸£à¹à¹à¸à¹à¸",649 cName, 650 subCName:subCNameInput,651 keyName:"detail_barcode",652 refInput:genRef(),653 inputType:"text",654 filterCommand:["detail","barcode"]655 },656 { 657 templateType:"arrayObjectString",658 lb:"รายละà¹à¸à¸µà¸¢à¸|à¸à¸·à¹à¸à¸ªà¸´à¸à¸à¹à¸²",659 cName, 660 subCName:subCNameInput,661 keyName:"detail_name",662 refInput:genRef(),663 inputType:"text",664 filterCommand:["detail","name"]665 },666 { 667 templateType:"arrayObjectString",668 lb:"รายละà¹à¸à¸µà¸¢à¸|à¹à¸à¸à¸µà¸à¸¥à¸¸à¹à¸¡",669 cName, 670 subCName:subCNameInput,671 keyName:"detail_groupId",672 refInput:genRef(),673 inputType:"number",674 filterCommand:["detail","groupId"]675 },676 { 677 templateType:"arrayObjectString",678 lb:"รายละà¹à¸à¸µà¸¢à¸|à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡",679 cName, 680 subCName:subCNameInput,681 keyName:"detail_groupName",682 refInput:genRef(),683 inputType:"text",684 filterCommand:["detail","groupName"]685 },686 { 687 templateType:"arrayObjectString",688 lb:"รายละà¹à¸à¸µà¸¢à¸|หà¸à¹à¸§à¸¢",689 cName, 690 subCName:subCNameInput,691 keyName:"detail_unit",692 refInput:genRef(),693 inputType:"text",694 filterCommand:["detail","unit"]695 },696 { 697 templateType:"arrayObjectString",698 lb:"รายละà¹à¸à¸µà¸¢à¸|ราà¸à¸²",699 cName, 700 subCName:subCNameInput,701 keyName:"detail_price",702 refInput:genRef(),703 inputType:"number",704 filterCommand:["detail","price"]705 },706 { 707 templateType:"arrayObjectString",708 lb:"รายละà¹à¸à¸µà¸¢à¸|à¸à¸³à¸à¸§à¸",709 cName, 710 subCName:subCNameInput,711 keyName:"detail_quantity",712 refInput:genRef(),713 inputType:"number",714 filterCommand:["detail","quantity"]715 },716 { 717 templateType:"arrayObjectString",718 lb:"รายละà¹à¸à¸µà¸¢à¸|รวม",719 cName, 720 subCName:subCNameInput,721 keyName:"detail_result",722 refInput:genRef(),723 inputType:"number",724 filterCommand:["detail","result"]725 },726 { 727 templateType:"arrayObjectString",728 lb:"รายละà¹à¸à¸µà¸¢à¸|หมายà¹à¸«à¸à¸¸",729 cName, 730 subCName:subCNameInput,731 keyName:"detail_remark",732 refInput:genRef(),733 inputType:"text",734 filterCommand:["detail","remark"]735 },736 { 737 templateType:"arrayObjectBoolean",738 lb:"รายละà¹à¸à¸µà¸¢à¸|à¹à¸à¹à¸à¸§à¸±à¸à¸à¸¸à¸à¸´à¸",739 cName, 740 subCName:subCNameInput,741 keyName:"detail_isRawMat",742 refInput:genRef(),743 inputType:"checkbox",744 filterCommand:["detail","isRawMat"]745 },746 747]748const transactionLogFilter = [749 750 { 751 templateType:"string",752 lb:"สà¸à¸²à¸à¸°",753 cName, 754 subCName:subCNameInput, 755 keyName:"status",756 refInput:genRef(),757 inputType:"text",758 filterCommand:["status"]759 },760 ...transactionFilter,761]762const StateTemplate={763 partnerFilter,productFilter,jobFilter,transactionFilter,transactionLogFilter764}765 766export default StateTemplate...
fixtures.js
Source:fixtures.js
1module.exports = [2 [3 "pk(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)",4 [5 "pk",6 {7 inputType: "publicKey",8 value: "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",9 parentFingerprint: null,10 parentDerivationPath: null,11 }12 ]13 ],14 [15 "pkh(02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5)",16 [17 "pkh",18 {19 inputType: "publicKey",20 value: "02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5",21 parentFingerprint: null,22 parentDerivationPath: null,23 }24 ]25 ],26 [27 "wpkh(02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9)",28 [29 "wpkh",30 {31 inputType: "publicKey",32 value: "02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9",33 parentFingerprint: null,34 parentDerivationPath: null,35 }36 ]37 ],38 [39 "combo(0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)",40 [41 "combo",42 {43 inputType: "publicKey",44 value: "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",45 parentFingerprint: null,46 parentDerivationPath: null,47 }48 ]49 ],50 [51 "pk(0429b3e0919adc41a316aad4f41444d9bf3a9b639550f2aa735676ffff25ba3898d6881e81d2e0163348ff07b3a9a3968401572aa79c79e7edb522f41addc8e6ce)",52 [53 "pk",54 {55 inputType: "publicKey",56 value: "0429b3e0919adc41a316aad4f41444d9bf3a9b639550f2aa735676ffff25ba3898d6881e81d2e0163348ff07b3a9a3968401572aa79c79e7edb522f41addc8e6ce",57 parentFingerprint: null,58 parentDerivationPath: null,59 }60 ]61 ],62 [63 "sh(wpkh(03fff97bd5755eeea420453a14355235d382f6472f8568a18b2f057a1460297556))",64 [65 "sh",66 [67 "wpkh",68 {69 inputType: "publicKey",70 value: "03fff97bd5755eeea420453a14355235d382f6472f8568a18b2f057a1460297556",71 parentFingerprint: null,72 parentDerivationPath: null,73 }74 ]75 ]76 ],77 [78 "sh(wsh(pkh(02e493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13)))",79 [80 "sh",81 [82 "wsh", 83 [84 "pkh",85 {86 inputType: "publicKey",87 value: "02e493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13",88 parentFingerprint: null,89 parentDerivationPath: null,90 }91 ]92 ]93 ]94 ],95 [96 "multi(1,022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4,025cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc)",97 [98 "multi",99 1,100 {101 inputType: "publicKey",102 value: "022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4",103 parentFingerprint: null,104 parentDerivationPath: null,105 },106 {107 inputType: "publicKey",108 value: "025cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc",109 parentFingerprint: null,110 parentDerivationPath: null,111 },112 ]113 ],114 [115 "sh(multi(2,022f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01,03acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe))",116 [117 "sh",118 [119 "multi",120 2,121 {122 inputType: "publicKey",123 value: "022f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01",124 parentFingerprint: null,125 parentDerivationPath: null,126 },127 {128 inputType: "publicKey",129 value: "03acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe",130 parentFingerprint: null,131 parentDerivationPath: null,132 },133 ]134 ]135 ],136 [137 "sh(sortedmulti(2,03acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe,022f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01))",138 [139 "sh",140 [141 "sortedmulti",142 2,143 {144 inputType: "publicKey",145 value: "03acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe",146 parentFingerprint: null,147 parentDerivationPath: null,148 },149 {150 inputType: "publicKey",151 value: "022f01e5e15cca351daff3843fb70f3c2f0a1bdd05e5af888a67784ef3e10a2a01",152 parentFingerprint: null,153 parentDerivationPath: null,154 },155 ]156 ]157 ],158 [159 "wsh(multi(2,03a0434d9e47f3c86235477c7b1ae6ae5d3442d49b1943c2b752a68e2a47e247c7,03774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb,03d01115d548e7561b15c38f004d734633687cf4419620095bc5b0f47070afe85a))",160 [161 "wsh",162 [163 "multi",164 2,165 {166 inputType: "publicKey",167 value: "03a0434d9e47f3c86235477c7b1ae6ae5d3442d49b1943c2b752a68e2a47e247c7",168 parentFingerprint: null,169 parentDerivationPath: null,170 },171 {172 inputType: "publicKey",173 value: "03774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb",174 parentFingerprint: null,175 parentDerivationPath: null,176 },177 {178 inputType: "publicKey",179 value: "03d01115d548e7561b15c38f004d734633687cf4419620095bc5b0f47070afe85a",180 parentFingerprint: null,181 parentDerivationPath: null,182 },183 ]184 ]185 ],186 [187 "sh(wsh(multi(1,03f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8,03499fdf9e895e719cfd64e67f07d38e3226aa7b63678949e6e49b241a60e823e4,02d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e)))",188 [189 "sh",190 [191 "wsh",192 [193 "multi",194 1,195 {196 inputType: "publicKey",197 value: "03f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8",198 parentFingerprint: null,199 parentDerivationPath: null,200 },201 {202 inputType: "publicKey",203 value: "03499fdf9e895e719cfd64e67f07d38e3226aa7b63678949e6e49b241a60e823e4",204 parentFingerprint: null,205 parentDerivationPath: null,206 },207 {208 inputType: "publicKey",209 value: "02d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e",210 parentFingerprint: null,211 parentDerivationPath: null,212 },213 ]214 ]215 ]216 ],217 [218 "pk(xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8)",219 [220 "pk",221 {222 inputType: "extendedPublicKey",223 value: "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8",224 parentFingerprint: null,225 parentDerivationPath: null,226 derivationPath: null,227 wildcard: false,228 wildcardHardened: false,229 }230 ]231 ],232 [233 "pkh(xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw/1'/2)",234 [235 "pkh",236 {237 inputType: "extendedPublicKey",238 value: "xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw",239 parentFingerprint: null,240 parentDerivationPath: null,241 derivationPath: "/1'/2",242 wildcard: false,243 wildcardHardened: false,244 }245 ]246 ],247 [248 "pkh([d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/1/*)",249 [250 "pkh",251 {252 inputType: "extendedPublicKey",253 value: "xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL",254 parentFingerprint: "d34db33f",255 parentDerivationPath: "/44'/0'/0'",256 derivationPath: "/1",257 wildcard: true,258 wildcardHardened: false,259 }260 ]261 ],262 [263 "wsh(multi(1,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))",264 [265 "wsh",266 [267 "multi",268 1,269 {270 inputType: "extendedPublicKey",271 value: "xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB",272 parentFingerprint: null,273 parentDerivationPath: null,274 derivationPath: "/1/0",275 wildcard: true,276 wildcardHardened: false,277 },278 {279 inputType: "extendedPublicKey",280 value: "xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH",281 parentFingerprint: null,282 parentDerivationPath: null,283 derivationPath: "/0/0",284 wildcard: true,285 wildcardHardened: false,286 }287 ]288 ]289 ],290 [291 "wsh(sortedmulti(1,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))",292 [293 "wsh",294 [295 "sortedmulti",296 1,297 {298 inputType: "extendedPublicKey",299 value: "xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB",300 parentFingerprint: null,301 parentDerivationPath: null,302 derivationPath: "/1/0",303 wildcard: true,304 wildcardHardened: false,305 },306 {307 inputType: "extendedPublicKey",308 value: "xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH",309 parentFingerprint: null,310 parentDerivationPath: null,311 derivationPath: "/0/0",312 wildcard: true,313 wildcardHardened: false,314 }315 ]316 ]317 ],318 [319 "raw(ababab)",320 [321 "raw",322 "ababab",323 ]324 ],325 // [326 // "addr(1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2)",327 // [328 // "addr",329 // {330 // inputType: "address",331 // value: "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",332 // parenetFingerprint: null,333 // parenetDerivationPath: null,334 // }335 // ]336 // ],337 // [338 // "pk(5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ)",339 // [340 // "pk",341 // {342 // inputType: "privateKey",343 // value: "5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ",344 // parentFingerprint: null,345 // parentDerivationPath: null,346 // }347 // ]348 // ],...
metadata.js
Source:metadata.js
1// @flow2import type { MetaData } from './types'3function genDescription(defaultDescription: string) {4 return {5 inputType: 'text',6 defaultValue: defaultDescription,7 isPrimary: true8 }9}10const universal: MetaData = {11 color: {12 inputType: 'text',13 defaultValue: '#3090FF',14 isPrimary: true15 },16 visible: {17 inputType: 'boolean',18 defaultValue: true,19 isPrimary: true20 },21 opacity: {22 inputType: 'math',23 defaultValue: '1'24 },25 zIndex: {26 inputType: 'math',27 defaultValue: '0',28 label: 'z-index'29 },30 zBias: {31 inputType: 'math',32 defaultValue: '0',33 label: 'z-bias'34 },35 calculatedVisibility: {36 inputType: 'math',37 defaultValue: '',38 allowEmpty: true,39 label: 'calculated visibility'40 }41}42const labeled: MetaData = {43 label: {44 inputType: 'text',45 defaultValue: ''46 },47 labelVisible: {48 inputType: 'boolean',49 defaultValue: false,50 label: 'label visible'51 }52}53// ---------- Axis ---------- //54const axisSpecific: MetaData = {55 color: {56 inputType: 'text',57 defaultValue: '#808080',58 isPrimary: true59 },60 min: {61 inputType: 'math',62 defaultValue: '-5',63 isPrimary: true64 },65 max: {66 inputType: 'math',67 defaultValue: '+5',68 isPrimary: true69 },70 axis: {71 inputType: 'text',72 defaultValue: 'x',73 isPrimary: true74 },75 scale: {76 inputType: 'math',77 defaultValue: '1',78 isPrimary: true79 },80 labelVisible: {81 inputType: 'boolean',82 defaultValue: true,83 label: 'label visible'84 },85 ticksVisible: {86 inputType: 'boolean',87 defaultValue: true,88 label: 'ticks visible'89 },90 size: {91 inputType: 'math',92 defaultValue: '2'93 },94 width: {95 inputType: 'math',96 defaultValue: '1'97 }98}99export const axisMeta: MetaData = {100 ...universal,101 ...labeled,102 ...axisSpecific103}104// ---------- Grid ---------- //105const gridSpecific: MetaData = {106 color: {107 inputType: 'text',108 defaultValue: '#808080',109 isPrimary: true110 },111 width: {112 inputType: 'math',113 defaultValue: '1/2'114 },115 divisions: {116 inputType: 'math',117 defaultValue: '\\left[10,\\ 10\\right]'118 },119 snap: {120 inputType: 'boolean',121 defaultValue: false122 }123}124export const gridMeta: MetaData = {125 ...universal,126 ...gridSpecific127}128// ---------- Point ---------- //129const pointSpecific: MetaData = {130 description: genDescription('Point'),131 coords: {132 inputType: 'math',133 defaultValue: '\\left[0,0,0\\right]',134 isPrimary: true135 },136 size: {137 inputType: 'math',138 defaultValue: '16'139 }140}141export const pointMeta: MetaData = {142 ...universal,143 ...labeled,144 ...pointSpecific145}146// ---------- Line ---------- //147const lineLike: MetaData = {148 size: {149 inputType: 'math',150 defaultValue: '6'151 },152 width: {153 inputType: 'math',154 defaultValue: '4'155 },156 start: {157 inputType: 'boolean',158 defaultValue: false159 },160 end: {161 inputType: 'boolean',162 defaultValue: false163 }164}165const lineSpecific: MetaData = {166 description: genDescription('Line'),167 coords: {168 inputType: 'math',169 defaultValue: '\\left[\\left[1,1,1\\right], \\left[-1,1,-1\\right]\\right]',170 isPrimary: true171 }172}173export const lineMeta: MetaData = {174 ...universal,175 ...labeled,176 ...lineLike,177 ...lineSpecific178}179// ---------- Vector ---------- //180const vectorSpecific: MetaData = {181 components: {182 inputType: 'math',183 defaultValue: '\\left[3,2,1\\right]',184 isPrimary: true185 },186 tail: {187 inputType: 'math',188 defaultValue: '\\left[0,0,0\\right]'189 },190 end: {191 inputType: 'boolean',192 defaultValue: true193 }194}195export const vectorMeta: MetaData = {196 ...universal,197 ...labeled,198 ...lineLike,199 ...vectorSpecific200}201// ---------- ParametricCurve ---------- //202const parametricCurveSpecific: MetaData = {203 expr: {204 inputType: 'math',205 defaultValue: '_f(t)=\\left[\\cos\\left(t\\right),\\ \\sin\\left(t\\right),\\ t\\right]',206 isPrimary: true207 },208 range: {209 inputType: 'math',210 defaultValue: '\\left[-2\\pi,\\ 2\\pi\\right]',211 isPrimary: true212 },213 samples: {214 inputType: 'math',215 defaultValue: '128'216 }217}218export const parametricCurveMeta: MetaData = {219 ...universal,220 ...lineLike,221 ...parametricCurveSpecific222}223// ---------- ParametricSurface ---------- //224const surfaceLike: MetaData = {225 shaded: {226 inputType: 'boolean',227 defaultValue: true228 },229 opacity: {230 inputType: 'math',231 defaultValue: '0.75'232 }233}234function makeParametricSamplesAndGrid(labelU: string, labelV: string) {235 return {236 uSamples: {237 inputType: 'math',238 defaultValue: '64',239 label: `${labelU} samples`240 },241 vSamples: {242 inputType: 'math',243 defaultValue: '64',244 label: `${labelV} samples`245 },246 gridU: {247 inputType: 'math',248 defaultValue: '8',249 label: `${labelU} gridlines`250 },251 gridV: {252 inputType: 'math',253 defaultValue: '8',254 label: `${labelV} gridlines`255 }256 }257}258const parametricSurfacaSpecific: MetaData = {259 expr: {260 inputType: 'math',261 defaultValue: '_f(u,v)=\\left[v\\cdot\\cos\\left(u\\right),v\\cdot\\sin\\left(u\\right),v\\right]',262 isPrimary: true263 },264 rangeU: {265 inputType: 'math',266 defaultValue: '\\left[-\\pi,\\ \\pi\\right]',267 isPrimary: true268 },269 rangeV: {270 inputType: 'math',271 defaultValue: '\\left[-3, 3\\right]',272 isPrimary: true273 },274 colorExpr: {275 isPrimary: true,276 inputType: 'math',277 defaultValue: '_f(X, Y, Z, u, v)=mod(Z, 1)'278 },279 gridOpacity: {280 inputType: 'math',281 defaultValue: '0.5'282 },283 gridWidth: {284 inputType: 'math',285 defaultValue: '2'286 },287 ...makeParametricSamplesAndGrid('u', 'v')288}289export const parametricSurfacaMeta: MetaData = {290 ...universal,291 ...surfaceLike,292 ...parametricSurfacaSpecific293}294// ---------- Explicit Surface (Rectangular) ---------- //295export const explicitSurfaceMeta: MetaData = {296 ...parametricSurfacaMeta,297 ...makeParametricSamplesAndGrid('x', 'y'),298 expr: {299 inputType: 'math',300 defaultValue: '_f(x,y)=x^2-y^2',301 isPrimary: true302 },303 rangeU: {304 inputType: 'math',305 defaultValue: '\\left[-2,\\ 2\\right]',306 isPrimary: true307 },308 rangeV: {309 inputType: 'math',310 defaultValue: '\\left[-2,\\ 2\\right]',311 isPrimary: true312 },313 colorExpr: {314 isPrimary: true,315 inputType: 'math',316 defaultValue: '_f(X, Y, Z, x, y)=mod(Z, 1)'317 }318}319// ---------- ExplicitSurface Polar ---------- //320export const explicitSurfacePolarMeta: MetaData = {321 ...parametricSurfacaMeta,322 ...makeParametricSamplesAndGrid('r', '\u03B8'), // \u03B8 is lowercase theta323 expr: {324 inputType: 'math',325 defaultValue: '_f(r,\\theta)=\\frac{1}{4}r^2\\cdot\\cos\\left(3\\theta\\right)',326 isPrimary: true327 },328 rangeU: {329 inputType: 'math',330 defaultValue: '\\left[0,\\ 3\\right]',331 isPrimary: true332 },333 rangeV: {334 inputType: 'math',335 defaultValue: '\\left[-\\pi,\\ \\pi\\right]',336 isPrimary: true337 },338 colorExpr: {339 isPrimary: true,340 inputType: 'math',341 defaultValue: '_f(X, Y, Z, r, \\theta)=mod(Z, 1)'342 }343}344// ---------- Implicit Surface ---------- //345const implicitSurfaceSpecific: MetaData = {346 lhs: {347 inputType: 'math',348 defaultValue: '_f(x,y,z)=x^2+y^2',349 isPrimary: true350 },351 rhs: {352 inputType: 'math',353 defaultValue: '_f(x,y,z)=z^2+1',354 isPrimary: true355 },356 samples: {357 inputType: 'math',358 defaultValue: '20'359 },360 opacity: {361 inputType: 'math',362 defaultValue: '1'363 }364}365const volumetricRange = {366 rangeX: {367 inputType: 'math',368 defaultValue: '\\left[-5,\\ 5\\right]',369 isPrimary: true370 },371 rangeY: {372 inputType: 'math',373 defaultValue: '\\left[-5,\\ 5\\right]',374 isPrimary: true375 },376 rangeZ: {377 inputType: 'math',378 defaultValue: '\\left[-5,\\ 5\\right]',379 isPrimary: true380 }381}382export const implicitSurfaceMeta: MetaData = {383 ...universal,384 ...surfaceLike,385 ...volumetricRange,386 ...implicitSurfaceSpecific387}388// ---------- Vector Field ---------- //389const vectorFieldSpecific: MetaData = {390 expr: {391 inputType: 'math',392 defaultValue: '_f(x,y,z)=\\frac{[y,\\ -x,\\ 0]}{\\sqrt{x^2+y^2}}',393 isPrimary: true394 },395 samples: {396 inputType: 'math',397 defaultValue: '[10, 10, 5]'398 },399 scale: {400 inputType: 'math',401 defaultValue: '1'402 },403 width: {404 inputType: 'math',405 defaultValue: '2'406 },407 end: {408 inputType: 'boolean',409 defaultValue: true410 }411}412export const vectorFieldMeta: MetaData = {413 ...universal,414 ...lineLike,415 ...volumetricRange,416 ...vectorFieldSpecific417}418// ---------- Camera ---------- //419export const cameraMeta: MetaData = {420 isOrthographic: {421 inputType: 'boolean',422 defaultValue: false,423 isPrimary: true424 },425 isPanEnabled: {426 inputType: 'boolean',427 defaultValue: false,428 isPrimary: true429 },430 isZoomEnabled: {431 inputType: 'boolean',432 defaultValue: true,433 isPrimary: true434 },435 isRotateEnabled: {436 inputType: 'boolean',437 defaultValue: true,438 isPrimary: true439 },440 relativePosition: {441 inputType: 'numericArray',442 defaultValue: [0.5, -2.0, 0.5],443 isPrimary: true444 },445 relativeLookAt: {446 inputType: 'numericArray',447 defaultValue: [0, 0, 0],448 isPrimary: true449 },450 computedPosition: {451 inputType: 'math',452 defaultValue: '\\left[-6, -4, 2\\right]',453 isPrimary: true454 },455 computedLookAt: {456 inputType: 'math',457 defaultValue: '\\left[0, 0, 0\\right]',458 isPrimary: true459 },460 useComputed: {461 inputType: 'boolean',462 defaultValue: false,463 isPrimary: true464 }...
ComparisonOperator.js
Source:ComparisonOperator.js
1/**2 * @author GJ3 */4urule.ComparisonOperator=function(menuCallFun){5 this.inputType=null;6 this.operator="";7 this.container=generateContainer();8 URule.setDomContent(this.container,"请éæ©æ¯è¾æä½ç¬¦");9 this.container.css({10 "font-size":"13px",11 "color":"red",12 "fontWeight":"bold",13 "margin-right":"3px"14 });15 var self=this;16 var onClick=function(menu){17 self.setOperator(menu.name);18 };19 self.menu=new URule.menu.Menu({20 onHide:function(){21 menuCallFun();22 },23 menuItems:[{24 label : "大äº",25 name:"GreaterThen",26 onClick : onClick27 }, {28 label : "大äºæçäº",29 name:"GreaterThenEquals",30 onClick : onClick31 }, {32 label : "å°äº",33 name:"LessThen",34 onClick : onClick35 }, {36 label : "å°äºæçäº",37 name:"LessThenEquals",38 onClick : onClick39 }, {40 label : "çäº",41 name:"Equals",42 onClick : onClick43 }, 44 // {45 // label : "çäº(ä¸å大å°å)",46 // name:"EqualsIgnoreCase",47 // onClick : onClick48 // }, {49 // label : "å¼å§äº",50 // name:"StartWith",51 // onClick : onClick52 // }, {53 // label : "ä¸å¼å§äº",54 // name:"NotStartWith",55 // onClick : onClick56 // },{57 // label : "ç»æäº",58 // name:"EndWith",59 // onClick : onClick60 // },{61 // label : "ä¸ç»æäº",62 // name:"NotEndWith",63 // onClick : onClick64 // }, 65 {66 label : "ä¸çäº",67 name:"NotEquals",68 onClick : onClick69 },70 // {71 // label : "ä¸çäº(ä¸å大å°å)",72 // name:"NotEqualsIgnoreCase",73 // onClick : onClick74 // }, {75 // label : "å¨éå",76 // name:"In",77 // onClick : onClick78 // }, {79 // label : "ä¸å¨éå",80 // name:"NotIn",81 // onClick : onClick82 // }, 83 {84 label : "为空",85 name:"Null",86 onClick : onClick87 }, {88 label : "ä¸ä¸ºç©º",89 name:"NotNull",90 onClick : onClick91 }, 92 // {93 // label : "å¹é
æ£å表达å¼",94 // name:"Match",95 // onClick : onClick96 // }, {97 // label : "ä¸å¹é
æ£å表达å¼",98 // name:"NotMatch",99 // onClick : onClick100 // }101 ]102 });103 this.container.click(function(e){104 self.menu.show(e);105 });106 107};108urule.ComparisonOperator.prototype.initRightValue=function(data){109 if(!this.inputType){110 return;111 }112 this.inputType.setValueType(data["valueType"],data);113};114urule.ComparisonOperator.prototype.setOperator=function(operator){115 switch(operator){116 case "GreaterThen":117 this.operator="GreaterThen";118 URule.setDomContent(this.container,"大äº");119 if(this.inputType){120 this.inputType.getContainer().remove();121 }122 this.inputType=new urule.InputType(); 123 break;124 case "GreaterThenEquals":125 this.operator="GreaterThenEquals";126 URule.setDomContent(this.container,"大äºæçäº");127 if(this.inputType){128 this.inputType.getContainer().remove();129 }130 this.inputType=new urule.InputType(); 131 break;132 case "LessThen":133 this.operator="LessThen";134 URule.setDomContent(this.container,"å°äº");135 if(this.inputType){136 this.inputType.getContainer().remove();137 }138 this.inputType=new urule.InputType(); 139 break;140 case "LessThenEquals":141 this.operator="LessThenEquals";142 URule.setDomContent(this.container,"å°äºæçäº");143 if(this.inputType){144 this.inputType.getContainer().remove();145 }146 this.inputType=new urule.InputType(); 147 break;148 case "StartWith":149 this.operator="StartWith";150 URule.setDomContent(this.container,"å¼å§äº");151 if(this.inputType){152 this.inputType.getContainer().remove();153 }154 this.inputType=new urule.InputType(); 155 break;156 case "Equals":157 this.operator="Equals";158 URule.setDomContent(this.container,"çäº");159 if(this.inputType){160 this.inputType.getContainer().remove();161 }162 this.inputType=new urule.InputType(); 163 break;164 case "EqualsIgnoreCase":165 this.operator="EqualsIgnoreCase";166 URule.setDomContent(this.container,"çäº(ä¸å大å°å)");167 if(this.inputType){168 this.inputType.getContainer().remove();169 }170 this.inputType=new urule.InputType(); 171 break;172 case "NotStartWith":173 this.operator="NotStartWith";174 URule.setDomContent(this.container,"ä¸å¼å§äº");175 if(this.inputType){176 this.inputType.getContainer().remove();177 }178 this.inputType=new urule.InputType(); 179 break;180 case "EndWith":181 this.operator="EndWith";182 URule.setDomContent(this.container,"ç»æäº");183 if(this.inputType){184 this.inputType.getContainer().remove();185 }186 this.inputType=new urule.InputType(); 187 break;188 case "NotEndWith":189 this.operator="NotEndWith";190 URule.setDomContent(this.container,"ä¸ç»æäº");191 if(this.inputType){192 this.inputType.getContainer().remove();193 }194 this.inputType=new urule.InputType();195 break;196 case "NotEquals":197 this.operator="NotEquals";198 URule.setDomContent(this.container,"ä¸çäº");199 if(this.inputType){200 this.inputType.getContainer().remove();201 }202 this.inputType=new urule.InputType();203 break;204 case "NotEqualsIgnoreCase":205 this.operator="NotEqualsIgnoreCase";206 URule.setDomContent(this.container,"ä¸çäº(ä¸å大å°å)");207 if(this.inputType){208 this.inputType.getContainer().remove();209 }210 this.inputType=new urule.InputType();211 break;212 case "In":213 this.operator="In";214 URule.setDomContent(this.container,"å¨éå");215 if(this.inputType){216 this.inputType.getContainer().remove();217 }218 this.inputType=new urule.InputType("ä¹ä¸"); 219 break;220 case "NotIn":221 this.operator="NotIn";222 URule.setDomContent(this.container,"ä¸å¨éå");223 if(this.inputType){224 this.inputType.getContainer().remove();225 }226 this.inputType=new urule.InputType("ä¹ä¸"); 227 break;228 case "Null":229 this.operator="Null";230 URule.setDomContent(this.container,"为空");231 if(this.inputType){232 this.inputType.getContainer().remove();233 this.inputType=null;234 }235 break;236 case "NotNull":237 this.operator="NotNull";238 URule.setDomContent(this.container,"ä¸ä¸ºç©º");239 if(this.inputType){240 this.inputType.getContainer().remove();241 this.inputType=null;242 }243 break;244 case "Match":245 this.operator="Match";246 URule.setDomContent(this.container,"å¹é
æ£å表达å¼");247 if(this.inputType){248 this.inputType.getContainer().remove();249 }250 this.inputType=new urule.InputType();251 break;252 case "NotMatch":253 this.operator="NotMatch";254 URule.setDomContent(this.container,"ä¸å¹é
æ£å表达å¼");255 if(this.inputType){256 this.inputType.getContainer().remove();257 }258 this.inputType=new urule.InputType();259 break;260 }261};262urule.ComparisonOperator.prototype.getOperator=function(){263 if(this.operator==""){264 throw "请éæ©æ¯è¾æä½ç¬¦ï¼";265 }266 return this.operator;267};268urule.ComparisonOperator.prototype.getInputType=function(){269 return this.inputType;270};271urule.ComparisonOperator.prototype.getContainer=function(){272 return this.container;...
chartDefinitions.js
Source:chartDefinitions.js
1const chartDefinitions = [2 {3 chartType: 'line',4 tauChartsType: 'line',5 chartLabel: 'Line',6 fields: [7 {8 fieldId: 'x',9 required: true,10 label: 'x',11 inputType: 'field-dropdown'12 },13 {14 fieldId: 'y',15 required: true,16 label: 'y',17 inputType: 'field-dropdown'18 },19 {20 fieldId: 'split',21 required: false,22 label: 'color / line for each',23 inputType: 'field-dropdown',24 forceDimension: true25 },26 {27 fieldId: 'size',28 required: false,29 label: 'size',30 inputType: 'field-dropdown'31 },32 {33 fieldId: 'xFacet',34 requied: false,35 label: 'x Facet',36 inputType: 'field-dropdown',37 forceDimension: true38 },39 {40 fieldId: 'yFacet',41 required: false,42 label: 'y Facet',43 inputType: 'field-dropdown',44 forceDimension: true45 },46 {47 fieldId: 'filter',48 required: false,49 label: 'Quick Filter',50 inputType: 'checkbox'51 },52 {53 fieldId: 'trendline',54 required: false,55 label: 'Show Trendline',56 inputType: 'checkbox'57 },58 {59 fieldId: 'yMin',60 required: false,61 label: 'y Axis Min',62 inputType: 'textbox'63 },64 {65 fieldId: 'yMax',66 required: false,67 label: 'y Axis Max',68 inputType: 'textbox'69 }70 ]71 },72 {73 chartType: 'bar',74 tauChartsType: 'horizontalBar',75 chartLabel: 'Bar - Horizontal',76 fields: [77 {78 fieldId: 'barlabel',79 required: true,80 label: 'Bar Label',81 inputType: 'field-dropdown'82 },83 {84 fieldId: 'barvalue',85 required: true,86 label: 'Bar Value',87 inputType: 'field-dropdown'88 },89 {90 fieldId: 'labelFacet',91 required: false,92 label: 'Bar Label Facet',93 inputType: 'field-dropdown',94 forceDimension: true95 },96 {97 fieldId: 'valueFacet',98 required: false,99 label: 'Bar Value Facet',100 inputType: 'field-dropdown',101 forceDimension: true102 }103 ]104 },105 {106 chartType: 'verticalbar',107 tauChartsType: 'bar',108 chartLabel: 'Bar - Vertical',109 fields: [110 {111 fieldId: 'barlabel',112 required: true,113 label: 'Bar Label',114 inputType: 'field-dropdown'115 },116 {117 fieldId: 'barvalue',118 required: true,119 label: 'Bar Value',120 inputType: 'field-dropdown'121 },122 {123 fieldId: 'labelFacet',124 required: false,125 label: 'Bar Label Facet',126 inputType: 'field-dropdown',127 forceDimension: true128 },129 {130 fieldId: 'valueFacet',131 required: false,132 label: 'Bar Value Facet',133 inputType: 'field-dropdown',134 forceDimension: true135 }136 ]137 },138 {139 chartType: 'bubble',140 tauChartsType: 'scatterplot',141 chartLabel: 'Scatterplot',142 fields: [143 {144 fieldId: 'x',145 label: 'x Axis',146 inputType: 'field-dropdown',147 required: true148 },149 {150 fieldId: 'y',151 label: 'y Axis',152 inputType: 'field-dropdown',153 required: true154 },155 {156 fieldId: 'size',157 label: 'Size',158 inputType: 'field-dropdown',159 required: false160 },161 {162 fieldId: 'color',163 label: 'Color',164 inputType: 'field-dropdown',165 required: false166 },167 {168 fieldId: 'xFacet',169 requied: false,170 label: 'x Facet',171 inputType: 'field-dropdown',172 forceDimension: true173 },174 {175 fieldId: 'yFacet',176 required: false,177 label: 'y Facet',178 inputType: 'field-dropdown',179 forceDimension: true180 },181 {182 fieldId: 'filter',183 required: false,184 label: 'Quick Filter',185 inputType: 'checkbox'186 },187 {188 fieldId: 'trendline',189 required: false,190 label: 'Show Trendline',191 inputType: 'checkbox'192 }193 ]194 },195 {196 chartType: 'stacked-bar-vertical',197 tauChartsType: 'stacked-bar',198 chartLabel: 'Stacked Bar - Vertical',199 fields: [200 {201 fieldId: 'barlabel',202 required: true,203 label: 'Bar Label',204 inputType: 'field-dropdown'205 },206 {207 fieldId: 'barvalue',208 required: true,209 label: 'Bar Value',210 inputType: 'field-dropdown'211 },212 {213 fieldId: 'color',214 label: 'Color',215 inputType: 'field-dropdown',216 required: false217 },218 {219 fieldId: 'labelFacet',220 required: false,221 label: 'Bar Label Facet',222 inputType: 'field-dropdown',223 forceDimension: true224 },225 {226 fieldId: 'valueFacet',227 required: false,228 label: 'Bar Value Facet',229 inputType: 'field-dropdown',230 forceDimension: true231 }232 ]233 },234 {235 chartType: 'stacked-bar-horizontal',236 tauChartsType: 'horizontal-stacked-bar',237 chartLabel: 'Stacked Bar - Horizontal',238 fields: [239 {240 fieldId: 'barlabel',241 required: true,242 label: 'Bar Label',243 inputType: 'field-dropdown'244 },245 {246 fieldId: 'barvalue',247 required: true,248 label: 'Bar Value',249 inputType: 'field-dropdown'250 },251 {252 fieldId: 'color',253 label: 'Color',254 inputType: 'field-dropdown',255 required: false256 },257 {258 fieldId: 'labelFacet',259 required: false,260 label: 'Bar Label Facet',261 inputType: 'field-dropdown',262 forceDimension: true263 },264 {265 fieldId: 'valueFacet',266 required: false,267 label: 'Bar Value Facet',268 inputType: 'field-dropdown',269 forceDimension: true270 }271 ]272 }273];...
singleton-inputcontrol.js
Source:singleton-inputcontrol.js
1var InputType = {2 NONE: -1,3 MOUSE: -2,4 LEFT: 0,5 UP: 1,6 RIGHT: 2,7 DOWN: 3,8 BTN1: 4,9 BTN2: 5,10 BTN3: 6,11 BTN4: 7,12 BTN5: 8,13 BTN6: 9,14 BTN7: 10,15 BTN8: 1116};17var InputControl = {18 _counter: null,19 _counterHigh: null,20 _blanckCounter: null,21 _prevInputType: -1,22 _isWait: false,23 24 initSingleton: function() {25 this._counterHigh = createObject(CycleCounter);26 this._counterHigh.setCounterInfo(0);27 28 this._counter = createObject(CycleCounter);29 this._counter.setCounterInfo(4);30 this._counter.disableGameAcceleration();31 32 this._blanckCounter = createObject(CycleCounter);33 this._blanckCounter.setCounterInfo(2);34 this._counter.disableGameAcceleration();35 },36 37 isSelectState: function() {38 return root.isInputState(InputType.BTN1);39 },40 41 isSelectAction: function() {42 return root.isInputAction(InputType.BTN1) || root.isMouseAction(MouseType.LEFT);43 },44 45 isCancelState: function() {46 return root.isInputState(InputType.BTN2) || root.isMouseAction(MouseType.DOWNWHEEL);47 },48 49 isCancelAction: function() {50 return root.isInputAction(InputType.BTN2) || root.isMouseAction(MouseType.RIGHT);51 },52 53 isOptionAction: function() {54 return root.isInputAction(InputType.BTN3);55 },56 57 isOptionAction2: function() {58 return root.isInputAction(InputType.BTN4);59 },60 61 isLeftPadAction: function() {62 return root.isInputAction(InputType.BTN5) || root.isMouseAction(MouseType.UPWHEEL);63 },64 65 isRightPadAction: function() {66 return root.isInputAction(InputType.BTN6) || root.isMouseAction(MouseType.DOWNWHEEL);67 },68 69 isSystemState: function() {70 return root.isInputState(InputType.BTN7);71 },72 73 isStartAction: function() {74 var type = EnvironmentControl.getSkipControlType();75 76 if (type === 0 || !root.isSystemSettings(SystemSettingsType.SKIP)) {77 return false;78 }79 80 if (root.isInputAction(InputType.BTN8)) {81 if (type === 1 && root.isMouseAction(MouseType.RIGHT)) {82 return false;83 }84 85 return true;86 }87 88 return false;89 },90 91 isInputState: function(type) {92 return root.isInputState(type);93 },94 95 isInputAction: function(type) {96 return root.isInputAction(type);97 },98 99 getDirectionState: function() {100 var inputType;101 var result = InputType.NONE;102 103 inputType = this.getInputType();104 105 // Check if the current state is no input.106 if (inputType === InputType.NONE) {107 this._prevInputType = inputType;108 this._isWait = false;109 return inputType;110 }111 112 // Check if the previous state is no input, or the current input differs from the previous one.113 if (inputType !== this._prevInputType || this._prevInputType === InputType.NONE) { 114 this._prevInputType = inputType;115 this._isWait = true;116 this._counter.resetCounterValue();117 this._blanckCounter.resetCounterValue();118 return inputType;119 }120 121 // Current input and previous input are identical.122 // It means that the key is continuously pressed.123 124 if (this._isWait) {125 if (this._blanckCounter.moveCycleCounter() !== MoveResult.CONTINUE) {126 this._isWait = false;127 }128 }129 else {130 if (this._counter.moveCycleCounter() !== MoveResult.CONTINUE) {131 // Allow to input.132 result = inputType;133 }134 }135 136 return result;137 },138 139 getDirectionStateHigh: function() {140 var inputType = InputType.NONE;141 142 if (DataConfig.isHighPerformance()) {143 if (this._counterHigh.moveCycleCounter() !== MoveResult.CONTINUE) {144 inputType = this.getInputType();145 }146 }147 else {148 inputType = this.getInputType();149 }150 151 return inputType;152 },153 154 getInputType: function() {155 var inputType = InputType.NONE;156 157 if (root.isInputState(InputType.LEFT)) {158 inputType = InputType.LEFT;159 }160 else if (root.isInputState(InputType.UP)) {161 inputType = InputType.UP;162 }163 else if (root.isInputState(InputType.RIGHT)) {164 inputType = InputType.RIGHT;165 }166 else if (root.isInputState(InputType.DOWN)) {167 inputType = InputType.DOWN;168 }169 170 return inputType;171 }...
type.client.service.js
Source:type.client.service.js
1'use strict';2//Questions service used for communicating with the questions REST endpoints3angular.module('questions').service('QuestionType', function() {4 this.getConditions = function(type) {5 if ( type === 'Yes/No' ) {6 return [7 {8 condition: 'yes',9 text: 'Yes',10 inputType: 'none'11 },12 {13 condition: 'no',14 text: 'No',15 inputType: 'none'16 }17 ];18 } else if ( type === 'Yes/No/NA' ) {19 return [20 {21 condition: 'yes',22 text: 'Yes',23 inputType: 'none'24 },25 {26 condition: 'no',27 text: 'No',28 inputType: 'none'29 },30 {31 condition: 'na',32 text: 'N/A',33 inputType: 'none'34 }35 ];36 } else if ( type === 'Numeric' ) {37 return [38 {39 condition: 'greaterThan',40 text: '>',41 inputType: 'number'42 },43 {44 condition: 'lessThan',45 text: '<',46 inputType: 'number'47 },48 {49 condition: 'equal',50 text: '=',51 inputType: 'number'52 }53 ];54 } else if ( type === 'Single' ) {55 return [56 {57 condition: 'equal',58 text: '',59 inputType: 'text'60 },61 {62 condition: 'equal',63 text: '',64 inputType: 'text'65 },66 {67 condition: 'equal',68 text: '',69 inputType: 'text'70 }71 ];72 } else if ( type === 'Date' ) {73 return [74 {75 condition: 'greaterThan',76 text: 'After',77 inputType: 'date'78 },79 {80 condition: 'lessThan',81 text: 'Before',82 inputType: 'date'83 },84 {85 condition: 'equal',86 text: 'Equal To',87 inputType: 'date'88 }89 ];90 } else if ( type === 'Text' ) {91 return [92 {93 condition: '',94 text: '',95 inputType: 'text'96 }97 ];98 } else {99 return [];100 }101 };...
Using AI Code Generation
1const inputType = require('playwright/lib/server/inputType');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const page = await browser.newPage();6 await page.click('input[type="text"]');7 await inputType(page, 'hello');8 await browser.close();9})();
Using AI Code Generation
1const { inputType } = require('@playwright/test/lib/server/frames');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 await page.click('input[name="q"]');8 await inputType(page, 'hello playwright');9 await browser.close();10})();11const { inputType } = require('@playwright/test/lib/server/frames');12const { chromium } = require('playwright');13(async () => {14 const browser = await chromium.launch();15 const context = await browser.newContext();16 const page = await context.newPage();17 await page.click('input[name="q"]');18 await inputType(page, 'hello playwright');19 await browser.close();20})();21const { inputType } = require('@playwright/test/lib/server/frames');22const { chromium } = require('playwright');23(async () => {24 const browser = await chromium.launch();25 const context = await browser.newContext();26 const page = await context.newPage();27 await page.click('input[name="q"]');28 await inputType(page, 'hello playwright');29 await browser.close();30})();31const { inputType } = require('@playwright/test/lib/server/frames');32const { chromium } = require('playwright');33(async () => {34 const browser = await chromium.launch();35 const context = await browser.newContext();36 const page = await context.newPage();37 await page.click('input[name="q"]');38 await inputType(page, 'hello playwright');39 await browser.close();40})();41const { inputType } = require('@playwright/test/lib/server/frames');42const { chromium } = require('playwright');43(async () => {44 const browser = await chromium.launch();45 const context = await browser.newContext();46 const page = await context.newPage();47 await page.click('input[name="q"]');
Using AI Code Generation
1const {inputType} = require('playwright/lib/server/inputType');2const {chromium} = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 const input = await page.$('input');8 await input.focus();9 await inputType(page, {text: 'Hello World'});10 await browser.close();11})();
Using AI Code Generation
1const { Input } = require('playwright/lib/input');2const { Keyboard } = require('playwright/lib/keyboard');3const { Mouse } = require('playwright/lib/mouse');4const { Touchscreen } = require('playwright/lib/touchscreen');5const { Playwright } = require('playwright/lib/server/playwright');6const { Page } = require('playwright/lib/server/page');7const { Frame } = require('playwright/lib/server/frame');8(async () => {9 const playwright = new Playwright();10 const browser = await playwright.chromium.launch();11 const context = await browser.newContext();12 const page = await context.newPage();13 await page.click('input[name="q"]');14 await page.keyboard.inputType('hello world');15 await page.screenshot({ path: 'example.png' });16 await browser.close();17})();18const { Input } = require('playwright/lib/input');19const { Keyboard } = require('playwright/lib/keyboard');20const { Mouse } = require('playwright/lib/mouse');21const { Touchscreen } = require('playwright/lib/touchscreen');22const { Playwright } = require('playwright/lib/server/playwright');23const { Page } = require('playwright/lib/server/page');24const { Frame } = require('playwright/lib/server/frame');25(async () => {26 const playwright = new Playwright();27 const browser = await playwright.chromium.launch();28 const context = await browser.newContext();29 const page = await context.newPage();30 await page.click('input[name="q"]');31 await page.keyboard.inputType('hello world');32 await page.screenshot({ path: 'example.png' });33 await browser.close();34})();35const { Input } = require('playwright/lib/input');36const { Keyboard } = require('playwright/lib/keyboard');37const { Mouse } = require('playwright/lib/mouse');38const { Touchscreen } = require('playwright/lib/touchscreen');39const { Playwright } = require('playwright/lib/server
Using AI Code Generation
1const { inputType } = require("playwright/lib/internal/protocol/protocol.yml");2const { chromium } = require("playwright");3(async () => {4 const browser = await chromium.launch({ headless: false });5 const page = await browser.newPage();6 await page.click("input[title='Search']");7 await page.keyboard.type("hello");8 await page.keyboard.press("Backspace");9 await page.keyboard.type(" world");10 await browser.close();11})();12const { chromium } = require("playwright");13(async () => {14 const browser = await chromium.launch({ headless: false });15 const page = await browser.newPage();16 await page.click("input[title='Search']");17 await page.keyboard.inputType("hello");18 await page.keyboard.press("Backspace");19 await page.keyboard.inputType(" world");20 await browser.close();21})();22const { inputType } = require("playwright/lib/internal/protocol/protocol.yml");23const { chromium } = require("playwright");24(async () => {25 const browser = await chromium.launch({ headless: false });26 const page = await browser.newPage();27 await page.click("input[title='Search']");28 await page.keyboard.inputType("hello");29 await page.keyboard.press("Backspace");30 await page.keyboard.inputType(" world");31 await browser.close();32})();33const { chromium } = require("playwright");34(async () => {35 const browser = await chromium.launch({ headless: false });36 const page = await browser.newPage();
Using AI Code Generation
1const { inputType } = require('@playwright/test/lib/server/input');2const { inputType } = require('@playwright/test/lib/server/input');3const { chromium } = require('playwright');4(async () => {5 const browser = await chromium.launch({ headless: false });6 const context = await browser.newContext();7 const page = await context.newPage();8 await page.click('input[aria-label="Search"]');9 await inputType(page, 'input[aria-label="Search"]', 'Hello World');10 await page.screenshot({ path: 'example.png' });11 await browser.close();12})();13const { test, expect } = require('@playwright/test');14test('example test', async ({ page }) => {15 await page.click('input[aria-label="Search"]');16 await page.type('input[aria-label="Search"]', 'Hello World');17 await page.screenshot({ path: 'example.png' });18});19const { test, expect } = require('@playwright/test');20test('example test', async ({ page }) => {21 await page.click('input[aria-label="Search"]');22 await page.type('input[aria-label="Search"]', 'Hello World');23 await page.screenshot({ path: 'example.png' });24});
Using AI Code Generation
1const { inputType } = require(‘playwright/lib/internal/protocol’);2await inputType(‘Hello World’);3const { inputType } = require(‘playwright/lib/internal/protocol’);4await inputType(‘Hello World’);5const { inputType } = require(‘playwright/lib/internal/protocol’);6await inputType(‘Hello World’);7const { inputType } = require(‘playwright/lib/internal/protocol’);8await inputType(‘Hello World’);9const { inputType } = require(‘playwright/lib/internal/protocol’);10await inputType(‘Hello World’);11const { inputType } = require(‘playwright/lib/internal/protocol’);12await inputType(‘Hello World’);13const { inputType } = require(‘playwright/lib/internal/protocol’);14await inputType(‘Hello World’);15const { inputType } = require(‘playwright/lib/internal/protocol’);16await inputType(‘Hello World’);17const { inputType } = require(‘playwright/lib/internal/protocol’);18await inputType(‘Hello World’);19const { inputType } = require(‘playwright/lib/internal/protocol’);20await inputType(‘Hello World’);21const { inputType } = require(‘playwright/lib/internal/protocol’);22await inputType(‘Hello World’);23const { inputType } = require(‘playwright/lib/internal/protocol’);24await inputType(‘Hello World’);25const { inputType } = require(‘playwright/lib/internal/protocol’);26await inputType(‘Hello World’);
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!!