Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datagrid

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datagrid - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

69

dist/datagrid.js

@@ -948,5 +948,2 @@ (function webpackUniversalModuleDefinition(root, factory) {

var lastSortColumnIndex
var sortType = NONE_ORDER
unbindEvents.push(

@@ -1020,2 +1017,8 @@ // 给每个字段内部注入小箭头

var getPageX = IS_TOUCH ? function (e) {
return e.pageX || e.changedTouches[0].pageX
} : function (e) {
return e.pageX
}
module.exports = function (DataGrid) {

@@ -1038,3 +1041,2 @@ DataGrid.hook(function (datagrid) {

var dragging = false // 是否正在拖动中
var draggingLever // 被拖动的那个小方块
var draggingTH // 被拖动的 th 元素

@@ -1046,2 +1048,30 @@ var draggingColumnIndex // 被拖动的元素是第几个字段

function showDragLine (th) {
// 显示虚线
var ui = datagrid.ui
var $columnsWrapper = ui.$columnsWrapper
var $bodyWrapper = ui.$bodyWrapper
dragLine.style.height = $columnsWrapper.offsetHeight + $bodyWrapper.offsetHeight + 'px'
draggingLineInitLeft = th.offsetLeft + th.clientWidth - $bodyWrapper.scrollLeft
dragLine.style.left = draggingLineInitLeft + 1 + 'px'
document.documentElement.classList.add('data-grid-dragging')
}
// 在非触摸屏设备上,鼠标移上去的时候就显示拖拽虚线
if (!IS_TOUCH) {
unbindEvents.push(
addEvent(datagrid.el, 'mouseover', function (e) {
if (!e.target.classList.contains('drag-lever')) return
var th = findParent('th', e.target, datagrid.el)
if (!th) return
showDragLine(th)
}),
addEvent(datagrid.el, 'mouseout', function (e) {
if (!e.target.classList.contains('drag-lever') || dragging) return
document.documentElement.classList.remove('data-grid-dragging')
})
)
}
unbindEvents.push(

@@ -1055,27 +1085,15 @@ // 注入供用户拖拽的小方块

addEvent(datagrid.el, MOUSEDOWN, function (e) {
if (e.target.classList.contains('drag-lever') && e.button === 0) {
if (e.target.classList.contains('drag-lever') && (IS_TOUCH || e.button === 0)) {
var th = findParent('th', e.target, datagrid.el)
if (!th) return
if (IS_TOUCH) showDragLine(th)
// 给 th 加一个状态, 避免触发排序功能
// todo 需要一个临时关闭排序的开关
th.classList.add('resizing')
minLeft = -(th.clientWidth - MIN_WIDTH)
draggingTH = th
minLeft = -(th.clientWidth - MIN_WIDTH)
var ui = datagrid.ui
var $columnsWrapper = ui.$columnsWrapper
var $bodyWrapper = ui.$bodyWrapper
// 显示虚线
dragLine.style.height = $columnsWrapper.offsetHeight + $bodyWrapper.offsetHeight + 'px'
draggingLineInitLeft = th.offsetLeft + th.clientWidth - $bodyWrapper.scrollLeft
dragLine.style.left = draggingLineInitLeft + 'px'
dragLine.classList.add('show')
dragging = true
draggingLever = e.target
draggingLever.classList.add('dragging')
startX = e.pageX
startX = getPageX(e)
draggingColumnIndex = indexOf.call(th.parentElement.children, th)

@@ -1088,5 +1106,5 @@ }

// 调整虚线的 left 值
var moved = e.pageX - startX
var moved = getPageX(e) - startX
if (moved > minLeft) {
dragLine.style.left = draggingLineInitLeft + (e.pageX - startX) + 'px'
dragLine.style.left = draggingLineInitLeft + (getPageX(e) - startX) + 'px'
}

@@ -1098,6 +1116,5 @@ }),

setTimeout(function () { draggingTH.classList.remove('resizing') }, 0)
dragLine.classList.remove('show')
document.documentElement.classList.remove('data-grid-dragging')
dragging = false
draggingLever.classList.remove('dragging')
var moved = e.pageX - startX // 计算移动的距离
var moved = getPageX(e) - startX // 计算移动的距离
if (moved < minLeft) moved = minLeft

@@ -1104,0 +1121,0 @@ var columnsMinWidth = datagrid.renderData.columnsMinWidth

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Datagrid=t():e.Datagrid=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var r=t.slice(1),n=e[t[0]];return function(e,t,o){n.apply(this,[e,t,o].concat(r))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,r){e.exports=r(11),e.exports.Selection=r(15),e.exports.Paging=r(14),e.exports.Sorting=r(16),e.exports.ColumnMove=r(12),e.exports.ColumnFixed=r(13)},function(e,t){e.exports=function(e,t,r,n){return e.addEventListener(t,r,n),function(){e.removeEventListener(t,r,n)}}},function(e,t){e.exports=function(e,t,r){r||(r=document.body);var n=e.toUpperCase(),o=t,i=null;do if(o.tagName===n){i=o;break}while(o!==r&&(o=o.parentElement));return i}},function(e,t){},3,3,3,3,3,function(e,t){e.exports='<div class=grid-wrapper> <div class=grid-columns-wrapper> <table class=grid-columns> <colgroup></colgroup> <thead></thead> </table> </div> <div class=grid-body-wrapper> <table class=grid-body> <colgroup></colgroup> <tbody></tbody> </table> </div> </div> <div class="grid-no-data hidden"> <div class=no-data-content> 暂无数据 </div> </div> '},function(e,t){e.exports="<div class=grid-pager> <div>显示第 {{start}} - {{end}} 条数据, 共 {{total}} 条数据</div> <div> <span data-jump=first>首页</span> <span data-jump=prev>上一页</span> <span>第 <input type=text data-page value={{cur}}> 页, 共 {{totalPage}} 页</span> <span data-jump=next>下一页</span> <span data-jump=end>尾页</span> </div> </div> "},function(e,t,r){function n(e){return e.name}function o(e,t){return t[e.key]}function i(e,t){s.call(this);var r=this.el=document.createElement("div");this.options=u({},{height:e.offsetHeight},t),this.origin=e.parentElement.replaceChild(r,e),h.forEach(function(e){e(this)},this),this._init()}r(3);var a=r(9),s=r(17),c=r(1),u=r(19),l=r(2),d=r(18),p=100,f="data-grid",h=[];i.use=function(e){e(i)},i.hook=function(e){return h.push(e),function(){var t=h.indexOf(e);t>=0&&h.splice(t,1)}};var v=i.prototype=Object.create(s.prototype);v.constructor=i,v._init=function(){var e=this._unbindEvents=[];this.emit("beforeInit");var t=this.el;t.classList.add(f),t.innerHTML=a;var r={$gridWrapper:".grid-wrapper",$columnsWrapper:".grid-columns-wrapper",$columns:".grid-columns",$columnsColGroup:".grid-columns colgroup",$columnsThead:".grid-columns thead",$bodyWrapper:".grid-body-wrapper",$body:".grid-body",$bodyColGroup:".grid-body colgroup",$bodyTbody:".grid-body tbody",$noData:".grid-no-data"};for(var n in r)r[n]=t.querySelector(r[n]);r.$gridWrapper.style.height=this.options.height+"px";var o=this;e.push(c(r.$bodyWrapper,"scroll",function(){r.$columns.style.left="-"+r.$bodyWrapper.scrollLeft+"px"}),c(r.$bodyWrapper,"mouseover",function(e){var t=l("tr",e.target);if(t){var r=t.getAttribute("data-index");r&&o.trHover(!0,Number(r))}}),c(r.$bodyWrapper,"mouseout",function(e){var t=l("tr",e.target);if(t){var r=t.getAttribute("data-index");r&&o.trHover(!1,Number(r))}}),c(r.$bodyWrapper,"click",function(e){var t=l("td",e.target);if(t){var r=l("tr",t);if(r){var n=t.getAttribute("data-index"),i=r.getAttribute("data-index"),a=o.renderData;o.emit("cellClick",a.columnsDef[n],o.empty?null:a.rows[i])}}})),this.ui=r,this.options.fit&&e.push(c(window,"resize",d(function(){o.setWidth()}))),this.emit("afterInit")},v.trHover=function(e,t,r){var n=this.ui.$bodyTbody,o=n.querySelector('tr[data-index="'+t+'"]');o.classList[e?"add":"remove"]("hover"),r!==!1&&this.emit(e?"trHoverTo":"clearHover",t,o,this.rows&&this.rows[t])},v.setData=function(e){if(this.renderData={},this.emit("beforeSetData",e),this.empty=!(e.columns&&e.columns.length&&e.rows&&e.rows.length),this.empty){var t=this.ui;t.$body.classList.add("hidden"),t.$noData.classList.remove("hidden")}else this.setColumns(e.columns),this.setBody(e.rows),this.setWidth(e.width);this.emit("afterSetData",e)},v.normalizeWidth=function(e){var t=this.renderData,r=t.columnsDef;Array.isArray(e)||(e=[]);for(var n=[],o=0;o<r.length;o++)n[o]=e[o]||Math.max(15*(r[o].name||"").length,p);return n},v.setWidth=function(e){if(!this.empty){var t={width:e};this.emit("beforeSetWidth",t);var r=this.renderData,n=t.width;!n&&r.columnsMinWidth||(r.columnsMinWidth=this.normalizeWidth(n));var o,i=r.columnsMinWidth;if(this.options.fit){var a=i.reduce(function(e,t){return e+t}),s=this.ui.$bodyWrapper.clientWidth;if(a>=s)o=i;else{var c=(s-a)/r.columnsDef.length;o=i.map(function(e){return Math.round(e+c)})}}else o=i;r.columnsWidth=o;var u=this._colGroupsHTML(o);this._renderCols(u),this._resize(o)}},v._colGroupsHTML=function(e){return e?e.map(function(e){return'<col style="width:'+e+'px">'}):[]},v._renderCols=function(e){var t=this.ui;t.$columnsColGroup.innerHTML=t.$bodyColGroup.innerHTML=e.join("")},v._resize=function(e){var t=this.ui,r=t.$columns,n=t.$noData,o=t.$body,i=e.reduce(function(e,t){return e+t});r.style.width=o.style.width=i+"px",this.empty?n.classList.remove("hidden"):n.classList.add("hidden")},v.setColumns=function(e){var t=this.renderData.columnsDef=this._normalize(e),r=this._columnsHTML(t);this.emit("beforeRenderColumns",r),this._renderColumns(r)},v._normalize=function(e){return e.map(function(e){var t="string"==typeof e?{name:e}:e;return t.key||(t.key=t.name),t})},v._columnsHTML=function(e){var t=this.options.thRenderer;return e.map(function(e,r){var o;return e.thRenderer&&(o=e.thRenderer(e)),null==o&&(t&&(o=t(e)),null==o&&(o=n(e))),'<th data-index="'+r+'">'+o+"</th>"})},v._renderColumns=function(e){this.ui.$columnsThead.innerHTML=e.join("")},v.setBody=function(e){var t=this.renderData;this.empty=!e||!e.length,t.rows=e,this._renderBody(t.trsArr=this._bodyHTML(t.columnsDef,e))},v._bodyHTML=function(e,t){var r=this.options.tdRenderer;return this.empty?[]:t.map(function(t,n){var i='<tr data-index="'+n+'">';return e.forEach(function(e,n){var a;e.tdRenderer&&(a=e.tdRenderer(e,t)),null==a&&(r&&(a=r(e,t)),null==a&&(a=o(e,t))),i+='<td data-index="'+n+'">'+a+"</td>"}),i+="</tr>"})},v._renderBody=function(e){var t=this.ui;t.$bodyTbody.innerHTML=e.join(""),t.$body.classList.remove("hidden"),t.$noData.classList.add("hidden")},v.destroy=function(){this.emit("beforeDestroy"),this._unbindEvents.forEach(function(e){e()});var e=this.el;try{e.parentElement.replaceChild(this.origin,e)}catch(e){}this.emit("afterDestroy")},e.exports=i},function(e,t,r){r(4);var n=r(1),o=r(2),i=100,a=Array.prototype.indexOf,s="ontouchstart"in window,c=s?"touchstart":"mousedown",u=s?"touchmove":"mousemove",l=s?"touchend":"mouseup";e.exports=function(e){e.hook(function(e){if(e.options.columnResize){var t=document.createElement("div");t.classList.add("dragging-line");var r=[];e.once("afterInit",function(){e.ui.$draggingLine=t,e.el.appendChild(t)});var s,d,p,f,h,v,m=!1;r.push(e.on("beforeRenderColumns",function(e){e.forEach(function(t,r){e[r]=t.replace("</th>",'<span class="drag-lever"></span></th>')})}),n(e.el,c,function(r){if(r.target.classList.contains("drag-lever")&&0===r.button){var n=o("th",r.target,e.el);if(!n)return;n.classList.add("resizing"),d=n,v=-(n.clientWidth-i);var c=e.ui,u=c.$columnsWrapper,l=c.$bodyWrapper;t.style.height=u.offsetHeight+l.offsetHeight+"px",h=n.offsetLeft+n.clientWidth-l.scrollLeft,t.style.left=h+"px",t.classList.add("show"),m=!0,s=r.target,s.classList.add("dragging"),f=r.pageX,p=a.call(n.parentElement.children,n)}}),n(document,u,function(e){if(m){e.preventDefault();var r=e.pageX-f;r>v&&(t.style.left=h+(e.pageX-f)+"px")}}),n(document,l,function(r){if(m){setTimeout(function(){d.classList.remove("resizing")},0),t.classList.remove("show"),m=!1,s.classList.remove("dragging");var n=r.pageX-f;n<v&&(n=v);var o=e.renderData.columnsMinWidth;o[p]=o[p]+n,e.setWidth(o)}})),e.once("beforeDestroy",function(){r.forEach(function(e){e()})})}})}},function(e,t,r){r(5);var n=Array.prototype.slice,o=r(1);e.exports=function(e){e.hook(function(t){function r(){function r(e,r){var n=i.el.contains(r)?t:i;n.trHover(!0,e,!1)}function n(e,r){var n=i.el.contains(r)?t:i;n.trHover(!1,e,!1)}var c=document.createElement("div");c.classList.add("fixed-datagrid");var u=document.createElement("div");u.classList.add("hidden"),c.appendChild(u),t.el.appendChild(c),i=new e(u,{height:t.ui.$columnsWrapper.offsetHeight+t.ui.$bodyWrapper.offsetHeight,columnSorting:t.options.columnSorting,columnResize:t.options.columnResize,selection:t.options.selection});var l,d,p=!1,f=!1;s.push(o(t.ui.$bodyWrapper,"scroll",function(){f||(p=!0,l&&clearTimeout(l),l=setTimeout(function(){p=!1},250),i.ui.$bodyWrapper.scrollTop=this.scrollTop)}),o(i.ui.$bodyWrapper,"scroll",function(){p||(f=!0,d&&clearTimeout(d),d=setTimeout(function(){f=!1},250),t.ui.$bodyWrapper.scrollTop=this.scrollTop)})),s.push(t.on("trHoverTo",r),i.on("trHoverTo",r),t.on("clearHover",n),i.on("clearHover",n)),t.options.selection&&(t.on("selectedChanged",function(e){i.selectRow(e,!1)}),i.on("selectedChanged",function(e){t.selectRow(e)})),t.options.columnSorting&&(i.on("sort",function(e,r,n){t.sortBy(n)}),t.on("sort",function(e,t,r){if(!(r<a)){var n=i.sort&&i.sort.index;if("number"==typeof n){i.sort.direction=0;var o=i.ui.$columnsWrapper.querySelector('th[data-index="'+n+'"]');o&&o.classList.remove("order-by-asc","order-by-desc")}}}))}if(t.options.fixedColumns){var i,a,s=[];t.on("afterSetData",function(e){if(a=e.fixedColumnsLeft,!a)return void(i&&i.el.classList.add("hidden"));i||r(t.el),i.el.classList.remove("hidden"),i.setData({columns:t.renderData.columnsDef.slice(0,a),width:t.renderData.columnsWidth.slice(0,a),rows:t.renderData.rows});var o=n.call(i.ui.$columnsWrapper.querySelectorAll("tr")).concat(n.call(i.ui.$bodyWrapper.querySelectorAll("tr"))),s=n.call(t.ui.$columnsWrapper.querySelectorAll("tr")).concat(n.call(t.ui.$bodyWrapper.querySelectorAll("tr")));o.forEach(function(e,t){var r=s[t];e.clientHeight!==r.clientHeight&&(e.style.height=r.clientHeight+"px")})}),t.once("beforeDestroy",function(){s.forEach(function(e){e()})})}})}},function(e,t,r){r(6);var n=r(10),o=r(1);e.exports=function(e){e.hook(function(e){function t(t){return Number.isNaN(t)||t<1||t>i.totalPage?void(s.querySelector("[data-page]").value=i.cur):(s.querySelector("[data-page]").value=i.cur=t,void e.emit("switchPage",t))}if(e.options.pagination){var r=e.options.pagingTemplate||n,i=e.pager={cur:1,total:null,size:null,start:null,end:null,totalPage:null},a=[],s=document.createElement("div");s.classList.add("grid-pager-wrapper"),a.push(o(s,"click",function(e){var r=e.target.dataset.jump;if(r){var n;switch(r){case"first":n=1;break;case"end":n=i.totalPage;break;case"prev":n=i.cur-1;break;case"next":n=i.cur+1;break;default:return}t(n)}}),o(s,"keydown",function(e){13===e.keyCode&&void 0!==e.target.dataset.page&&t(Number(e.target.value))}),e.on("beforeSetData",function(e){if(!e.rows||!e.rows.length)return void s.classList.add("hidden");var t=e.size||0,n=e.total||0,o=i.cur,a=e.rows.length;i.total=n,i.size=t,i.start=(o-1)*t+1,i.end=i.start+a-1,i.total=n,i.totalPage=Math.ceil(n/t)||0,s.innerHTML=r.replace(/\{\{(\w+)\}\}/g,function(e,t){return i.hasOwnProperty(t)?i[t]:e}),s.classList.remove("hidden")})),e.once("afterInit",function(){e.ui.$gridWrapper.appendChild(s),e.ui.$pagerWrapper=s}),e.once("beforeDestroy",function(){a.forEach(function(e){e()})})}})}},function(e,t,r){r(7);var n=r(2),o=r(1),i="selected";e.exports=function(e){e.prototype.selectRow=function(e,t){var r=this.ui.$body,n=r.querySelector('tr[data-index="'+e+'"]');if(n){var o=this._selectRowsIndex.indexOf(e);if(this._isMultipleSelect)o>=0?this._selectRowsIndex.splice(o,1):this._selectRowsIndex.push(e);else{if(o>=0)return;var a=r.querySelector("tr."+i);a&&a.classList.remove(i),n.classList.add("selected"),this._selectRowsIndex=[e]}t!==!1&&this.emit("selectedChanged",this._isMultipleSelect?this._selectRowsIndex:e)}},e.prototype.selectAll=function(e,t){if(this._isMultipleSelect){this._selectRowsIndex=[];var r=this;Array.prototype.forEach.call(this.ui.$bodyWrapper.querySelectorAll("tr[data-index]"),function(t){if(e){var n=Number(t.getAttribute("data-index"));r._selectRowsIndex.push(n)}t.querySelector("input[type=checkbox]").checked=e}),t!==!1&&this.emit("selectedChanged",this._selectRowsIndex)}},e.hook(function(e){var t=e.options.selection;if(t){var r=e._isMultipleSelect="multiple"===t,i=[];i.push(e.on("beforeSetData",function(){e._selectRowsIndex=[]})),r&&i.push(e.on("beforeSetData",function(e){e.columns.unshift({sortable:!1,thRenderer:function(){return'<input type="checkbox" class="select-all">'},tdRenderer:function(){return'<input type="checkbox">'}})})),e.once("afterInit",function(){var t=e.ui.$bodyWrapper,a=e.ui.$columnsWrapper;r?(i.push(o(t,"change",function(r){if("INPUT"===r.target.tagName&&"checkbox"===r.target.type){a.querySelector("input.select-all").checked=!1;var o=n("tr",r.target,t);if(o){var i=Number(o.getAttribute("data-index"));Number.isNaN(i)||e.selectRow(i),a.querySelector("input[type=checkbox].select-all").checked=!e.empty&&e._selectRowsIndex.length===e.renderData.rows.length}}})),i.push(o(a,"change",function(t){var r=t.target;"INPUT"===r.tagName&&"checkbox"===r.type&&r.classList.contains("select-all")&&e.selectAll(r.checked)}))):i.push(o(t,"click",function(r){var o=n("tr",r.target,t);if(o){var i=Number(o.getAttribute("data-index"));Number.isNaN(i)||e.selectRow(i)}}))}),e.once("beforeDestroy",function(){i.forEach(function(e){e()})})}})}},function(e,t,r){r(8);var n=r(2),o=r(1),i=-1,a=1,s=0,c="order-by-asc",u="order-by-desc";e.exports=function(e){e.prototype.sortBy=function(e,t){var r=this.renderData.columnsDef[e];if(r&&r.sortable!==!1){var n=this.sort||(this.sort={}),o=this.ui.$columnsWrapper,l=n.index;if(e!==l){if("number"==typeof l){var d=o.querySelector('th[data-index="'+l+'"]');d&&d.classList.remove(c,u)}n.index=e,n.direction=s}var p=o.querySelector('th[data-index="'+e+'"]');switch(p.classList.remove(c,u),n.direction){case s:n.direction=a,p.classList.add(c);break;case a:n.direction=i,p.classList.add(u);break;case i:n.direction=s}t!==!1&&this.emit("sort",r,n.direction,e,p)}},e.hook(function(e){if(e.options.columnSorting){var t=[];t.push(e.on("beforeRenderColumns",function(e){e.forEach(function(t,r){e[r]=t.replace("</th>",'<span class="order-ico"></span></th>')})})),e.once("afterInit",function(){var r=e.ui.$columnsWrapper;t.push(o(r,"click",function(t){var o=n("th",t.target,r);if(o&&!o.classList.contains("resizing")){var i=Number(o.getAttribute("data-index"));window.isNaN(i)||e.sortBy(i)}}),e.on("afterSetData",function(){var t=e.sort&&e.sort.index;if(!("number"!=typeof t||t<0)){var r=e.ui.$columnsWrapper.querySelector('th[data-index="'+t+'"]');if(r)switch(e.sort.direction){case a:r.classList.add(c);break;case i:r.classList.add(u)}}}))}),e.once("beforeDestroy",function(){t.forEach(function(e){e()})})}})}},function(e,t){function r(){this._callbacks={}}var n=Array.prototype.slice,o=r.prototype;o.on=function(e,t){var r=this._callbacks,n=r[e]||(r[e]=[]);return n.push(t),function(){var e=n.indexOf(t);e>=0&&n.splice(e,1)}},o.once=function(e,t){var r=this.on(e,function(){t.apply(null,arguments),window.setTimeout(r,0)});return r},o.emit=function(e){var t=this._callbacks[e];if(t&&t.length){var r=n.call(arguments,1);t.forEach(function(e){e.apply(null,r)})}},e.exports=r},function(e,t){e.exports=function(e,t){var r;return t="number"==typeof t?t:250,function(){"number"==typeof r&&window.clearTimeout(r);var n=arguments;r=window.setTimeout(function(){e.apply(null,n)},t)}}},function(e,t){var r=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=1;t<arguments.length;t+=1){var n=arguments[t];if(n&&"object"==typeof n)for(var o in n)r.call(n,o)&&(e[o]=n[o])}return e}}]))});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Datagrid=t():e.Datagrid=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var r=t.slice(1),n=e[t[0]];return function(e,t,o){n.apply(this,[e,t,o].concat(r))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,r){e.exports=r(11),e.exports.Selection=r(15),e.exports.Paging=r(14),e.exports.Sorting=r(16),e.exports.ColumnMove=r(12),e.exports.ColumnFixed=r(13)},function(e,t){e.exports=function(e,t,r,n){return e.addEventListener(t,r,n),function(){e.removeEventListener(t,r,n)}}},function(e,t){e.exports=function(e,t,r){r||(r=document.body);var n=e.toUpperCase(),o=t,i=null;do if(o.tagName===n){i=o;break}while(o!==r&&(o=o.parentElement));return i}},function(e,t){},3,3,3,3,3,function(e,t){e.exports='<div class=grid-wrapper> <div class=grid-columns-wrapper> <table class=grid-columns> <colgroup></colgroup> <thead></thead> </table> </div> <div class=grid-body-wrapper> <table class=grid-body> <colgroup></colgroup> <tbody></tbody> </table> </div> </div> <div class="grid-no-data hidden"> <div class=no-data-content> 暂无数据 </div> </div> '},function(e,t){e.exports="<div class=grid-pager> <div>显示第 {{start}} - {{end}} 条数据, 共 {{total}} 条数据</div> <div> <span data-jump=first>首页</span> <span data-jump=prev>上一页</span> <span>第 <input type=text data-page value={{cur}}> 页, 共 {{totalPage}} 页</span> <span data-jump=next>下一页</span> <span data-jump=end>尾页</span> </div> </div> "},function(e,t,r){function n(e){return e.name}function o(e,t){return t[e.key]}function i(e,t){s.call(this);var r=this.el=document.createElement("div");this.options=u({},{height:e.offsetHeight},t),this.origin=e.parentElement.replaceChild(r,e),h.forEach(function(e){e(this)},this),this._init()}r(3);var a=r(9),s=r(17),c=r(1),u=r(19),l=r(2),d=r(18),p=100,f="data-grid",h=[];i.use=function(e){e(i)},i.hook=function(e){return h.push(e),function(){var t=h.indexOf(e);t>=0&&h.splice(t,1)}};var m=i.prototype=Object.create(s.prototype);m.constructor=i,m._init=function(){var e=this._unbindEvents=[];this.emit("beforeInit");var t=this.el;t.classList.add(f),t.innerHTML=a;var r={$gridWrapper:".grid-wrapper",$columnsWrapper:".grid-columns-wrapper",$columns:".grid-columns",$columnsColGroup:".grid-columns colgroup",$columnsThead:".grid-columns thead",$bodyWrapper:".grid-body-wrapper",$body:".grid-body",$bodyColGroup:".grid-body colgroup",$bodyTbody:".grid-body tbody",$noData:".grid-no-data"};for(var n in r)r[n]=t.querySelector(r[n]);r.$gridWrapper.style.height=this.options.height+"px";var o=this;e.push(c(r.$bodyWrapper,"scroll",function(){r.$columns.style.left="-"+r.$bodyWrapper.scrollLeft+"px"}),c(r.$bodyWrapper,"mouseover",function(e){var t=l("tr",e.target);if(t){var r=t.getAttribute("data-index");r&&o.trHover(!0,Number(r))}}),c(r.$bodyWrapper,"mouseout",function(e){var t=l("tr",e.target);if(t){var r=t.getAttribute("data-index");r&&o.trHover(!1,Number(r))}}),c(r.$bodyWrapper,"click",function(e){var t=l("td",e.target);if(t){var r=l("tr",t);if(r){var n=t.getAttribute("data-index"),i=r.getAttribute("data-index"),a=o.renderData;o.emit("cellClick",a.columnsDef[n],o.empty?null:a.rows[i])}}})),this.ui=r,this.options.fit&&e.push(c(window,"resize",d(function(){o.setWidth()}))),this.emit("afterInit")},m.trHover=function(e,t,r){var n=this.ui.$bodyTbody,o=n.querySelector('tr[data-index="'+t+'"]');o.classList[e?"add":"remove"]("hover"),r!==!1&&this.emit(e?"trHoverTo":"clearHover",t,o,this.rows&&this.rows[t])},m.setData=function(e){if(this.renderData={},this.emit("beforeSetData",e),this.empty=!(e.columns&&e.columns.length&&e.rows&&e.rows.length),this.empty){var t=this.ui;t.$body.classList.add("hidden"),t.$noData.classList.remove("hidden")}else this.setColumns(e.columns),this.setBody(e.rows),this.setWidth(e.width);this.emit("afterSetData",e)},m.normalizeWidth=function(e){var t=this.renderData,r=t.columnsDef;Array.isArray(e)||(e=[]);for(var n=[],o=0;o<r.length;o++)n[o]=e[o]||Math.max(15*(r[o].name||"").length,p);return n},m.setWidth=function(e){if(!this.empty){var t={width:e};this.emit("beforeSetWidth",t);var r=this.renderData,n=t.width;!n&&r.columnsMinWidth||(r.columnsMinWidth=this.normalizeWidth(n));var o,i=r.columnsMinWidth;if(this.options.fit){var a=i.reduce(function(e,t){return e+t}),s=this.ui.$bodyWrapper.clientWidth;if(a>=s)o=i;else{var c=(s-a)/r.columnsDef.length;o=i.map(function(e){return Math.round(e+c)})}}else o=i;r.columnsWidth=o;var u=this._colGroupsHTML(o);this._renderCols(u),this._resize(o)}},m._colGroupsHTML=function(e){return e?e.map(function(e){return'<col style="width:'+e+'px">'}):[]},m._renderCols=function(e){var t=this.ui;t.$columnsColGroup.innerHTML=t.$bodyColGroup.innerHTML=e.join("")},m._resize=function(e){var t=this.ui,r=t.$columns,n=t.$noData,o=t.$body,i=e.reduce(function(e,t){return e+t});r.style.width=o.style.width=i+"px",this.empty?n.classList.remove("hidden"):n.classList.add("hidden")},m.setColumns=function(e){var t=this.renderData.columnsDef=this._normalize(e),r=this._columnsHTML(t);this.emit("beforeRenderColumns",r),this._renderColumns(r)},m._normalize=function(e){return e.map(function(e){var t="string"==typeof e?{name:e}:e;return t.key||(t.key=t.name),t})},m._columnsHTML=function(e){var t=this.options.thRenderer;return e.map(function(e,r){var o;return e.thRenderer&&(o=e.thRenderer(e)),null==o&&(t&&(o=t(e)),null==o&&(o=n(e))),'<th data-index="'+r+'">'+o+"</th>"})},m._renderColumns=function(e){this.ui.$columnsThead.innerHTML=e.join("")},m.setBody=function(e){var t=this.renderData;this.empty=!e||!e.length,t.rows=e,this._renderBody(t.trsArr=this._bodyHTML(t.columnsDef,e))},m._bodyHTML=function(e,t){var r=this.options.tdRenderer;return this.empty?[]:t.map(function(t,n){var i='<tr data-index="'+n+'">';return e.forEach(function(e,n){var a;e.tdRenderer&&(a=e.tdRenderer(e,t)),null==a&&(r&&(a=r(e,t)),null==a&&(a=o(e,t))),i+='<td data-index="'+n+'">'+a+"</td>"}),i+="</tr>"})},m._renderBody=function(e){var t=this.ui;t.$bodyTbody.innerHTML=e.join(""),t.$body.classList.remove("hidden"),t.$noData.classList.add("hidden")},m.destroy=function(){this.emit("beforeDestroy"),this._unbindEvents.forEach(function(e){e()});var e=this.el;try{e.parentElement.replaceChild(this.origin,e)}catch(e){}this.emit("afterDestroy")},e.exports=i},function(e,t,r){r(4);var n=r(1),o=r(2),i=100,a=Array.prototype.indexOf,s="ontouchstart"in window,c=s?"touchstart":"mousedown",u=s?"touchmove":"mousemove",l=s?"touchend":"mouseup",d=s?function(e){return e.pageX||e.changedTouches[0].pageX}:function(e){return e.pageX};e.exports=function(e){e.hook(function(e){function t(t){var n=e.ui,o=n.$columnsWrapper,i=n.$bodyWrapper;r.style.height=o.offsetHeight+i.offsetHeight+"px",v=t.offsetLeft+t.clientWidth-i.scrollLeft,r.style.left=v+1+"px",document.documentElement.classList.add("data-grid-dragging")}if(e.options.columnResize){var r=document.createElement("div");r.classList.add("dragging-line");var p=[];e.once("afterInit",function(){e.ui.$draggingLine=r,e.el.appendChild(r)});var f,h,m,v,g,y=!1;s||p.push(n(e.el,"mouseover",function(r){if(r.target.classList.contains("drag-lever")){var n=o("th",r.target,e.el);n&&t(n)}}),n(e.el,"mouseout",function(e){e.target.classList.contains("drag-lever")&&!y&&document.documentElement.classList.remove("data-grid-dragging")})),p.push(e.on("beforeRenderColumns",function(e){e.forEach(function(t,r){e[r]=t.replace("</th>",'<span class="drag-lever"></span></th>')})}),n(e.el,c,function(r){if(r.target.classList.contains("drag-lever")&&(s||0===r.button)){var n=o("th",r.target,e.el);if(!n)return;s&&t(n),n.classList.add("resizing"),g=-(n.clientWidth-i),f=n,y=!0,m=d(r),h=a.call(n.parentElement.children,n)}}),n(document,u,function(e){if(y){e.preventDefault();var t=d(e)-m;t>g&&(r.style.left=v+(d(e)-m)+"px")}}),n(document,l,function(t){if(y){setTimeout(function(){f.classList.remove("resizing")},0),document.documentElement.classList.remove("data-grid-dragging"),y=!1;var r=d(t)-m;r<g&&(r=g);var n=e.renderData.columnsMinWidth;n[h]=n[h]+r,e.setWidth(n)}})),e.once("beforeDestroy",function(){p.forEach(function(e){e()})})}})}},function(e,t,r){r(5);var n=Array.prototype.slice,o=r(1);e.exports=function(e){e.hook(function(t){function r(){function r(e,r){var n=i.el.contains(r)?t:i;n.trHover(!0,e,!1)}function n(e,r){var n=i.el.contains(r)?t:i;n.trHover(!1,e,!1)}var c=document.createElement("div");c.classList.add("fixed-datagrid");var u=document.createElement("div");u.classList.add("hidden"),c.appendChild(u),t.el.appendChild(c),i=new e(u,{height:t.ui.$columnsWrapper.offsetHeight+t.ui.$bodyWrapper.offsetHeight,columnSorting:t.options.columnSorting,columnResize:t.options.columnResize,selection:t.options.selection});var l,d,p=!1,f=!1;s.push(o(t.ui.$bodyWrapper,"scroll",function(){f||(p=!0,l&&clearTimeout(l),l=setTimeout(function(){p=!1},250),i.ui.$bodyWrapper.scrollTop=this.scrollTop)}),o(i.ui.$bodyWrapper,"scroll",function(){p||(f=!0,d&&clearTimeout(d),d=setTimeout(function(){f=!1},250),t.ui.$bodyWrapper.scrollTop=this.scrollTop)})),s.push(t.on("trHoverTo",r),i.on("trHoverTo",r),t.on("clearHover",n),i.on("clearHover",n)),t.options.selection&&(t.on("selectedChanged",function(e){i.selectRow(e,!1)}),i.on("selectedChanged",function(e){t.selectRow(e)})),t.options.columnSorting&&(i.on("sort",function(e,r,n){t.sortBy(n)}),t.on("sort",function(e,t,r){if(!(r<a)){var n=i.sort&&i.sort.index;if("number"==typeof n){i.sort.direction=0;var o=i.ui.$columnsWrapper.querySelector('th[data-index="'+n+'"]');o&&o.classList.remove("order-by-asc","order-by-desc")}}}))}if(t.options.fixedColumns){var i,a,s=[];t.on("afterSetData",function(e){if(a=e.fixedColumnsLeft,!a)return void(i&&i.el.classList.add("hidden"));i||r(t.el),i.el.classList.remove("hidden"),i.setData({columns:t.renderData.columnsDef.slice(0,a),width:t.renderData.columnsWidth.slice(0,a),rows:t.renderData.rows});var o=n.call(i.ui.$columnsWrapper.querySelectorAll("tr")).concat(n.call(i.ui.$bodyWrapper.querySelectorAll("tr"))),s=n.call(t.ui.$columnsWrapper.querySelectorAll("tr")).concat(n.call(t.ui.$bodyWrapper.querySelectorAll("tr")));o.forEach(function(e,t){var r=s[t];e.clientHeight!==r.clientHeight&&(e.style.height=r.clientHeight+"px")})}),t.once("beforeDestroy",function(){s.forEach(function(e){e()})})}})}},function(e,t,r){r(6);var n=r(10),o=r(1);e.exports=function(e){e.hook(function(e){function t(t){return Number.isNaN(t)||t<1||t>i.totalPage?void(s.querySelector("[data-page]").value=i.cur):(s.querySelector("[data-page]").value=i.cur=t,void e.emit("switchPage",t))}if(e.options.pagination){var r=e.options.pagingTemplate||n,i=e.pager={cur:1,total:null,size:null,start:null,end:null,totalPage:null},a=[],s=document.createElement("div");s.classList.add("grid-pager-wrapper"),a.push(o(s,"click",function(e){var r=e.target.dataset.jump;if(r){var n;switch(r){case"first":n=1;break;case"end":n=i.totalPage;break;case"prev":n=i.cur-1;break;case"next":n=i.cur+1;break;default:return}t(n)}}),o(s,"keydown",function(e){13===e.keyCode&&void 0!==e.target.dataset.page&&t(Number(e.target.value))}),e.on("beforeSetData",function(e){if(!e.rows||!e.rows.length)return void s.classList.add("hidden");var t=e.size||0,n=e.total||0,o=i.cur,a=e.rows.length;i.total=n,i.size=t,i.start=(o-1)*t+1,i.end=i.start+a-1,i.total=n,i.totalPage=Math.ceil(n/t)||0,s.innerHTML=r.replace(/\{\{(\w+)\}\}/g,function(e,t){return i.hasOwnProperty(t)?i[t]:e}),s.classList.remove("hidden")})),e.once("afterInit",function(){e.ui.$gridWrapper.appendChild(s),e.ui.$pagerWrapper=s}),e.once("beforeDestroy",function(){a.forEach(function(e){e()})})}})}},function(e,t,r){r(7);var n=r(2),o=r(1),i="selected";e.exports=function(e){e.prototype.selectRow=function(e,t){var r=this.ui.$body,n=r.querySelector('tr[data-index="'+e+'"]');if(n){var o=this._selectRowsIndex.indexOf(e);if(this._isMultipleSelect)o>=0?this._selectRowsIndex.splice(o,1):this._selectRowsIndex.push(e);else{if(o>=0)return;var a=r.querySelector("tr."+i);a&&a.classList.remove(i),n.classList.add("selected"),this._selectRowsIndex=[e]}t!==!1&&this.emit("selectedChanged",this._isMultipleSelect?this._selectRowsIndex:e)}},e.prototype.selectAll=function(e,t){if(this._isMultipleSelect){this._selectRowsIndex=[];var r=this;Array.prototype.forEach.call(this.ui.$bodyWrapper.querySelectorAll("tr[data-index]"),function(t){if(e){var n=Number(t.getAttribute("data-index"));r._selectRowsIndex.push(n)}t.querySelector("input[type=checkbox]").checked=e}),t!==!1&&this.emit("selectedChanged",this._selectRowsIndex)}},e.hook(function(e){var t=e.options.selection;if(t){var r=e._isMultipleSelect="multiple"===t,i=[];i.push(e.on("beforeSetData",function(){e._selectRowsIndex=[]})),r&&i.push(e.on("beforeSetData",function(e){e.columns.unshift({sortable:!1,thRenderer:function(){return'<input type="checkbox" class="select-all">'},tdRenderer:function(){return'<input type="checkbox">'}})})),e.once("afterInit",function(){var t=e.ui.$bodyWrapper,a=e.ui.$columnsWrapper;r?(i.push(o(t,"change",function(r){if("INPUT"===r.target.tagName&&"checkbox"===r.target.type){a.querySelector("input.select-all").checked=!1;var o=n("tr",r.target,t);if(o){var i=Number(o.getAttribute("data-index"));Number.isNaN(i)||e.selectRow(i),a.querySelector("input[type=checkbox].select-all").checked=!e.empty&&e._selectRowsIndex.length===e.renderData.rows.length}}})),i.push(o(a,"change",function(t){var r=t.target;"INPUT"===r.tagName&&"checkbox"===r.type&&r.classList.contains("select-all")&&e.selectAll(r.checked)}))):i.push(o(t,"click",function(r){var o=n("tr",r.target,t);if(o){var i=Number(o.getAttribute("data-index"));Number.isNaN(i)||e.selectRow(i)}}))}),e.once("beforeDestroy",function(){i.forEach(function(e){e()})})}})}},function(e,t,r){r(8);var n=r(2),o=r(1),i=-1,a=1,s=0,c="order-by-asc",u="order-by-desc";e.exports=function(e){e.prototype.sortBy=function(e,t){var r=this.renderData.columnsDef[e];if(r&&r.sortable!==!1){var n=this.sort||(this.sort={}),o=this.ui.$columnsWrapper,l=n.index;if(e!==l){if("number"==typeof l){var d=o.querySelector('th[data-index="'+l+'"]');d&&d.classList.remove(c,u)}n.index=e,n.direction=s}var p=o.querySelector('th[data-index="'+e+'"]');switch(p.classList.remove(c,u),n.direction){case s:n.direction=a,p.classList.add(c);break;case a:n.direction=i,p.classList.add(u);break;case i:n.direction=s}t!==!1&&this.emit("sort",r,n.direction,e,p)}},e.hook(function(e){if(e.options.columnSorting){var t=[];t.push(e.on("beforeRenderColumns",function(e){e.forEach(function(t,r){e[r]=t.replace("</th>",'<span class="order-ico"></span></th>')})})),e.once("afterInit",function(){var r=e.ui.$columnsWrapper;t.push(o(r,"click",function(t){var o=n("th",t.target,r);if(o&&!o.classList.contains("resizing")){var i=Number(o.getAttribute("data-index"));window.isNaN(i)||e.sortBy(i)}}),e.on("afterSetData",function(){var t=e.sort&&e.sort.index;if(!("number"!=typeof t||t<0)){var r=e.ui.$columnsWrapper.querySelector('th[data-index="'+t+'"]');if(r)switch(e.sort.direction){case a:r.classList.add(c);break;case i:r.classList.add(u)}}}))}),e.once("beforeDestroy",function(){t.forEach(function(e){e()})})}})}},function(e,t){function r(){this._callbacks={}}var n=Array.prototype.slice,o=r.prototype;o.on=function(e,t){var r=this._callbacks,n=r[e]||(r[e]=[]);return n.push(t),function(){var e=n.indexOf(t);e>=0&&n.splice(e,1)}},o.once=function(e,t){var r=this.on(e,function(){t.apply(null,arguments),window.setTimeout(r,0)});return r},o.emit=function(e){var t=this._callbacks[e];if(t&&t.length){var r=n.call(arguments,1);t.forEach(function(e){e.apply(null,r)})}},e.exports=r},function(e,t){e.exports=function(e,t){var r;return t="number"==typeof t?t:250,function(){"number"==typeof r&&window.clearTimeout(r);var n=arguments;r=window.setTimeout(function(){e.apply(null,n)},t)}}},function(e,t){var r=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=1;t<arguments.length;t+=1){var n=arguments[t];if(n&&"object"==typeof n)for(var o in n)r.call(n,o)&&(e[o]=n[o])}return e}}]))});
{
"name": "datagrid",
"version": "0.3.4",
"version": "0.3.5",
"description": "Datagrid.",

@@ -21,3 +21,4 @@ "main": "./src/index.js",

"build": "webpack --config build/webpack.dev.config.js && webpack --config build/webpack.build.config.js",
"lint": "eslint --ignore-pattern '/dist/' \"**/*.{js,vue}\""
"lint": "eslint --ignore-pattern '/dist/' \"**/*.{js,vue}\"",
"pub": "npm run lint && npm build && npm publish"
},

