bi-eleme 2.0.13 → 2.1.1

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.
@@ -13218,12 +13218,20 @@ var convertToRows = function convertToRows(originColumns) {
13218
13218
  if (isGroup) this.$parent.isGroup = true;
13219
13219
  return h(
13220
13220
  'table',
13221
- { 'class': 'el-table__header', attrs: { cellspacing: '0', cellpadding: '0', border: '0' }
13221
+ {
13222
+ 'class': 'el-table__header',
13223
+ attrs: { cellspacing: '0',
13224
+ cellpadding: '0',
13225
+ border: '0'
13226
+ }
13222
13227
  },
13223
13228
  [h('colgroup', [this.columns.map(function (column) {
13224
13229
  return h('col', {
13225
- attrs: { name: column.id },
13226
- key: column.id });
13230
+ attrs: {
13231
+ name: column.id
13232
+ },
13233
+ key: column.id
13234
+ });
13227
13235
  }), this.hasGutter ? h('col', {
13228
13236
  attrs: { name: 'gutter' }
13229
13237
  }) : '']), h(
@@ -13232,12 +13240,18 @@ var convertToRows = function convertToRows(originColumns) {
13232
13240
  [this._l(columnRows, function (columns, rowIndex) {
13233
13241
  return h(
13234
13242
  'tr',
13235
- { style: _this.getHeaderRowStyle(rowIndex), 'class': _this.getHeaderRowClass(rowIndex) },
13243
+ {
13244
+ style: _this.getHeaderRowStyle(rowIndex),
13245
+ 'class': _this.getHeaderRowClass(rowIndex)
13246
+ },
13236
13247
  [columns.map(function (column, cellIndex) {
13237
13248
  return h(
13238
13249
  'th',
13239
13250
  {
13240
- attrs: { colspan: column.colSpan, rowspan: column.rowSpan },
13251
+ attrs: {
13252
+ colspan: column.colSpan,
13253
+ rowspan: column.rowSpan
13254
+ },
13241
13255
  on: {
13242
13256
  'mousemove': function mousemove($event) {
13243
13257
  return _this.handleMouseMove($event, column);
@@ -13249,28 +13263,41 @@ var convertToRows = function convertToRows(originColumns) {
13249
13263
  'click': function click($event) {
13250
13264
  return _this.handleHeaderClick($event, column);
13251
13265
  },
13266
+ 'dblclick': function dblclick($event) {
13267
+ return _this.handleHeaderDblclick($event, column);
13268
+ },
13252
13269
  'contextmenu': function contextmenu($event) {
13253
13270
  return _this.handleHeaderContextMenu($event, column);
13254
13271
  }
13255
13272
  },
13256
- style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column), 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column), key: column.id },
13273
+
13274
+ style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column),
13275
+ 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column),
13276
+ key: column.id
13277
+ },
13257
13278
  [h(
13258
13279
  'div',
13259
13280
  { 'class': ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] },
13260
13281
  [column.renderHeader ? column.renderHeader.call(_this._renderProxy, h, { column: column, $index: cellIndex, store: _this.store, _self: _this.$parent.$vnode.context }) : column.label, column.sortable ? h(
13261
13282
  'span',
13262
- { 'class': 'caret-wrapper', on: {
13283
+ {
13284
+ 'class': 'caret-wrapper',
13285
+ on: {
13263
13286
  'click': function click($event) {
13264
13287
  return _this.handleSortClick($event, column);
13265
13288
  }
13266
13289
  }
13267
13290
  },
13268
- [h('i', { 'class': 'sort-caret ascending', on: {
13291
+ [h('i', {
13292
+ 'class': 'sort-caret ascending',
13293
+ on: {
13269
13294
  'click': function click($event) {
13270
13295
  return _this.handleSortClick($event, column, 'ascending');
13271
13296
  }
13272
13297
  }
13273
- }), h('i', { 'class': 'sort-caret descending', on: {
13298
+ }), h('i', {
13299
+ 'class': 'sort-caret descending',
13300
+ on: {
13274
13301
  'click': function click($event) {
13275
13302
  return _this.handleSortClick($event, column, 'descending');
13276
13303
  }
@@ -13278,7 +13305,9 @@ var convertToRows = function convertToRows(originColumns) {
13278
13305
  })]
13279
13306
  ) : '', column.filterable ? h(
13280
13307
  'span',
13281
- { 'class': 'el-table__column-filter-trigger', on: {
13308
+ {
13309
+ 'class': 'el-table__column-filter-trigger',
13310
+ on: {
13282
13311
  'click': function click($event) {
13283
13312
  return _this.handleFilterClick($event, column);
13284
13313
  }
@@ -13478,19 +13507,28 @@ var convertToRows = function convertToRows(originColumns) {
13478
13507
  }, 16);
13479
13508
  },
13480
13509
  handleHeaderClick: function handleHeaderClick(event, column) {
13481
- if (!column.filters && column.sortable) {
13482
- this.handleSortClick(event, column);
13483
- } else if (column.filterable && !column.sortable) {
13484
- this.handleFilterClick(event, column);
13485
- }
13510
+ var _this3 = this;
13486
13511
 
13487
- this.$parent.$emit('header-click', column, event);
13512
+ clearTimeout(this.clickTimer);
13513
+ this.clickTimer = setTimeout(function () {
13514
+ if (!column.filters && column.sortable) {
13515
+ _this3.handleSortClick(event, column);
13516
+ } else if (column.filterable && !column.sortable) {
13517
+ _this3.handleFilterClick(event, column);
13518
+ }
13519
+ _this3.$parent.$emit('header-click', column, event);
13520
+ }, 400);
13521
+ },
13522
+ handleHeaderDblclick: function handleHeaderDblclick(event, column) {
13523
+ // event.stopPropagation()
13524
+ clearTimeout(this.clickTimer);
13525
+ this.$parent.$emit('header-dblclick', column, event);
13488
13526
  },
13489
13527
  handleHeaderContextMenu: function handleHeaderContextMenu(event, column) {
13490
13528
  this.$parent.$emit('header-contextmenu', column, event);
13491
13529
  },
13492
13530
  handleMouseDown: function handleMouseDown(event, column) {
13493
- var _this3 = this;
13531
+ var _this4 = this;
13494
13532
 
13495
13533
  if (this.$isServer) return;
13496
13534
  if (column.children && column.children.length > 0) return;
@@ -13527,15 +13565,15 @@ var convertToRows = function convertToRows(originColumns) {
13527
13565
  };
13528
13566
 
13529
13567
  var handleMouseMove = function handleMouseMove(event) {
13530
- var deltaLeft = event.clientX - _this3.dragState.startMouseLeft;
13531
- var proxyLeft = _this3.dragState.startLeft + deltaLeft;
13568
+ var deltaLeft = event.clientX - _this4.dragState.startMouseLeft;
13569
+ var proxyLeft = _this4.dragState.startLeft + deltaLeft;
13532
13570
 
13533
13571
  resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
13534
13572
  };
13535
13573
 
13536
13574
  var handleMouseUp = function handleMouseUp() {
13537
- if (_this3.dragging) {
13538
- var _dragState = _this3.dragState,
13575
+ if (_this4.dragging) {
13576
+ var _dragState = _this4.dragState,
13539
13577
  startColumnLeft = _dragState.startColumnLeft,
13540
13578
  startLeft = _dragState.startLeft;
13541
13579
 
@@ -13544,12 +13582,12 @@ var convertToRows = function convertToRows(originColumns) {
13544
13582
  column.width = column.realWidth = columnWidth;
13545
13583
  table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
13546
13584
 
13547
- _this3.store.scheduleLayout();
13585
+ _this4.store.scheduleLayout();
13548
13586
 
13549
13587
  document.body.style.cursor = '';
13550
- _this3.dragging = false;
13551
- _this3.draggingColumn = null;
13552
- _this3.dragState = {};
13588
+ _this4.dragging = false;
13589
+ _this4.draggingColumn = null;
13590
+ _this4.dragState = {};
13553
13591
 
13554
13592
  table.resizeProxyVisible = false;
13555
13593
  }
@@ -13656,7 +13694,8 @@ var convertToRows = function convertToRows(originColumns) {
13656
13694
  return {
13657
13695
  draggingColumn: null,
13658
13696
  dragging: false,
13659
- dragState: {}
13697
+ dragState: {},
13698
+ clickTimer: null
13660
13699
  };
13661
13700
  }
13662
13701
  });
@@ -44453,7 +44492,7 @@ if (typeof window !== 'undefined' && window.Vue) {
44453
44492
  }
44454
44493
 
44455
44494
  /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
44456
- version: '2.0.13',
44495
+ version: '2.1.1',
44457
44496
  locale: lib_locale_default.a.use,
44458
44497
  i18n: lib_locale_default.a.i18n,
44459
44498
  install: src_install,