@@ -2,7 +2,6 @@ import React, { useEffect, useState, forwardRef, useRef } from "react";
2
2
import {
3
3
getMonth ,
4
4
getYear ,
5
- isMobile ,
6
5
onChangeHeightOfTextArea ,
7
6
onChangeInput ,
8
7
radioButtonWidget ,
@@ -14,7 +13,10 @@ import DatePicker from "react-datepicker";
14
13
import "react-datepicker/dist/react-datepicker.css" ;
15
14
import "../../styles/signature.css" ;
16
15
import RegexParser from "regex-parser" ;
17
-
16
+ const textWidgetCls =
17
+ "w-full h-full md:min-w-full md:min-h-full z-[999] text-[12px] rounded-[2px] border-[1px] border-[#007bff] overflow-hidden resize-none outline-none text-base-content bg-base-100 whitespace-pre-wrap" ;
18
+ const selectWidgetCls =
19
+ "w-full h-full absolute left-0 top-0 border-[1px] border-[#007bff] rounded-[2px] focus:outline-none bg-base-100 text-base-content" ;
18
20
function PlaceholderType ( props ) {
19
21
const type = props ?. pos ?. type ;
20
22
const [ selectOption , setSelectOption ] = useState ( "" ) ;
@@ -137,13 +139,13 @@ function PlaceholderType(props) {
137
139
138
140
const ExampleCustomInput = forwardRef ( ( { value, onClick } , ref ) => (
139
141
< div
140
- className = "inputPlaceholder"
141
- style = { { overflow : "hidden" , fontSize : calculateFontSize ( ) } }
142
+ className = { ` ${ selectWidgetCls } overflow-hidden` }
143
+ style = { { fontSize : calculateFontSize ( ) } }
142
144
onClick = { onClick }
143
145
ref = { ref }
144
146
>
145
147
{ value }
146
- < i className = "fa-regular fa-calendar" style = { { marginLeft : " 5px" } } > </ i >
148
+ < i className = "fa-regular fa-calendar ml-[ 5px]" > </ i >
147
149
</ div >
148
150
) ) ;
149
151
ExampleCustomInput . displayName = "ExampleCustomInput" ;
@@ -304,17 +306,13 @@ function PlaceholderType(props) {
304
306
case "signature" :
305
307
return props . pos . SignUrl ? (
306
308
< img
307
- alt = "signimg "
309
+ alt = "signature "
308
310
draggable = "false"
309
311
src = { props . pos . SignUrl }
310
- style = { {
311
- width : "99%" ,
312
- height : "100%" ,
313
- objectFit : "contain"
314
- } }
312
+ className = "w-[99%] h-full object-contain"
315
313
/>
316
314
) : (
317
- < div style = { { fontSize : 11 , color : " black" , justifyContent : " center" } } >
315
+ < div className = "text-[11px] text- black justify- center">
318
316
{ props ?. handleUserName &&
319
317
props ?. handleUserName (
320
318
props ?. data ?. Id ,
@@ -326,17 +324,13 @@ function PlaceholderType(props) {
326
324
case "stamp" :
327
325
return props . pos . SignUrl ? (
328
326
< img
329
- alt = "signimg "
327
+ alt = "stamp "
330
328
draggable = "false"
331
329
src = { props . pos . SignUrl }
332
- style = { {
333
- width : "99%" ,
334
- height : "100%" ,
335
- objectFit : "contain"
336
- } }
330
+ className = "w-[99%] h-full object-contain"
337
331
/>
338
332
) : (
339
- < div style = { { fontSize : 11 , color : " black" , justifyContent : " center" } } >
333
+ < div className = "text-[11px] text- black justify- center">
340
334
{ props ?. handleUserName &&
341
335
props ?. handleUserName (
342
336
props ?. data ?. Id ,
@@ -417,12 +411,7 @@ function PlaceholderType(props) {
417
411
false
418
412
) ;
419
413
} }
420
- className = {
421
- isMobile
422
- ? "labelTextArea labelWidthMobile"
423
- : "labelTextArea labelWidthDesktop"
424
- }
425
- style = { { whiteSpace : "pre-wrap" , color : "initial" } }
414
+ className = { textWidgetCls }
426
415
cols = "50"
427
416
/>
428
417
) : (
@@ -438,9 +427,8 @@ function PlaceholderType(props) {
438
427
case "dropdown" :
439
428
return props . data ?. signerObjId === props . signerObjId ? (
440
429
< select
441
- className = "inputPlaceholder"
430
+ className = { ` ${ selectWidgetCls } text-[12px]` }
442
431
id = "myDropdown"
443
- style = { { fontSize : "12px" , color : "initial" } }
444
432
value = { selectOption }
445
433
onChange = { ( e ) => {
446
434
setSelectOption ( e . target . value ) ;
@@ -470,7 +458,7 @@ function PlaceholderType(props) {
470
458
</ select >
471
459
) : (
472
460
< div
473
- className = "inputPlaceholder"
461
+ className = { selectWidgetCls }
474
462
style = { { fontSize : calculateFontSize ( ) } }
475
463
>
476
464
{ props . pos ?. options ?. name ? props . pos . options . name : type }
@@ -479,17 +467,13 @@ function PlaceholderType(props) {
479
467
case "initials" :
480
468
return props . pos . SignUrl ? (
481
469
< img
482
- alt = "signimg "
470
+ alt = "initials "
483
471
draggable = "false"
484
472
src = { props . pos . SignUrl }
485
- style = { {
486
- width : "99%" ,
487
- height : "100%" ,
488
- objectFit : "contain"
489
- } }
473
+ className = "w-[99%] h-full object-contain"
490
474
/>
491
475
) : (
492
- < div style = { { fontSize : 11 , color : " black" , justifyContent : " center" } } >
476
+ < div className = "text-[11px] text- black justify- center">
493
477
{ props ?. handleUserName &&
494
478
props ?. handleUserName (
495
479
props ?. data ?. Id ,
@@ -520,12 +504,7 @@ function PlaceholderType(props) {
520
504
isDefault
521
505
) ;
522
506
} }
523
- className = {
524
- isMobile
525
- ? "labelTextArea labelWidthMobile"
526
- : "labelTextArea labelWidthDesktop"
527
- }
528
- style = { { whiteSpace : "pre-wrap" , color : "initial" } }
507
+ className = { textWidgetCls }
529
508
cols = "50"
530
509
/>
531
510
) : (
@@ -559,12 +538,7 @@ function PlaceholderType(props) {
559
538
false
560
539
) ;
561
540
} }
562
- className = {
563
- isMobile
564
- ? "labelTextArea labelWidthMobile"
565
- : "labelTextArea labelWidthDesktop"
566
- }
567
- style = { { whiteSpace : "pre-wrap" , color : "initial" } }
541
+ className = { textWidgetCls }
568
542
cols = "50"
569
543
/>
570
544
) : (
@@ -598,12 +572,7 @@ function PlaceholderType(props) {
598
572
false
599
573
) ;
600
574
} }
601
- className = {
602
- isMobile
603
- ? "labelTextArea labelWidthMobile"
604
- : "labelTextArea labelWidthDesktop"
605
- }
606
- style = { { whiteSpace : "pre-wrap" , color : "initial" } }
575
+ className = { textWidgetCls }
607
576
cols = "50"
608
577
/>
609
578
) : (
@@ -655,8 +624,7 @@ function PlaceholderType(props) {
655
624
}
656
625
onBlur = { handleInputBlur }
657
626
closeOnScroll = { true }
658
- className = "inputPlaceholder"
659
- style = { { outlineColor : "#007bff" } }
627
+ className = { `${ selectWidgetCls } outline-[#007bff]` }
660
628
selected = {
661
629
props ?. startDate
662
630
? props ?. startDate
@@ -679,17 +647,13 @@ function PlaceholderType(props) {
679
647
case "image" :
680
648
return props . pos . SignUrl ? (
681
649
< img
682
- alt = "signimg "
650
+ alt = "image "
683
651
draggable = "false"
684
652
src = { props . pos . SignUrl }
685
- style = { {
686
- width : "99%" ,
687
- height : "100%" ,
688
- objectFit : "contain"
689
- } }
653
+ className = "w-[99%] h-full object-contain"
690
654
/>
691
655
) : (
692
- < div style = { { fontSize : 11 , color : " black" , justifyContent : " center" } } >
656
+ < div className = "text-[11px] text- black justify- center">
693
657
{ props ?. handleUserName &&
694
658
props ?. handleUserName (
695
659
props ?. data ?. Id ,
@@ -720,12 +684,7 @@ function PlaceholderType(props) {
720
684
false
721
685
) ;
722
686
} }
723
- className = {
724
- isMobile
725
- ? "labelTextArea labelWidthMobile"
726
- : "labelTextArea labelWidthDesktop"
727
- }
728
- style = { { whiteSpace : "pre-wrap" , color : "initial" } }
687
+ className = { textWidgetCls }
729
688
cols = "50"
730
689
/>
731
690
) : (
@@ -791,31 +750,18 @@ function PlaceholderType(props) {
791
750
false
792
751
) ;
793
752
} }
794
- className = {
795
- isMobile
796
- ? "labelTextArea labelWidthMobile"
797
- : "labelTextArea labelWidthDesktop"
798
- }
799
- style = { {
800
- whiteSpace : "pre-wrap" ,
801
- overflow : "hidden" ,
802
- color : "initial"
803
- } }
753
+ className = { textWidgetCls }
804
754
cols = "50"
805
755
/>
806
756
) ;
807
757
default :
808
758
return props . pos . SignUrl ? (
809
- < div style = { { pointerEvents : " none" } } >
759
+ < div className = "pointer-events- none">
810
760
< img
811
- alt = "signimg "
761
+ alt = "image "
812
762
draggable = "false"
813
763
src = { props . pos . SignUrl }
814
- style = { {
815
- width : "99%" ,
816
- height : "100%" ,
817
- objectFit : "contain"
818
- } }
764
+ className = "w-[99%] h-full object-contain"
819
765
/>
820
766
</ div >
821
767
) : (
0 commit comments