@@ -24,0 +25,0 @@ "dependencies": {

@@ -14,2 +14,8 @@ require('./index.scss')

var getPageX = IS_TOUCH ? function (e) {
return e.pageX || e.changedTouches[0].pageX
} : function (e) {
return e.pageX
}
module.exports = function (DataGrid) {

@@ -32,3 +38,2 @@ DataGrid.hook(function (datagrid) {

var dragging = false // 是否正在拖动中
var draggingLever // 被拖动的那个小方块
var draggingTH // 被拖动的 th 元素

@@ -40,2 +45,30 @@ var draggingColumnIndex // 被拖动的元素是第几个字段

function showDragLine (th) {
// 显示虚线
var ui = datagrid.ui
var $columnsWrapper = ui.$columnsWrapper
var $bodyWrapper = ui.$bodyWrapper
dragLine.style.height = $columnsWrapper.offsetHeight + $bodyWrapper.offsetHeight + 'px'
draggingLineInitLeft = th.offsetLeft + th.clientWidth - $bodyWrapper.scrollLeft
dragLine.style.left = draggingLineInitLeft + 1 + 'px'
document.documentElement.classList.add('data-grid-dragging')
}
// 在非触摸屏设备上,鼠标移上去的时候就显示拖拽虚线
if (!IS_TOUCH) {
unbindEvents.push(
addEvent(datagrid.el, 'mouseover', function (e) {
if (!e.target.classList.contains('drag-lever')) return
var th = findParent('th', e.target, datagrid.el)
if (!th) return
showDragLine(th)
}),
addEvent(datagrid.el, 'mouseout', function (e) {
if (!e.target.classList.contains('drag-lever') || dragging) return
document.documentElement.classList.remove('data-grid-dragging')
})
)
}
unbindEvents.push(

@@ -49,27 +82,15 @@ // 注入供用户拖拽的小方块

addEvent(datagrid.el, MOUSEDOWN, function (e) {
if (e.target.classList.contains('drag-lever') && e.button === 0) {
if (e.target.classList.contains('drag-lever') && (IS_TOUCH || e.button === 0)) {
var th = findParent('th', e.target, datagrid.el)
if (!th) return
if (IS_TOUCH) showDragLine(th)
// 给 th 加一个状态, 避免触发排序功能
// todo 需要一个临时关闭排序的开关
th.classList.add('resizing')
minLeft = -(th.clientWidth - MIN_WIDTH)
draggingTH = th
minLeft = -(th.clientWidth - MIN_WIDTH)
var ui = datagrid.ui
var $columnsWrapper = ui.$columnsWrapper
var $bodyWrapper = ui.$bodyWrapper
// 显示虚线
dragLine.style.height = $columnsWrapper.offsetHeight + $bodyWrapper.offsetHeight + 'px'
draggingLineInitLeft = th.offsetLeft + th.clientWidth - $bodyWrapper.scrollLeft
dragLine.style.left = draggingLineInitLeft + 'px'
dragLine.classList.add('show')
dragging = true
draggingLever = e.target
draggingLever.classList.add('dragging')
startX = e.pageX
startX = getPageX(e)
draggingColumnIndex = indexOf.call(th.parentElement.children, th)

@@ -82,5 +103,5 @@ }

// 调整虚线的 left 值
var moved = e.pageX - startX
var moved = getPageX(e) - startX
if (moved > minLeft) {
dragLine.style.left = draggingLineInitLeft + (e.pageX - startX) + 'px'
dragLine.style.left = draggingLineInitLeft + (getPageX(e) - startX) + 'px'
}

@@ -92,6 +113,5 @@ }),

setTimeout(function () { draggingTH.classList.remove('resizing') }, 0)
dragLine.classList.remove('show')
document.documentElement.classList.remove('data-grid-dragging')
dragging = false
draggingLever.classList.remove('dragging')
var moved = e.pageX - startX // 计算移动的距离
var moved = getPageX(e) - startX // 计算移动的距离
if (moved < minLeft) moved = minLeft

@@ -98,0 +118,0 @@ var columnsMinWidth = datagrid.renderData.columnsMinWidth

@@ -54,5 +54,2 @@ require('./index.scss')

var lastSortColumnIndex
var sortType = NONE_ORDER
unbindEvents.push(

@@ -59,0 +56,0 @@ // 给每个字段内部注入小箭头

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc