linkmore-design 1.0.16 → 1.0.17

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.umd.js CHANGED
@@ -65214,159 +65214,105 @@
65214
65214
 
65215
65215
  ProviderWarp.Summary = _Table__default['default'].Summary;
65216
65216
 
65217
- var classCallCheck = createCommonjsModule(function (module) {
65218
- function _classCallCheck(instance, Constructor) {
65217
+ var classCallCheck = function (instance, Constructor) {
65219
65218
  if (!(instance instanceof Constructor)) {
65220
65219
  throw new TypeError("Cannot call a class as a function");
65221
65220
  }
65222
- }
65223
-
65224
- module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
65225
- });
65226
-
65227
- var _classCallCheck$7 = /*@__PURE__*/getDefaultExportFromCjs(classCallCheck);
65221
+ };
65228
65222
 
65229
- var createClass = createCommonjsModule(function (module) {
65230
- function _defineProperties(target, props) {
65231
- for (var i = 0; i < props.length; i++) {
65232
- var descriptor = props[i];
65233
- descriptor.enumerable = descriptor.enumerable || false;
65234
- descriptor.configurable = true;
65235
- if ("value" in descriptor) descriptor.writable = true;
65236
- Object.defineProperty(target, descriptor.key, descriptor);
65223
+ var createClass = function () {
65224
+ function defineProperties(target, props) {
65225
+ for (var i = 0; i < props.length; i++) {
65226
+ var descriptor = props[i];
65227
+ descriptor.enumerable = descriptor.enumerable || false;
65228
+ descriptor.configurable = true;
65229
+ if ("value" in descriptor) descriptor.writable = true;
65230
+ Object.defineProperty(target, descriptor.key, descriptor);
65231
+ }
65237
65232
  }
65238
- }
65239
-
65240
- function _createClass(Constructor, protoProps, staticProps) {
65241
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
65242
- if (staticProps) _defineProperties(Constructor, staticProps);
65243
- Object.defineProperty(Constructor, "prototype", {
65244
- writable: false
65245
- });
65246
- return Constructor;
65247
- }
65248
65233
 
65249
- module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
65250
- });
65234
+ return function (Constructor, protoProps, staticProps) {
65235
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
65236
+ if (staticProps) defineProperties(Constructor, staticProps);
65237
+ return Constructor;
65238
+ };
65239
+ }();
65251
65240
 
65252
- var _createClass$7 = /*@__PURE__*/getDefaultExportFromCjs(createClass);
65241
+ var _extends$7 = Object.assign || function (target) {
65242
+ for (var i = 1; i < arguments.length; i++) {
65243
+ var source = arguments[i];
65253
65244
 
65254
- var setPrototypeOf = createCommonjsModule(function (module) {
65255
- function _setPrototypeOf(o, p) {
65256
- module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
65257
- o.__proto__ = p;
65258
- return o;
65259
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
65260
- return _setPrototypeOf(o, p);
65261
- }
65245
+ for (var key in source) {
65246
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
65247
+ target[key] = source[key];
65248
+ }
65249
+ }
65250
+ }
65262
65251
 
65263
- module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
65264
- });
65252
+ return target;
65253
+ };
65265
65254
 
65266
- var inherits = createCommonjsModule(function (module) {
65267
- function _inherits(subClass, superClass) {
65255
+ var inherits = function (subClass, superClass) {
65268
65256
  if (typeof superClass !== "function" && superClass !== null) {
65269
- throw new TypeError("Super expression must either be null or a function");
65257
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
65270
65258
  }
65271
65259
 
65272
65260
  subClass.prototype = Object.create(superClass && superClass.prototype, {
65273
65261
  constructor: {
65274
65262
  value: subClass,
65263
+ enumerable: false,
65275
65264
  writable: true,
65276
65265
  configurable: true
65277
65266
  }
65278
65267
  });
65279
- Object.defineProperty(subClass, "prototype", {
65280
- writable: false
65281
- });
65282
- if (superClass) setPrototypeOf(subClass, superClass);
65283
- }
65284
-
65285
- module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
65286
- });
65287
-
65288
- var _inherits$7 = /*@__PURE__*/getDefaultExportFromCjs(inherits);
65289
-
65290
- var getPrototypeOf = createCommonjsModule(function (module) {
65291
- function _getPrototypeOf(o) {
65292
- module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
65293
- return o.__proto__ || Object.getPrototypeOf(o);
65294
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
65295
- return _getPrototypeOf(o);
65296
- }
65297
-
65298
- module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
65299
- });
65300
-
65301
- var isNativeReflectConstruct = createCommonjsModule(function (module) {
65302
- function _isNativeReflectConstruct() {
65303
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
65304
- if (Reflect.construct.sham) return false;
65305
- if (typeof Proxy === "function") return true;
65306
-
65307
- try {
65308
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
65309
- return true;
65310
- } catch (e) {
65311
- return false;
65312
- }
65313
- }
65314
-
65315
- module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
65316
- });
65268
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
65269
+ };
65317
65270
 
