@pdg/react-table 1.0.56 → 1.0.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.
package/dist/index.js CHANGED
@@ -62,39 +62,57 @@ function getDefaultExportFromCjs (x) {
62
62
 
63
63
  var hasOwn = {}.hasOwnProperty;
64
64
 
65
- function classNames() {
66
- var classes = [];
65
+ function classNames () {
66
+ var classes = '';
67
67
 
68
68
  for (var i = 0; i < arguments.length; i++) {
69
69
  var arg = arguments[i];
70
- if (!arg) continue;
71
-
72
- var argType = typeof arg;
73
-
74
- if (argType === 'string' || argType === 'number') {
75
- classes.push(arg);
76
- } else if (Array.isArray(arg)) {
77
- if (arg.length) {
78
- var inner = classNames.apply(null, arg);
79
- if (inner) {
80
- classes.push(inner);
81
- }
82
- }
83
- } else if (argType === 'object') {
84
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
85
- classes.push(arg.toString());
86
- continue;
87
- }
88
-
89
- for (var key in arg) {
90
- if (hasOwn.call(arg, key) && arg[key]) {
91
- classes.push(key);
92
- }
93
- }
70
+ if (arg) {
71
+ classes = appendClass(classes, parseValue(arg));
94
72
  }
95
73
  }
96
74
 
97
- return classes.join(' ');
75
+ return classes;
76
+ }
77
+
78
+ function parseValue (arg) {
79
+ if (typeof arg === 'string' || typeof arg === 'number') {
80
+ return arg;
81
+ }
82
+
83
+ if (typeof arg !== 'object') {
84
+ return '';
85
+ }
86
+
87
+ if (Array.isArray(arg)) {
88
+ return classNames.apply(null, arg);
89
+ }
90
+
91
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
92
+ return arg.toString();
93
+ }
94
+
95
+ var classes = '';
96
+
97
+ for (var key in arg) {
98
+ if (hasOwn.call(arg, key) && arg[key]) {
99
+ classes = appendClass(classes, key);
100
+ }
101
+ }
102
+
103
+ return classes;
104
+ }
105
+
106
+ function appendClass (value, newClass) {
107
+ if (!newClass) {
108
+ return value;
109
+ }
110
+
111
+ if (value) {
112
+ return value + ' ' + newClass;
113
+ }
114
+
115
+ return value + newClass;
98
116
  }
99
117
 
100
118
  if (module.exports) {
@@ -2246,16 +2264,18 @@ function throttle(func, wait, options) {
2246
2264
 
2247
2265
  var throttle_1 = throttle;
2248
2266
 
2249
- var throttle$1 = /*@__PURE__*/getDefaultExportFromCjs(throttle_1);/* global Reflect, Promise */
2267
+ var throttle$1 = /*@__PURE__*/getDefaultExportFromCjs(throttle_1);/* global Reflect, Promise, SuppressedError, Symbol */
2250
2268
 
2251
2269
  var extendStatics = function(d, b) {
2252
2270
  extendStatics = Object.setPrototypeOf ||
2253
2271
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2254
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
2272
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2255
2273
  return extendStatics(d, b);
2256
2274
  };
2257
2275
 
2258
2276
  function __extends(d, b) {
2277
+ if (typeof b !== "function" && b !== null)
2278
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2259
2279
  extendStatics(d, b);
2260
2280
  function __() { this.constructor = d; }
2261
2281
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -2282,7 +2302,12 @@ function __rest(s, e) {
2282
2302
  t[p[i]] = s[p[i]];
2283
2303
  }
2284
2304
  return t;
2285
- }var patchResizeCallback = function (resizeCallback, refreshMode, refreshRate, refreshOptions) {
2305
+ }
2306
+
2307
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
2308
+ var e = new Error(message);
2309
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2310
+ };var patchResizeCallback = function (resizeCallback, refreshMode, refreshRate, refreshOptions) {
2286
2311
  switch (refreshMode) {
2287
2312
  case 'debounce':
2288
2313
  return debounce$2(resizeCallback, refreshRate, refreshOptions);
@@ -2498,14 +2523,6 @@ var isDOMElement = function (element) {
2498
2523
  }, [refElement]);
2499
2524
  // adding `current` to make it compatible with useRef shape
2500
2525
  onRefChange.current = refElement;
2501
- React.useEffect(function () {
2502
- return function () {
2503
- // component is unmounted
2504
- // clear ref to avoid memory leaks
2505
- setRefElement(null);
2506
- onRefChange.current = null;
2507
- };
2508
- }, []);
2509
2526
  var shouldSetSize = React.useCallback(function (prevSize, nextSize) {
2510
2527
  if (prevSize.width === nextSize.width && prevSize.height === nextSize.height) {
2511
2528
  // skip if dimensions haven't changed
@@ -3171,7 +3188,7 @@ for (let i = 0; i < 256; ++i) {
3171
3188
  function unsafeStringify(arr, offset = 0) {
3172
3189
  // Note: Be careful editing this code! It's been tuned for performance
3173
3190
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
3174
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
3191
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
3175
3192
  }const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
3176
3193
  var native = {
3177
3194
  randomUUID