@ntlab/ntjs-assets 2.0.24 → 2.0.25
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/assets/js/cdn.json +1 -1
- package/assets/js/jqGrid/js/grid.aria.js +22 -20
- package/assets/js/jqGrid/js/grid.base.js +61 -13
- package/assets/js/jqGrid/js/grid.grouping.js +16 -9
- package/assets/js/jqGrid/js/jquery.jqGrid.js +100 -43
- package/assets/js/jqGrid/js/jquery.jqGrid.min.js +2 -2
- package/assets/js/jqGrid/js/jquery.jqGrid.min.js.map +1 -1
- package/assets/js/jqGrid/js/minified/grid.aria.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.base.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.grouping.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./grid.base"],e):e(jQuery)}(function(v){"use strict";v.extend(v.jgrid,{focusableElementsList:[">a[href]",">button:not([disabled])",">area[href]",">input:not([disabled])",">select:not([disabled])",">textarea:not([disabled])",">iframe",">object",">embed",">*[tabindex]",">*[contenteditable]"]}),v.jgrid.extend({ariaBodyGrid:function(e){var f=v.extend({onEnterCell:null,onKeyCheck:null,customCellAction:null},e||{});return this.each(function(){var a=this,t=v.jgrid.getMethod("getStyleUI"),l=t(a.p.styleUI+".common","highlight",!0);function n(e,i){return!isNaN(e)&&!isNaN(i)&&0<=e&&0<=i&&a.rows.length&&e<a.rows.length&&i<a.p.colModel.length}function r(e,i){var t,i=a.p.iRow+i,r=a.p.iCol+e,o=a.rows.length,e=0!==e;return!!o&&(t=a.p.colModel.length,e&&(r<0&&2<=i&&(r=t-1,i--),t<=r)&&(r=0,i++),e||(i<1?(r--,a.rows[i=o-1]&&0<=r&&!a.rows[i].cells[r]&&i--):(o<=i||!a.rows[i].cells[r])&&(i=1,r++)),n(i,r)?{row:i,col:r}:!!n(a.p.iRow,a.p.iCol)&&{row:a.p.iRow,col:a.p.iCol})}function o(e,i){var t=r(e,i);if(!t)return!1;for(;v(a.rows[t.row].cells[t.col]).is(":hidden");)if(a.p.iRow=t.row,a.p.iCol=t.col,t=r(e,i),a.p.iRow===t.row&&a.p.iCol===t.col)return!1;return 0!==i&&v(a).jqGrid("setSelection",a.rows[t.row].id,!1,null,!1),t}function s(e){var i=a.p.page,t=a.p.lastpage;a.p.page!==(i=t<(i=(i+=e)<=0?1:i)?t:i)&&(a.p.page=i,a.grid.populate())}var i=v.jgrid.focusableElementsList.join(),d=(v(a).removeAttr("tabindex"),v(a).on("jqGridAfterGridComplete.setAriaGrid",function(e){v("tbody",a).first().find(">tr:not(.jqgfirstrow)>td:not(:hidden, :has("+i+"))").attr("tabindex",-1),v("tbody",a).first().find(">tr:not(.jqgfirstrow)").removeAttr("tabindex"),void 0!==a.p.iRow&&void 0!==a.p.iCol&&a.rows[a.p.iRow]&&v(a.rows[a.p.iRow].cells[a.p.iCol]).attr("tabindex",0).focus(function(){v(this).addClass(l)}).blur(function(){v(this).removeClass(l)})}),a.p.iRow=1,a.p.iCol=v.jgrid.getFirstVisibleCol(a),0),c=0,p=!!v.jgrid.isFunction(f.customCellAction)&&f.customCellAction,u=!!v.jgrid.isFunction(f.onKeyCheck)&&f.onKeyCheck;v(a).on("keydown",function(e){if((!a.p.navigationDisabled||!0!==a.p.navigationDisabled)&&!e.target.id.startsWith("jqs_"+a.p.id)&&(!u||u.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e))){var i;switch(e.which||e.keyCode){case 38:i=o(0,-1),d=i.row,c=i.col,e.preventDefault();break;case 40:i=o(0,1),d=i.row,c=i.col,e.preventDefault();break;case 37:i=o(-1,0),d=i.row,c=i.col,e.preventDefault();break;case 39:i=o(1,0),d=i.row,c=i.col,e.preventDefault();break;case 36:d=e.ctrlKey?1:a.p.iRow,c=0,e.preventDefault();break;case 35:d=e.ctrlKey?a.rows.length-1:a.p.iRow,c=a.p.colModel.length-1,e.preventDefault();break;case 33:s(-1),c=a.p.iCol,d=a.p.iRow,e.preventDefault();break;case 34:s(1),c=a.p.iCol,(d=a.p.iRow)>a.rows.length-1&&(d=a.rows.length-1,a.p.iRow=a.rows.length-1),e.preventDefault();break;case 13:return void(v.jgrid.isFunction(f.onEnterCell)&&(f.onEnterCell.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e),e.preventDefault()));case 113:try{v(a).jqGrid("editCell",a.p.iRow,a.p.iCol,!0,e)}catch(e){}break;default:return void(p&&p.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e))}setTimeout(function(){v(a).jqGrid("focusBodyCell",d,c,t,l)},50)}}),v(a).on("jqGridBeforeSelectRow.ariaGridClick",function(){return!1}),v(a).on("jqGridCellSelect.ariaGridClick",function(e,i,t,r,o){var n,o=o.target;0<a.p.iRow&&0<=a.p.iCol&&v(a.rows[a.p.iRow].cells[a.p.iCol]).attr("tabindex",-1),(v(o).is("td")||v(o).is("th")||o.id.startsWith("jqs_"+a.p.id))&&(a.p.iCol=o.cellIndex,n=v(o).closest("tr.jqgrow"),a.p.iRow=n[0].rowIndex,v(o).attr("tabindex",0).addClass(l).focus().blur(function(){v(this).removeClass(l)}))}),a.p.ariaBody=!0})},excelLikeGrid:function(e){var b=v.extend({beforeDeleteCell:null,customCellAction:null,customUndoFunction:null,specialChars:["~","!","@","#","$","%","^","&","*","(",")","_","+","{","}",":",'"',"|","<",">","?",",",".","/",";","\\","[","]"],addonChars:!1,onKeyCheck:null},e||{});return this.each(function(){var a=this,l=v.jgrid.getMethod("getStyleUI"),s=l(a.p.styleUI+".common","highlight",!0);function n(e,i){return!isNaN(e)&&!isNaN(i)&&0<=e&&0<=i&&a.rows.length&&e<a.rows.length&&i<a.p.colModel.length}function r(e,i){var i=a.p.iRow+i,t=a.p.iCol+e,r=a.rows.length,e=0!==e,o=a.p.frozenColumns?a.p.frozenColCount+1:0;return!!r&&(r=a.p.colModel.length,e&&(t=t<o?o:t)===r&&(t=r),e||a.rows[i]&&0<=t&&!a.rows[i].cells[t]&&i--,n(i,t)?{row:i,col:t}:!!n(a.p.iRow,a.p.iCol)&&{row:a.p.iRow,col:a.p.iCol})}function d(e,i){var t=r(e,i);if(!t)return!1;for(;v(a.rows[t.row].cells[t.col]).is(":hidden");)if(a.p.iRow=t.row,a.p.iCol=t.col,t=r(e,i),a.p.iRow===t.row&&a.p.iCol===t.col)return!1;return 0!==i&&v(a).jqGrid("setSelection",a.rows[t.row].id,!1,null,!1),t}function c(e){var i=a.p.page,t=a.p.lastpage;a.p.page!==(i=t<(i=(i+=e)<=0?1:i)?t:i)&&(a.p.page=i,a.grid.populate())}a.p.F2key=!1;var i=v.jgrid.focusableElementsList.join(),p=(v(a).removeAttr("tabindex"),v(a).on("jqGridAfterGridComplete.setAriaGrid",function(e){v("tbody",a).first().find(">tr:not(.jqgfirstrow)>td:not(:hidden, :has("+i+"))").attr("tabindex",-1),v("tbody",a).first().find(">tr:not(.jqgfirstrow)").removeAttr("tabindex"),void 0!==a.p.iRow&&void 0!==a.p.iCol&&a.rows[a.p.iRow]&&v(a.rows[a.p.iRow].cells[a.p.iCol]).attr("tabindex",0).focus(function(){v(this).addClass(s)}).blur(function(){v(this).removeClass(s)})}),a.p.iRow=1,a.p.iCol=v.jgrid.getFirstVisibleCol(a),a.p.ariaBody=!0,0),u=0,f=!!v.jgrid.isFunction(b.customCellAction)&&b.customCellAction,h=!!v.jgrid.isFunction(b.beforeDeleteCell)&&b.beforeDeleteCell,w=new Set(b.specialChars),g=!1,C=(a.addEventListener("paste",function(e){g&&(e=(e.clipboardData||window.clipboardData).getData("text"),v(a).jqGrid("saveCell",a.p.iRow,a.p.iCol,e),g=!1)}),!!v.jgrid.isFunction(b.onKeyCheck)&&b.onKeyCheck);v(a).on("keydown",function(e){if((!a.p.navigationDisabled||!0!==a.p.navigationDisabled)&&!e.target.id.startsWith("jqs_"+a.p.id)&&(!C||C.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e))){var i=e.which||e.keyCode,t=e.ctrlKey||17===i;switch(i){case 38:r=d(0,-1),p=r.row,u=r.col,e.preventDefault();break;case 40:case 13:r=d(0,1),p=r.row,u=r.col,e.preventDefault();break;case 37:r=d(-1,0),p=r.row,u=r.col,e.preventDefault();break;case 39:r=d(1,0),p=r.row,u=r.col,e.preventDefault();break;case 36:p=e.ctrlKey?1:a.p.iRow,u=a.p.frozenColumns?a.p.frozenColCount+1:0,e.preventDefault();break;case 35:p=e.ctrlKey?a.rows.length-1:a.p.iRow,u=a.p.colModel.length-1,e.preventDefault();break;case 33:c(-1),u=a.p.iCol,p=a.p.iRow,e.preventDefault();break;case 34:c(1),u=a.p.iCol,(p=a.p.iRow)>a.rows.length-1&&(p=a.rows.length-1,a.p.iRow=a.rows.length-1),e.preventDefault();break;case 9:r=e.shiftKey?d(-1,0):d(1,0),p=r.row,u=r.col,e.preventDefault();break;case 113:try{v(a).jqGrid("editCell",a.p.iRow,a.p.iCol,!0,e,!1),a.p.F2key=!0}catch(e){}break;case 8:case 46:var r=!0;!0===(r=h?h.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e):r)&&v(a).jqGrid("saveCell",a.p.iRow,a.p.iCol,"");break;case 86:if(t)return g=!0;break;case 90:if(t)return r=!0,(r=v.jgrid.isFunction(b.customUndoFunction)?b.customUndoFunction.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e):r)&&a.p.savedValues&&v(a).jqGrid("getCell",a.rows[a.p.iRow].id,a.p.colModel[a.p.iCol].name,!1)===a.p.savedValues.newvalue&&a.p.iRow===a.p.savedValues.indexRow&&v(a).jqGrid("saveCell",a.p.iRow,a.p.iCol,a.p.savedValues.oldvalue),!0;break;default:var r=/^[a-z]$/i.test(e.key),o=/^[0-9]$/i.test(e.key),n=!1;return b.addonChars&&(n=b.addonChars.test(e.key)),(r||o||w.has(e.key)||n)&&v(a).jqGrid("editCell",a.p.iRow,a.p.iCol,!0,e,!0),void(f&&f.call(a,a.rows[a.p.iRow].id,a.p.iRow,a.p.iCol,e))}setTimeout(function(){v(a).jqGrid("focusBodyCell",p,u,l,s)},50)}}),v(a).on("jqGridBeforeSelectRow.ariaGridClick",function(){return!1}),v(a).on("jqGridCellSelect.ariaGridClick",function(e,i,t,r,o){var n,o=o.target;0<a.p.iRow&&0<=a.p.iCol&&v(a.rows[a.p.iRow].cells[a.p.iCol]).attr("tabindex",-1),(v(o).is("td")||v(o).is("th")||o.id.startsWith("jqs_"+a.p.id))&&(a.p.iCol=o.cellIndex,a.p.savedRow.length&&v(a).jqGrid("saveCell",a.p.savedRow[0].id,a.p.savedRow[0].ic),n=v(o).closest("tr.jqgrow"),a.p.iRow=n[0].rowIndex,v(o).attr("tabindex",0).addClass(s).focus().blur(function(){v(this).removeClass(s)}))}).on("jqGridDblClickRow.ariaGridDblClick",function(e,i,t,r,o){v(a).jqGrid("editCell",t,r,!0,o,!1),a.p.F2key=!0})})},focusBodyCell:function(a,l,s,d){return this.each(function(){var e,i=this,t=s||v.jgrid.getMethod("getStyleUI"),r=d||t(i.p.styleUI+".common","highlight",!0),o=v.jgrid.focusableElementsList.join();function n(e){return v(o,e)[0]}void 0!==a&&void 0!==l?!isNaN(i.p.iRow)&&!isNaN(i.p.iCol)&&0<=i.p.iCol&&(e=n(i.rows[i.p.iRow].cells[i.p.iCol]),v(e||i.rows[i.p.iRow].cells[i.p.iCol]).attr("tabindex",-1)):(a=i.p.iRow,l=i.p.iCol),a=parseInt(a,10),l=parseInt(l,10),0<a&&0<=l&&(e=n(i.rows[a].cells[l]),v(e||i.rows[a].cells[l]).attr("tabindex",0).addClass(r).focus().blur(function(){v(this).removeClass(r)}),i.p.iRow=a,i.p.iCol=l)})},resetAriaBody:function(){return this.each(function(){var i=this,t=!1,e=(i.p.ariaBody=!1,v(i).attr("tabindex","0").off("keydown").off("jqGridBeforeSelectRow.ariaGridClick").off("jqGridCellSelect.ariaGridClick").off("jqGridAfterGridComplete.setAriaGrid"),v.jgrid.focusableElementsList.join());v("tbody",i).first().find(">tr:not(.jqgfirstrow)>td:not(:hidden, :has("+e+"))").removeAttr("tabindex").off("focus"),v("tbody",i).first().find(">tr:not(.jqgfirstrow)").attr("tabindex",-1);try{i.removeEventListener("paste",function(e){t&&(e=(e.clipboardData||window.clipboardData).getData("text"),v(i).jqGrid("saveCell",i.p.iRow,i.p.iCol,e),t=!1)},!0)}catch(e){}})},ariaHeaderGrid:function(e){var t=v.extend({onHeaderKeyCheck:null},e||{});return this.each(function(){var o=this,e=v.jgrid.getMethod("getStyleUI")(o.p.styleUI+".common","highlight",!0),i=v("#gbox_"+o.p.id).find(".ui-jqgrid-hbox>table").first(),n=!!v.jgrid.isFunction(t.onHeaderKeyCheck)&&t.onHeaderKeyCheck;v("tr.ui-jqgrid-labels",i).on("keydown",function(e){var i=o.p.selHeadInd,t=e.which||e.keyCode,r=o.grid.headers.length;if(!n||n.call(o,i,e))switch(t){case 37:if(0<=i-1){for(i--;v(o.grid.headers[i].el).is(":hidden")&&0<=i-1&&!(--i<0););0<=i&&(v(o.grid.headers[i].el).focus(),v(o.grid.headers[o.p.selHeadInd].el).attr("tabindex","-1"),o.p.selHeadInd=i,e.preventDefault())}break;case 39:if(i+1<r){for(i++;v(o.grid.headers[i].el).is(":hidden")&&i+1<r&&!(r-1<++i););i<r&&(v(o.grid.headers[i].el).focus(),v(o.grid.headers[o.p.selHeadInd].el).attr("tabindex","-1"),o.p.selHeadInd=i,e.preventDefault())}break;case 13:v(o.grid.headers[i].el).find("div").first().trigger("click"),e.preventDefault();break;default:return}}),v("tr.ui-jqgrid-labels>th:not(:hidden)",i).attr("tabindex",-1).focus(function(){v(this).addClass(e).attr("tabindex","0")}).blur(function(){v(this).removeClass(e)}),o.p.selHeadInd=v.jgrid.getFirstVisibleCol(o),v(o.grid.headers[o.p.selHeadInd].el).attr("tabindex","0")})},focusHeaderCell:function(i){return this.each(function(){var e=this;0<=(i=void 0===i?e.p.selHeadInd:i)&&i<e.p.colModel.length&&(v(e.grid.headers[e.p.selHeadInd].el).attr("tabindex","-1"),v(e.grid.headers[i].el).focus(),e.p.selHeadInd=i)})},resetAriaHeader:function(){return this.each(function(){var e=v("#gbox_"+this.p.id).find(".ui-jqgrid-hbox>table").first();v("tr.ui-jqgrid-labels",e).off("keydown"),v("tr.ui-jqgrid-labels>th:not(:hidden)",e).removeAttr("tabindex").off("focus blur")})},ariaPagerGrid:function(){return this.each(function(){var r=this,e=v.jgrid.getMethod("getStyleUI"),i=e(r.p.styleUI+".common","highlight",!0),o="."+e(r.p.styleUI+".common","disabled",!0),n=v(".ui-pg-button",r.p.pager),a=n.length;n.attr("tabindex","-1").focus(function(){v(this).addClass(i)}).blur(function(){v(this).removeClass(i)}),r.p.navIndex=0,setTimeout(function(){var e=n.not(o).first().attr("tabindex","0");r.p.navIndex=e[0]&&e[0].cellIndex?e[0].cellIndex-1:0},100),v(r.p.pager).find("table.ui-pager-table tr").first().on("keydown",function(e){var i=e.which||e.keyCode,t=r.p.navIndex;switch(i){case 37:if(0<=t-1){for(t--;v(n[t]).is(o)&&0<=t-1&&!(--t<0););0<=t&&(v(n[r.p.navIndex]).attr("tabindex","-1"),v(n[t]).attr("tabindex","0").focus(),r.p.navIndex=t),e.preventDefault()}break;case 39:if(t+1<a){for(t++;v(n[t]).is(o)&&t+1<a+1&&!(a-1<++t););t<a&&(v(n[r.p.navIndex]).attr("tabindex","-1"),v(n[t]).attr("tabindex","0").focus(),r.p.navIndex=t),e.preventDefault()}break;case 13:v(e.originalEvent.srcElement).hasClass("ui-pg-input")||(v(n[t]).trigger("click"),e.preventDefault());break;default:return}})})},focusPagerCell:function(t){return this.each(function(){var e=v(".ui-pg-button",this.p.pager),i=e.length;0<=(t=void 0===t?this.p.navIndex:t)&&t<i&&(v(e[this.p.navIndex]).attr("tabindex","-1"),v(e[t]).attr("tabindex","0").focus(),this.p.navIndex=t)})},resetAriaPager:function(){return this.each(function(){v(".ui-pg-button",this.p.pager).removeAttr("tabindex").off("focus"),v(this.p.pager).find("table.ui-pager-table tr").first().off("keydown")})},setAriaGrid:function(e){var i=v.extend({header:!0,body:!0,pager:!0,onEnterCell:null,customCellAction:null,excel:!1},e||{});return this.each(function(){i.header&&v(this).jqGrid("ariaHeaderGrid",i),i.body&&(i.excel?v(this).jqGrid("excelLikeGrid",i):v(this).jqGrid("ariaBodyGrid",i)),i.pager&&v(this).jqGrid("ariaPagerGrid")})},resetAriaGrid:function(e){var i=v.extend({header:!0,body:!0,pager:!0},e||{});return this.each(function(){i.body&&v(this).jqGrid("resetAriaBody"),i.header&&v(this).jqGrid("resetAriaHeader"),i.pager&&v(this).jqGrid("resetAriaPager")})}})});
|
|
1
|
+
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./grid.base"],e):e(jQuery)}(function(b){"use strict";b.extend(b.jgrid,{focusableElementsList:[">a[href]",">button:not([disabled])",">area[href]",">input:not([disabled])",">select:not([disabled])",">textarea:not([disabled])",">iframe",">object",">embed",">*[tabindex]",">*[contenteditable]"]}),b.jgrid.extend({ariaBodyGrid:function(e){var f=b.extend({onEnterCell:null,onKeyCheck:null,customCellAction:null},e||{});return this.each(function(){var n=this,t=b.jgrid.getMethod("getStyleUI"),a=t(n.p.styleUI+".common","highlight",!0);function l(e,i){return!isNaN(e)&&!isNaN(i)&&0<=e&&0<=i&&n.rows.length&&e<n.rows.length&&i<n.p.colModel.length}function r(e,i){var t,i=n.p.iRow+i,r=n.p.iCol+e,o=n.rows.length,e=0!==e;return!!o&&(t=n.p.colModel.length,e&&(r<0&&2<=i&&(r=t-1,i--),t<=r)&&(r=0,i++),e||(i<1?(r--,n.rows[i=o-1]&&0<=r&&!n.rows[i].cells[r]&&i--):(o<=i||!n.rows[i].cells[r])&&(i=1,r++)),l(i,r)?{row:i,col:r}:!!l(n.p.iRow,n.p.iCol)&&{row:n.p.iRow,col:n.p.iCol})}function o(e,i){var t=r(e,i);if(!t)return!1;for(;b(n.rows[t.row].cells[t.col]).is(":hidden");)if(n.p.iRow=t.row,n.p.iCol=t.col,t=r(e,i),n.p.iRow===t.row&&n.p.iCol===t.col)return!1;return 0!==i&&b(n).jqGrid("setSelection",n.rows[t.row].id,!1,null,!1),t}function s(e){var i=n.p.page,t=n.p.lastpage;n.p.page!==(i=t<(i=(i+=e)<=0?1:i)?t:i)&&(n.p.page=i,n.grid.populate())}var i=b.jgrid.focusableElementsList.join(),d=(b(n).removeAttr("tabindex"),b(n).on("jqGridAfterGridComplete.setAriaGrid",function(e){b("tbody",n).first().find(">tr:not(.jqgfirstrow)>td:not(:hidden, :has("+i+"))").attr("tabindex",-1),b("tbody",n).first().find(">tr:not(.jqgfirstrow)").removeAttr("tabindex"),void 0!==n.p.iRow&&void 0!==n.p.iCol&&n.rows[n.p.iRow]&&b(n.rows[n.p.iRow].cells[n.p.iCol]).attr("tabindex",0).focus(function(){b(this).addClass(a)}).blur(function(){b(this).removeClass(a)})}),n.p.iRow=1,n.p.iCol=b.jgrid.getFirstVisibleCol(n),0),c=0,p=!!b.jgrid.isFunction(f.customCellAction)&&f.customCellAction,u=!!b.jgrid.isFunction(f.onKeyCheck)&&f.onKeyCheck;b(n).on("keydown",function(e){if((!n.p.navigationDisabled||!0!==n.p.navigationDisabled)&&!e.target.id.startsWith("jqs_"+n.p.id)&&(!u||u.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e))){var i;switch(e.which||e.keyCode){case 38:i=o(0,-1),d=i.row,c=i.col,e.preventDefault();break;case 40:i=o(0,1),d=i.row,c=i.col,e.preventDefault();break;case 37:i=o(-1,0),d=i.row,c=i.col,e.preventDefault();break;case 39:i=o(1,0),d=i.row,c=i.col,e.preventDefault();break;case 36:d=e.ctrlKey?1:n.p.iRow,c=0,e.preventDefault();break;case 35:d=e.ctrlKey?n.rows.length-1:n.p.iRow,c=n.p.colModel.length-1,e.preventDefault();break;case 33:s(-1),c=n.p.iCol,d=n.p.iRow,e.preventDefault();break;case 34:s(1),c=n.p.iCol,(d=n.p.iRow)>n.rows.length-1&&(d=n.rows.length-1,n.p.iRow=n.rows.length-1),e.preventDefault();break;case 13:return void(b.jgrid.isFunction(f.onEnterCell)&&(f.onEnterCell.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e),e.preventDefault()));case 113:try{b(n).jqGrid("editCell",n.p.iRow,n.p.iCol,!0,e)}catch(e){}break;default:return void(p&&p.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e))}setTimeout(function(){b(n).jqGrid("focusBodyCell",d,c,t,a)},50)}}),b(n).on("jqGridBeforeSelectRow.ariaGridClick",function(){return!1}),b(n).on("jqGridCellSelect.ariaGridClick",function(e,i,t,r,o){var l,o=o.target;0<n.p.iRow&&0<=n.p.iCol&&b(n.rows[n.p.iRow].cells[n.p.iCol]).attr("tabindex",-1),(b(o).is("td")||b(o).is("th")||o.id.startsWith("jqs_"+n.p.id))&&(n.p.iCol=o.cellIndex,l=b(o).closest("tr.jqgrow"),n.p.iRow=l[0].rowIndex,b(o).attr("tabindex",0).addClass(a).focus().blur(function(){b(this).removeClass(a)}))}),n.p.ariaBody=!0})},excelLikeGrid:function(e){var C=b.extend({beforeDeleteCell:null,customCellAction:null,customUndoFunction:null,specialChars:["~","!","@","#","$","%","^","&","*","(",")","_","+","{","}",":",'"',"|","<",">","?",",",".","/",";","\\","[","]"],addonChars:!1,onKeyCheck:null},e||{});return this.each(function(){var n=this,a=b.jgrid.getMethod("getStyleUI"),s=a(n.p.styleUI+".common","highlight",!0),d=(n.p.F2key=!1,{isValidCell:function(e,i){return!isNaN(e)&&!isNaN(i)&&0<=e&&0<=i&&n.rows.length&&e<n.rows.length&&i<n.p.colModel.length},getNextCell:function(e,i){var i=n.p.iRow+i,t=n.p.iCol+e,r=n.rows.length,e=0!==e,o=n.p.frozenColumns?n.p.frozenColCount+1:0;return!!r&&(r=n.p.colModel.length,e&&(t=t<o?o:t)===r&&(t=r),e||n.rows[i]&&0<=t&&!n.rows[i].cells[t]&&i--,this.isValidCell(i,t)?{row:i,col:t}:!!this.isValidCell(n.p.iRow,n.p.iCol)&&{row:n.p.iRow,col:n.p.iCol})},getNextVisibleCell:function(e,i){var t=this.getNextCell(e,i);if(!t)return!1;for(;b(n.rows[t.row].cells[t.col]).is(":hidden");)if(n.p.iRow=t.row,n.p.iCol=t.col,t=this.getNextCell(e,i),n.p.iRow===t.row&&n.p.iCol===t.col)return!1;return 0!==i&&b(n).jqGrid("setSelection",n.rows[t.row].id,!1,null,!1),t},movePage:function(e){var i=n.p.page,t=n.p.lastpage;n.p.page!==(i=t<(i=(i+=e)<=0?1:i)?t:i)&&(n.p.page=i,n.grid.populate())}}),i=b.jgrid.focusableElementsList.join(),c=(b(n).removeAttr("tabindex"),b(n).on("jqGridAfterGridComplete.setAriaGrid",function(e){b("tbody",n).first().find(">tr:not(.jqgfirstrow)>td:not(:hidden, :has("+i+"))").attr("tabindex",-1),b("tbody",n).first().find(">tr:not(.jqgfirstrow)").removeAttr("tabindex"),void 0!==n.p.iRow&&void 0!==n.p.iCol&&n.rows[n.p.iRow]&&b(n.rows[n.p.iRow].cells[n.p.iCol]).attr("tabindex",0).focus(function(){b(this).addClass(s)}).blur(function(){b(this).removeClass(s)})}),n.p.iRow=1,n.p.iCol=b.jgrid.getFirstVisibleCol(n),n.p.ariaBody=!0,0),p=0,u=!!b.jgrid.isFunction(C.customCellAction)&&C.customCellAction,f=!!b.jgrid.isFunction(C.beforeDeleteCell)&&C.beforeDeleteCell,h=new Set(C.specialChars),w=!1,g=(n.addEventListener("paste",function(e){w&&(e=(e.clipboardData||window.clipboardData).getData("text"),b(n).jqGrid("saveCell",n.p.iRow,n.p.iCol,e),w=!1)}),!!b.jgrid.isFunction(C.onKeyCheck)&&C.onKeyCheck);b(n).on("keydown",function(e){if((!n.p.navigationDisabled||!0!==n.p.navigationDisabled)&&!e.target.id.startsWith("jqs_"+n.p.id)&&(!g||g.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e,d))){var i=e.which||e.keyCode,t=e.ctrlKey||17===i;switch(i){case 38:r=d.getNextVisibleCell(0,-1),c=r.row,p=r.col,e.preventDefault();break;case 40:case 13:r=d.getNextVisibleCell(0,1),c=r.row,p=r.col,e.preventDefault();break;case 37:r=d.getNextVisibleCell(-1,0),c=r.row,p=r.col,e.preventDefault();break;case 39:r=d.getNextVisibleCell(1,0),c=r.row,p=r.col,e.preventDefault();break;case 36:c=e.ctrlKey?1:n.p.iRow,p=n.p.frozenColumns?n.p.frozenColCount+1:0,e.preventDefault();break;case 35:c=e.ctrlKey?n.rows.length-1:n.p.iRow,p=n.p.colModel.length-1,e.preventDefault();break;case 33:d.movePage(-1),p=n.p.iCol,c=n.p.iRow,e.preventDefault();break;case 34:d.movePage(1),p=n.p.iCol,(c=n.p.iRow)>n.rows.length-1&&(c=n.rows.length-1,n.p.iRow=n.rows.length-1),e.preventDefault();break;case 9:r=e.shiftKey?d.getNextVisibleCell(-1,0):d.getNextVisibleCell(1,0),c=r.row,p=r.col,e.preventDefault();break;case 113:try{b(n).jqGrid("editCell",n.p.iRow,n.p.iCol,!0,e,!1),n.p.F2key=!0}catch(e){}break;case 8:case 46:var r=!0;!0===(r=f?f.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e):r)&&b(n).jqGrid("saveCell",n.p.iRow,n.p.iCol,"");break;case 86:if(t)return w=!0;break;case 90:if(t)return r=!0,(r=b.jgrid.isFunction(C.customUndoFunction)?C.customUndoFunction.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e):r)&&n.p.savedValues&&b(n).jqGrid("getCell",n.rows[n.p.iRow].id,n.p.colModel[n.p.iCol].name,!1)===n.p.savedValues.newvalue&&n.p.iRow===n.p.savedValues.indexRow&&b(n).jqGrid("saveCell",n.p.iRow,n.p.iCol,n.p.savedValues.oldvalue),!0;break;default:var r=/^[a-z]$/i.test(e.key),o=/^[0-9]$/i.test(e.key),l=!1;return C.addonChars&&(l=C.addonChars.test(e.key)),(r||o||h.has(e.key)||l)&&b(n).jqGrid("editCell",n.p.iRow,n.p.iCol,!0,e,!0),void(u&&u.call(n,n.rows[n.p.iRow].id,n.p.iRow,n.p.iCol,e))}setTimeout(function(){b(n).jqGrid("focusBodyCell",c,p,a,s)},50)}}),b(n).on("jqGridBeforeSelectRow.ariaGridClick",function(){return!1}),b(n).on("jqGridCellSelect.ariaGridClick",function(e,i,t,r,o){var l,o=o.target;0<n.p.iRow&&0<=n.p.iCol&&b(n.rows[n.p.iRow].cells[n.p.iCol]).attr("tabindex",-1),(b(o).is("td")||b(o).is("th")||o.id.startsWith("jqs_"+n.p.id))&&(n.p.iCol=o.cellIndex,n.p.savedRow.length&&b(n).jqGrid("saveCell",n.p.savedRow[0].id,n.p.savedRow[0].ic),l=b(o).closest("tr.jqgrow"),n.p.iRow=l[0].rowIndex,b(o).attr("tabindex",0).addClass(s).focus().blur(function(){b(this).removeClass(s)}))}).on("jqGridDblClickRow.ariaGridDblClick",function(e,i,t,r,o){b(n).jqGrid("editCell",t,r,!0,o,!1),n.p.F2key=!0})})},focusBodyCell:function(n,a,s,d){return this.each(function(){var e,i=this,t=s||b.jgrid.getMethod("getStyleUI"),r=d||t(i.p.styleUI+".common","highlight",!0),o=b.jgrid.focusableElementsList.join();function l(e){return b(o,e)[0]}void 0!==n&&void 0!==a?!isNaN(i.p.iRow)&&!isNaN(i.p.iCol)&&0<=i.p.iCol&&(e=l(i.rows[i.p.iRow].cells[i.p.iCol]),b(e||i.rows[i.p.iRow].cells[i.p.iCol]).attr("tabindex",-1)):(n=i.p.iRow,a=i.p.iCol),n=parseInt(n,10),a=parseInt(a,10),0<n&&0<=a&&(e=l(i.rows[n].cells[a]),b(e||i.rows[n].cells[a]).attr("tabindex",0).addClass(r).focus().blur(function(){b(this).removeClass(r)}),i.p.iRow=n,i.p.iCol=a)})},resetAriaBody:function(){return this.each(function(){var i=this,t=!1,e=(i.p.ariaBody=!1,b(i).attr("tabindex","0").off("keydown").off("jqGridBeforeSelectRow.ariaGridClick").off("jqGridCellSelect.ariaGridClick").off("jqGridAfterGridComplete.setAriaGrid"),b.jgrid.focusableElementsList.join());b("tbody",i).first().find(">tr:not(.jqgfirstrow)>td:not(:hidden, :has("+e+"))").removeAttr("tabindex").off("focus"),b("tbody",i).first().find(">tr:not(.jqgfirstrow)").attr("tabindex",-1);try{i.removeEventListener("paste",function(e){t&&(e=(e.clipboardData||window.clipboardData).getData("text"),b(i).jqGrid("saveCell",i.p.iRow,i.p.iCol,e),t=!1)},!0)}catch(e){}})},ariaHeaderGrid:function(e){var t=b.extend({onHeaderKeyCheck:null},e||{});return this.each(function(){var o=this,e=b.jgrid.getMethod("getStyleUI")(o.p.styleUI+".common","highlight",!0),i=b("#gbox_"+o.p.id).find(".ui-jqgrid-hbox>table").first(),l=!!b.jgrid.isFunction(t.onHeaderKeyCheck)&&t.onHeaderKeyCheck;b("tr.ui-jqgrid-labels",i).on("keydown",function(e){var i=o.p.selHeadInd,t=e.which||e.keyCode,r=o.grid.headers.length;if(!l||l.call(o,i,e))switch(t){case 37:if(0<=i-1){for(i--;b(o.grid.headers[i].el).is(":hidden")&&0<=i-1&&!(--i<0););0<=i&&(b(o.grid.headers[i].el).focus(),b(o.grid.headers[o.p.selHeadInd].el).attr("tabindex","-1"),o.p.selHeadInd=i,e.preventDefault())}break;case 39:if(i+1<r){for(i++;b(o.grid.headers[i].el).is(":hidden")&&i+1<r&&!(r-1<++i););i<r&&(b(o.grid.headers[i].el).focus(),b(o.grid.headers[o.p.selHeadInd].el).attr("tabindex","-1"),o.p.selHeadInd=i,e.preventDefault())}break;case 13:b(o.grid.headers[i].el).find("div").first().trigger("click"),e.preventDefault();break;default:return}}),b("tr.ui-jqgrid-labels>th:not(:hidden)",i).attr("tabindex",-1).focus(function(){b(this).addClass(e).attr("tabindex","0")}).blur(function(){b(this).removeClass(e)}),o.p.selHeadInd=b.jgrid.getFirstVisibleCol(o),b(o.grid.headers[o.p.selHeadInd].el).attr("tabindex","0")})},focusHeaderCell:function(i){return this.each(function(){var e=this;0<=(i=void 0===i?e.p.selHeadInd:i)&&i<e.p.colModel.length&&(b(e.grid.headers[e.p.selHeadInd].el).attr("tabindex","-1"),b(e.grid.headers[i].el).focus(),e.p.selHeadInd=i)})},resetAriaHeader:function(){return this.each(function(){var e=b("#gbox_"+this.p.id).find(".ui-jqgrid-hbox>table").first();b("tr.ui-jqgrid-labels",e).off("keydown"),b("tr.ui-jqgrid-labels>th:not(:hidden)",e).removeAttr("tabindex").off("focus blur")})},ariaPagerGrid:function(){return this.each(function(){var r=this,e=b.jgrid.getMethod("getStyleUI"),i=e(r.p.styleUI+".common","highlight",!0),o="."+e(r.p.styleUI+".common","disabled",!0),l=b(".ui-pg-button",r.p.pager),n=l.length;l.attr("tabindex","-1").focus(function(){b(this).addClass(i)}).blur(function(){b(this).removeClass(i)}),r.p.navIndex=0,setTimeout(function(){var e=l.not(o).first().attr("tabindex","0");r.p.navIndex=e[0]&&e[0].cellIndex?e[0].cellIndex-1:0},100),b(r.p.pager).find("table.ui-pager-table tr").first().on("keydown",function(e){var i=e.which||e.keyCode,t=r.p.navIndex;switch(i){case 37:if(0<=t-1){for(t--;b(l[t]).is(o)&&0<=t-1&&!(--t<0););0<=t&&(b(l[r.p.navIndex]).attr("tabindex","-1"),b(l[t]).attr("tabindex","0").focus(),r.p.navIndex=t),e.preventDefault()}break;case 39:if(t+1<n){for(t++;b(l[t]).is(o)&&t+1<n+1&&!(n-1<++t););t<n&&(b(l[r.p.navIndex]).attr("tabindex","-1"),b(l[t]).attr("tabindex","0").focus(),r.p.navIndex=t),e.preventDefault()}break;case 13:b(e.originalEvent.srcElement).hasClass("ui-pg-input")||(b(l[t]).trigger("click"),e.preventDefault());break;default:return}})})},focusPagerCell:function(t){return this.each(function(){var e=b(".ui-pg-button",this.p.pager),i=e.length;0<=(t=void 0===t?this.p.navIndex:t)&&t<i&&(b(e[this.p.navIndex]).attr("tabindex","-1"),b(e[t]).attr("tabindex","0").focus(),this.p.navIndex=t)})},resetAriaPager:function(){return this.each(function(){b(".ui-pg-button",this.p.pager).removeAttr("tabindex").off("focus"),b(this.p.pager).find("table.ui-pager-table tr").first().off("keydown")})},setAriaGrid:function(e){var i=b.extend({header:!0,body:!0,pager:!0,onEnterCell:null,customCellAction:null,excel:!1},e||{});return this.each(function(){i.header&&b(this).jqGrid("ariaHeaderGrid",i),i.body&&(i.excel?b(this).jqGrid("excelLikeGrid",i):b(this).jqGrid("ariaBodyGrid",i)),i.pager&&b(this).jqGrid("ariaPagerGrid")})},resetAriaGrid:function(e){var i=b.extend({header:!0,body:!0,pager:!0},e||{});return this.each(function(){i.body&&b(this).jqGrid("resetAriaBody"),i.header&&b(this).jqGrid("resetAriaHeader"),i.pager&&b(this).jqGrid("resetAriaPager")})}})});
|