65318
- var assertThisInitialized = createCommonjsModule(function (module) {
65319
- function _assertThisInitialized(self) {
65320
- if (self === void 0) {
65271
+ var possibleConstructorReturn = function (self, call) {
65272
+ if (!self) {
65321
65273
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
65322
65274
  }
65323
65275
 
65324
- return self;
65325
- }
65326
-
65327
- module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
65328
- });
65276
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
65277
+ };
65329
65278
 
65330
- var possibleConstructorReturn = createCommonjsModule(function (module) {
65331
- var _typeof = _typeof_1["default"];
65279
+ var slicedToArray$1 = function () {
65280
+ function sliceIterator(arr, i) {
65281
+ var _arr = [];
65282
+ var _n = true;
65283
+ var _d = false;
65284
+ var _e = undefined;
65332
65285
 
65286
+ try {
65287
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
65288
+ _arr.push(_s.value);
65333
65289
 
65290
+ if (i && _arr.length === i) break;
65291
+ }
65292
+ } catch (err) {
65293
+ _d = true;
65294
+ _e = err;
65295
+ } finally {
65296
+ try {
65297
+ if (!_n && _i["return"]) _i["return"]();
65298
+ } finally {
65299
+ if (_d) throw _e;
65300
+ }
65301
+ }
65334
65302
 
65335
- function _possibleConstructorReturn(self, call) {
65336
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
65337
- return call;
65338
- } else if (call !== void 0) {
65339
- throw new TypeError("Derived constructors may only return object or undefined");
65303
+ return _arr;
65340
65304
  }
65341
65305
 
65342
- return assertThisInitialized(self);
65343
- }
65344
-
65345
- module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
65346
- });
65347
-
65348
- var createSuper = createCommonjsModule(function (module) {
65349
- function _createSuper(Derived) {
65350
- var hasNativeReflectConstruct = isNativeReflectConstruct();
65351
- return function _createSuperInternal() {
65352
- var Super = getPrototypeOf(Derived),
65353
- result;
65354
-
65355
- if (hasNativeReflectConstruct) {
65356
- var NewTarget = getPrototypeOf(this).constructor;
65357
- result = Reflect.construct(Super, arguments, NewTarget);
65306
+ return function (arr, i) {
65307
+ if (Array.isArray(arr)) {
65308
+ return arr;
65309
+ } else if (Symbol.iterator in Object(arr)) {
65310
+ return sliceIterator(arr, i);
65358
65311
  } else {
65359
- result = Super.apply(this, arguments);
65312
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
65360
65313
  }
65361
-
65362
- return possibleConstructorReturn(this, result);
65363
65314
  };
65364
- }
65365
-
65366
- module.exports = _createSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
65367
- });
65368
-
65369
- var _createSuper$7 = /*@__PURE__*/getDefaultExportFromCjs(createSuper);
65315
+ }();
65370
65316
 
65371
65317
  /**
65372
65318
  * Detect Element Resize.
@@ -65374,47 +65320,83 @@
65374
65320
  * Sebastian Decima
65375
65321
  *
65376
65322
  * Forked from version 0.5.3; includes the following modifications:
65377
- * 1) Guard against unsafe 'window' and 'document' references (to support SSR).
65378
- * 2) Defer initialization code via a top-level function wrapper (to support SSR).
65323
+ * 1) Guard against unsafe 'window' and 'document' references (to support SSR).
65324
+ * 2) Defer initialization code via a top-level function wrapper (to support SSR).
65379
65325
  * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
65380
65326
  * 4) Add nonce for style element.
65381
- * 5) Added support for injecting custom window object
65382
65327
  **/
65383
- function createDetectElementResize(nonce, hostWindow) {
65384
- // Check `document` and `window` in case of server-side rendering
65385
- var _window;
65386
-
65387
- if (typeof hostWindow !== 'undefined') {
65388
- _window = hostWindow;
65389
- } else if (typeof window !== 'undefined') {
65390
- _window = window;
65391
- } else if (typeof self !== 'undefined') {
65392
- _window = self;
65393
- } else {
65394
- _window = global;
65395
- }
65396
65328
 
65397
- var attachEvent = typeof _window.document !== 'undefined' && _window.document.attachEvent;
65329
+ // Check `document` and `window` in case of server-side rendering
65330
+ var windowObject = void 0;
65331
+ if (typeof window !== 'undefined') {
65332
+ windowObject = window;
65398
65333
 
65399
- if (!attachEvent) {
65400
- var requestFrame = function () {
65401
- var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function (fn) {
65402
- return _window.setTimeout(fn, 20);
65403
- };
65334
+ // eslint-disable-next-line no-restricted-globals
65335
+ } else if (typeof self !== 'undefined') {
65336
+ // eslint-disable-next-line no-restricted-globals
65337
+ windowObject = self;
65338
+ } else {
65339
+ windowObject = global;
65340
+ }
65404
65341
 
65405
- return function (fn) {
65406
- return raf(fn);
65407
- };
65408
- }();
65342
+ var cancelFrame = null;
65343
+ var requestFrame = null;
65409
65344
 
65410
- var cancelFrame = function () {
65411
- var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || _window.clearTimeout;
65412
- return function (id) {
65413
- return cancel(id);
65414
- };
65415
- }();
65345
+ var TIMEOUT_DURATION = 20;
65346
+
65347
+ var clearTimeoutFn = windowObject.clearTimeout;
65348
+ var setTimeoutFn = windowObject.setTimeout;
65349
+
65350
+ var cancelAnimationFrameFn = windowObject.cancelAnimationFrame || windowObject.mozCancelAnimationFrame || windowObject.webkitCancelAnimationFrame;
65351
+
65352
+ var requestAnimationFrameFn = windowObject.requestAnimationFrame || windowObject.mozRequestAnimationFrame || windowObject.webkitRequestAnimationFrame;
65353
+
65354
+ if (cancelAnimationFrameFn == null || requestAnimationFrameFn == null) {
65355
+ // For environments that don't support animation frame,
65356
+ // fallback to a setTimeout based approach.
65357
+ cancelFrame = clearTimeoutFn;
65358
+ requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
65359
+ return setTimeoutFn(callback, TIMEOUT_DURATION);
65360
+ };
65361
+ } else {
65362
+ // Counter intuitively, environments that support animation frames can be trickier.
65363
+ // Chrome's "Throttle non-visible cross-origin iframes" flag can prevent rAFs from being called.
65364
+ // In this case, we should fallback to a setTimeout() implementation.
65365
+ cancelFrame = function cancelFrame(_ref) {
65366
+ var _ref2 = slicedToArray$1(_ref, 2),
65367
+ animationFrameID = _ref2[0],
65368
+ timeoutID = _ref2[1];
65369
+
65370
+ cancelAnimationFrameFn(animationFrameID);
65371
+ clearTimeoutFn(timeoutID);
65372
+ };
65373
+ requestFrame = function requestAnimationFrameWithSetTimeoutFallback(callback) {
65374
+ var animationFrameID = requestAnimationFrameFn(function animationFrameCallback() {
65375
+ clearTimeoutFn(timeoutID);
65376
+ callback();
65377
+ });
65378
+
65379
+ var timeoutID = setTimeoutFn(function timeoutCallback() {
65380
+ cancelAnimationFrameFn(animationFrameID);
65381
+ callback();
65382
+ }, TIMEOUT_DURATION);
65383
+
65384
+ return [animationFrameID, timeoutID];
65385
+ };
65386
+ }
65387
+
65388
+ function createDetectElementResize(nonce) {
65389
+ var animationKeyframes = void 0;
65390
+ var animationName = void 0;
65391
+ var animationStartEvent = void 0;
65392
+ var animationStyle = void 0;
65393
+ var checkTriggers = void 0;
65394
+ var resetTriggers = void 0;
65395
+ var scrollListener = void 0;
65416
65396
 
65417
- var resetTriggers = function resetTriggers(element) {
65397
+ var attachEvent = typeof document !== 'undefined' && document.attachEvent;
65398
+ if (!attachEvent) {
65399
+ resetTriggers = function resetTriggers(element) {
65418
65400
  var triggers = element.__resizeTriggers__,
65419
65401
  expand = triggers.firstElementChild,
65420
65402
  contract = triggers.lastElementChild,
@@ -65427,11 +65409,11 @@
65427
65409
  expand.scrollTop = expand.scrollHeight;
65428
65410
  };
65429
65411
 
65430
- var checkTriggers = function checkTriggers(element) {
65431
- return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;
65412
+ checkTriggers = function checkTriggers(element) {
65413
+ return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
65432
65414
  };
65433
65415
 
65434
- var scrollListener = function scrollListener(e) {
65416
+ scrollListener = function scrollListener(e) {
65435
65417
  // Don't measure (which forces) reflow for scrolls that happen inside of children!
65436
65418
  if (e.target.className && typeof e.target.className.indexOf === 'function' && e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {
65437
65419
  return;
@@ -65439,34 +65421,29 @@
65439
65421
 
65440
65422
  var element = this;
65441
65423
  resetTriggers(this);
65442
-
65443
65424
  if (this.__resizeRAF__) {
65444
65425
  cancelFrame(this.__resizeRAF__);
65445
65426
  }
65446
-
65447
- this.__resizeRAF__ = requestFrame(function () {
65427
+ this.__resizeRAF__ = requestFrame(function animationFrame() {
65448
65428
  if (checkTriggers(element)) {
65449
65429
  element.__resizeLast__.width = element.offsetWidth;
65450
65430
  element.__resizeLast__.height = element.offsetHeight;
65451
-
65452
- element.__resizeListeners__.forEach(function (fn) {
65431
+ element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
65453
65432
  fn.call(element, e);
65454
65433
  });
65455
65434
  }
65456
65435
  });
65457
65436
  };
65458
- /* Detect CSS Animations support to detect element display/re-attach */
65459
65437
 
65460
-
65461
- var animation = false,
65462
- keyframeprefix = '',
65463
- animationstartevent = 'animationstart',
65464
- domPrefixes = 'Webkit Moz O ms'.split(' '),
65465
- startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),
65466
- pfx = '';
65438
+ /* Detect CSS Animations support to detect element display/re-attach */
65439
+ var animation = false;
65440
+ var keyframeprefix = '';
65441
+ animationStartEvent = 'animationstart';
65442
+ var domPrefixes = 'Webkit Moz O ms'.split(' ');
65443
+ var startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' ');
65444
+ var pfx = '';
65467
65445
  {
65468
- var elm = _window.document.createElement('fakeelement');
65469
-
65446
+ var elm = document.createElement('fakeelement');
65470
65447
  if (elm.style.animationName !== undefined) {
65471
65448
  animation = true;
65472
65449
  }
@@ -65476,16 +65453,17 @@
65476
65453
  if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
65477
65454
  pfx = domPrefixes[i];
65478
65455
  keyframeprefix = '-' + pfx.toLowerCase() + '-';
65479
- animationstartevent = startEvents[i];
65456
+ animationStartEvent = startEvents[i];
65480
65457
  animation = true;
65481
65458
  break;
65482
65459
  }
65483
65460
  }
65484
65461
  }
65485
65462
  }
65486
- var animationName = 'resizeanim';
65487
- var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';
65488
- var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';
65463
+
65464
+ animationName = 'resizeanim';
65465
+ animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';
65466
+ animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';
65489
65467
  }
65490
65468
 
65491
65469
  var createStyles = function createStyles(doc) {
@@ -65494,6 +65472,7 @@
65494
65472
  var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
65495
65473
  head = doc.head || doc.getElementsByTagName('head')[0],
65496
65474
  style = doc.createElement('style');
65475
+
65497
65476
  style.id = 'detectElementResize';
65498
65477
  style.type = 'text/css';
65499
65478
 
@@ -65517,13 +65496,10 @@
65517
65496
  } else {
65518
65497
  if (!element.__resizeTriggers__) {
65519
65498
  var doc = element.ownerDocument;
65520
-
65521
- var elementStyle = _window.getComputedStyle(element);
65522
-
65523
- if (elementStyle && elementStyle.position == 'static') {
65499
+ var elementStyle = windowObject.getComputedStyle(element);
65500
+ if (elementStyle && elementStyle.position === 'static') {
65524
65501
  element.style.position = 'relative';
65525
65502
  }
65526
-
65527
65503
  createStyles(doc);
65528
65504
  element.__resizeLast__ = {};
65529
65505
  element.__resizeListeners__ = [];
@@ -65533,27 +65509,22 @@
65533
65509
  expandTrigger.appendChild(doc.createElement('div'));
65534
65510
  var contractTrigger = doc.createElement('div');
65535
65511
  contractTrigger.className = 'contract-trigger';
65536
-
65537
65512
  element.__resizeTriggers__.appendChild(expandTrigger);
65538
-
65539
65513
  element.__resizeTriggers__.appendChild(contractTrigger);
65540
-
65541
65514
  element.appendChild(element.__resizeTriggers__);
65542
65515
  resetTriggers(element);
65543
65516
  element.addEventListener('scroll', scrollListener, true);
65544
- /* Listen for a css animation to detect element display/re-attach */
65545
65517
 
65546
- if (animationstartevent) {
65518
+ /* Listen for a css animation to detect element display/re-attach */
65519
+ if (animationStartEvent) {
65547
65520
  element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
65548
- if (e.animationName == animationName) {
65521
+ if (e.animationName === animationName) {
65549
65522
  resetTriggers(element);
65550
65523
  }
65551
65524
  };
65552
-
65553
- element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);
65525
+ element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
65554
65526
  }
65555
65527
  }
65556
-
65557
65528
  element.__resizeListeners__.push(fn);
65558
65529
  }
65559
65530
  };
@@ -65563,19 +65534,16 @@
65563
65534
  element.detachEvent('onresize', fn);
65564
65535
  } else {
65565
65536
  element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
65566
-
65567
65537
  if (!element.__resizeListeners__.length) {
65568
65538
  element.removeEventListener('scroll', scrollListener, true);
65569
-
65570
65539
  if (element.__resizeTriggers__.__animationListener__) {
65571
- element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);
65572
-
65540
+ element.__resizeTriggers__.removeEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
65573
65541
  element.__resizeTriggers__.__animationListener__ = null;
65574
65542
  }
65575
-
65576
65543
  try {
65577
65544
  element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
65578
- } catch (e) {// Preact compat; see developit/preact-compat/issues/228
65545
+ } catch (e) {
65546
+ // Preact compat; see developit/preact-compat/issues/228
65579
65547
  }
65580
65548
  }
65581
65549
  }
@@ -65587,77 +65555,63 @@
65587
65555
  };
65588
65556
  }
65589
65557
 
65590
- var AutoSizer = /*#__PURE__*/function (_React$Component) {
65591
- _inherits$7(AutoSizer, _React$Component);
65592
-
65593
- var _super = _createSuper$7(AutoSizer);
65558
+ var AutoSizer = function (_React$PureComponent) {
65559
+ inherits(AutoSizer, _React$PureComponent);
65594
65560
 
65595
65561
  function AutoSizer() {
65596
- var _this;
65562
+ var _ref;
65563
+
65564
+ var _temp, _this, _ret;
65597
65565
 
65598
- _classCallCheck$7(this, AutoSizer);
65566
+ classCallCheck(this, AutoSizer);
65599
65567
 
65600
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
65568
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
65601
65569
  args[_key] = arguments[_key];
65602
65570
  }
65603
65571
 
65604
- _this = _super.call.apply(_super, [this].concat(args));
65605
- _this.state = {
65572
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = AutoSizer.__proto__ || Object.getPrototypeOf(AutoSizer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
65606
65573
  height: _this.props.defaultHeight || 0,
65607
65574
  width: _this.props.defaultWidth || 0
65608
- };
65609
- _this._parentNode = void 0;
65610
- _this._autoSizer = void 0;
65611
- _this._window = void 0;
65612
- _this._detectElementResize = void 0;
65613
-
65614
- _this._onResize = function () {
65615
- console.log(11);
65575
+ }, _this._onResize = function () {
65616
65576
  var _this$props = _this.props,
65617
65577
  disableHeight = _this$props.disableHeight,
65618
65578
  disableWidth = _this$props.disableWidth,
65619
65579
  onResize = _this$props.onResize;
65620
65580
 
65581
+
65621
65582
  if (_this._parentNode) {
65622
65583
  // Guard against AutoSizer component being removed from the DOM immediately after being added.
65623
65584
  // This can result in invalid style values which can result in NaN values if we don't handle them.
65624
65585
  // See issue #150 for more context.
65625
- var height = _this._parentNode.offsetHeight || 0;
65626
- var width = _this._parentNode.offsetWidth || 0;
65627
- var win = _this._window || window;
65628
- var style = win.getComputedStyle(_this._parentNode) || {};
65629
- var paddingLeft = parseInt(style.paddingLeft, 10) || 0;
65630
- var paddingRight = parseInt(style.paddingRight, 10) || 0;
65631
- var paddingTop = parseInt(style.paddingTop, 10) || 0;
65632
- var paddingBottom = parseInt(style.paddingBottom, 10) || 0;
65633
- var newHeight = height - paddingTop - paddingBottom;
65634
- var newWidth = width - paddingLeft - paddingRight;
65586
+
65587
+ var _height = _this._parentNode.offsetHeight || 0;
65588
+ var _width = _this._parentNode.offsetWidth || 0;
65589
+
65590
+ var _style = window.getComputedStyle(_this._parentNode) || {};
65591
+ var paddingLeft = parseInt(_style.paddingLeft, 10) || 0;
65592
+ var paddingRight = parseInt(_style.paddingRight, 10) || 0;
65593
+ var paddingTop = parseInt(_style.paddingTop, 10) || 0;
65594
+ var paddingBottom = parseInt(_style.paddingBottom, 10) || 0;
65595
+
65596
+ var newHeight = _height - paddingTop - paddingBottom;
65597
+ var newWidth = _width - paddingLeft - paddingRight;
65635
65598
 
65636
65599
  if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) {
65637
65600
  _this.setState({
65638
- height: height - paddingTop - paddingBottom,
65639
- width: width - paddingLeft - paddingRight
65601
+ height: _height - paddingTop - paddingBottom,
65602
+ width: _width - paddingLeft - paddingRight
65640
65603
  });
65641
65604
 
65642
- onResize({
65643
- height: height,
65644
- width: width
65645
- });
65605
+ onResize({ height: _height, width: _width });
65646
65606
  }
65647
65607
  }
65648
- };
65649
-
65650
- _this.handleResize = lodash.debounce(_this._onResize, 800);
65651
-
65652
- _this._setRef = function (autoSizer) {
65608
+ }, _this._setRef = function (autoSizer) {
65653
65609
  _this._autoSizer = autoSizer;
65654
- };
65655
-
65656
- return _this;
65610
+ }, _temp), possibleConstructorReturn(_this, _ret);
65657
65611
  }
65658
65612
 
65659
- _createClass$7(AutoSizer, [{
65660
- key: "componentDidMount",
65613
+ createClass(AutoSizer, [{
65614
+ key: 'componentDidMount',
65661
65615
  value: function componentDidMount() {
65662
65616
  var nonce = this.props.nonce;
65663
65617
 
@@ -65666,65 +65620,75 @@
65666
65620
  // This handles edge-cases where the component has already been unmounted before its ref has been set,
65667
65621
  // As well as libraries like react-lite which have a slightly different lifecycle.
65668
65622
  this._parentNode = this._autoSizer.parentNode;
65669
- this._window = this._autoSizer.parentNode.ownerDocument.defaultView; // Defer requiring resize handler in order to support server-side rendering.
65670
- // See issue #41
65671
-
65672
- this._detectElementResize = createDetectElementResize(nonce, this._window);
65673
65623
 
65674
- this._detectElementResize.addResizeListener(this._parentNode, this.handleResize);
65675
-
65676
- console.log(3);
65624
+ // Defer requiring resize handler in order to support server-side rendering.
65625
+ // See issue #41
65626
+ this._detectElementResize = createDetectElementResize(nonce);
65627
+ this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
65677
65628
 
65678
65629
  this._onResize();
65679
65630
  }
65680
65631
  }
65681
65632
  }, {
65682
- key: "componentWillUnmount",
65633
+ key: 'componentWillUnmount',
65683
65634
  value: function componentWillUnmount() {
65684
65635
  if (this._detectElementResize && this._parentNode) {
65685
65636
  this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
65686
65637
  }
65687
65638
  }
65688
65639
  }, {
65689
- key: "render",
65640
+ key: 'render',
65690
65641
  value: function render() {
65691
- var _this$props2 = this.props,
65692
- children = _this$props2.children,
65693
- className = _this$props2.className,
65694
- disableHeight = _this$props2.disableHeight,
65695
- disableWidth = _this$props2.disableWidth,
65696
- style = _this$props2.style;
65697
- var _this$state = this.state,
65698
- height = _this$state.height,
65699
- width = _this$state.width; // Outer div should not force width/height since that may prevent containers from shrinking.
65642
+ var _props = this.props,
65643
+ children = _props.children,
65644
+ className = _props.className,
65645
+ disableHeight = _props.disableHeight,
65646
+ disableWidth = _props.disableWidth,
65647
+ style = _props.style;
65648
+ var _state = this.state,
65649
+ height = _state.height,
65650
+ width = _state.width;
65651
+
65652
+ // Outer div should not force width/height since that may prevent containers from shrinking.
65700
65653
  // Inner component should overflow and use calculated width/height.
65701
65654
  // See issue #68 for more information.
65702
65655
 
65703
- var outerStyle = {
65704
- overflow: 'visible'
65705
- };
65656
+ var outerStyle = { overflow: 'visible' };
65706
65657
  var childParams = {};
65707
65658
 
65659
+ // Avoid rendering children before the initial measurements have been collected.
65660
+ // At best this would just be wasting cycles.
65661
+ var bailoutOnChildren = false;
65662
+
65708
65663
  if (!disableHeight) {
65664
+ if (height === 0) {
65665
+ bailoutOnChildren = true;
65666
+ }
65709
65667
  outerStyle.height = 0;
65710
65668
  childParams.height = height;
65711
65669
  }
65712
65670
 
65713
65671
  if (!disableWidth) {
65672
+ if (width === 0) {
65673
+ bailoutOnChildren = true;
65674
+ }
65714
65675
  outerStyle.width = 0;
65715
65676
  childParams.width = width;
65716
65677
  }
65717
65678
 
65718
- return /*#__PURE__*/React__default['default'].createElement("div", {
65719
- className: className,
65720
- ref: this._setRef,
65721
- style: _objectSpread(_objectSpread({}, outerStyle), style)
65722
- }, children(childParams));
65679
+ return React.createElement(
65680
+ 'div',
65681
+ {
65682
+ className: className,
65683
+ ref: this._setRef,
65684
+ style: _extends$7({}, outerStyle, style)
65685
+ },
65686
+ !bailoutOnChildren && children(childParams)
65687
+ );
65723
65688
  }
65724
65689
  }]);
65725
-
65726
65690
  return AutoSizer;
65727
- }(React__default['default'].Component);
65691
+ }(React.PureComponent);
65728
65692
 
65729
65693
  AutoSizer.defaultProps = {
65730
65694
  onResize: function onResize() {},
@@ -68705,7 +68669,7 @@
68705
68669
  editConfig: editConfig
68706
68670
  };
68707
68671
 
68708
- var _excluded$14 = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "customCheck"];
68672
+ var _excluded$14 = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "customCheck"];
68709
68673
  var Summary = ProviderWarp.Summary;
