| 1 |
var moveToFirstErrFld=function(){"use strict";return function(t,n=[]){const e=t?.layout||{},r=t?.nestedLayout||{},o=Array.isArray(e)&&e.length>1,i=Array.isArray(e)?e:[{layout:e}];let s=-1;const c=i.reduce(((t,e,o)=>{const i=e.layout.lg.reduce(((t,n)=>{const e=n.i;if(e in r){const n=r[e].lg.map((t=>t.i));return[...t,e,...n]}return[...t,e]}),[]),c=i.find((t=>n.includes(t)));return-1===s&&c&&(s=o),[...t,...i]}),[]);o&&s>-1&&t.inits.multi_step_form.step!==s+1&&(t.inits.multi_step_form.step=s+1),t.inits?.conversational_form&&(t.inits.conversational_form.activeFieldStep=n[0]),c.some((e=>n.some((n=>{const[r,o]=getFldKeyAndRowIndx(n);if(e===r){const n=o?`.rpt-index-${o}`:"",r=bfSelect(`#form-${t.contentId} ${n} .btcd-fld-itm.${e}`);return scrollToElm(r),setTimeout((()=>{const r=bfSelect(`#form-${t.contentId} ${n} .${e}-fld, #form-${t.contentId} ${n} .${e}-cc input, #form-${t.contentId} ${n} .${e}-dpd-wrp`);r&&r.focus({preventScroll:!0})}),450),!0}return!1}))))}}(); |