jquery.dgtable 0.5.54 → 0.5.57

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jquery.dgtable 0.5.54
2
+ * jquery.dgtable 0.5.57
3
3
  * git://github.com/danielgindi/jquery.dgtable.git
4
4
  */
5
5
  'use strict';
@@ -31,7 +31,7 @@ var global$o =
31
31
 
32
32
  var objectGetOwnPropertyDescriptor = {};
33
33
 
34
- var fails$8 = function (exec) {
34
+ var fails$9 = function (exec) {
35
35
  try {
36
36
  return !!exec();
37
37
  } catch (error) {
@@ -39,17 +39,27 @@ var fails$8 = function (exec) {
39
39
  }
40
40
  };
41
41
 
42
- var fails$7 = fails$8;
42
+ var fails$8 = fails$9;
43
43
 
44
44
  // Detect IE8's incomplete defineProperty implementation
45
- var descriptors = !fails$7(function () {
45
+ var descriptors = !fails$8(function () {
46
46
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
47
47
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
48
48
  });
49
49
 
50
+ var fails$7 = fails$9;
51
+
52
+ var functionBindNative = !fails$7(function () {
53
+ var test = (function () { /* empty */ }).bind();
54
+ // eslint-disable-next-line no-prototype-builtins -- safe
55
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
56
+ });
57
+
58
+ var NATIVE_BIND$1 = functionBindNative;
59
+
50
60
  var call$4 = Function.prototype.call;
51
61
 
52
- var functionCall = call$4.bind ? call$4.bind(call$4) : function () {
62
+ var functionCall = NATIVE_BIND$1 ? call$4.bind(call$4) : function () {
53
63
  return call$4.apply(call$4, arguments);
54
64
  };
55
65
 
@@ -78,12 +88,14 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
78
88
  };
79
89
  };
80
90
 
91
+ var NATIVE_BIND = functionBindNative;
92
+
81
93
  var FunctionPrototype$1 = Function.prototype;
82
94
  var bind = FunctionPrototype$1.bind;
83
95
  var call$3 = FunctionPrototype$1.call;
84
- var uncurryThis$a = bind && bind.bind(call$3, call$3);
96
+ var uncurryThis$a = NATIVE_BIND && bind.bind(call$3, call$3);
85
97
 
86
- var functionUncurryThis = bind ? function (fn) {
98
+ var functionUncurryThis = NATIVE_BIND ? function (fn) {
87
99
  return fn && uncurryThis$a(fn);
88
100
  } : function (fn) {
89
101
  return fn && function () {
@@ -102,7 +114,7 @@ var classofRaw$1 = function (it) {
102
114
 
103
115
  var global$n = global$o;
104
116
  var uncurryThis$8 = functionUncurryThis;
105
- var fails$6 = fails$8;
117
+ var fails$6 = fails$9;
106
118
  var classof$2 = classofRaw$1;
107
119
 
108
120
  var Object$4 = global$n.Object;
@@ -198,7 +210,7 @@ var engineV8Version = version;
198
210
  /* eslint-disable es/no-symbol -- required for testing */
199
211
 
200
212
  var V8_VERSION = engineV8Version;
201
- var fails$5 = fails$8;
213
+ var fails$5 = fails$9;
202
214
 
203
215
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
204
216
  var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
@@ -311,9 +323,11 @@ var store$2 = sharedStore;
311
323
  (shared$3.exports = function (key, value) {
312
324
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
313
325
  })('versions', []).push({
314
- version: '3.20.2',
326
+ version: '3.21.1',
315
327
  mode: 'global',
316
- copyright: '© 2022 Denis Pushkarev (zloirock.ru)'
328
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
329
+ license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
330
+ source: 'https://github.com/zloirock/core-js'
317
331
  });
318
332
 
319
333
  var global$d = global$o;
@@ -422,10 +436,10 @@ var documentCreateElement = function (it) {
422
436
  };
423
437
 
424
438
  var DESCRIPTORS$5 = descriptors;
425
- var fails$4 = fails$8;
439
+ var fails$4 = fails$9;
426
440
  var createElement$1 = documentCreateElement;
427
441
 
428
- // Thank's IE8 for his funny defineProperty
442
+ // Thanks to IE8 for its funny defineProperty
429
443
  var ie8DomDefine = !DESCRIPTORS$5 && !fails$4(function () {
430
444
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
431
445
  return Object.defineProperty(createElement$1('div'), 'a', {
@@ -459,7 +473,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor$1 :
459
473
  var objectDefineProperty = {};
460
474
 
461
475
  var DESCRIPTORS$3 = descriptors;
462
- var fails$3 = fails$8;
476
+ var fails$3 = fails$9;
463
477
 
464
478
  // V8 ~ Chrome 36-
465
479
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
@@ -868,7 +882,7 @@ var copyConstructorProperties$1 = function (target, source, exceptions) {
868
882
  }
869
883
  };
870
884
 
871
- var fails$2 = fails$8;
885
+ var fails$2 = fails$9;
872
886
  var isCallable$1 = isCallable$a;
873
887
 
874
888
  var replacement = /#|\.prototype\./;
@@ -1070,13 +1084,13 @@ var merge = function (array, left, right, comparefn) {
1070
1084
 
1071
1085
  var arraySort = mergeSort;
1072
1086
 
1073
- var fails$1 = fails$8;
1087
+ var fails$1 = fails$9;
1074
1088
 
1075
1089
  var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1076
1090
  var method = [][METHOD_NAME];
1077
1091
  return !!method && fails$1(function () {
1078
- // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
1079
- method.call(null, argument || function () { throw 1; }, 1);
1092
+ // eslint-disable-next-line no-useless-call -- required for testing
1093
+ method.call(null, argument || function () { return 1; }, 1);
1080
1094
  });
1081
1095
  };
1082
1096
 
@@ -1102,7 +1116,7 @@ var aCallable = aCallable$2;
1102
1116
  var toObject = toObject$2;
1103
1117
  var lengthOfArrayLike = lengthOfArrayLike$3;
1104
1118
  var toString = toString$1;
1105
- var fails = fails$8;
1119
+ var fails = fails$9;
1106
1120
  var internalSort = arraySort;
1107
1121
  var arrayMethodIsStrict = arrayMethodIsStrict$1;
1108
1122
  var FF = engineFfVersion;
@@ -2488,8 +2502,7 @@ DGTable.prototype.renderRows = function (first, last) {
2488
2502
  isVirtual = o.virtualTable,
2489
2503
  virtualRowHeightFirst = p.virtualRowHeightFirst,
2490
2504
  virtualRowHeight = p.virtualRowHeight,
2491
- top,
2492
- physicalRowIndex;
2505
+ top;
2493
2506
 
2494
2507
  let colCount = visibleColumns.length;
2495
2508
  for (let colIndex = 0, column; colIndex < colCount; colIndex++) {
@@ -2509,7 +2522,7 @@ DGTable.prototype.renderRows = function (first, last) {
2509
2522
  i++) {
2510
2523
 
2511
2524
  let rowData = rows[i];
2512
- physicalRowIndex = isDataFiltered ? rowData['__i'] : i;
2525
+ let physicalRowIndex = isDataFiltered ? rowData['__i'] : i;
2513
2526
 
2514
2527
  let row = createElement('div');
2515
2528
  row.className = rowClassName;
@@ -2554,8 +2567,9 @@ DGTable.prototype.renderRows = function (first, last) {
2554
2567
 
2555
2568
  this.trigger('rowcreate', i, physicalRowIndex, row, rowData);
2556
2569
 
2570
+ let rowIndex = i;
2557
2571
  row.addEventListener('click', (event) => {
2558
- this.trigger('rowclick', event, i, physicalRowIndex, row, rowData);
2572
+ this.trigger('rowclick', event, rowIndex, physicalRowIndex, row, rowData);
2559
2573
  });
2560
2574
  }
2561
2575
 
@@ -5450,6 +5464,7 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5450
5464
  p.abortCellPreview = false;
5451
5465
 
5452
5466
  let $el = $(el),$elInner = $(elInner);
5467
+ const rowNode = el.parentNode;
5453
5468
  let previewCell = createElement('div'),$previewCell = $(previewCell);
5454
5469
  previewCell.innerHTML = el.innerHTML;
5455
5470
  previewCell.className = o.cellPreviewClassName;
@@ -5523,13 +5538,13 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5523
5538
  'z-index': '-1',
5524
5539
  'left': '0',
5525
5540
  'top': '0',
5526
- 'cursor': 'default' };
5541
+ 'cursor': $el.css('cursor') };
5527
5542
 
5528
5543
 
5529
5544
  if (css) {
5530
5545
  let bgColor = $(el).css('background-color');
5531
5546
  if (bgColor === p.transparentBgColor1 || bgColor === p.transparentBgColor2) {
5532
- bgColor = $(el.parentNode).css('background-color');
5547
+ bgColor = $(rowNode).css('background-color');
5533
5548
  }
5534
5549
  if (bgColor === p.transparentBgColor1 || bgColor === p.transparentBgColor2) {
5535
5550
  bgColor = '#fff';
@@ -5558,9 +5573,9 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5558
5573
 
5559
5574
  }
5560
5575
 
5561
- previewCell['rowIndex'] = el.parentNode['rowIndex'];
5562
- let physicalRowIndex = previewCell['physicalRowIndex'] = el.parentNode['physicalRowIndex'];
5563
- previewCell['columnName'] = p.visibleColumns[nativeIndexOf.call(el.parentNode.childNodes, el)].name;
5576
+ previewCell['rowIndex'] = rowNode['rowIndex'];
5577
+ let physicalRowIndex = previewCell['physicalRowIndex'] = rowNode['physicalRowIndex'];
5578
+ previewCell['columnName'] = p.visibleColumns[nativeIndexOf.call(rowNode.childNodes, el)].name;
5564
5579
 
5565
5580
  try {
5566
5581
  let selection = SelectionHelper.saveSelection(el);
@@ -5582,6 +5597,14 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5582
5597
  return;
5583
5598
  }
5584
5599
 
5600
+ if (physicalRowIndex != null) {
5601
+ previewCell.addEventListener('click', (event) => {
5602
+ this.trigger('rowclick', event,
5603
+ rowNode['rowIndex'], physicalRowIndex,
5604
+ rowNode, p.rows[physicalRowIndex]);
5605
+ });
5606
+ }
5607
+
5585
5608
  let $parent = this.$el;
5586
5609
  let $scrollParent = $parent[0] === window ? $(document) : $parent;
5587
5610