68710
68674
  var ResetTable = /*#__PURE__*/React.forwardRef(function (props, ref) {
68711
68675
  var dataSource = props.dataSource,
@@ -68718,6 +68682,8 @@
68718
68682
  pagination = props.pagination,
68719
68683
  hiddenPage = props.hiddenPage,
68720
68684
  loading = props.loading,
68685
+ _props$virtual = props.virtual,
68686
+ virtual = _props$virtual === void 0 ? true : _props$virtual,
68721
68687
  customCheck = props.customCheck,
68722
68688
  resetProps = _objectWithoutProperties(props, _excluded$14);
68723
68689
 
@@ -68804,688 +68770,204 @@
68804
68770
  }; // 重写表格,增加虚拟滚动
68805
68771
 
68806
68772
 
68807
- var vComponents = React.useMemo(function () {
68808
- return VList({
68809
- height: autoSize.height // 此值和scrollY值相同. 必传.
68810
-
68811
- });
68812
- }, [autoSize.height]); // 复选框配置
68813
-
68814
- var config = React.useMemo(function () {
68815
- return _objectSpread({
68816
- defaultSize: 'small',
68817
- tableLayout: 'fixed',
68818
- rowKey: rowKey,
68819
- debounceTime: 300,
68820
- revalidateOnFocus: false,
68821
- options: {
68822
- setting: true,
68823
- density: false,
68824
- fullScreen: false,
68825
- reload: false
68826
- },
68827
- columnsState: {
68828
- value: columnsStateMap,
68829
- onChange: function onChange(k) {
68830
- setColumnsStateMap(k);
68831
- }
68832
- },
68833
- search: false,
68834
- tableAlertRender: false,
68835
- checkConfig: checkConfig,
68836
- // components: vComponents,
68837
- scroll: {
68838
- x: '100%',
68839
- y: _summary ? autoSize.height - 48 : autoSize.height
68840
- },
68841
- pagination: !hiddenPage && _objectSpread({
68842
- showSizeChanger: true,
68843
- showQuickJumper: true,
68844
- showTotal: function showTotal(total) {
68845
- return "\u5171 ".concat(total, " \u6761");
68846
- }
68847
- }, pagination),
68848
- rowSelection: {
68849
- fixed: true,
68850
- type: 'checkbox',
68851
- columnWidth: 36,
68852
- selectedRowKeys: useSelectedRows.selectedRows.map(function (v) {
68853
- return v[rowKey];
68854
- }),
68855
- onChange: function onChange(selectedRowKeys, selectedRows, t, s) {
68856
- setSelectedRows({
68857
- selectedRows: selectedRows
68858
- });
68859
- rowClick === null || rowClick === void 0 ? void 0 : rowClick(selectedRows);
68860
- }
68861
- },
68862
- onRow: function onRow(record) {
68863
- return {
68864
- onClick: function onClick(e) {
68865
- onRecord(record);
68866
- },
68867
- onDoubleClick: function onDoubleClick() {
68868
- _onDoubleClick === null || _onDoubleClick === void 0 ? void 0 : _onDoubleClick(record);
68869
- }
68870
- };
68871
- },
68872
- rowClassName: function rowClassName(record) {
68873
- return record[rowKey] === useActiveKey ? 'row-active' : '';
68874
- },
68875
- columns: resetColumns()
68876
- }, resetProps);
68877
- }, [autoSize.height, useColumns, useSelectedRows, columnsStateMap, resetProps]);
68878
- var resultColumns = React.useMemo(function () {
68879
- var result = useColumns.map(function (item, index) {
68880
- var _columnsStateMap$item, _columnsStateMap$item2, _columnsStateMap$item3, _columnsStateMap$item4;
68881
-
68882
- return _objectSpread(_objectSpread({}, item), {}, {
68883
- colSort: (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item === void 0 ? void 0 : _columnsStateMap$item.order) === undefined ? index : (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item2 = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item2 === void 0 ? void 0 : _columnsStateMap$item2.order) || index,
68884
- fixed: (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item3 = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item3 === void 0 ? void 0 : _columnsStateMap$item3.fixed) || item.fixed || undefined,
68885
- show: (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item4 = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item4 === void 0 ? void 0 : _columnsStateMap$item4.show) !== false
68886
- });
68887
- }).filter(function (item) {
68888
- return !!item.show;
68889
- });
68890
- result.sort(function (a, b) {
68891
- return (a.fixed === 'left' ? a.colSort : a.fixed === 'right' ? 500 + a.colSort : a.colSort + 50) - (b.fixed === 'left' ? b.colSort : b.fixed === 'right' ? 500 + b.colSort : b.colSort + 50);
68892
- });
68893
- return result;
68894
- }, [columnsStateMap, useColumns]);
68895
- React.useEffect(function () {
68896
- var countW = lodash.sumBy(columns, 'width') + 36;
68897
- var nValue = columns.map(function (col) {
68898
- var rw = countW < autoSize.width ? autoSize.width / countW * col.width : col.width;
68899
- return _objectSpread(_objectSpread({}, col), {}, {
68900
- width: lodash.round(rw)
68901
- });
68902
- });
68903
- setColumns(nValue);
68904
- }, [columns, autoSize.width]);
68905
- React.useEffect(function () {
68906
- var obj = {};
68907
- columns === null || columns === void 0 ? void 0 : columns.forEach(function (item) {
68908
- if (item.fixed) {
68909
- obj[item.dataIndex || item.key] = {
68910
- fixed: item.fixed
68911
- };
68912
- }
68913
- });
68914
- setColumnsStateMap(obj);
68915
- }, []); // useEffect(() => {
68916
- // rowClick?.()
68917
- // }, [useSelectedRows])
68918
- // 将节点方法给外部使用
68919
-
68920
- React__default['default'].useImperativeHandle(ref, function () {
68921
- return {
68922
- getCheckboxRecords: function getCheckboxRecords() {
68923
- return useSelectedRows.selectedRows;
68924
- },
68925
- // 用于按钮触发事件
68926
- clearSelect: function clearSelect() {
68927
- setSelectedRows({
68928
- selectedRows: []
68929
- });
68930
- rowClick === null || rowClick === void 0 ? void 0 : rowClick([]);
68931
- },
68932
- customSetCheckboxRecords: function customSetCheckboxRecords(value) {
68933
- setSelectedRows({
68934
- selectedRows: value
68935
- });
68936
- rowClick === null || rowClick === void 0 ? void 0 : rowClick(value);
68937
- }
68938
- };
68939
- }); // loading触发清空选中状态
68940
-
68941
- React.useEffect(function () {
68942
- setSelectedRows({
68943
- selectedRows: []
68944
- });
68945
- }, [loading]);
68946
- return /*#__PURE__*/React__default['default'].createElement(Context$3.Provider, {
68947
- value: {
68948
- width: autoSize.width,
68949
- countW: lodash.sumBy(useColumns, 'width') + 36
68950
- }
68951
- }, /*#__PURE__*/React__default['default'].createElement(ProviderWarp, _extends({}, config, {
68952
- loading: loading,
68953
- dataSource: dataSource,
68954
- components: vComponents,
68955
- tableClassName: "lm_protable",
68956
- summary: function summary(pageData) {
68957
- return _summary && _summary(pageData, resultColumns);
68958
- }
68959
- })), !!customCheck && /*#__PURE__*/React__default['default'].createElement("div", {
68960
- className: "lm_customCheck"
68961
- }, customCheck));
68962
- }); // 监听大小: 这里的高度是整个表格的高度,表体需要减去列头和分页的高度
68963
-
68964
- var ResizeSize = /*#__PURE__*/React.forwardRef(function (props, ref) {
68965
- var defaultRef = ref || React.useRef(null);
68966
- var throttleSize = lodash.throttle(function (_ref) {
68967
- var height = _ref.height,
68968
- width = _ref.width;
68969
- console.log(height, width, 444);
68970
-
68971
- var resetHeight = function resetHeight() {
68972
- var h = height - 48;
68973
-
68974
- if (!props.hiddenPage) {
68975
- h -= 28;
68976
- }
68977
-
68978
- if (props.columns.some(function (v) {
68979
- return v.children;
68980
- })) {
68981
- h -= 31;
68982
- }
68983
-
68984
- return h;
68985
- };
68986
-
68987
- return /*#__PURE__*/React__default['default'].createElement(ResetTable, _extends({
68988
- ref: defaultRef
68989
- }, props, {
68990
- autoSize: {
68991
- height: resetHeight(),
68992
- width: width
68993
- }
68994
- }));
68995
- }, 100);
68996
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(AutoSizer, {
68997
- style: {
68998
- width: '100%',
68999
- height: '100%'
69000
- },
69001
- disableWidth: true
69002
- }, throttleSize));
69003
- });
69004
-
69005
- var Context$4 = /*#__PURE__*/React.createContext();
69006
-
69007
- var classCallCheck$1 = function (instance, Constructor) {
69008
- if (!(instance instanceof Constructor)) {
69009
- throw new TypeError("Cannot call a class as a function");
69010
- }
69011
- };
69012
-
69013
- var createClass$1 = function () {
69014
- function defineProperties(target, props) {
69015
- for (var i = 0; i < props.length; i++) {
69016
- var descriptor = props[i];
69017
- descriptor.enumerable = descriptor.enumerable || false;
69018
- descriptor.configurable = true;
69019
- if ("value" in descriptor) descriptor.writable = true;
69020
- Object.defineProperty(target, descriptor.key, descriptor);
69021
- }
69022
- }
69023
-
69024
- return function (Constructor, protoProps, staticProps) {
69025
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
69026
- if (staticProps) defineProperties(Constructor, staticProps);
69027
- return Constructor;
69028
- };
69029
- }();
69030
-
69031
- var _extends$7 = Object.assign || function (target) {
69032
- for (var i = 1; i < arguments.length; i++) {
69033
- var source = arguments[i];
69034
-
69035
- for (var key in source) {
69036
- if (Object.prototype.hasOwnProperty.call(source, key)) {
69037
- target[key] = source[key];
69038
- }
69039
- }
69040
- }
69041
-
69042
- return target;
69043
- };
69044
-
69045
- var inherits$1 = function (subClass, superClass) {
69046
- if (typeof superClass !== "function" && superClass !== null) {
69047
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
69048
- }
69049
-
69050
- subClass.prototype = Object.create(superClass && superClass.prototype, {
69051
- constructor: {
69052
- value: subClass,
69053
- enumerable: false,
69054
- writable: true,
69055
- configurable: true
69056
- }
69057
- });
69058
- if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
69059
- };
69060
-
69061
- var possibleConstructorReturn$1 = function (self, call) {
69062
- if (!self) {
69063
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
69064
- }
69065
-
69066
- return call && (typeof call === "object" || typeof call === "function") ? call : self;
69067
- };
69068
-
69069
- var slicedToArray$1 = function () {
69070
- function sliceIterator(arr, i) {
69071
- var _arr = [];
69072
- var _n = true;
69073
- var _d = false;
69074
- var _e = undefined;
69075
-
69076
- try {
69077
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
69078
- _arr.push(_s.value);
69079
-
69080
- if (i && _arr.length === i) break;
69081
- }
69082
- } catch (err) {
69083
- _d = true;
69084
- _e = err;
69085
- } finally {
69086
- try {
69087
- if (!_n && _i["return"]) _i["return"]();
69088
- } finally {
69089
- if (_d) throw _e;
69090
- }
69091
- }
69092
-
69093
- return _arr;
69094
- }
69095
-
69096
- return function (arr, i) {
69097
- if (Array.isArray(arr)) {
69098
- return arr;
69099
- } else if (Symbol.iterator in Object(arr)) {
69100
- return sliceIterator(arr, i);
69101
- } else {
69102
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
69103
- }
69104
- };
69105
- }();
69106
-
69107
- /**
69108
- * Detect Element Resize.
69109
- * https://github.com/sdecima/javascript-detect-element-resize
69110
- * Sebastian Decima
69111
- *
69112
- * Forked from version 0.5.3; includes the following modifications:
69113
- * 1) Guard against unsafe 'window' and 'document' references (to support SSR).
69114
- * 2) Defer initialization code via a top-level function wrapper (to support SSR).
69115
- * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
69116
- * 4) Add nonce for style element.
69117
- **/
69118
-
69119
- // Check `document` and `window` in case of server-side rendering
69120
- var windowObject = void 0;
69121
- if (typeof window !== 'undefined') {
69122
- windowObject = window;
69123
-
69124
- // eslint-disable-next-line no-restricted-globals
69125
- } else if (typeof self !== 'undefined') {
69126
- // eslint-disable-next-line no-restricted-globals
69127
- windowObject = self;
69128
- } else {
69129
- windowObject = global;
69130
- }
69131
-
69132
- var cancelFrame = null;
69133
- var requestFrame = null;
69134
-
69135
- var TIMEOUT_DURATION = 20;
69136
-
69137
- var clearTimeoutFn = windowObject.clearTimeout;
69138
- var setTimeoutFn = windowObject.setTimeout;
69139
-
69140
- var cancelAnimationFrameFn = windowObject.cancelAnimationFrame || windowObject.mozCancelAnimationFrame || windowObject.webkitCancelAnimationFrame;
69141
-
69142
- var requestAnimationFrameFn = windowObject.requestAnimationFrame || windowObject.mozRequestAnimationFrame || windowObject.webkitRequestAnimationFrame;
69143
-
69144
- if (cancelAnimationFrameFn == null || requestAnimationFrameFn == null) {
69145
- // For environments that don't support animation frame,
69146
- // fallback to a setTimeout based approach.
69147
- cancelFrame = clearTimeoutFn;
69148
- requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
69149
- return setTimeoutFn(callback, TIMEOUT_DURATION);
69150
- };
69151
- } else {
69152
- // Counter intuitively, environments that support animation frames can be trickier.
69153
- // Chrome's "Throttle non-visible cross-origin iframes" flag can prevent rAFs from being called.
69154
- // In this case, we should fallback to a setTimeout() implementation.
69155
- cancelFrame = function cancelFrame(_ref) {
69156
- var _ref2 = slicedToArray$1(_ref, 2),
69157
- animationFrameID = _ref2[0],
69158
- timeoutID = _ref2[1];
69159
-
69160
- cancelAnimationFrameFn(animationFrameID);
69161
- clearTimeoutFn(timeoutID);
69162
- };
69163
- requestFrame = function requestAnimationFrameWithSetTimeoutFallback(callback) {
69164
- var animationFrameID = requestAnimationFrameFn(function animationFrameCallback() {
69165
- clearTimeoutFn(timeoutID);
69166
- callback();
69167
- });
69168
-
69169
- var timeoutID = setTimeoutFn(function timeoutCallback() {
69170
- cancelAnimationFrameFn(animationFrameID);
69171
- callback();
69172
- }, TIMEOUT_DURATION);
69173
-
69174
- return [animationFrameID, timeoutID];
69175
- };
69176
- }
69177
-
69178
- function createDetectElementResize$1(nonce) {
69179
- var animationKeyframes = void 0;
69180
- var animationName = void 0;
69181
- var animationStartEvent = void 0;
69182
- var animationStyle = void 0;
69183
- var checkTriggers = void 0;
69184
- var resetTriggers = void 0;
69185
- var scrollListener = void 0;
69186
-
69187
- var attachEvent = typeof document !== 'undefined' && document.attachEvent;
69188
- if (!attachEvent) {
69189
- resetTriggers = function resetTriggers(element) {
69190
- var triggers = element.__resizeTriggers__,
69191
- expand = triggers.firstElementChild,
69192
- contract = triggers.lastElementChild,
69193
- expandChild = expand.firstElementChild;
69194
- contract.scrollLeft = contract.scrollWidth;
69195
- contract.scrollTop = contract.scrollHeight;
69196
- expandChild.style.width = expand.offsetWidth + 1 + 'px';
69197
- expandChild.style.height = expand.offsetHeight + 1 + 'px';
69198
- expand.scrollLeft = expand.scrollWidth;
69199
- expand.scrollTop = expand.scrollHeight;
69200
- };
69201
-
69202
- checkTriggers = function checkTriggers(element) {
69203
- return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
69204
- };
69205
-
69206
- scrollListener = function scrollListener(e) {
69207
- // Don't measure (which forces) reflow for scrolls that happen inside of children!
69208
- if (e.target.className && typeof e.target.className.indexOf === 'function' && e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {
69209
- return;
69210
- }
69211
-
69212
- var element = this;
69213
- resetTriggers(this);
69214
- if (this.__resizeRAF__) {
69215
- cancelFrame(this.__resizeRAF__);
69216
- }
69217
- this.__resizeRAF__ = requestFrame(function animationFrame() {
69218
- if (checkTriggers(element)) {
69219
- element.__resizeLast__.width = element.offsetWidth;
69220
- element.__resizeLast__.height = element.offsetHeight;
69221
- element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
69222
- fn.call(element, e);
69223
- });
69224
- }
69225
- });
69226
- };
69227
-
69228
- /* Detect CSS Animations support to detect element display/re-attach */
69229
- var animation = false;
69230
- var keyframeprefix = '';
69231
- animationStartEvent = 'animationstart';
69232
- var domPrefixes = 'Webkit Moz O ms'.split(' ');
69233
- var startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' ');
69234
- var pfx = '';
69235
- {
69236
- var elm = document.createElement('fakeelement');
69237
- if (elm.style.animationName !== undefined) {
69238
- animation = true;
69239
- }
69240
-
69241
- if (animation === false) {
69242
- for (var i = 0; i < domPrefixes.length; i++) {
69243
- if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
69244
- pfx = domPrefixes[i];
69245
- keyframeprefix = '-' + pfx.toLowerCase() + '-';
69246
- animationStartEvent = startEvents[i];
69247
- animation = true;
69248
- break;
69249
- }
69250
- }
69251
- }
69252
- }
69253
-
69254
- animationName = 'resizeanim';
69255
- animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';
69256
- animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';
69257
- }
69258
-
69259
- var createStyles = function createStyles(doc) {
69260
- if (!doc.getElementById('detectElementResize')) {
69261
- //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
69262
- var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
69263
- head = doc.head || doc.getElementsByTagName('head')[0],
69264
- style = doc.createElement('style');
69265
-
69266
- style.id = 'detectElementResize';
69267
- style.type = 'text/css';
69268
-
69269
- if (nonce != null) {
69270
- style.setAttribute('nonce', nonce);
69271
- }
69272
-
69273
- if (style.styleSheet) {
69274
- style.styleSheet.cssText = css;
69275
- } else {
69276
- style.appendChild(doc.createTextNode(css));
69277
- }
69278
-
69279
- head.appendChild(style);
69280
- }
69281
- };
69282
-
69283
- var addResizeListener = function addResizeListener(element, fn) {
69284
- if (attachEvent) {
69285
- element.attachEvent('onresize', fn);
69286
- } else {
69287
- if (!element.__resizeTriggers__) {
69288
- var doc = element.ownerDocument;
69289
- var elementStyle = windowObject.getComputedStyle(element);
69290
- if (elementStyle && elementStyle.position === 'static') {
69291
- element.style.position = 'relative';
69292
- }
69293
- createStyles(doc);
69294
- element.__resizeLast__ = {};
69295
- element.__resizeListeners__ = [];
69296
- (element.__resizeTriggers__ = doc.createElement('div')).className = 'resize-triggers';
69297
- var expandTrigger = doc.createElement('div');
69298
- expandTrigger.className = 'expand-trigger';
69299
- expandTrigger.appendChild(doc.createElement('div'));
69300
- var contractTrigger = doc.createElement('div');
69301
- contractTrigger.className = 'contract-trigger';
69302
- element.__resizeTriggers__.appendChild(expandTrigger);
69303
- element.__resizeTriggers__.appendChild(contractTrigger);
69304
- element.appendChild(element.__resizeTriggers__);
69305
- resetTriggers(element);
69306
- element.addEventListener('scroll', scrollListener, true);
69307
-
69308
- /* Listen for a css animation to detect element display/re-attach */
69309
- if (animationStartEvent) {
69310
- element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
69311
- if (e.animationName === animationName) {
69312
- resetTriggers(element);
69313
- }
69314
- };
69315
- element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
69316
- }
69317
- }
69318
- element.__resizeListeners__.push(fn);
69319
- }
69320
- };
69321
-
69322
- var removeResizeListener = function removeResizeListener(element, fn) {
69323
- if (attachEvent) {
69324
- element.detachEvent('onresize', fn);
69325
- } else {
69326
- element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
69327
- if (!element.__resizeListeners__.length) {
69328
- element.removeEventListener('scroll', scrollListener, true);
69329
- if (element.__resizeTriggers__.__animationListener__) {
69330
- element.__resizeTriggers__.removeEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
69331
- element.__resizeTriggers__.__animationListener__ = null;
69332
- }
69333
- try {
69334
- element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
69335
- } catch (e) {
69336
- // Preact compat; see developit/preact-compat/issues/228
69337
- }
69338
- }
69339
- }
69340
- };
69341
-
69342
- return {
69343
- addResizeListener: addResizeListener,
69344
- removeResizeListener: removeResizeListener
69345
- };
69346
- }
69347
-
69348
- var AutoSizer$1 = function (_React$PureComponent) {
69349
- inherits$1(AutoSizer, _React$PureComponent);
69350
-
69351
- function AutoSizer() {
69352
- var _ref;
69353
-
69354
- var _temp, _this, _ret;
69355
-
69356
- classCallCheck$1(this, AutoSizer);
69357
-
69358
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
69359
- args[_key] = arguments[_key];
69360
- }
69361
-
69362
- return _ret = (_temp = (_this = possibleConstructorReturn$1(this, (_ref = AutoSizer.__proto__ || Object.getPrototypeOf(AutoSizer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
69363
- height: _this.props.defaultHeight || 0,
69364
- width: _this.props.defaultWidth || 0
69365
- }, _this._onResize = function () {
69366
- var _this$props = _this.props,
69367
- disableHeight = _this$props.disableHeight,
69368
- disableWidth = _this$props.disableWidth,
69369
- onResize = _this$props.onResize;
69370
-
69371
-
69372
- if (_this._parentNode) {
69373
- // Guard against AutoSizer component being removed from the DOM immediately after being added.
69374
- // This can result in invalid style values which can result in NaN values if we don't handle them.
69375
- // See issue #150 for more context.
69376
-
69377
- var _height = _this._parentNode.offsetHeight || 0;
69378
- var _width = _this._parentNode.offsetWidth || 0;
69379
-
69380
- var _style = window.getComputedStyle(_this._parentNode) || {};
69381
- var paddingLeft = parseInt(_style.paddingLeft, 10) || 0;
69382
- var paddingRight = parseInt(_style.paddingRight, 10) || 0;
69383
- var paddingTop = parseInt(_style.paddingTop, 10) || 0;
69384
- var paddingBottom = parseInt(_style.paddingBottom, 10) || 0;
69385
-
69386
- var newHeight = _height - paddingTop - paddingBottom;
69387
- var newWidth = _width - paddingLeft - paddingRight;
69388
-
69389
- if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) {
69390
- _this.setState({
69391
- height: _height - paddingTop - paddingBottom,
69392
- width: _width - paddingLeft - paddingRight
69393
- });
69394
-
69395
- onResize({ height: _height, width: _width });
69396
- }
69397
- }
69398
- }, _this._setRef = function (autoSizer) {
69399
- _this._autoSizer = autoSizer;
69400
- }, _temp), possibleConstructorReturn$1(_this, _ret);
69401
- }
68773
+ var vComponents = React.useMemo(function () {
68774
+ return VList({
68775
+ height: autoSize.height // 此值和scrollY值相同. 必传.
69402
68776
 
69403
- createClass$1(AutoSizer, [{
69404
- key: 'componentDidMount',
69405
- value: function componentDidMount() {
69406
- var nonce = this.props.nonce;
68777
+ });
68778
+ }, [autoSize.height]); // 复选框配置
69407
68779
 
69408
- if (this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement) {
69409
- // Delay access of parentNode until mount.
69410
- // This handles edge-cases where the component has already been unmounted before its ref has been set,
69411
- // As well as libraries like react-lite which have a slightly different lifecycle.
69412
- this._parentNode = this._autoSizer.parentNode;
68780
+ var config = React.useMemo(function () {
68781
+ return _objectSpread({
68782
+ defaultSize: 'small',
68783
+ tableLayout: 'fixed',
68784
+ rowKey: rowKey,
68785
+ debounceTime: 300,
68786
+ revalidateOnFocus: false,
68787
+ options: {
68788
+ setting: true,
68789
+ density: false,
68790
+ fullScreen: false,
68791
+ reload: false
68792
+ },
68793
+ columnsState: {
68794
+ value: columnsStateMap,
68795
+ onChange: function onChange(k) {
68796
+ setColumnsStateMap(k);
68797
+ }
68798
+ },
68799
+ search: false,
68800
+ tableAlertRender: false,
68801
+ checkConfig: checkConfig,
68802
+ // components: vComponents,
68803
+ scroll: {
68804
+ x: '100%',
68805
+ y: _summary ? autoSize.height - 48 : autoSize.height
68806
+ },
68807
+ pagination: !hiddenPage && _objectSpread({
68808
+ showSizeChanger: true,
68809
+ showQuickJumper: true,
68810
+ showTotal: function showTotal(total) {
68811
+ return "\u5171 ".concat(total, " \u6761");
68812
+ }
68813
+ }, pagination),
68814
+ rowSelection: {
68815
+ fixed: true,
68816
+ type: 'checkbox',
68817
+ columnWidth: 36,
68818
+ selectedRowKeys: useSelectedRows.selectedRows.map(function (v) {
68819
+ return v[rowKey];
68820
+ }),
68821
+ onChange: function onChange(selectedRowKeys, selectedRows, t, s) {
68822
+ setSelectedRows({
68823
+ selectedRows: selectedRows
68824
+ });
68825
+ rowClick === null || rowClick === void 0 ? void 0 : rowClick(selectedRows);
68826
+ }
68827
+ },
68828
+ onRow: function onRow(record) {
68829
+ return {
68830
+ onClick: function onClick(e) {
68831
+ onRecord(record);
68832
+ },
68833
+ onDoubleClick: function onDoubleClick() {
68834
+ _onDoubleClick === null || _onDoubleClick === void 0 ? void 0 : _onDoubleClick(record);
68835
+ }
68836
+ };
68837
+ },
68838
+ rowClassName: function rowClassName(record) {
68839
+ return record[rowKey] === useActiveKey ? 'row-active' : '';
68840
+ },
68841
+ columns: resetColumns()
68842
+ }, resetProps);
68843
+ }, [autoSize.height, useColumns, useSelectedRows, columnsStateMap, resetProps]);
68844
+ var resultColumns = React.useMemo(function () {
68845
+ var result = useColumns.map(function (item, index) {
68846
+ var _columnsStateMap$item, _columnsStateMap$item2, _columnsStateMap$item3, _columnsStateMap$item4;
69413
68847
 
69414
- // Defer requiring resize handler in order to support server-side rendering.
69415
- // See issue #41
69416
- this._detectElementResize = createDetectElementResize$1(nonce);
69417
- this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
68848
+ return _objectSpread(_objectSpread({}, item), {}, {
68849
+ colSort: (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item === void 0 ? void 0 : _columnsStateMap$item.order) === undefined ? index : (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item2 = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item2 === void 0 ? void 0 : _columnsStateMap$item2.order) || index,
68850
+ fixed: (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item3 = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item3 === void 0 ? void 0 : _columnsStateMap$item3.fixed) || item.fixed || undefined,
68851
+ show: (columnsStateMap === null || columnsStateMap === void 0 ? void 0 : (_columnsStateMap$item4 = columnsStateMap[item.dataIndex]) === null || _columnsStateMap$item4 === void 0 ? void 0 : _columnsStateMap$item4.show) !== false
68852
+ });
68853
+ }).filter(function (item) {
68854
+ return !!item.show;
68855
+ });
68856
+ result.sort(function (a, b) {
68857
+ return (a.fixed === 'left' ? a.colSort : a.fixed === 'right' ? 500 + a.colSort : a.colSort + 50) - (b.fixed === 'left' ? b.colSort : b.fixed === 'right' ? 500 + b.colSort : b.colSort + 50);
68858
+ });
68859
+ return result;
68860
+ }, [columnsStateMap, useColumns]);
68861
+ React.useEffect(function () {
68862
+ var countW = lodash.sumBy(columns, 'width') + 36;
68863
+ var nValue = columns.map(function (col) {
68864
+ var rw = countW < autoSize.width ? autoSize.width / countW * col.width : col.width;
68865
+ return _objectSpread(_objectSpread({}, col), {}, {
68866
+ width: lodash.round(rw)
68867
+ });
68868
+ });
68869
+ setColumns(nValue);
68870
+ }, [columns, autoSize.width]);
68871
+ React.useEffect(function () {
68872
+ var obj = {};
68873
+ columns === null || columns === void 0 ? void 0 : columns.forEach(function (item) {
68874
+ if (item.fixed) {
68875
+ obj[item.dataIndex || item.key] = {
68876
+ fixed: item.fixed
68877
+ };
68878
+ }
68879
+ });
68880
+ setColumnsStateMap(obj);
68881
+ }, []); // useEffect(() => {
68882
+ // rowClick?.()
68883
+ // }, [useSelectedRows])
68884
+ // 将节点方法给外部使用
69418
68885
 
69419
- this._onResize();
68886
+ React__default['default'].useImperativeHandle(ref, function () {
68887
+ return {
68888
+ getCheckboxRecords: function getCheckboxRecords() {
68889
+ return useSelectedRows.selectedRows;
68890
+ },
68891
+ // 用于按钮触发事件
68892
+ clearSelect: function clearSelect() {
68893
+ setSelectedRows({
68894
+ selectedRows: []
68895
+ });
68896
+ rowClick === null || rowClick === void 0 ? void 0 : rowClick([]);
68897
+ },
68898
+ customSetCheckboxRecords: function customSetCheckboxRecords(value) {
68899
+ setSelectedRows({
68900
+ selectedRows: value
68901
+ });
68902
+ rowClick === null || rowClick === void 0 ? void 0 : rowClick(value);
69420
68903
  }
68904
+ };
68905
+ }); // loading触发清空选中状态
68906
+
68907
+ React.useEffect(function () {
68908
+ setSelectedRows({
68909
+ selectedRows: []
68910
+ });
68911
+ }, [loading]);
68912
+ return /*#__PURE__*/React__default['default'].createElement(Context$3.Provider, {
68913
+ value: {
68914
+ width: autoSize.width,
68915
+ countW: lodash.sumBy(useColumns, 'width') + 36
69421
68916
  }
69422
- }, {
69423
- key: 'componentWillUnmount',
69424
- value: function componentWillUnmount() {
69425
- if (this._detectElementResize && this._parentNode) {
69426
- this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
69427
- }
68917
+ }, /*#__PURE__*/React__default['default'].createElement(ProviderWarp, _extends({}, config, {
68918
+ loading: loading,
68919
+ dataSource: dataSource,
68920
+ components: virtual ? vComponents : null,
68921
+ tableClassName: "lm_protable",
68922
+ summary: function summary(pageData) {
68923
+ return _summary && _summary(pageData, resultColumns);
69428
68924
  }
69429
- }, {
69430
- key: 'render',
69431
- value: function render() {
69432
- var _props = this.props,
69433
- children = _props.children,
69434
- className = _props.className,
69435
- disableHeight = _props.disableHeight,
69436
- disableWidth = _props.disableWidth,
69437
- style = _props.style;
69438
- var _state = this.state,
69439
- height = _state.height,
69440
- width = _state.width;
69441
-
69442
- // Outer div should not force width/height since that may prevent containers from shrinking.
69443
- // Inner component should overflow and use calculated width/height.
69444
- // See issue #68 for more information.
68925
+ })), !!customCheck && /*#__PURE__*/React__default['default'].createElement("div", {
68926
+ className: "lm_customCheck"
68927
+ }, customCheck));
68928
+ }); // 监听大小: 这里的高度是整个表格的高度,表体需要减去列头和分页的高度
69445
68929
 
69446
- var outerStyle = { overflow: 'visible' };
69447
- var childParams = {};
68930
+ var ResizeSize = /*#__PURE__*/React.forwardRef(function (props, ref) {
68931
+ var defaultRef = ref || React.useRef(null);
68932
+ var throttleSize = lodash.throttle(function (_ref) {
68933
+ var height = _ref.height,
68934
+ width = _ref.width;
68935
+ console.log(height, width, 444);
69448
68936
 
69449
- // Avoid rendering children before the initial measurements have been collected.
69450
- // At best this would just be wasting cycles.
69451
- var bailoutOnChildren = false;
68937
+ var resetHeight = function resetHeight() {
68938
+ var h = height - 48;
69452
68939
 
69453
- if (!disableHeight) {
69454
- if (height === 0) {
69455
- bailoutOnChildren = true;
69456
- }
69457
- outerStyle.height = 0;
69458
- childParams.height = height;
68940
+ if (!props.hiddenPage) {
68941
+ h -= 28;
69459
68942
  }
69460
68943
 
69461
- if (!disableWidth) {
69462
- if (width === 0) {
69463
- bailoutOnChildren = true;
69464
- }
69465
- outerStyle.width = 0;
69466
- childParams.width = width;
68944
+ if (props.columns.some(function (v) {
68945
+ return v.children;
68946
+ })) {
68947
+ h -= 31;
69467
68948
  }
69468
68949
 
69469
- return React.createElement(
69470
- 'div',
69471
- {
69472
- className: className,
69473
- ref: this._setRef,
69474
- style: _extends$7({}, outerStyle, style)
69475
- },
69476
- !bailoutOnChildren && children(childParams)
69477
- );
68950
+ return h;
68951
+ };
68952
+
68953
+ return /*#__PURE__*/React__default['default'].createElement(ResetTable, _extends({
68954
+ ref: defaultRef
68955
+ }, props, {
68956
+ autoSize: {
68957
+ height: resetHeight(),
68958
+ width: width
68959
+ }
68960
+ }));
68961
+ }, 100);
68962
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(AutoSizer, {
68963
+ style: {
68964
+ width: '100%',
68965
+ height: '100%'
69478
68966
  }
69479
- }]);
69480
- return AutoSizer;
69481
- }(React.PureComponent);
68967
+ }, throttleSize));
68968
+ });
69482
68969
 
69483
- AutoSizer$1.defaultProps = {
69484
- onResize: function onResize() {},
69485
- disableHeight: false,
69486
- disableWidth: false,
69487
- style: {}
69488
- };
68970
+ var Context$4 = /*#__PURE__*/React.createContext();
69489
68971
 
69490
68972
  function _inheritsLoose$1(subClass, superClass) {
69491
68973
  subClass.prototype = Object.create(superClass.prototype);
@@ -70952,7 +70434,7 @@
70952
70434
 
70953
70435
 
70954
70436
  var ResizeSize$1 = function ResizeSize(props) {
70955
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(AutoSizer$1, {
70437
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(AutoSizer, {
70956
70438
  style: {
70957
70439
  width: '100%'
70958
70440
  }