@unvired/turboforms-embed-sdk 1.0.23 → 1.0.29
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/dist/unvired-form-sdk.html +4 -9
- package/dist/unvired-forms-sdk.js +67 -23
- package/package.json +1 -1
|
@@ -58970,16 +58970,13 @@ function showDynamicModal(
|
|
|
58970
58970
|
.custom-modal.show, .custom-modal-backdrop.show {
|
|
58971
58971
|
display: flex;
|
|
58972
58972
|
}
|
|
58973
|
-
/*
|
|
58973
|
+
/* Flexbox on the parent handles centering */
|
|
58974
58974
|
.custom-modal-dialog {
|
|
58975
58975
|
width: 100%;
|
|
58976
58976
|
max-width: 500px;
|
|
58977
|
-
margin:
|
|
58977
|
+
margin: auto;
|
|
58978
58978
|
box-sizing: border-box;
|
|
58979
58979
|
position: relative;
|
|
58980
|
-
top: 50%;
|
|
58981
|
-
left: 50%;
|
|
58982
|
-
transform: translate(-50%, -50%);
|
|
58983
58980
|
}
|
|
58984
58981
|
.custom-modal-content {
|
|
58985
58982
|
background: #fff;
|
|
@@ -59031,9 +59028,7 @@ function showDynamicModal(
|
|
|
59031
59028
|
@media (max-width: 600px) {
|
|
59032
59029
|
.custom-modal-dialog {
|
|
59033
59030
|
max-width: 95vw;
|
|
59034
|
-
|
|
59035
|
-
top: 40%;
|
|
59036
|
-
transform: translate(-50%, -40%);
|
|
59031
|
+
margin: 1rem auto;
|
|
59037
59032
|
}
|
|
59038
59033
|
.custom-modal-content {
|
|
59039
59034
|
border-radius: 0.15rem;
|
|
@@ -60715,7 +60710,7 @@ window.CommentOnBack = CommentOnBack;
|
|
|
60715
60710
|
|
|
60716
60711
|
|
|
60717
60712
|
<div id="sticky-footer">
|
|
60718
|
-
<div class="build-version">SDK v1.0.
|
|
60713
|
+
<div class="build-version">SDK v1.0.29</div>
|
|
60719
60714
|
<div class="relative-position">
|
|
60720
60715
|
<button id="unvired-more-btn" class="ui button primary dataGrid-addRow" onclick="toggleTooltip()">
|
|
60721
60716
|
<i class="icon options"></i>
|
|
@@ -43,11 +43,18 @@ function attachMasterDataToForm(obj, masterdataResults, key = "dataSrc", type =
|
|
|
43
43
|
attachMasterDataToForm(obj[k], masterdataResults, key, type, true);
|
|
44
44
|
} else if (k === key && obj[k] === type) {
|
|
45
45
|
if (Array.isArray(masterdataResults)) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
let matchedData = [];
|
|
47
|
+
if (obj.selMasterdataId) {
|
|
48
|
+
const match = masterdataResults.find((md) => md.masterdataId === obj.selMasterdataId);
|
|
49
|
+
if (match && match.submissionData) {
|
|
50
|
+
matchedData = match.submissionData;
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
matchedData = masterdataResults.flatMap((md) => md.submissionData || []);
|
|
54
|
+
}
|
|
55
|
+
obj.masterdata = matchedData.map((item) => item && item.data !== void 0 ? item : { data: item });
|
|
49
56
|
} else if (masterdataResults && Array.isArray(masterdataResults.submissionData)) {
|
|
50
|
-
obj.masterdata = masterdataResults.submissionData;
|
|
57
|
+
obj.masterdata = masterdataResults.submissionData.map((item) => item && item.data !== void 0 ? item : { data: item });
|
|
51
58
|
} else {
|
|
52
59
|
obj.masterdata = [];
|
|
53
60
|
}
|
|
@@ -939,6 +946,8 @@ async function loadUnviredForms({
|
|
|
939
946
|
const template = formJson;
|
|
940
947
|
const nestedFormArrTemp = options.nestedFormData || [];
|
|
941
948
|
const masterDataArrTemp = options.masterData || [];
|
|
949
|
+
console.log("[SDK:3] Debug - options.masterData received:", options.masterData);
|
|
950
|
+
console.log("[SDK:3] Debug - masterDataArrTemp evaluated to:", masterDataArrTemp);
|
|
942
951
|
const nestedFormError = validateNestedForms(formJson, nestedFormArrTemp);
|
|
943
952
|
if (nestedFormError) {
|
|
944
953
|
console.error("[SDK] \u274C Step 3: Nested form validation failed", nestedFormError);
|
|
@@ -27823,6 +27832,7 @@ select.ui.dropdown {
|
|
|
27823
27832
|
height: 100%;
|
|
27824
27833
|
background: rgba(255, 255, 255, 0.95);
|
|
27825
27834
|
backdrop-filter: blur(10px);
|
|
27835
|
+
-webkit-backdrop-filter: blur(10px);
|
|
27826
27836
|
display: flex;
|
|
27827
27837
|
flex-direction: column;
|
|
27828
27838
|
justify-content: center;
|
|
@@ -27842,15 +27852,23 @@ select.ui.dropdown {
|
|
|
27842
27852
|
border: 4px solid #e0e0e0;
|
|
27843
27853
|
border-top: 4px solid #0077b6;
|
|
27844
27854
|
border-radius: 50%;
|
|
27855
|
+
-webkit-animation: sdk-spin 1s linear infinite;
|
|
27845
27856
|
animation: sdk-spin 1s linear infinite;
|
|
27846
27857
|
margin-bottom: 20px;
|
|
27858
|
+
-webkit-transform: translateZ(0);
|
|
27859
|
+
transform: translateZ(0);
|
|
27860
|
+
will-change: transform;
|
|
27847
27861
|
}
|
|
27848
27862
|
.sdk-loader-text {
|
|
27849
27863
|
color: #0077b6;
|
|
27850
27864
|
font-size: 1.1rem;
|
|
27851
27865
|
font-weight: 500;
|
|
27852
27866
|
letter-spacing: 0.5px;
|
|
27867
|
+
-webkit-animation: sdk-pulse 1.5s ease-in-out infinite;
|
|
27853
27868
|
animation: sdk-pulse 1.5s ease-in-out infinite;
|
|
27869
|
+
-webkit-transform: translateZ(0);
|
|
27870
|
+
transform: translateZ(0);
|
|
27871
|
+
will-change: opacity;
|
|
27854
27872
|
}
|
|
27855
27873
|
.sdk-loader-subtext {
|
|
27856
27874
|
color: #666;
|
|
@@ -27858,10 +27876,18 @@ select.ui.dropdown {
|
|
|
27858
27876
|
margin-top: 8px;
|
|
27859
27877
|
opacity: 0.7;
|
|
27860
27878
|
}
|
|
27879
|
+
@-webkit-keyframes sdk-spin {
|
|
27880
|
+
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
|
|
27881
|
+
100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
|
|
27882
|
+
}
|
|
27861
27883
|
@keyframes sdk-spin {
|
|
27862
27884
|
0% { transform: rotate(0deg); }
|
|
27863
27885
|
100% { transform: rotate(360deg); }
|
|
27864
27886
|
}
|
|
27887
|
+
@-webkit-keyframes sdk-pulse {
|
|
27888
|
+
0%, 100% { opacity: 1; }
|
|
27889
|
+
50% { opacity: 0.5; }
|
|
27890
|
+
}
|
|
27865
27891
|
@keyframes sdk-pulse {
|
|
27866
27892
|
0%, 100% { opacity: 1; }
|
|
27867
27893
|
50% { opacity: 0.5; }
|
|
@@ -27922,7 +27948,7 @@ select.ui.dropdown {
|
|
|
27922
27948
|
<div id="formio-cmt" style="margin-bottom: 20px;"></div>
|
|
27923
27949
|
</div>
|
|
27924
27950
|
<div id="sticky-footer">
|
|
27925
|
-
<div class="build-version">SDK v1.0.
|
|
27951
|
+
<div class="build-version">SDK v1.0.29</div>
|
|
27926
27952
|
<button class="ui button primary dataGrid-addRow" id="saveBtn" disabled="true" onclick="FormOnSave()">
|
|
27927
27953
|
<i class="icon save large"></i>Save
|
|
27928
27954
|
</button>
|
|
@@ -66224,16 +66250,13 @@ function showDynamicModal(
|
|
|
66224
66250
|
.custom-modal.show, .custom-modal-backdrop.show {
|
|
66225
66251
|
display: flex;
|
|
66226
66252
|
}
|
|
66227
|
-
/*
|
|
66253
|
+
/* Flexbox on the parent handles centering */
|
|
66228
66254
|
.custom-modal-dialog {
|
|
66229
66255
|
width: 100%;
|
|
66230
66256
|
max-width: 500px;
|
|
66231
|
-
margin:
|
|
66257
|
+
margin: auto;
|
|
66232
66258
|
box-sizing: border-box;
|
|
66233
66259
|
position: relative;
|
|
66234
|
-
top: 50%;
|
|
66235
|
-
left: 50%;
|
|
66236
|
-
transform: translate(-50%, -50%);
|
|
66237
66260
|
}
|
|
66238
66261
|
.custom-modal-content {
|
|
66239
66262
|
background: #fff;
|
|
@@ -66285,9 +66308,7 @@ function showDynamicModal(
|
|
|
66285
66308
|
@media (max-width: 600px) {
|
|
66286
66309
|
.custom-modal-dialog {
|
|
66287
66310
|
max-width: 95vw;
|
|
66288
|
-
|
|
66289
|
-
top: 40%;
|
|
66290
|
-
transform: translate(-50%, -40%);
|
|
66311
|
+
margin: 1rem auto;
|
|
66291
66312
|
}
|
|
66292
66313
|
.custom-modal-content {
|
|
66293
66314
|
border-radius: 0.15rem;
|
|
@@ -67275,6 +67296,11 @@ function buildMandatoryFieldsCache() {
|
|
|
67275
67296
|
cacheMandatoryFields(comp.components, fieldPath);
|
|
67276
67297
|
}
|
|
67277
67298
|
|
|
67299
|
+
// Nested forms
|
|
67300
|
+
if (comp.type === 'form' && comp.subForm && Array.isArray(comp.subForm.components)) {
|
|
67301
|
+
cacheMandatoryFields(comp.subForm.components, fieldPath ? \`\${fieldPath}.data\` : 'data');
|
|
67302
|
+
}
|
|
67303
|
+
|
|
67278
67304
|
// Columns component handles children differently in instances?
|
|
67279
67305
|
// Usually comp.columns is an array of objects which contain .components (instances)
|
|
67280
67306
|
if (Array.isArray(comp.columns)) {
|
|
@@ -67704,6 +67730,12 @@ function FormOnSave() {
|
|
|
67704
67730
|
}
|
|
67705
67731
|
|
|
67706
67732
|
function FormOnBack() {
|
|
67733
|
+
// Do not ask for confirmation in read-only mode
|
|
67734
|
+
if (formObj && formObj.options && formObj.options.readOnly) {
|
|
67735
|
+
FormOnBackNavigation();
|
|
67736
|
+
return;
|
|
67737
|
+
}
|
|
67738
|
+
|
|
67707
67739
|
let currentData;
|
|
67708
67740
|
try {
|
|
67709
67741
|
currentData = formObj ? formObj.getValue().data : null;
|
|
@@ -67711,10 +67743,10 @@ function FormOnBack() {
|
|
|
67711
67743
|
currentData = null;
|
|
67712
67744
|
}
|
|
67713
67745
|
|
|
67714
|
-
const
|
|
67746
|
+
const noChanges =
|
|
67715
67747
|
JSON.stringify(currentData) === JSON.stringify(initialFormData);
|
|
67716
67748
|
|
|
67717
|
-
if (
|
|
67749
|
+
if (noChanges) {
|
|
67718
67750
|
FormOnBackNavigation();
|
|
67719
67751
|
} else {
|
|
67720
67752
|
showDynamicModal(
|
|
@@ -68257,19 +68289,28 @@ window.CommentOnBack = CommentOnBack;
|
|
|
68257
68289
|
window.__unviredSdkScriptsLoading = false;
|
|
68258
68290
|
throw error;
|
|
68259
68291
|
}
|
|
68260
|
-
|
|
68261
|
-
|
|
68262
|
-
|
|
68263
|
-
|
|
68264
|
-
|
|
68265
|
-
|
|
68292
|
+
if (options.showComments) {
|
|
68293
|
+
for (let i = 1; i <= 2; i++) {
|
|
68294
|
+
if (scriptContents[i] && scriptContents[i].trim()) {
|
|
68295
|
+
const scriptElement = document.createElement("script");
|
|
68296
|
+
scriptElement.textContent = scriptContents[i];
|
|
68297
|
+
scriptElement.setAttribute("data-unvired-script", `recogito-${i}`);
|
|
68298
|
+
document.head.appendChild(scriptElement);
|
|
68299
|
+
await new Promise((r) => setTimeout(r, 0));
|
|
68300
|
+
}
|
|
68266
68301
|
}
|
|
68302
|
+
} else {
|
|
68303
|
+
console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");
|
|
68267
68304
|
}
|
|
68268
|
-
|
|
68305
|
+
const hasThemeOverrides = options.themeData && Object.keys(options.themeData).length > 0;
|
|
68306
|
+
if (hasThemeOverrides && scriptContents[3] && scriptContents[3].trim()) {
|
|
68269
68307
|
const lessScript = document.createElement("script");
|
|
68270
68308
|
lessScript.textContent = scriptContents[3];
|
|
68271
68309
|
lessScript.setAttribute("data-unvired-script", "less");
|
|
68272
68310
|
document.head.appendChild(lessScript);
|
|
68311
|
+
} else {
|
|
68312
|
+
console.log("[SDK:10.4] \u26A1 Skipping LESS.js (no theme overrides, optimized load)");
|
|
68313
|
+
window.less = window.less || { modifyVars: () => Promise.resolve() };
|
|
68273
68314
|
}
|
|
68274
68315
|
window.form = window.form || {};
|
|
68275
68316
|
window.platform = window.platform || {};
|
|
@@ -68292,6 +68333,9 @@ window.CommentOnBack = CommentOnBack;
|
|
|
68292
68333
|
scriptElement.textContent = scriptContent;
|
|
68293
68334
|
scriptElement.setAttribute("data-unvired-script", `script-${i}`);
|
|
68294
68335
|
document.head.appendChild(scriptElement);
|
|
68336
|
+
if (i % 5 === 0) {
|
|
68337
|
+
await new Promise((r) => setTimeout(r, 0));
|
|
68338
|
+
}
|
|
68295
68339
|
}
|
|
68296
68340
|
}
|
|
68297
68341
|
window.__unviredSdkScriptsLoaded = true;
|
|
@@ -68517,7 +68561,7 @@ window.deleteAppDocument = async function(id) {
|
|
|
68517
68561
|
window.getAllDocuments = getAllDocuments;
|
|
68518
68562
|
window.hasDocuments = hasDocuments;
|
|
68519
68563
|
function getBuildVersion() {
|
|
68520
|
-
return "1.0.
|
|
68564
|
+
return "1.0.29";
|
|
68521
68565
|
}
|
|
68522
68566
|
export {
|
|
68523
68567
|
getBuildVersion,
|
package/package.json
CHANGED