@unvired/turboforms-embed-sdk 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -15
- package/dist/unvired-form-sdk.html +634 -258
- package/dist/unvired-forms-sdk.js +1885 -597
- package/package.json +1 -1
|
@@ -736,6 +736,14 @@ body {
|
|
|
736
736
|
/* subtle shadow for elevation */
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
+
|
|
740
|
+
#submitBtn,
|
|
741
|
+
#saveBtn {
|
|
742
|
+
width: 110px;
|
|
743
|
+
display: flex;
|
|
744
|
+
justify-content: space-evenly;
|
|
745
|
+
}
|
|
746
|
+
|
|
739
747
|
.form-cmt-btn {
|
|
740
748
|
width: 40px;
|
|
741
749
|
height: 40px;
|
|
@@ -771,8 +779,9 @@ body {
|
|
|
771
779
|
width: 100%;
|
|
772
780
|
background-color: #ffffff;
|
|
773
781
|
padding: 6px;
|
|
774
|
-
justify-content:
|
|
782
|
+
justify-content: flex-end;
|
|
775
783
|
align-items: center;
|
|
784
|
+
gap: 8px;
|
|
776
785
|
border-top: 1px solid #ddd;
|
|
777
786
|
z-index: 1000;
|
|
778
787
|
box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
|
|
@@ -784,18 +793,20 @@ body {
|
|
|
784
793
|
display: none;
|
|
785
794
|
position: absolute;
|
|
786
795
|
bottom: 100%;
|
|
787
|
-
left:
|
|
788
|
-
margin-bottom:
|
|
796
|
+
left: -170px;
|
|
797
|
+
margin-bottom: 16px;
|
|
789
798
|
background-color: #fff;
|
|
790
799
|
border: 1px solid #ddd;
|
|
791
800
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
792
801
|
padding: 6px;
|
|
793
802
|
border-radius: 6px;
|
|
794
|
-
z-index:
|
|
803
|
+
z-index: 1000;
|
|
795
804
|
flex-direction: column;
|
|
796
805
|
gap: 0px;
|
|
797
806
|
}
|
|
798
807
|
|
|
808
|
+
#unvired-more-btn {}
|
|
809
|
+
|
|
799
810
|
/* Print and PDF Modes */
|
|
800
811
|
@media print {
|
|
801
812
|
|
|
@@ -1007,7 +1018,6 @@ body {
|
|
|
1007
1018
|
|
|
1008
1019
|
@keyframes sdk-pulse {
|
|
1009
1020
|
|
|
1010
|
-
0%,
|
|
1011
1021
|
100% {
|
|
1012
1022
|
opacity: 1;
|
|
1013
1023
|
}
|
|
@@ -1015,6 +1025,48 @@ body {
|
|
|
1015
1025
|
50% {
|
|
1016
1026
|
opacity: 0.5;
|
|
1017
1027
|
}
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/* Responsive Footer for Mobile */
|
|
1031
|
+
@media (max-width: 600px) {
|
|
1032
|
+
#sticky-footer {
|
|
1033
|
+
justify-content: flex-end;
|
|
1034
|
+
padding: 4px;
|
|
1035
|
+
gap: 4px;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
#submitBtn {
|
|
1039
|
+
|
|
1040
|
+
width: 105px;
|
|
1041
|
+
min-width: 108px;
|
|
1042
|
+
flex-grow: 0;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
#saveBtn {
|
|
1047
|
+
width: 80px;
|
|
1048
|
+
min-width: 90px;
|
|
1049
|
+
flex-grow: 0;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
#unvired-more-btn {
|
|
1053
|
+
margin-left: 10px;
|
|
1054
|
+
margin-right: 10px;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/* Fix tooltip on mobile to prevent cutoff */
|
|
1058
|
+
#moreTooltip {
|
|
1059
|
+
position: fixed;
|
|
1060
|
+
bottom: 70px;
|
|
1061
|
+
left: 20px;
|
|
1062
|
+
right: 20px;
|
|
1063
|
+
width: auto;
|
|
1064
|
+
margin-bottom: 0;
|
|
1065
|
+
max-width: 300px;
|
|
1066
|
+
margin-left: auto;
|
|
1067
|
+
margin-right: auto;
|
|
1068
|
+
|
|
1069
|
+
}
|
|
1018
1070
|
}</style>
|
|
1019
1071
|
<style>.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:rgba(63,63,63,.9);stroke-width:1.4;fill:transparent}
|
|
1020
1072
|
.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle;cursor:pointer}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2 !important;background-color:#a3c2e2 !important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px rgba(0,0,0,.25)}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:"Lato",sans-serif}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-readonly-comment{white-space:pre}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px 10px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2)}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag:empty{display:none}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{margin:0;display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px rgba(0,0,0,.1)}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width 200ms}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width 200ms}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;width:400px;color:#3f3f3f;opacity:0;font-family:"Lato",sans-serif;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.r6o-editor .r6o-arrow:after{content:"";position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px rgba(0,0,0,.4)}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media(max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow::after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.r6o-editor{margin-left:-12px}.r6o-annotation{background-color:rgba(255,165,0,.2);border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:rgba(207,207,255,.63);cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-relation-editor{position:absolute;font-family:"Lato",sans-serif;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,.4);box-shadow:0 1px 14px rgba(0,0,0,.4);-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%, -50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}
|
|
@@ -40723,6 +40775,14 @@ body {
|
|
|
40723
40775
|
/* subtle shadow for elevation */
|
|
40724
40776
|
}
|
|
40725
40777
|
|
|
40778
|
+
|
|
40779
|
+
#submitBtn,
|
|
40780
|
+
#saveBtn {
|
|
40781
|
+
width: 110px;
|
|
40782
|
+
display: flex;
|
|
40783
|
+
justify-content: space-evenly;
|
|
40784
|
+
}
|
|
40785
|
+
|
|
40726
40786
|
.form-cmt-btn {
|
|
40727
40787
|
width: 40px;
|
|
40728
40788
|
height: 40px;
|
|
@@ -40758,8 +40818,9 @@ body {
|
|
|
40758
40818
|
width: 100%;
|
|
40759
40819
|
background-color: #ffffff;
|
|
40760
40820
|
padding: 6px;
|
|
40761
|
-
justify-content:
|
|
40821
|
+
justify-content: flex-end;
|
|
40762
40822
|
align-items: center;
|
|
40823
|
+
gap: 8px;
|
|
40763
40824
|
border-top: 1px solid #ddd;
|
|
40764
40825
|
z-index: 1000;
|
|
40765
40826
|
box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
|
|
@@ -40771,18 +40832,20 @@ body {
|
|
|
40771
40832
|
display: none;
|
|
40772
40833
|
position: absolute;
|
|
40773
40834
|
bottom: 100%;
|
|
40774
|
-
left:
|
|
40775
|
-
margin-bottom:
|
|
40835
|
+
left: -170px;
|
|
40836
|
+
margin-bottom: 16px;
|
|
40776
40837
|
background-color: #fff;
|
|
40777
40838
|
border: 1px solid #ddd;
|
|
40778
40839
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
40779
40840
|
padding: 6px;
|
|
40780
40841
|
border-radius: 6px;
|
|
40781
|
-
z-index:
|
|
40842
|
+
z-index: 1000;
|
|
40782
40843
|
flex-direction: column;
|
|
40783
40844
|
gap: 0px;
|
|
40784
40845
|
}
|
|
40785
40846
|
|
|
40847
|
+
#unvired-more-btn {}
|
|
40848
|
+
|
|
40786
40849
|
/* Print and PDF Modes */
|
|
40787
40850
|
@media print {
|
|
40788
40851
|
|
|
@@ -40994,7 +41057,6 @@ body {
|
|
|
40994
41057
|
|
|
40995
41058
|
@keyframes sdk-pulse {
|
|
40996
41059
|
|
|
40997
|
-
0%,
|
|
40998
41060
|
100% {
|
|
40999
41061
|
opacity: 1;
|
|
41000
41062
|
}
|
|
@@ -41002,6 +41064,48 @@ body {
|
|
|
41002
41064
|
50% {
|
|
41003
41065
|
opacity: 0.5;
|
|
41004
41066
|
}
|
|
41067
|
+
}
|
|
41068
|
+
|
|
41069
|
+
/* Responsive Footer for Mobile */
|
|
41070
|
+
@media (max-width: 600px) {
|
|
41071
|
+
#sticky-footer {
|
|
41072
|
+
justify-content: flex-end;
|
|
41073
|
+
padding: 4px;
|
|
41074
|
+
gap: 4px;
|
|
41075
|
+
}
|
|
41076
|
+
|
|
41077
|
+
#submitBtn {
|
|
41078
|
+
|
|
41079
|
+
width: 105px;
|
|
41080
|
+
min-width: 108px;
|
|
41081
|
+
flex-grow: 0;
|
|
41082
|
+
}
|
|
41083
|
+
|
|
41084
|
+
|
|
41085
|
+
#saveBtn {
|
|
41086
|
+
width: 80px;
|
|
41087
|
+
min-width: 90px;
|
|
41088
|
+
flex-grow: 0;
|
|
41089
|
+
}
|
|
41090
|
+
|
|
41091
|
+
#unvired-more-btn {
|
|
41092
|
+
margin-left: 10px;
|
|
41093
|
+
margin-right: 10px;
|
|
41094
|
+
}
|
|
41095
|
+
|
|
41096
|
+
/* Fix tooltip on mobile to prevent cutoff */
|
|
41097
|
+
#moreTooltip {
|
|
41098
|
+
position: fixed;
|
|
41099
|
+
bottom: 70px;
|
|
41100
|
+
left: 20px;
|
|
41101
|
+
right: 20px;
|
|
41102
|
+
width: auto;
|
|
41103
|
+
margin-bottom: 0;
|
|
41104
|
+
max-width: 300px;
|
|
41105
|
+
margin-left: auto;
|
|
41106
|
+
margin-right: auto;
|
|
41107
|
+
|
|
41108
|
+
}
|
|
41005
41109
|
}</style>
|
|
41006
41110
|
|
|
41007
41111
|
<script>
|
|
@@ -41547,6 +41651,14 @@ async function startCameraScanner() {
|
|
|
41547
41651
|
|
|
41548
41652
|
showBarcodeError(errorMessage);
|
|
41549
41653
|
setTimeout(() => closeScannerModal(), 3000);
|
|
41654
|
+
|
|
41655
|
+
if (window.sendEventCallback) {
|
|
41656
|
+
window.sendEventCallback({
|
|
41657
|
+
type: "ERROR",
|
|
41658
|
+
errorMessage: "ErrorCode : 012, Camera access error",
|
|
41659
|
+
data: { technicalError: err, reason: errorMessage }
|
|
41660
|
+
});
|
|
41661
|
+
}
|
|
41550
41662
|
}
|
|
41551
41663
|
}
|
|
41552
41664
|
|
|
@@ -41927,7 +42039,7 @@ function injectBarcodeModalStyles() {
|
|
|
41927
42039
|
</script>
|
|
41928
42040
|
<script>
|
|
41929
42041
|
// Listen for "getLocation" custom event
|
|
41930
|
-
|
|
42042
|
+
document.addEventListener("getLocation", function (event) {
|
|
41931
42043
|
const { compObj, controlId } = event.detail;
|
|
41932
42044
|
window.compId = controlId;
|
|
41933
42045
|
getLocationFromBrowser(controlId); // Pass controlId to getLocationFromBrowser
|
|
@@ -41937,7 +42049,7 @@ function injectBarcodeModalStyles() {
|
|
|
41937
42049
|
function getLocationFromBrowser(componentID) {
|
|
41938
42050
|
// Check if running in Cordova environment
|
|
41939
42051
|
const isCordova = !!(window.cordova || window.PhoneGap || window.phonegap);
|
|
41940
|
-
|
|
42052
|
+
|
|
41941
42053
|
if (!navigator.geolocation) {
|
|
41942
42054
|
showLocationError("Geolocation is not supported by this device.");
|
|
41943
42055
|
return;
|
|
@@ -41958,7 +42070,7 @@ function getLocationFromBrowser(componentID) {
|
|
|
41958
42070
|
showLocationError("Location permission was denied. Please enable it in browser settings and refresh the page.");
|
|
41959
42071
|
return;
|
|
41960
42072
|
}
|
|
41961
|
-
|
|
42073
|
+
|
|
41962
42074
|
if (permissionStatus.state === "granted" || permissionStatus.state === "prompt") {
|
|
41963
42075
|
requestLocation(componentID);
|
|
41964
42076
|
}
|
|
@@ -41976,7 +42088,7 @@ function getLocationFromBrowser(componentID) {
|
|
|
41976
42088
|
|
|
41977
42089
|
function requestLocation(componentID) {
|
|
41978
42090
|
const isCordova = !!(window.cordova || window.PhoneGap || window.phonegap);
|
|
41979
|
-
|
|
42091
|
+
|
|
41980
42092
|
const options = {
|
|
41981
42093
|
enableHighAccuracy: true,
|
|
41982
42094
|
timeout: isCordova ? 30000 : 10000, // Longer timeout for Cordova
|
|
@@ -41993,7 +42105,7 @@ function requestLocation(componentID) {
|
|
|
41993
42105
|
},
|
|
41994
42106
|
});
|
|
41995
42107
|
document.dispatchEvent(customEvent);
|
|
41996
|
-
|
|
42108
|
+
|
|
41997
42109
|
// Send success event
|
|
41998
42110
|
if (window.sendEventCallback) {
|
|
41999
42111
|
window.sendEventCallback({
|
|
@@ -42011,36 +42123,36 @@ function requestLocation(componentID) {
|
|
|
42011
42123
|
}
|
|
42012
42124
|
|
|
42013
42125
|
function handleLocationError(error) {
|
|
42014
|
-
let errorMessage = "
|
|
42015
|
-
let errorCode = "
|
|
42016
|
-
|
|
42126
|
+
let errorMessage = "Location unknown error";
|
|
42127
|
+
let errorCode = "011";
|
|
42128
|
+
|
|
42017
42129
|
switch (error.code) {
|
|
42018
42130
|
case error.PERMISSION_DENIED:
|
|
42019
|
-
errorMessage = "Location permission denied
|
|
42131
|
+
errorMessage = "Location permission denied";
|
|
42020
42132
|
errorCode = "008";
|
|
42021
42133
|
break;
|
|
42022
42134
|
case error.POSITION_UNAVAILABLE:
|
|
42023
|
-
errorMessage = "Location
|
|
42135
|
+
errorMessage = "Location unavailable";
|
|
42024
42136
|
errorCode = "009";
|
|
42025
42137
|
break;
|
|
42026
42138
|
case error.TIMEOUT:
|
|
42027
|
-
errorMessage = "Location request
|
|
42139
|
+
errorMessage = "Location request timeout";
|
|
42028
42140
|
errorCode = "010";
|
|
42029
42141
|
break;
|
|
42030
42142
|
default:
|
|
42031
|
-
errorMessage = "
|
|
42143
|
+
errorMessage = "Location unknown error";
|
|
42032
42144
|
errorCode = "011";
|
|
42033
42145
|
break;
|
|
42034
42146
|
}
|
|
42035
|
-
|
|
42147
|
+
|
|
42036
42148
|
showLocationError(errorMessage);
|
|
42037
42149
|
console.error("Geolocation error:", error);
|
|
42038
|
-
|
|
42150
|
+
|
|
42039
42151
|
// Send error event
|
|
42040
42152
|
if (window.sendEventCallback) {
|
|
42041
42153
|
window.sendEventCallback({
|
|
42042
42154
|
type: "ERROR",
|
|
42043
|
-
|
|
42155
|
+
errorMessage: `ErrorCode : ${errorCode}, ${errorMessage}`,
|
|
42044
42156
|
data: { technicalError: error, reason: errorMessage }
|
|
42045
42157
|
});
|
|
42046
42158
|
}
|
|
@@ -42065,9 +42177,9 @@ function showLocationError(message) {
|
|
|
42065
42177
|
text-align: center;
|
|
42066
42178
|
`;
|
|
42067
42179
|
errorDiv.textContent = message;
|
|
42068
|
-
|
|
42180
|
+
|
|
42069
42181
|
document.body.appendChild(errorDiv);
|
|
42070
|
-
|
|
42182
|
+
|
|
42071
42183
|
// Remove after 5 seconds
|
|
42072
42184
|
setTimeout(() => {
|
|
42073
42185
|
if (errorDiv.parentNode) {
|
|
@@ -42107,15 +42219,18 @@ let capturedImageData = "";
|
|
|
42107
42219
|
function openCameraModal() {
|
|
42108
42220
|
injectCameraModalStyles();
|
|
42109
42221
|
|
|
42222
|
+
// Ensure clean slate: Remove any existing modal if present
|
|
42110
42223
|
const existingModal = document.getElementById("cameraModal");
|
|
42224
|
+
if (existingModal) {
|
|
42225
|
+
existingModal.remove();
|
|
42226
|
+
}
|
|
42111
42227
|
|
|
42112
42228
|
capturedImageData = "";
|
|
42113
42229
|
|
|
42114
|
-
|
|
42115
|
-
const modalHTML = `
|
|
42230
|
+
const modalHTML = `
|
|
42116
42231
|
<div id="cameraModal">
|
|
42117
42232
|
<div id="cameraContainer">
|
|
42118
|
-
<video id="cameraVideo"
|
|
42233
|
+
<video id="cameraVideo" playsinline webkit-playsinline muted style="opacity: 0; pointer-events: none;"></video>
|
|
42119
42234
|
<div id="cameraLoader">
|
|
42120
42235
|
<div class="loader-spinner"></div>
|
|
42121
42236
|
<p class="loader-text">Starting camera...</p>
|
|
@@ -42126,6 +42241,11 @@ function openCameraModal() {
|
|
|
42126
42241
|
<path d="M18 6L6 18M6 6L18 18" stroke="white" stroke-width="2" stroke-linecap="round"/>
|
|
42127
42242
|
</svg>
|
|
42128
42243
|
</button>
|
|
42244
|
+
<div class="camera-select-container">
|
|
42245
|
+
<select id="cameraSelect" class="camera-select">
|
|
42246
|
+
<option value="" disabled selected>Select Camera</option>
|
|
42247
|
+
</select>
|
|
42248
|
+
</div>
|
|
42129
42249
|
<div id="captureButton" style="opacity: 0; pointer-events: none;">
|
|
42130
42250
|
<div class="capture-ring">
|
|
42131
42251
|
<div class="capture-inner"></div>
|
|
@@ -42135,35 +42255,18 @@ function openCameraModal() {
|
|
|
42135
42255
|
</div>
|
|
42136
42256
|
</div>
|
|
42137
42257
|
`;
|
|
42138
|
-
|
|
42139
|
-
|
|
42140
|
-
|
|
42141
|
-
|
|
42142
|
-
|
|
42143
|
-
|
|
42144
|
-
// Reset UI state when reopening
|
|
42145
|
-
const video = document.getElementById("cameraVideo");
|
|
42146
|
-
const loader = document.getElementById("cameraLoader");
|
|
42147
|
-
const captureBtn = document.getElementById("captureButton");
|
|
42148
|
-
|
|
42149
|
-
if (video) {
|
|
42150
|
-
video.style.opacity = "0";
|
|
42151
|
-
video.srcObject = null;
|
|
42152
|
-
}
|
|
42153
|
-
if (loader) {
|
|
42154
|
-
loader.style.display = "flex";
|
|
42155
|
-
loader.style.opacity = "1";
|
|
42156
|
-
}
|
|
42157
|
-
if (captureBtn) {
|
|
42158
|
-
captureBtn.style.opacity = "0";
|
|
42159
|
-
captureBtn.style.pointerEvents = "none";
|
|
42160
|
-
}
|
|
42161
|
-
}
|
|
42258
|
+
document.body.insertAdjacentHTML("beforeend", modalHTML);
|
|
42259
|
+
document.getElementById("closeCameraBtn").addEventListener("click", closeCameraModal);
|
|
42260
|
+
document.getElementById("captureButton").addEventListener("click", captureImage);
|
|
42261
|
+
document.getElementById("cameraSelect").addEventListener("change", (e) => {
|
|
42262
|
+
startCameraStream(e.target.value);
|
|
42263
|
+
});
|
|
42162
42264
|
|
|
42265
|
+
// Small delay to ensure DOM is ready
|
|
42163
42266
|
setTimeout(startCameraStream, 100);
|
|
42164
42267
|
}
|
|
42165
42268
|
|
|
42166
|
-
async function startCameraStream() {
|
|
42269
|
+
async function startCameraStream(deviceId = null) {
|
|
42167
42270
|
if (videoStream) {
|
|
42168
42271
|
try {
|
|
42169
42272
|
videoStream.getTracks().forEach(track => track.stop());
|
|
@@ -42174,42 +42277,84 @@ async function startCameraStream() {
|
|
|
42174
42277
|
}
|
|
42175
42278
|
|
|
42176
42279
|
try {
|
|
42280
|
+
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || (window.platform && window.platform.iosPlatform);
|
|
42281
|
+
|
|
42282
|
+
// Check if API is supported
|
|
42283
|
+
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
|
|
42284
|
+
const errorMsg = "Camera API is not supported. Please ensure you are using HTTPS or localhost.";
|
|
42285
|
+
alert(errorMsg);
|
|
42286
|
+
showCameraError(errorMsg);
|
|
42287
|
+
return;
|
|
42288
|
+
}
|
|
42289
|
+
|
|
42177
42290
|
const video = document.getElementById("cameraVideo");
|
|
42178
42291
|
if (!video) {
|
|
42179
42292
|
alert("Camera video element not found.");
|
|
42180
42293
|
return;
|
|
42181
42294
|
}
|
|
42182
42295
|
|
|
42183
|
-
//
|
|
42184
|
-
|
|
42185
|
-
|
|
42296
|
+
// Simplified approach: Ask for camera directly.
|
|
42297
|
+
// This allows the browser to handle permissions correctly on all platforms (Windows/Android/iOS)
|
|
42298
|
+
// and defaults to the system default camera (webcam) on laptops.
|
|
42299
|
+
// Simplified approach: Ask for camera directly.
|
|
42300
|
+
// We race against a timeout because WebViews often hang indefinitely if permissions aren't handled.
|
|
42301
|
+
// OPTIMIZATION: Request 16:9 aspect ratio (1280x720) instead of 4:3 (640x480).
|
|
42302
|
+
// This reduces the "zoom" effect on modern mobile screens which are typically 16:9 or taller.
|
|
42303
|
+
const constraints = {
|
|
42304
|
+
video: {
|
|
42305
|
+
width: { ideal: 1280 },
|
|
42306
|
+
height: { ideal: 720 }
|
|
42307
|
+
}
|
|
42308
|
+
};
|
|
42186
42309
|
|
|
42187
|
-
if (
|
|
42188
|
-
|
|
42189
|
-
|
|
42310
|
+
if (deviceId) {
|
|
42311
|
+
constraints.video.deviceId = { exact: deviceId };
|
|
42312
|
+
} else {
|
|
42313
|
+
constraints.video.facingMode = "environment";
|
|
42190
42314
|
}
|
|
42191
42315
|
|
|
42192
|
-
|
|
42193
|
-
const backCamera = videoDevices.find(device =>
|
|
42194
|
-
device.label.toLowerCase().includes('back') ||
|
|
42195
|
-
device.label.toLowerCase().includes('rear')
|
|
42196
|
-
) || videoDevices[0];
|
|
42316
|
+
const streamPromise = navigator.mediaDevices.getUserMedia(constraints);
|
|
42197
42317
|
|
|
42198
|
-
|
|
42199
|
-
|
|
42200
|
-
|
|
42201
|
-
|
|
42202
|
-
|
|
42203
|
-
|
|
42318
|
+
const timeoutPromise = new Promise((_, reject) =>
|
|
42319
|
+
setTimeout(() => reject(new Error("PermissionTimeout")), 6000)
|
|
42320
|
+
);
|
|
42321
|
+
|
|
42322
|
+
try {
|
|
42323
|
+
videoStream = await Promise.race([streamPromise, timeoutPromise]);
|
|
42324
|
+
} catch (err) {
|
|
42325
|
+
if (err.message === "PermissionTimeout") {
|
|
42326
|
+
throw new Error("Permission request timed out. Please check app permissions.");
|
|
42204
42327
|
}
|
|
42205
|
-
|
|
42328
|
+
throw err;
|
|
42329
|
+
}
|
|
42330
|
+
|
|
42331
|
+
// iOS Specific: Ensure inline playback setup BEFORE stream assignment
|
|
42332
|
+
if (isIOS) {
|
|
42333
|
+
video.setAttribute("playsinline", "");
|
|
42334
|
+
video.setAttribute("webkit-playsinline", "");
|
|
42335
|
+
video.playsInline = true; // Set property as well
|
|
42336
|
+
}
|
|
42337
|
+
|
|
42338
|
+
// Mute video to prevent audio feedback and allow autoplay in restrictive policies
|
|
42339
|
+
video.muted = true;
|
|
42206
42340
|
|
|
42341
|
+
// Assign stream
|
|
42207
42342
|
video.srcObject = videoStream;
|
|
42208
42343
|
|
|
42344
|
+
// Ensure video doesn't stay paused if it somehow exits fullscreen or gets interrupted
|
|
42345
|
+
video.onpause = () => {
|
|
42346
|
+
if (cameraStarted && video.srcObject) {
|
|
42347
|
+
// Only try to resume if we expect it to be playing
|
|
42348
|
+
video.play().catch(e => console.log("Resume error", e));
|
|
42349
|
+
}
|
|
42350
|
+
};
|
|
42351
|
+
|
|
42209
42352
|
// Wait for video to start playing, then hide loader
|
|
42210
42353
|
video.onloadedmetadata = () => {
|
|
42211
|
-
|
|
42212
|
-
|
|
42354
|
+
// Once permission is granted and stream starts, listing devices will return labels
|
|
42355
|
+
populateCameraDevices();
|
|
42356
|
+
|
|
42357
|
+
const showUI = () => {
|
|
42213
42358
|
const loader = document.getElementById("cameraLoader");
|
|
42214
42359
|
const captureBtn = document.getElementById("captureButton");
|
|
42215
42360
|
|
|
@@ -42217,23 +42362,34 @@ async function startCameraStream() {
|
|
|
42217
42362
|
loader.style.display = "none";
|
|
42218
42363
|
loader.style.opacity = "0";
|
|
42219
42364
|
}
|
|
42365
|
+
|
|
42220
42366
|
video.style.opacity = "1";
|
|
42367
|
+
|
|
42221
42368
|
if (captureBtn) {
|
|
42222
42369
|
captureBtn.style.opacity = "1";
|
|
42223
42370
|
captureBtn.style.pointerEvents = "all";
|
|
42224
42371
|
}
|
|
42372
|
+
};
|
|
42225
42373
|
|
|
42374
|
+
video.play().then(() => {
|
|
42375
|
+
showUI();
|
|
42226
42376
|
cameraStarted = true;
|
|
42227
42377
|
}).catch(err => {
|
|
42228
42378
|
console.error("Video play error:", err);
|
|
42229
|
-
|
|
42230
|
-
|
|
42379
|
+
if (!video.paused) {
|
|
42380
|
+
console.log("Video is playing despite error. Continuing.");
|
|
42381
|
+
showUI();
|
|
42382
|
+
cameraStarted = true;
|
|
42383
|
+
} else {
|
|
42384
|
+
alert("Failed to start video preview: " + err.message);
|
|
42385
|
+
closeCameraModal();
|
|
42386
|
+
}
|
|
42231
42387
|
});
|
|
42232
42388
|
};
|
|
42233
42389
|
|
|
42234
42390
|
} catch (err) {
|
|
42235
42391
|
console.error("Camera start error:", err);
|
|
42236
|
-
let errorMessage = "Failed to start camera";
|
|
42392
|
+
let errorMessage = err.message || "Failed to start camera";
|
|
42237
42393
|
|
|
42238
42394
|
if (err.name === 'NotAllowedError' || err.name === 'PermissionDeniedError') {
|
|
42239
42395
|
errorMessage = "Camera permission denied. Please allow camera access and try again.";
|
|
@@ -42249,18 +42405,50 @@ async function startCameraStream() {
|
|
|
42249
42405
|
errorMessage = "Camera access was interrupted.";
|
|
42250
42406
|
}
|
|
42251
42407
|
|
|
42252
|
-
|
|
42408
|
+
alert(errorMessage);
|
|
42409
|
+
closeCameraModal();
|
|
42410
|
+
}
|
|
42411
|
+
}
|
|
42412
|
+
|
|
42413
|
+
async function populateCameraDevices() {
|
|
42414
|
+
const select = document.getElementById("cameraSelect");
|
|
42415
|
+
if (!select) return;
|
|
42253
42416
|
|
|
42254
|
-
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
|
|
42258
|
-
|
|
42259
|
-
|
|
42417
|
+
try {
|
|
42418
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
42419
|
+
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
42420
|
+
|
|
42421
|
+
// Only show if we have more than 1 camera, or at least we want to show the current one
|
|
42422
|
+
if (videoDevices.length > 0) {
|
|
42423
|
+
select.innerHTML = '<option value="" disabled>Select Camera</option>';
|
|
42424
|
+
|
|
42425
|
+
let currentDeviceId = "";
|
|
42426
|
+
if (videoStream) {
|
|
42427
|
+
const track = videoStream.getVideoTracks()[0];
|
|
42428
|
+
if (track) {
|
|
42429
|
+
const settings = track.getSettings();
|
|
42430
|
+
currentDeviceId = settings.deviceId;
|
|
42431
|
+
}
|
|
42432
|
+
}
|
|
42433
|
+
|
|
42434
|
+
videoDevices.forEach((device, index) => {
|
|
42435
|
+
const option = document.createElement("option");
|
|
42436
|
+
option.value = device.deviceId;
|
|
42437
|
+
option.text = device.label || `Camera ${index + 1}`;
|
|
42438
|
+
if (device.deviceId === currentDeviceId) {
|
|
42439
|
+
option.selected = true;
|
|
42440
|
+
}
|
|
42441
|
+
select.appendChild(option);
|
|
42260
42442
|
});
|
|
42261
|
-
}
|
|
42262
42443
|
|
|
42263
|
-
|
|
42444
|
+
// If there are multiple devices, ensure the dropdown container is visible
|
|
42445
|
+
const container = document.querySelector('.camera-select-container');
|
|
42446
|
+
if (container) {
|
|
42447
|
+
container.style.display = videoDevices.length > 1 ? 'block' : 'none';
|
|
42448
|
+
}
|
|
42449
|
+
}
|
|
42450
|
+
} catch (e) {
|
|
42451
|
+
console.warn("Error enumerating devices:", e);
|
|
42264
42452
|
}
|
|
42265
42453
|
}
|
|
42266
42454
|
|
|
@@ -42330,19 +42518,19 @@ function closeCameraModal() {
|
|
|
42330
42518
|
const modal = document.getElementById("cameraModal");
|
|
42331
42519
|
|
|
42332
42520
|
if (videoStream) {
|
|
42333
|
-
|
|
42521
|
+
try {
|
|
42522
|
+
videoStream.getTracks().forEach(track => track.stop());
|
|
42523
|
+
} catch (e) {
|
|
42524
|
+
console.warn("Error stopping tracks", e);
|
|
42525
|
+
}
|
|
42334
42526
|
videoStream = null;
|
|
42335
42527
|
cameraStarted = false;
|
|
42336
42528
|
}
|
|
42337
42529
|
|
|
42338
|
-
//
|
|
42339
|
-
|
|
42340
|
-
|
|
42341
|
-
video.srcObject = null;
|
|
42342
|
-
video.style.opacity = "0";
|
|
42530
|
+
// Completely remove from DOM to reset video element state for iOS
|
|
42531
|
+
if (modal) {
|
|
42532
|
+
modal.remove();
|
|
42343
42533
|
}
|
|
42344
|
-
|
|
42345
|
-
if (modal) modal.style.display = "none";
|
|
42346
42534
|
}
|
|
42347
42535
|
|
|
42348
42536
|
function injectCameraModalStyles() {
|
|
@@ -42373,6 +42561,7 @@ function injectCameraModalStyles() {
|
|
|
42373
42561
|
object-fit: cover;
|
|
42374
42562
|
background: #000;
|
|
42375
42563
|
transition: opacity 0.3s ease;
|
|
42564
|
+
pointer-events: none;
|
|
42376
42565
|
}
|
|
42377
42566
|
|
|
42378
42567
|
#cameraLoader {
|
|
@@ -42453,6 +42642,39 @@ function injectCameraModalStyles() {
|
|
|
42453
42642
|
background: rgba(0, 0, 0, 0.7);
|
|
42454
42643
|
}
|
|
42455
42644
|
|
|
42645
|
+
.camera-select-container {
|
|
42646
|
+
position: absolute;
|
|
42647
|
+
top: 20px;
|
|
42648
|
+
right: 20px;
|
|
42649
|
+
z-index: 10001;
|
|
42650
|
+
pointer-events: all;
|
|
42651
|
+
display: none; /* Hidden by default until devices found */
|
|
42652
|
+
}
|
|
42653
|
+
|
|
42654
|
+
.camera-select {
|
|
42655
|
+
background: rgba(0, 0, 0, 0.5);
|
|
42656
|
+
color: white;
|
|
42657
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
42658
|
+
padding: 8px 12px;
|
|
42659
|
+
border-radius: 20px;
|
|
42660
|
+
font-size: 14px;
|
|
42661
|
+
backdrop-filter: blur(10px);
|
|
42662
|
+
outline: none;
|
|
42663
|
+
cursor: pointer;
|
|
42664
|
+
appearance: none;
|
|
42665
|
+
-webkit-appearance: none;
|
|
42666
|
+
padding-right: 30px;
|
|
42667
|
+
background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
|
|
42668
|
+
background-repeat: no-repeat;
|
|
42669
|
+
background-position: right 10px center;
|
|
42670
|
+
background-size: 10px;
|
|
42671
|
+
}
|
|
42672
|
+
|
|
42673
|
+
.camera-select option {
|
|
42674
|
+
background: #333;
|
|
42675
|
+
color: white;
|
|
42676
|
+
}
|
|
42677
|
+
|
|
42456
42678
|
#captureButton {
|
|
42457
42679
|
position: absolute;
|
|
42458
42680
|
bottom: 40px;
|
|
@@ -42519,6 +42741,11 @@ function injectCameraModalStyles() {
|
|
|
42519
42741
|
bottom: env(safe-area-inset-bottom, 40px);
|
|
42520
42742
|
bottom: max(40px, env(safe-area-inset-bottom));
|
|
42521
42743
|
}
|
|
42744
|
+
|
|
42745
|
+
.camera-select-container {
|
|
42746
|
+
top: env(safe-area-inset-top, 20px);
|
|
42747
|
+
top: max(20px, env(safe-area-inset-top));
|
|
42748
|
+
}
|
|
42522
42749
|
}
|
|
42523
42750
|
|
|
42524
42751
|
/* Landscape mode adjustments */
|
|
@@ -42801,6 +43028,13 @@ async function loadDocument() {
|
|
|
42801
43028
|
err.textContent = "Error loading documents";
|
|
42802
43029
|
content.appendChild(err);
|
|
42803
43030
|
console.error(e);
|
|
43031
|
+
if (typeof sendEventCallback === 'function') {
|
|
43032
|
+
sendEventCallback({
|
|
43033
|
+
type: "ERROR",
|
|
43034
|
+
errorMessage: "ErrorCode : 013, Attachments missing from storage",
|
|
43035
|
+
data: { reason: "Failed to load documents from IndexedDB", technicalError: e }
|
|
43036
|
+
});
|
|
43037
|
+
}
|
|
42804
43038
|
}
|
|
42805
43039
|
|
|
42806
43040
|
// Assemble
|
|
@@ -43497,7 +43731,7 @@ see README and LICENSE for details
|
|
|
43497
43731
|
<script>
|
|
43498
43732
|
let flag = false;
|
|
43499
43733
|
class SmartStorage {
|
|
43500
|
-
constructor() {}
|
|
43734
|
+
constructor() { }
|
|
43501
43735
|
|
|
43502
43736
|
static get title() {
|
|
43503
43737
|
return "SmartStorage";
|
|
@@ -43523,15 +43757,38 @@ class SmartStorage {
|
|
|
43523
43757
|
|
|
43524
43758
|
return new Promise((resolve, reject) => {
|
|
43525
43759
|
const request = indexedDB.open("Forms-Attachments", 3);
|
|
43760
|
+
|
|
43526
43761
|
request.onsuccess = function (event) {
|
|
43527
43762
|
const db = event.target.result;
|
|
43763
|
+
if (!db.objectStoreNames.contains("Files")) {
|
|
43764
|
+
console.warn("[SmartStorage] Files store missing. Recreating database.");
|
|
43765
|
+
db.close();
|
|
43766
|
+
const deleteReq = indexedDB.deleteDatabase("Forms-Attachments");
|
|
43767
|
+
deleteReq.onsuccess = () => {
|
|
43768
|
+
const retryReq = indexedDB.open("Forms-Attachments", 3);
|
|
43769
|
+
retryReq.onupgradeneeded = (e) => {
|
|
43770
|
+
const newDb = e.target.result;
|
|
43771
|
+
newDb.createObjectStore("Files");
|
|
43772
|
+
};
|
|
43773
|
+
retryReq.onsuccess = (e) => resolve(e.target.result);
|
|
43774
|
+
retryReq.onerror = (e) => reject(e);
|
|
43775
|
+
};
|
|
43776
|
+
deleteReq.onerror = (e) => reject(e);
|
|
43777
|
+
return;
|
|
43778
|
+
}
|
|
43528
43779
|
resolve(db);
|
|
43529
43780
|
};
|
|
43530
43781
|
|
|
43531
43782
|
request.onupgradeneeded = function (e) {
|
|
43532
43783
|
const db = e.target.result;
|
|
43533
|
-
db.
|
|
43534
|
-
|
|
43784
|
+
if (!db.objectStoreNames.contains("Files")) {
|
|
43785
|
+
db.createObjectStore("Files");
|
|
43786
|
+
}
|
|
43787
|
+
resolve(db); // Note: resolve here calls with incomplete db during upgrade transaction, but it's typically fine for callers waiting on db handle.
|
|
43788
|
+
// Ideally we resolve in onsuccess, but existing code had it this way too?
|
|
43789
|
+
// Actually, in the original code, it resolved in BOTH. Resolving in upgrade gives the transaction-bound db.
|
|
43790
|
+
// But Standard practice is waiting for success.
|
|
43791
|
+
// The original code had `resolve(db)` in `onupgradeneeded`.
|
|
43535
43792
|
};
|
|
43536
43793
|
|
|
43537
43794
|
request.onerror = function (e) {
|
|
@@ -43558,6 +43815,7 @@ class SmartStorage {
|
|
|
43558
43815
|
size: file.size,
|
|
43559
43816
|
type: file.type,
|
|
43560
43817
|
url,
|
|
43818
|
+
mode: "A",
|
|
43561
43819
|
};
|
|
43562
43820
|
if (
|
|
43563
43821
|
window.platform.isBrowser ||
|
|
@@ -43579,6 +43837,7 @@ class SmartStorage {
|
|
|
43579
43837
|
type: file.type,
|
|
43580
43838
|
url: url,
|
|
43581
43839
|
id,
|
|
43840
|
+
mode: "A",
|
|
43582
43841
|
});
|
|
43583
43842
|
};
|
|
43584
43843
|
} else {
|
|
@@ -43589,6 +43848,7 @@ class SmartStorage {
|
|
|
43589
43848
|
type: file.type,
|
|
43590
43849
|
url: url,
|
|
43591
43850
|
id,
|
|
43851
|
+
mode: "A",
|
|
43592
43852
|
});
|
|
43593
43853
|
}
|
|
43594
43854
|
};
|
|
@@ -43675,6 +43935,7 @@ class SmartStorage {
|
|
|
43675
43935
|
size: blobObject.size,
|
|
43676
43936
|
type: file.type,
|
|
43677
43937
|
url: file.url,
|
|
43938
|
+
mode: file.mode || "G",
|
|
43678
43939
|
};
|
|
43679
43940
|
const trans = db.transaction(["Files"], "readwrite");
|
|
43680
43941
|
const addReq = trans.objectStore("Files").put(data, id);
|
|
@@ -44332,7 +44593,21 @@ class SmartFileComponent extends FieldComponent {
|
|
|
44332
44593
|
}
|
|
44333
44594
|
|
|
44334
44595
|
getValue() {
|
|
44335
|
-
|
|
44596
|
+
const value = Array.isArray(this.dataValue) ? this.dataValue : (this.dataValue ? [this.dataValue] : []);
|
|
44597
|
+
return value.concat(this.deletedFiles || []);
|
|
44598
|
+
}
|
|
44599
|
+
|
|
44600
|
+
setValue(value, flags) {
|
|
44601
|
+
if (Array.isArray(value)) {
|
|
44602
|
+
this.deletedFiles = value.filter(f => f.mode === 'D');
|
|
44603
|
+
value = value.filter(f => f.mode !== 'D');
|
|
44604
|
+
} else if (value && value.mode === 'D') {
|
|
44605
|
+
this.deletedFiles = [value];
|
|
44606
|
+
value = [];
|
|
44607
|
+
} else {
|
|
44608
|
+
this.deletedFiles = [];
|
|
44609
|
+
}
|
|
44610
|
+
return super.setValue(value, flags);
|
|
44336
44611
|
}
|
|
44337
44612
|
|
|
44338
44613
|
get defaultValue() {
|
|
@@ -44655,6 +44930,13 @@ class SmartFileComponent extends FieldComponent {
|
|
|
44655
44930
|
new SmartStorage().markFileAsDeleted(fileInfo.id);
|
|
44656
44931
|
this.deleteFile(fileInfo);
|
|
44657
44932
|
event.preventDefault();
|
|
44933
|
+
|
|
44934
|
+
fileInfo.mode = "D";
|
|
44935
|
+
if (!this.deletedFiles) {
|
|
44936
|
+
this.deletedFiles = [];
|
|
44937
|
+
}
|
|
44938
|
+
this.deletedFiles.push(fileInfo);
|
|
44939
|
+
|
|
44658
44940
|
this.splice(index);
|
|
44659
44941
|
this.redraw();
|
|
44660
44942
|
});
|
|
@@ -44909,10 +45191,8 @@ class SmartFileComponent extends FieldComponent {
|
|
|
44909
45191
|
let id = this.component.id;
|
|
44910
45192
|
isfileBrowse = false;
|
|
44911
45193
|
|
|
44912
|
-
//
|
|
44913
|
-
|
|
44914
|
-
|
|
44915
|
-
if (window.platform.isAndroid) {
|
|
45194
|
+
// Dispatch custom camera event for both Android and iOS
|
|
45195
|
+
if (window.platform.isAndroid || window.platform.iosPlatform) {
|
|
44916
45196
|
window.isListenerSet = false;
|
|
44917
45197
|
let eventCustom = new CustomEvent("openCamera", {
|
|
44918
45198
|
detail: {
|
|
@@ -45296,6 +45576,24 @@ class SmartFileComponent extends FieldComponent {
|
|
|
45296
45576
|
if (this.component.storage && files && files.length) {
|
|
45297
45577
|
// if (this.component.storage && files) {
|
|
45298
45578
|
Array.prototype.forEach.call(files, async (file) => {
|
|
45579
|
+
// Modify iOS filenames with timestamp BEFORE duplicate check
|
|
45580
|
+
let originalFileName = file.name;
|
|
45581
|
+
if (window.platform.iosPlatform) {
|
|
45582
|
+
const fileNameOriginal = file.name;
|
|
45583
|
+
const lastDotIndex = fileNameOriginal.lastIndexOf(".");
|
|
45584
|
+
let newName = "";
|
|
45585
|
+
if (lastDotIndex !== -1) {
|
|
45586
|
+
newName = `${fileNameOriginal.substring(
|
|
45587
|
+
0,
|
|
45588
|
+
lastDotIndex
|
|
45589
|
+
)}-${Date.now()}${fileNameOriginal.substring(lastDotIndex)}`;
|
|
45590
|
+
} else {
|
|
45591
|
+
newName = `${fileNameOriginal}-${Date.now()}`;
|
|
45592
|
+
}
|
|
45593
|
+
file = new File([file], newName, {
|
|
45594
|
+
type: file.type,
|
|
45595
|
+
});
|
|
45596
|
+
}
|
|
45299
45597
|
const fileName = uniqueName(
|
|
45300
45598
|
file.name,
|
|
45301
45599
|
this.component.fileNameTemplate,
|
|
@@ -45338,8 +45636,9 @@ class SmartFileComponent extends FieldComponent {
|
|
|
45338
45636
|
// Check if file with the same name is being uploaded
|
|
45339
45637
|
var fileWithSameNameUploaded = false;
|
|
45340
45638
|
if (window.platform.iosPlatform) {
|
|
45639
|
+
// For iOS, compare using the escaped filename (after timestamp modification)
|
|
45341
45640
|
fileWithSameNameUploaded = this.dataValue.some(
|
|
45342
|
-
(fileStatus) => fileStatus.
|
|
45641
|
+
(fileStatus) => fileStatus.originalName === escapedFileName
|
|
45343
45642
|
);
|
|
45344
45643
|
} else {
|
|
45345
45644
|
fileWithSameNameUploaded = isfileBrowse
|
|
@@ -45549,19 +45848,27 @@ class SmartFileComponent extends FieldComponent {
|
|
|
45549
45848
|
fileInfo.originalName = escapedFileName;
|
|
45550
45849
|
fileInfo.hash = fileUpload.hash;
|
|
45551
45850
|
fileInfo.compnentId = this.component.id;
|
|
45851
|
+
fileInfo.mode = fileUpload.mode || "A";
|
|
45552
45852
|
if (!this.hasValue()) {
|
|
45553
45853
|
this.dataValue = [];
|
|
45554
45854
|
}
|
|
45555
45855
|
if (replace) {
|
|
45556
|
-
let ind;
|
|
45856
|
+
let ind = -1;
|
|
45557
45857
|
for (let i = 0; i < this.dataValue.length; i++) {
|
|
45558
45858
|
if (this.dataValue[i].originalName == fileInfo.originalName) {
|
|
45559
45859
|
console.log("original name matches");
|
|
45560
45860
|
ind = i;
|
|
45861
|
+
break;
|
|
45561
45862
|
}
|
|
45562
45863
|
}
|
|
45563
45864
|
if (ind !== -1) {
|
|
45564
45865
|
let originalFileId = this.dataValue[ind].id;
|
|
45866
|
+
let originalFileMode = this.dataValue[ind].mode;
|
|
45867
|
+
|
|
45868
|
+
if (originalFileMode === "G" || originalFileMode === "M") {
|
|
45869
|
+
fileInfo.mode = "M";
|
|
45870
|
+
}
|
|
45871
|
+
|
|
45565
45872
|
console.log("originalFileId = " + originalFileId);
|
|
45566
45873
|
this.dataValue[ind] = fileInfo;
|
|
45567
45874
|
let eventCustom = new CustomEvent(
|
|
@@ -53102,7 +53409,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53102
53409
|
return {
|
|
53103
53410
|
...super.conditionOperatorsSettings,
|
|
53104
53411
|
valueComponent(classComp) {
|
|
53105
|
-
const valueComp = { ...
|
|
53412
|
+
const valueComp = { ...classComp, type: 'select' };
|
|
53106
53413
|
|
|
53107
53414
|
if (isSelectResourceWithObjectValue(classComp)) {
|
|
53108
53415
|
valueComp.reference = false;
|
|
@@ -53254,7 +53561,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53254
53561
|
return this.component.valueProperty;
|
|
53255
53562
|
}
|
|
53256
53563
|
// Force values datasource to use values without actually setting it on the component settings.
|
|
53257
|
-
|
|
53564
|
+
if (this.component.dataSrc === 'values') {
|
|
53258
53565
|
return 'value';
|
|
53259
53566
|
}
|
|
53260
53567
|
return '';
|
|
@@ -53292,10 +53599,10 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53292
53599
|
|
|
53293
53600
|
get shouldInitialLoad() {
|
|
53294
53601
|
if (this.component.widget === 'html5' &&
|
|
53295
|
-
|
|
53296
|
-
|
|
53297
|
-
|
|
53298
|
-
|
|
53602
|
+
this.isEntireObjectDisplay() &&
|
|
53603
|
+
this.component.searchField &&
|
|
53604
|
+
this.dataValue) {
|
|
53605
|
+
return false;
|
|
53299
53606
|
}
|
|
53300
53607
|
|
|
53301
53608
|
return super.shouldLoad;
|
|
@@ -53330,7 +53637,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53330
53637
|
if (this.component.multiple && _.isArray(this.dataValue) ? this.dataValue.find((val) => value === val) : (this.dataValue === value)) {
|
|
53331
53638
|
const selectData = this.selectData;
|
|
53332
53639
|
if (selectData) {
|
|
53333
|
-
const templateValue = this.component.reference && value && (value._id
|
|
53640
|
+
const templateValue = this.component.reference && value && (value._id ? value._id.toString() : value);
|
|
53334
53641
|
if (!this.templateData || !this.templateData[templateValue]) {
|
|
53335
53642
|
this.getOptionTemplate(data, value);
|
|
53336
53643
|
}
|
|
@@ -53357,7 +53664,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53357
53664
|
});
|
|
53358
53665
|
}
|
|
53359
53666
|
|
|
53360
|
-
|
|
53667
|
+
if (data.data) {
|
|
53361
53668
|
// checking additional fields in the template for the selected Entire Object option
|
|
53362
53669
|
const hasNestedFields = /item\.data\.\w*/g.test(this.component.template);
|
|
53363
53670
|
data.data = this.isEntireObjectDisplay() && _.isObject(data.data) && !hasNestedFields ?
|
|
@@ -53376,8 +53683,8 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53376
53683
|
hasTranslator = this.i18next.translator;
|
|
53377
53684
|
}
|
|
53378
53685
|
if (!label || (hasTranslator && !this.t(label, {
|
|
53379
|
-
|
|
53380
|
-
|
|
53686
|
+
_userInput: true
|
|
53687
|
+
}))) return;
|
|
53381
53688
|
return hasTranslator ? template.replace(label, this.t(label, {
|
|
53382
53689
|
_userInput: true
|
|
53383
53690
|
})) : label;
|
|
@@ -53404,7 +53711,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53404
53711
|
// ...idPath
|
|
53405
53712
|
// };
|
|
53406
53713
|
|
|
53407
|
-
|
|
53714
|
+
const option = Object.assign({
|
|
53408
53715
|
value: this.getOptionValue(value),
|
|
53409
53716
|
label,
|
|
53410
53717
|
}, idPath);
|
|
@@ -53560,7 +53867,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53560
53867
|
if (this.root && this.root.options.editForm && this.root.options.editForm._id && this.root.options.editForm._id === item._id) return;
|
|
53561
53868
|
const itemValueAndLabel = this.selectValueAndLabel(item);
|
|
53562
53869
|
this.addOption(itemValueAndLabel.value, itemValueAndLabel.label, {}, _.get(item, this.component.idPath, String(index)));
|
|
53563
|
-
|
|
53870
|
+
|
|
53564
53871
|
});
|
|
53565
53872
|
if (this.choices) {
|
|
53566
53873
|
if ((this.component.dataSrc === 'masterdata') && this.component.masterdata) {
|
|
@@ -53602,10 +53909,10 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53602
53909
|
// If a value is provided, then select it.
|
|
53603
53910
|
if (!this.isEmpty()) {
|
|
53604
53911
|
if (localStorage.getItem('renderMode') === 'html') {
|
|
53605
|
-
|
|
53606
|
-
|
|
53607
|
-
|
|
53608
|
-
|
|
53912
|
+
var tmplt = this.component.template;
|
|
53913
|
+
var str1 = tmplt.substring(tmplt.lastIndexOf('.') + 1, tmplt.length);
|
|
53914
|
+
var label = str1.substring(0, str1.indexOf('}'), str1.length);
|
|
53915
|
+
label = label.trim();
|
|
53609
53916
|
|
|
53610
53917
|
if (items.length > 0) {
|
|
53611
53918
|
if (this.component.multiple) {
|
|
@@ -53618,13 +53925,13 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53618
53925
|
});
|
|
53619
53926
|
} else {
|
|
53620
53927
|
}
|
|
53928
|
+
}
|
|
53929
|
+
} else {
|
|
53930
|
+
this.setValue(this.dataValue, {
|
|
53931
|
+
noUpdateEvent: true
|
|
53932
|
+
});
|
|
53621
53933
|
}
|
|
53622
|
-
}else{
|
|
53623
|
-
this.setValue(this.dataValue, {
|
|
53624
|
-
noUpdateEvent: true
|
|
53625
|
-
});
|
|
53626
|
-
}
|
|
53627
|
-
}else if (this.shouldAddDefaultValue && !this.options.readOnly) {
|
|
53934
|
+
} else if (this.shouldAddDefaultValue && !this.options.readOnly) {
|
|
53628
53935
|
// If a default value is provided then select it.
|
|
53629
53936
|
const defaultValue = this.defaultValue;
|
|
53630
53937
|
if (!this.isEmpty(defaultValue)) {
|
|
@@ -53931,32 +54238,32 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
53931
54238
|
} else {
|
|
53932
54239
|
if (!this.component.dropdownOpened && this.data[this.key] && String(this.data[this.key]).length > 0) {
|
|
53933
54240
|
let result = [];
|
|
53934
|
-
if(this.component.multiple && this.component.masterdata){
|
|
53935
|
-
this.data[this.key].forEach(item =>
|
|
54241
|
+
if (this.component.multiple && this.component.masterdata) {
|
|
54242
|
+
this.data[this.key].forEach(item =>
|
|
53936
54243
|
this.component.masterdata.filter((value) => {
|
|
53937
54244
|
const propValue = value[this.component.valueProperty];
|
|
53938
|
-
|
|
53939
|
-
|
|
53940
|
-
if(valPropData.includes(item)){
|
|
54245
|
+
// Convert to string only if necessary
|
|
54246
|
+
const valPropData = typeof propValue !== 'string' ? String(propValue) : propValue;
|
|
54247
|
+
if (valPropData.includes(item)) {
|
|
53941
54248
|
result.push(value)
|
|
53942
54249
|
}
|
|
53943
54250
|
})
|
|
53944
54251
|
);
|
|
53945
54252
|
// result = this.component.masterdata;
|
|
53946
|
-
}else{
|
|
53947
|
-
if(this.component.masterdata){
|
|
53948
|
-
|
|
53949
|
-
|
|
53950
|
-
|
|
53951
|
-
|
|
53952
|
-
|
|
53953
|
-
|
|
53954
|
-
|
|
54253
|
+
} else {
|
|
54254
|
+
if (this.component.masterdata) {
|
|
54255
|
+
result = this.component.masterdata.filter(value => {
|
|
54256
|
+
const propValue = value[this.component.valueProperty];
|
|
54257
|
+
// Convert to string only if necessary
|
|
54258
|
+
const valPropData = typeof propValue !== 'string' ? String(propValue) : propValue;
|
|
54259
|
+
return valPropData?.includes(this.data[this.key]);
|
|
54260
|
+
});
|
|
54261
|
+
}
|
|
53955
54262
|
}
|
|
53956
54263
|
const unique = result.filter((obj, index) => {
|
|
53957
54264
|
return index === result.findIndex(o => obj[this.component.valueProperty] === o[this.component.valueProperty]);
|
|
53958
|
-
|
|
53959
|
-
|
|
54265
|
+
});
|
|
54266
|
+
this.setItems(unique);
|
|
53960
54267
|
}
|
|
53961
54268
|
}
|
|
53962
54269
|
}
|
|
@@ -54117,9 +54424,9 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54117
54424
|
get active() {
|
|
54118
54425
|
if ((this.component.dataSrc === 'masterdata') && this.component.masterdata) {
|
|
54119
54426
|
return !this.component.lazyLoad || this.activated;
|
|
54120
|
-
}else{
|
|
54121
|
-
|
|
54122
|
-
|
|
54427
|
+
} else {
|
|
54428
|
+
// return !this.component.lazyLoad || this.activated || this.options.readOnly;
|
|
54429
|
+
return !this.component.lazyLoad || this.activated;
|
|
54123
54430
|
}
|
|
54124
54431
|
}
|
|
54125
54432
|
|
|
@@ -54193,8 +54500,8 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54193
54500
|
searchChoices: !this.component.searchField,
|
|
54194
54501
|
searchFields: _.get(this, 'component.searchFields', ['label']),
|
|
54195
54502
|
shadowRoot: this.root ? this.root.shadowRoot : null,
|
|
54196
|
-
|
|
54197
|
-
_.get(this, 'component.fuseOptions', {}),
|
|
54503
|
+
fuseOptions: this.component.useExactSearch ? Object.assign(fuseObj, commonFuseOptions) : Object.assign({},
|
|
54504
|
+
_.get(this, 'component.fuseOptions', {}),
|
|
54198
54505
|
Object.assign(fuseObj1, commonFuseOptions)
|
|
54199
54506
|
),
|
|
54200
54507
|
valueComparer: _.isEqual,
|
|
@@ -54362,17 +54669,17 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54362
54669
|
}
|
|
54363
54670
|
this.isFromSearch = false;
|
|
54364
54671
|
});
|
|
54365
|
-
|
|
54366
|
-
|
|
54367
|
-
|
|
54368
|
-
|
|
54369
|
-
|
|
54370
|
-
|
|
54371
|
-
|
|
54372
|
-
|
|
54373
|
-
|
|
54374
|
-
|
|
54375
|
-
|
|
54672
|
+
// avoid spamming the resource/url endpoint when we have server side filtering enabled.
|
|
54673
|
+
const debounceTimeout = this.component.searchField && (this.isSelectResource || this.isSelectURL) ?
|
|
54674
|
+
(this.component.searchDebounce === 0 ? 0 : this.component.searchDebounce || this.defaultSchema.searchDebounce) * 1000
|
|
54675
|
+
: 0;
|
|
54676
|
+
const updateComponent = (evt) => {
|
|
54677
|
+
this.triggerUpdate(evt.detail.value);
|
|
54678
|
+
};
|
|
54679
|
+
this.addEventListener(input, 'search', _.debounce((e) => {
|
|
54680
|
+
updateComponent(e);
|
|
54681
|
+
this.positionDropdown();
|
|
54682
|
+
}, debounceTimeout));
|
|
54376
54683
|
|
|
54377
54684
|
this.addEventListener(input, 'stopSearch', () => this.triggerUpdate());
|
|
54378
54685
|
this.addEventListener(input, 'hideDropdown', () => {
|
|
@@ -54387,9 +54694,9 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54387
54694
|
if (this.data[this.key] && String(this.data[this.key]).length > 0) {
|
|
54388
54695
|
selData = this.component.masterdata.filter((value) => {
|
|
54389
54696
|
const propValue = value[this.component.valueProperty];
|
|
54390
|
-
|
|
54391
|
-
|
|
54392
|
-
|
|
54697
|
+
// Convert to string only if necessary
|
|
54698
|
+
const valPropData = typeof propValue !== 'string' ? String(propValue) : propValue;
|
|
54699
|
+
return valPropData?.includes(this.data[this.key]);
|
|
54393
54700
|
|
|
54394
54701
|
})
|
|
54395
54702
|
}
|
|
@@ -54482,10 +54789,10 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54482
54789
|
setDropdownPosition() {
|
|
54483
54790
|
let dropdown;
|
|
54484
54791
|
let container;
|
|
54485
|
-
if(this.choices && this.choices.dropdown && this.choices.dropdown.element){
|
|
54486
|
-
|
|
54792
|
+
if (this.choices && this.choices.dropdown && this.choices.dropdown.element) {
|
|
54793
|
+
dropdown = this.choices.dropdown.element;
|
|
54487
54794
|
}
|
|
54488
|
-
if(this.choices && this.choices.containerOuter && this.choices.containerOuter.element){
|
|
54795
|
+
if (this.choices && this.choices.containerOuter && this.choices.containerOuter.element) {
|
|
54489
54796
|
container = this.choices.containerOuter.element;
|
|
54490
54797
|
}
|
|
54491
54798
|
|
|
@@ -54570,9 +54877,9 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54570
54877
|
if (this.data[this.key] && String(this.data[this.key]).length > 0) {
|
|
54571
54878
|
selData = this.component.masterdata.filter((value) => {
|
|
54572
54879
|
const propValue = value[this.component.valueProperty];
|
|
54573
|
-
|
|
54574
|
-
|
|
54575
|
-
|
|
54880
|
+
// Convert to string only if necessary
|
|
54881
|
+
const valPropData = typeof propValue !== 'string' ? String(propValue) : propValue;
|
|
54882
|
+
return valPropData?.includes(this.data[this.key]);
|
|
54576
54883
|
})
|
|
54577
54884
|
}
|
|
54578
54885
|
|
|
@@ -54923,29 +55230,29 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54923
55230
|
|
|
54924
55231
|
setValue(value, flags = {}) {
|
|
54925
55232
|
// console.log("value line 1875" + this.component.label, value)
|
|
54926
|
-
if(value && String(value).length > 0){
|
|
55233
|
+
if (value && String(value).length > 0) {
|
|
54927
55234
|
$(".barcode-select-error").remove();
|
|
54928
55235
|
}
|
|
54929
|
-
|
|
54930
|
-
|
|
54931
|
-
|
|
54932
|
-
|
|
54933
|
-
|
|
54934
|
-
|
|
55236
|
+
if (localStorage.getItem('renderMode') === 'html' && this.component.dataSrc === 'values') {
|
|
55237
|
+
this.component.data.values.filter((data) => {
|
|
55238
|
+
if ((value && data.value === value) || (value && data.value === String(value))) {
|
|
55239
|
+
value = data.label;
|
|
55240
|
+
};
|
|
55241
|
+
})
|
|
55242
|
+
}
|
|
55243
|
+
if (localStorage.getItem('renderMode') === 'html' && this.component.dataSrc === 'masterdata' && !this.component.multiple) {
|
|
55244
|
+
var tmplt = this.component.template;
|
|
55245
|
+
var str1 = tmplt.substring(tmplt.lastIndexOf('.') + 1, tmplt.length);
|
|
55246
|
+
var label = str1.substring(0, str1.indexOf('}'), str1.length);
|
|
55247
|
+
label = label.trim();
|
|
55248
|
+
|
|
55249
|
+
this.component.masterdata.filter((data) => {
|
|
55250
|
+
if ((value && data[this.component.valueProperty] === value) || (value && data[this.component.valueProperty] === String(value))) {
|
|
55251
|
+
value = data[label];
|
|
55252
|
+
}
|
|
55253
|
+
})
|
|
54935
55254
|
}
|
|
54936
|
-
if (localStorage.getItem('renderMode') === 'html' && this.component.dataSrc === 'masterdata' && !this.component.multiple) {
|
|
54937
|
-
var tmplt = this.component.template;
|
|
54938
|
-
var str1 = tmplt.substring(tmplt.lastIndexOf('.') + 1, tmplt.length);
|
|
54939
|
-
var label = str1.substring(0, str1.indexOf('}'), str1.length);
|
|
54940
|
-
label = label.trim();
|
|
54941
55255
|
|
|
54942
|
-
this.component.masterdata.filter((data) => {
|
|
54943
|
-
if ((value && data[this.component.valueProperty] === value) || (value && data[this.component.valueProperty] === String(value))) {
|
|
54944
|
-
value = data[label];
|
|
54945
|
-
}
|
|
54946
|
-
})
|
|
54947
|
-
}
|
|
54948
|
-
|
|
54949
55256
|
const previousValue = this.dataValue;
|
|
54950
55257
|
// console.log("value line 1900 " + this.component.label, value)
|
|
54951
55258
|
const changed = this.updateValue(value, flags);
|
|
@@ -54957,10 +55264,10 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54957
55264
|
if (this.component.multiple && Array.isArray(value)) {
|
|
54958
55265
|
value = value.map(value => {
|
|
54959
55266
|
if (typeof value === 'boolean' || typeof value === 'number') {
|
|
54960
|
-
|
|
55267
|
+
console.log("value line 1910 " + this.component.label, value)
|
|
54961
55268
|
return value.toString();
|
|
54962
55269
|
}
|
|
54963
|
-
|
|
55270
|
+
console.log("value line 1914 " + this.component.label, value)
|
|
54964
55271
|
return value;
|
|
54965
55272
|
});
|
|
54966
55273
|
} else {
|
|
@@ -54992,10 +55299,10 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
54992
55299
|
// Add the value options.
|
|
54993
55300
|
this.itemsLoaded.then(() => {
|
|
54994
55301
|
this.addValueOptions();
|
|
54995
|
-
|
|
55302
|
+
// console.log("value line 1945 " + this.component.label, value)
|
|
54996
55303
|
this.setChoicesValue(value, hasPreviousValue, flags);
|
|
54997
55304
|
});
|
|
54998
|
-
|
|
55305
|
+
|
|
54999
55306
|
return changed;
|
|
55000
55307
|
}
|
|
55001
55308
|
|
|
@@ -55042,7 +55349,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
55042
55349
|
if (hasValue) {
|
|
55043
55350
|
const values = Array.isArray(value) ? value : [value];
|
|
55044
55351
|
if (!_.isEqual(this.dataValue, this.defaultValue) && this.selectOptions.length < 2
|
|
55045
|
-
|
|
55352
|
+
|| (this.selectData && flags.fromSubmission)) {
|
|
55046
55353
|
const { value, label } = this.selectValueAndLabel(this.dataValue);
|
|
55047
55354
|
this.addOption(value, label);
|
|
55048
55355
|
}
|
|
@@ -55115,14 +55422,14 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
55115
55422
|
*/
|
|
55116
55423
|
getOptionValue(value) {
|
|
55117
55424
|
return _.isObject(value) && this.isEntireObjectDisplay()
|
|
55118
|
-
|
|
55119
|
-
|
|
55120
|
-
|
|
55121
|
-
|
|
55122
|
-
|
|
55123
|
-
|
|
55124
|
-
|
|
55125
|
-
|
|
55425
|
+
? this.normalizeSingleValue(value)
|
|
55426
|
+
: _.isObject(value) && (this.valueProperty || this.component.key !== 'resource')
|
|
55427
|
+
? value
|
|
55428
|
+
: _.isObject(value) && !this.valueProperty
|
|
55429
|
+
? this.interpolate(this.component.template, { item: value }).replace(/<\/?[^>]+(>|$)/g, '')
|
|
55430
|
+
: _.isNull(value)
|
|
55431
|
+
? this.emptyValue
|
|
55432
|
+
: String(this.normalizeSingleValue(value));
|
|
55126
55433
|
}
|
|
55127
55434
|
|
|
55128
55435
|
/**
|
|
@@ -55238,19 +55545,19 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
55238
55545
|
items: convertToString(this.getNormalizedValues(), 'value'),
|
|
55239
55546
|
valueProperty: 'value',
|
|
55240
55547
|
} : {
|
|
55241
|
-
|
|
55242
|
-
|
|
55243
|
-
|
|
55548
|
+
items: convertToString(this.getCustomItems(), this.valueProperty),
|
|
55549
|
+
valueProperty: this.valueProperty,
|
|
55550
|
+
};
|
|
55244
55551
|
const getFromValues = () => {
|
|
55245
55552
|
const initialValue = _.find(items, [valueProperty, value]);
|
|
55246
55553
|
const values = this.defaultSchema.data.values || [];
|
|
55247
55554
|
return _.isEqual(initialValue, values[0]) ? '-' : initialValue;
|
|
55248
55555
|
};
|
|
55249
55556
|
value = (this.component.multiple && Array.isArray(value))
|
|
55250
|
-
|
|
55251
|
-
|
|
55252
|
-
|
|
55253
|
-
|
|
55557
|
+
? _.filter(items, (item) => value.includes(item.value))
|
|
55558
|
+
: valueProperty
|
|
55559
|
+
? getFromValues() ?? { value, label: value }
|
|
55560
|
+
: value;
|
|
55254
55561
|
}
|
|
55255
55562
|
|
|
55256
55563
|
if (_.isString(value)) {
|
|
@@ -55266,7 +55573,7 @@ class SmartSelectComponent extends SmartSelectField {
|
|
|
55266
55573
|
if (Array.isArray(value)) {
|
|
55267
55574
|
const items = [];
|
|
55268
55575
|
value.forEach(item => items.push(getTemplateValue(item)));
|
|
55269
|
-
if (this.component.dataSrc === 'resource' &&
|
|
55576
|
+
if (this.component.dataSrc === 'resource' && items.length > 0) {
|
|
55270
55577
|
return items.join(', ');
|
|
55271
55578
|
}
|
|
55272
55579
|
else if (items.length > 0) {
|
|
@@ -58620,8 +58927,7 @@ async function validateAttachments(template, submissionData) {
|
|
|
58620
58927
|
if (
|
|
58621
58928
|
!fileRecord ||
|
|
58622
58929
|
!fileRecord.id ||
|
|
58623
|
-
!fileRecord.data
|
|
58624
|
-
!fileRecord.url
|
|
58930
|
+
(!fileRecord.data && !fileRecord.url)
|
|
58625
58931
|
) {
|
|
58626
58932
|
missingFiles.push({
|
|
58627
58933
|
fileId,
|
|
@@ -59013,19 +59319,31 @@ function FormOnBackNavigation() {
|
|
|
59013
59319
|
|
|
59014
59320
|
// ============================================ FORM-IO ===========================================================
|
|
59015
59321
|
|
|
59322
|
+
// Button state management based on privateExternal and permission
|
|
59016
59323
|
// Button state management based on privateExternal and permission
|
|
59017
59324
|
function initialButtonSetup(privateExternal, permission) {
|
|
59018
59325
|
const saveBtn = document.getElementById("saveBtn");
|
|
59019
59326
|
const submitBtn = document.getElementById("submitBtn");
|
|
59327
|
+
const completeOption = document.getElementById("completeOption");
|
|
59328
|
+
const saveOption = document.getElementById("saveOption");
|
|
59329
|
+
const completeDivider = document.getElementById("completeDivider");
|
|
59330
|
+
const saveDivider = document.getElementById("saveDivider");
|
|
59331
|
+
|
|
59020
59332
|
if (!saveBtn || !submitBtn) return;
|
|
59021
59333
|
|
|
59022
59334
|
const isPrivate = privateExternal === true || privateExternal === "true";
|
|
59023
59335
|
const isPublic = privateExternal === false || privateExternal === "false";
|
|
59024
59336
|
const permissionMode = String(permission || "").toLowerCase();
|
|
59025
59337
|
|
|
59026
|
-
|
|
59027
|
-
|
|
59028
|
-
|
|
59338
|
+
// Helper to toggle dropdown items
|
|
59339
|
+
const toggleDropdown = (option, divider, show) => {
|
|
59340
|
+
if (option) option.style.display = show ? "block" : "none";
|
|
59341
|
+
if (divider) divider.style.display = show ? "block" : "none";
|
|
59342
|
+
};
|
|
59343
|
+
|
|
59344
|
+
// Default: Hide dropdown specific items
|
|
59345
|
+
toggleDropdown(completeOption, completeDivider, false);
|
|
59346
|
+
toggleDropdown(saveOption, saveDivider, false);
|
|
59029
59347
|
|
|
59030
59348
|
// READ ONLY
|
|
59031
59349
|
if (permissionMode === "read") {
|
|
@@ -59042,23 +59360,35 @@ function initialButtonSetup(privateExternal, permission) {
|
|
|
59042
59360
|
console.log("Mode: PUBLIC WRITE → Show submit (disabled)");
|
|
59043
59361
|
saveBtn.style.display = "none";
|
|
59044
59362
|
submitBtn.style.display = "";
|
|
59363
|
+
submitBtn.innerHTML = '<i class="icon save"></i> Submit';
|
|
59045
59364
|
submitBtn.disabled = true;
|
|
59046
59365
|
}
|
|
59047
59366
|
|
|
59048
59367
|
// PRIVATE FORM - writemultiple
|
|
59049
59368
|
else if (isPrivate && permissionMode === "writemultiple") {
|
|
59050
|
-
console.log(
|
|
59051
|
-
|
|
59052
|
-
|
|
59053
|
-
|
|
59369
|
+
console.log(
|
|
59370
|
+
"Mode: PRIVATE WRITEMULTIPLE → Show save (disabled), Complete in Dropdown"
|
|
59371
|
+
);
|
|
59372
|
+
saveBtn.style.display = "";
|
|
59373
|
+
submitBtn.style.display = "none";
|
|
59374
|
+
saveBtn.disabled = true;
|
|
59375
|
+
|
|
59376
|
+
// Show Complete in Dropdown
|
|
59377
|
+
toggleDropdown(completeOption, completeDivider, true);
|
|
59054
59378
|
}
|
|
59055
59379
|
|
|
59056
59380
|
// PRIVATE FORM - writesingle
|
|
59057
59381
|
else if (isPrivate && permissionMode === "writesingle") {
|
|
59058
|
-
console.log(
|
|
59059
|
-
|
|
59060
|
-
|
|
59061
|
-
saveBtn.
|
|
59382
|
+
console.log(
|
|
59383
|
+
"Mode: PRIVATE WRITESINGLE → Show submit (disabled), Save in Dropdown"
|
|
59384
|
+
);
|
|
59385
|
+
saveBtn.style.display = "none";
|
|
59386
|
+
submitBtn.style.display = "";
|
|
59387
|
+
submitBtn.innerHTML = '<i class="icon save"></i> Complete';
|
|
59388
|
+
submitBtn.disabled = true;
|
|
59389
|
+
|
|
59390
|
+
// Show Save in Dropdown
|
|
59391
|
+
toggleDropdown(saveOption, saveDivider, true);
|
|
59062
59392
|
}
|
|
59063
59393
|
|
|
59064
59394
|
// DEFAULT / UNKNOWN
|
|
@@ -59066,6 +59396,7 @@ function initialButtonSetup(privateExternal, permission) {
|
|
|
59066
59396
|
console.log("Mode: DEFAULT / UNKNOWN → Show submit (disabled)");
|
|
59067
59397
|
saveBtn.style.display = "none";
|
|
59068
59398
|
submitBtn.style.display = "";
|
|
59399
|
+
submitBtn.innerHTML = '<i class="icon save"></i> Submit';
|
|
59069
59400
|
submitBtn.disabled = true;
|
|
59070
59401
|
}
|
|
59071
59402
|
}
|
|
@@ -59089,16 +59420,12 @@ function onChangeButtonSetup(
|
|
|
59089
59420
|
v !== undefined &&
|
|
59090
59421
|
v !== null &&
|
|
59091
59422
|
v !== "" &&
|
|
59092
|
-
|
|
59423
|
+
v !== false &&
|
|
59424
|
+
!(Array.isArray(v) && v.length === 0) &&
|
|
59425
|
+
!(typeof v === "object" && !Array.isArray(v) && Object.keys(v).length === 0)
|
|
59093
59426
|
);
|
|
59094
59427
|
const isComplete = completionPercentage >= 100;
|
|
59095
59428
|
|
|
59096
|
-
console.log("=== onChangeButtonSetup ===");
|
|
59097
|
-
console.log("privateExternal:", privateExternal);
|
|
59098
|
-
console.log("permission:", permissionMode);
|
|
59099
|
-
console.log("hasAnyValue:", hasAnyValue);
|
|
59100
|
-
console.log("completionPercentage:", completionPercentage);
|
|
59101
|
-
|
|
59102
59429
|
// READ ONLY
|
|
59103
59430
|
if (permissionMode === "read") {
|
|
59104
59431
|
console.log("Mode: READ → Hide all buttons");
|
|
@@ -59110,26 +59437,24 @@ function onChangeButtonSetup(
|
|
|
59110
59437
|
// PRIVATE FORM - writesingle
|
|
59111
59438
|
if (isPrivate && permissionMode === "writesingle") {
|
|
59112
59439
|
console.log("Mode: PRIVATE WRITESINGLE");
|
|
59440
|
+
// Main: Complete (Submit)
|
|
59113
59441
|
saveBtn.style.display = "none";
|
|
59114
59442
|
submitBtn.style.display = "";
|
|
59115
|
-
|
|
59443
|
+
|
|
59444
|
+
// Logic: Disable Complete until 100%
|
|
59445
|
+
submitBtn.disabled = !isComplete;
|
|
59116
59446
|
return;
|
|
59117
59447
|
}
|
|
59118
59448
|
|
|
59119
59449
|
// PRIVATE FORM - writemultiple
|
|
59120
59450
|
if (isPrivate && permissionMode === "writemultiple") {
|
|
59121
59451
|
console.log("Mode: PRIVATE WRITEMULTIPLE");
|
|
59122
|
-
|
|
59123
|
-
|
|
59124
|
-
|
|
59125
|
-
|
|
59126
|
-
|
|
59127
|
-
|
|
59128
|
-
console.log("→ Incomplete: Show save");
|
|
59129
|
-
saveBtn.style.display = "";
|
|
59130
|
-
submitBtn.style.display = "none";
|
|
59131
|
-
saveBtn.disabled = !hasAnyValue;
|
|
59132
|
-
}
|
|
59452
|
+
// Main: Save
|
|
59453
|
+
saveBtn.style.display = "";
|
|
59454
|
+
submitBtn.style.display = "none";
|
|
59455
|
+
|
|
59456
|
+
// Logic: Enable Save if hasAnyValue
|
|
59457
|
+
saveBtn.disabled = !hasAnyValue;
|
|
59133
59458
|
return;
|
|
59134
59459
|
}
|
|
59135
59460
|
|
|
@@ -59218,12 +59543,21 @@ async function renderRNform(
|
|
|
59218
59543
|
console.log("-------->>>Processed ID ", processSubData);
|
|
59219
59544
|
// window.FORM_PREVIOUS_DATA = processId;
|
|
59220
59545
|
|
|
59221
|
-
document.getElementById("formio-cmt").innerHTML = "";
|
|
59222
|
-
|
|
59223
|
-
Formio.use(window.semantic.default || window.semantic);
|
|
59546
|
+
// document.getElementById("formio-cmt").innerHTML = "";
|
|
59224
59547
|
|
|
59225
59548
|
console.log("privae external --->> ", privateExternal);
|
|
59226
59549
|
|
|
59550
|
+
if (typeof Formio === "undefined") {
|
|
59551
|
+
sendEventCallback({
|
|
59552
|
+
type: "ERROR",
|
|
59553
|
+
errorMessage: "ErrorCode : 016, Formio library not loaded",
|
|
59554
|
+
data: { reason: "Formio library not loaded" },
|
|
59555
|
+
});
|
|
59556
|
+
return;
|
|
59557
|
+
}
|
|
59558
|
+
|
|
59559
|
+
Formio.use(window.semantic.default || window.semantic);
|
|
59560
|
+
|
|
59227
59561
|
try {
|
|
59228
59562
|
// Determine form configuration based on mode
|
|
59229
59563
|
let formConfig = {
|
|
@@ -59408,8 +59742,8 @@ async function renderRNform(
|
|
|
59408
59742
|
sendEventCallback({
|
|
59409
59743
|
type: "ERROR",
|
|
59410
59744
|
errorMessage:
|
|
59411
|
-
"ErrorCode : 005,
|
|
59412
|
-
data: { technicalError: error },
|
|
59745
|
+
"ErrorCode : 005, Formio not rendered the forms",
|
|
59746
|
+
data: { reason: "Failed to render form", technicalError: error },
|
|
59413
59747
|
});
|
|
59414
59748
|
}
|
|
59415
59749
|
} // End of renderForm function
|
|
@@ -59550,6 +59884,9 @@ function setupOnChange(privateExternal, permission) {
|
|
|
59550
59884
|
const completion =
|
|
59551
59885
|
mandatory === 0 ? 100 : Math.round((filledMandatory / mandatory) * 100);
|
|
59552
59886
|
|
|
59887
|
+
calculationPercentage = completion;
|
|
59888
|
+
completeFlag = completion >= 100;
|
|
59889
|
+
|
|
59553
59890
|
console.log("📊 Completion %:", completion);
|
|
59554
59891
|
onChangeButtonSetup(completion, formObj.data, privateExternal, permission);
|
|
59555
59892
|
|
|
@@ -59685,6 +60022,18 @@ function FormOnSubmit() {
|
|
|
59685
60022
|
[{ label: "OK", callback: {} }],
|
|
59686
60023
|
"Fill The Required Fields"
|
|
59687
60024
|
);
|
|
60025
|
+
|
|
60026
|
+
sendEventCallback({
|
|
60027
|
+
type: FORM_EVENTS.SUBMIT_ERROR,
|
|
60028
|
+
errorMessage: "ErrorCode : 006, Formio not submit the form",
|
|
60029
|
+
data: {
|
|
60030
|
+
reason: "Form submission failed",
|
|
60031
|
+
formData: processedData,
|
|
60032
|
+
completeFlag,
|
|
60033
|
+
completionPercentage: calculationPercentage,
|
|
60034
|
+
technicalError: error,
|
|
60035
|
+
},
|
|
60036
|
+
});
|
|
59688
60037
|
});
|
|
59689
60038
|
}
|
|
59690
60039
|
|
|
@@ -59708,6 +60057,22 @@ function loadComments() {
|
|
|
59708
60057
|
function FormOnSave() {
|
|
59709
60058
|
if (!formObj) return;
|
|
59710
60059
|
|
|
60060
|
+
const formData = formObj.getValue().data;
|
|
60061
|
+
const hasAnyValue = Object.values(formData || {}).some(
|
|
60062
|
+
(v) =>
|
|
60063
|
+
v !== undefined &&
|
|
60064
|
+
v !== null &&
|
|
60065
|
+
v !== "" &&
|
|
60066
|
+
v !== false &&
|
|
60067
|
+
!(Array.isArray(v) && v.length === 0) &&
|
|
60068
|
+
!(typeof v === "object" && !Array.isArray(v) && Object.keys(v).length === 0)
|
|
60069
|
+
);
|
|
60070
|
+
|
|
60071
|
+
if (!hasAnyValue) {
|
|
60072
|
+
showDynamicModal("Attention", [{ label: "OK" }], "Please fill at least one field before saving.");
|
|
60073
|
+
return;
|
|
60074
|
+
}
|
|
60075
|
+
|
|
59711
60076
|
showDynamicModal("Do you want to save the data?", [
|
|
59712
60077
|
{
|
|
59713
60078
|
label: "Yes",
|
|
@@ -59918,17 +60283,28 @@ function goToformRender() {
|
|
|
59918
60283
|
|
|
59919
60284
|
// Reload main form from cached globals
|
|
59920
60285
|
if (typeof window.renderRNform === 'function') {
|
|
59921
|
-
|
|
59922
|
-
window.
|
|
59923
|
-
|
|
59924
|
-
|
|
59925
|
-
|
|
59926
|
-
|
|
59927
|
-
|
|
59928
|
-
|
|
59929
|
-
|
|
59930
|
-
|
|
59931
|
-
|
|
60286
|
+
try {
|
|
60287
|
+
window.renderRNform(
|
|
60288
|
+
window.FORM_TEMPLATE,
|
|
60289
|
+
window.FORM_PREVIOUS_DATA,
|
|
60290
|
+
window.FORM_THEME_DATA,
|
|
60291
|
+
window.FORM_MODE,
|
|
60292
|
+
window.FORM_LANGUAGE,
|
|
60293
|
+
window.FORM_TRASLATIONS,
|
|
60294
|
+
window.FORM_CONTROL_DATA,
|
|
60295
|
+
window.FORM_PRIVATE_EXTERNAL,
|
|
60296
|
+
window.FORM_PERMISSION,
|
|
60297
|
+
);
|
|
60298
|
+
} catch (e) {
|
|
60299
|
+
console.error("Error reloading form:", e);
|
|
60300
|
+
if (typeof sendEventCallback === 'function') {
|
|
60301
|
+
sendEventCallback({
|
|
60302
|
+
type: "ERROR",
|
|
60303
|
+
errorMessage: "ErrorCode : 005, Formio not rendered the forms",
|
|
60304
|
+
data: { reason: "Failed to reload form", technicalError: e }
|
|
60305
|
+
});
|
|
60306
|
+
}
|
|
60307
|
+
}
|
|
59932
60308
|
} else {
|
|
59933
60309
|
console.error('renderRNform is not defined');
|
|
59934
60310
|
}
|
|
@@ -60013,7 +60389,7 @@ window.CommentOnBack = CommentOnBack;
|
|
|
60013
60389
|
|
|
60014
60390
|
<div id="sticky-footer">
|
|
60015
60391
|
<div class="relative-position">
|
|
60016
|
-
<button id="
|
|
60392
|
+
<button id="unvired-more-btn" class="ui button primary dataGrid-addRow" onclick="toggleTooltip()">
|
|
60017
60393
|
<i class="icon options"></i>
|
|
60018
60394
|
More
|
|
60019
60395
|
</button>
|
|
@@ -60162,7 +60538,7 @@ window.CommentOnBack = CommentOnBack;
|
|
|
60162
60538
|
};
|
|
60163
60539
|
|
|
60164
60540
|
document.addEventListener('click', function (event) {
|
|
60165
|
-
const moreBtn = document.getElementById('
|
|
60541
|
+
const moreBtn = document.getElementById('unvired-more-btn');
|
|
60166
60542
|
const tooltip = document.getElementById('moreTooltip');
|
|
60167
60543
|
if (!moreBtn.contains(event.target) && !tooltip.contains(event.target)) {
|
|
60168
60544
|
tooltip.style.display = 'none';
|