template.js.base.grid.common.min.js Maven / Gradle / Ivy
'use strict';(function(b,t){"function"===typeof define&&define.amd?define(["jquery","./grid.base","./jqdnr","./jqmodal"],function(n){return t(n,b.document)}):"object"===typeof module&&module.exports?module.exports=function(b,w){b||(b=window);void 0===w&&(w="undefined"!==typeof window?require("jquery"):require("jquery")(b));require("./grid.base");require("./jqdnr");require("./jqmodal");t(w,b.document);return w}:t(jQuery,b.document)})("undefined"!==typeof window?window:this,function(b,t){var n=b.jgrid,
w=b.fn.jqGrid,v=w.getGuiStyles,y=w.getGridRes;n.jqModal=n.jqModal||{};b.extend(!0,n.jqModal,{toTop:!0});b.extend(n,{showModal:function(b){b.w.show()},closeModal:function(b){b.w.hide().attr("aria-hidden","true");b.o&&b.o.remove()},hideModal:function(d,a){a=b.extend({jqm:!0,gb:"",removemodal:!1},a||{});var c=a.gb&&"string"===typeof a.gb&&"#gbox_"===a.gb.substr(0,6)?b("#"+a.gb.substr(6))[0]:!1,k=b(d);if(a.onClose&&(d=c?a.onClose.call(c,d):a.onClose(d),"boolean"===typeof d&&!d))return;if(b.fn.jqm&&!0===
a.jqm)k.attr("aria-hidden","true").jqmHide();else{if(""!==a.gb)try{b("\x3e.jqgrid-overlay",a.gb).first().hide()}catch(l){}k.hide().attr("aria-hidden","true")}a.removemodal&&k.remove()},createModal:function(d,a,c,k,l,f,e){var g=n.jqID,h=this.p;c=b.extend(!0,{resizingRightBottomIcon:w.getIconRes.call(this,"form.resizableLtr")},n.jqModal||{},null!=h?h.jqModal||{}:{},c);var h=t.createElement("div"),m="#"+g(d.themodal),q="rtl"===b(c.gbox).attr("dir")?!0:!1,r=d.resizeAlso?"#"+g(d.resizeAlso):!1;e=b.extend({},
e||{});h.className=v.call(this,"dialog.window","ui-jqdialog");h.id=d.themodal;h.dir=q?"rtl":"ltr";var p=t.createElement("div");p.className=v.call(this,"dialog.document");b(p).attr("role","document");var u=t.createElement("div");u.className=v.call(this,"dialog.subdocument");p.appendChild(u);h.appendChild(p);p=t.createElement("div");p.className=v.call(this,"dialog.header","ui-jqdialog-titlebar "+(q?"ui-jqdialog-titlebar-rtl":"ui-jqdialog-titlebar-ltr"));p.id=d.modalhead;b(p).append("\x3cspan class\x3d'ui-jqdialog-title'\x3e"+
c.caption+"\x3c/span\x3e");var x=v.call(this,"states.hover"),z=b("\x3ca aria-label\x3d'Close' class\x3d'"+v.call(this,"dialog.closeButton","ui-jqdialog-titlebar-close")+"'\x3e\x3c/a\x3e").hover(function(){z.addClass(x)},function(){z.removeClass(x)}).append("\x3cspan class\x3d'"+w.getIconRes.call(this,"form.close")+"'\x3e\x3c/span\x3e");b(p).append(z);q=t.createElement("div");b(q).addClass(v.call(this,"dialog.content","ui-jqdialog-content")).attr("id",d.modalcontent);b(q).append(a);u.appendChild(q);
b(u).prepend(p);!0===f?b("body").append(h):"string"===typeof f?b(f).append(h):b(h).insertBefore(k);b(h).css(e);void 0===c.jqModal&&(c.jqModal=!0);a={};if(b.fn.jqm&&!0===c.jqModal)0===c.left&&0===c.top&&c.overlay&&(c=b(l).offset(),c.left+=4,c.top+=4),a.top=c.top+"px",a.left=c.left;else if(0!==c.left||0!==c.top)a.left=c.left,a.top=c.top+"px";b("a.ui-jqdialog-titlebar-close",p).click(function(){var a=b(m).data("onClose")||c.onClose,d=b(m).data("gbox")||c.gbox;n.hideModal(m,{gb:d,jqm:c.jqModal,onClose:a,
removemodal:c.removemodal||!1});return!1});0!==c.width&&c.width||(c.width=300);0!==c.height&&c.height||(c.height=200);c.zIndex||((k=b(k).parents("*[role\x3ddialog]").first().css("z-index"))?(c.zIndex=parseInt(k,10)+2,c.toTop=!0):c.zIndex=950);a.left&&(a.left+="px");b(h).css(b.extend({width:isNaN(c.width)?"auto":c.width+"px",height:isNaN(c.height)?"auto":c.height+"px",zIndex:c.zIndex},a)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":d.modalhead,"aria-hidden":"true"});void 0===c.drag&&(c.drag=
!0);void 0===c.resize&&(c.resize=!0);if(c.drag)if(b.fn.jqDrag)b(p).css("cursor","move"),b(h).jqDrag(p);else try{b(h).draggable({handle:b("#"+g(p.id))})}catch(A){}if(c.resize)if(b.fn.jqResize)b(q).append("\x3cdiv class\x3d'jqResize ui-resizable-handle ui-resizable-se "+c.resizingRightBottomIcon+"'\x3e\x3c/div\x3e"),b(m).jqResize(".jqResize",r);else try{b(h).resizable({handles:"se, sw",alsoResize:r})}catch(A){}!0===c.closeOnEscape&&b(h).keydown(function(a){27===a.which&&(a=b(m).data("onClose")||c.onClose,
n.hideModal(m,{gb:c.gbox,jqm:c.jqModal,onClose:a,removemodal:c.removemodal||!1,formprop:!c.recreateForm||!1,form:c.form||""}))})},viewModal:function(d,a){a=b.extend(!0,{overlay:30,modal:!1,overlayClass:v.call(this,"overlay"),onShow:n.showModal,onHide:n.closeModal,gbox:"",jqm:!0,jqM:!0},n.jqModal||{},a||{});if(b.fn.jqm&&!0===a.jqm)a.jqM?b(d).attr("aria-hidden","false").jqm(a).jqmShow():b(d).attr("aria-hidden","false").jqmShow();else{""!==a.gbox&&(b("\x3e.jqgrid-overlay",a.gbox).first().show(),b(d).data("gbox",
a.gbox));b(d).show().attr("aria-hidden","false");try{b(":input:visible",d)[0].focus()}catch(c){}}},info_dialog:function(d,a,c,k){var l=this,f=l.p,e=b.extend(!0,{width:290,height:"auto",dataheight:"auto",drag:!0,resize:!1,left:250,top:170,zIndex:1E3,jqModal:!0,modal:!1,closeOnEscape:!0,align:"center",buttonalign:"center",buttons:[]},n.jqModal||{},null!=f?f.jqModal||{}:{},{caption:"\x3cb\x3e"+d+"\x3c/b\x3e"},k||{}),g=e.jqModal;b.fn.jqm&&!g&&(g=!1);d="";var h=v.call(l,"states.hover");if(0l.search(/(false|f|0|no|n|off|undefined)/i)&&""!==l?(e.checked=!0,e.defaultChecked=!0,e.value=
c):e.value="on",b(e).data("offval","off"));f(e,a,["value"]);b(e).attr({role:"checkbox","aria-checked":e.checked?"true":"false"});break;case "select":e=t.createElement("select");k=[];d=null;!0===a.multiple||"multiple"===a.multiple?(m=!0,e.multiple="multiple",b(e).attr("aria-multiselectable","true"),k=c.split(","),k=b.map(k,function(a){return b.trim(a)})):(m=!1,k[0]=b.trim(c));void 0===a.size&&(a.size=m?3:1);try{d=a.rowId}catch(x){}h&&h.idPrefix&&(d=n.stripPref(h.idPrefix,d));void 0===a.dataUrl&&a.generateValue&&
null!=h.indexByColumnData[a.cm.name]&&(a.value=g.generateValueFromColumnIndex(a.cm.name,a.separator,a.delimiter));void 0!==a.dataUrl?(h=a.postData||l.postData,k={elem:e,options:a,cm:a.cm,mode:a.mode,rowid:d,iCol:a.iCol,ovm:k},f(e,a,h?["postData"]:void 0),b.ajax(b.extend({url:b.isFunction(a.dataUrl)?a.dataUrl.call(g,d,c,String(a.name),k):a.dataUrl,type:"GET",dataType:"html",data:b.isFunction(h)?h.call(g,d,c,String(a.name)):h,context:k,success:function(a,d,c){var e=this.ovm,k=this.elem,f=this.cm,h=
this.iCol,l=b.extend({},this.options),m=this.rowid,p=this.mode;a=b.isFunction(l.buildSelect)?l.buildSelect.call(g,a,c,f,h):a;"string"===typeof a&&(a=b(b.trim(a)).html());a&&(b(k).append(a),setTimeout(function(){var a;b("option",k).each(function(d){0===d&&k.multiple&&(this.selected=!1);-1h.length||1>c[b[e]]||12h.length||1>c[b[d]]||31(0!==
l%4||0===l%100&&0!==l%400?28:29));return a||c[b[d]]>g[c[b[e]]]?!1:!0},isEmpty:function(b){return b.match(/^\s+$/)||""===b?!0:!1},checkTime:function(b){var a=/^(\d{1,2}):(\d{2})([apAP][Mm])?$/;if(!n.isEmpty(b))if(b=b.match(a)){if(b[3]){if(1>b[1]||12a)return[!0,"",""];c=g[a];f=c.editrules;null!=c.formoptions&&(e=c.formoptions.label)}else f=c,e=void 0===k?"_":k,c=g[a];if(f){e||(e=null!=m.colNames?m.colNames[a]:c.label);if(!0===p("required")&&q(d))return[!1,e+": "+r.required,""];m=!1===p("required")?!1:!0;if(!0===p("number")&&(!1!==m||!q(d))&&isNaN(d))return[!1,e+": "+r.number,""];if(void 0!==f.minValue&&!isNaN(f.minValue)&&parseFloat(d)<
parseFloat(f.minValue))return[!1,e+": "+r.minValue+" "+f.minValue,""];if(void 0!==f.maxValue&&!isNaN(f.maxValue)&&parseFloat(d)>parseFloat(f.maxValue))return[!1,e+": "+r.maxValue+" "+f.maxValue,""];if(!(!0!==p("email")||!1===m&&q(d)||(k=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
k.test(d))))return[!1,e+": "+r.email,""];if(!(!0!==p("integer")||!1===m&&q(d)||!isNaN(d)&&0===d%1&&-1===d.indexOf(".")))return[!1,e+": "+r.integer,""];if(!(!0!==p("date")||!1===m&&q(d)||(c.formatoptions&&c.formatoptions.newformat?(g=c.formatoptions.newformat,t.hasOwnProperty(g)&&(g=t[g])):g=g[a].datefmt||"Y-m-d",n.checkDate(g,d))))return[!1,e+": "+r.date+" - "+g,""];if(!0===p("time")&&!(!1===m&&q(d)||n.checkTime(d)))return[!1,e+": "+r.date+" - hh:mm (am/pm)",""];if(!(!0!==p("url")||!1===m&&q(d)||
(k=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@`~=%!]*)(\.\w{2,})?)*\/?)/i,k.test(d))))return[!1,e+": "+r.url,""];if(!0===f.custom){if(!1!==m||!q(d))return b.isFunction(f.custom_func)?(d=f.custom_func.call(h,d,e,a),b.isArray(d)?d:[!1,r.customarray,""]):[!1,r.customfcheck,""]}else if(b.isFunction(f.custom)&&(!1!==m||!q(d)))return d=f.custom.call(h,l),b.isArray(d)?d:[!1,r.customarray,""]}return[!0,"",""]}})});
//# sourceMappingURL=grid.common.min.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy