jquery.dgtable 0.5.55 → 0.5.58

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.55
2
+ * jquery.dgtable 0.5.58
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;
@@ -2126,7 +2140,10 @@ DGTable.prototype.off = function (eventName, callback) {
2126
2140
  };
2127
2141
 
2128
2142
  DGTable.prototype.trigger = function (eventName) {
2129
- let events = this.p.events;
2143
+ const p = this.p;
2144
+ if (!p) return;
2145
+
2146
+ let events = p.events;
2130
2147
 
2131
2148
  if (hasOwnProperty.call(events, eventName)) {
2132
2149
  let callbacks = events[eventName];
@@ -5450,6 +5467,7 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5450
5467
  p.abortCellPreview = false;
5451
5468
 
5452
5469
  let $el = $(el),$elInner = $(elInner);
5470
+ const rowNode = el.parentNode;
5453
5471
  let previewCell = createElement('div'),$previewCell = $(previewCell);
5454
5472
  previewCell.innerHTML = el.innerHTML;
5455
5473
  previewCell.className = o.cellPreviewClassName;
@@ -5523,13 +5541,13 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5523
5541
  'z-index': '-1',
5524
5542
  'left': '0',
5525
5543
  'top': '0',
5526
- 'cursor': 'default' };
5544
+ 'cursor': $el.css('cursor') };
5527
5545
 
5528
5546
 
5529
5547
  if (css) {
5530
5548
  let bgColor = $(el).css('background-color');
5531
5549
  if (bgColor === p.transparentBgColor1 || bgColor === p.transparentBgColor2) {
5532
- bgColor = $(el.parentNode).css('background-color');
5550
+ bgColor = $(rowNode).css('background-color');
5533
5551
  }
5534
5552
  if (bgColor === p.transparentBgColor1 || bgColor === p.transparentBgColor2) {
5535
5553
  bgColor = '#fff';
@@ -5558,9 +5576,9 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5558
5576
 
5559
5577
  }
5560
5578
 
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;
5579
+ previewCell['rowIndex'] = rowNode['rowIndex'];
5580
+ let physicalRowIndex = previewCell['physicalRowIndex'] = rowNode['physicalRowIndex'];
5581
+ previewCell['columnName'] = p.visibleColumns[nativeIndexOf.call(rowNode.childNodes, el)].name;
5564
5582
 
5565
5583
  try {
5566
5584
  let selection = SelectionHelper.saveSelection(el);
@@ -5582,6 +5600,14 @@ DGTable.prototype._cellMouseOverEvent = function (el) {
5582
5600
  return;
5583
5601
  }
5584
5602
 
5603
+ if (physicalRowIndex != null) {
5604
+ previewCell.addEventListener('click', (event) => {
5605
+ this.trigger('rowclick', event,
5606
+ rowNode['rowIndex'], physicalRowIndex,
5607
+ rowNode, p.rows[physicalRowIndex]);
5608
+ });
5609
+ }
5610
+
5585
5611
  let $parent = this.$el;
5586
5612
  let $scrollParent = $parent[0] === window ? $(document) : $parent;
5587
5613