jquery.dgtable 2.0.36 → 2.0.39
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/README.md +17 -17
- package/dist/lib.cjs.js +194 -611
- package/dist/lib.cjs.js.map +1 -1
- package/dist/lib.cjs.min.js +1 -1
- package/dist/lib.cjs.min.js.map +1 -1
- package/dist/lib.es6.js +194 -611
- package/dist/lib.es6.js.map +1 -1
- package/dist/lib.es6.min.js +1 -1
- package/dist/lib.es6.min.js.map +1 -1
- package/dist/lib.umd.js +1382 -7729
- package/dist/lib.umd.js.map +1 -1
- package/dist/lib.umd.min.js +5 -1
- package/dist/lib.umd.min.js.map +1 -1
- package/package.json +11 -11
package/dist/lib.cjs.js
CHANGED
|
@@ -97,7 +97,7 @@ function requireFunctionBindNative () {
|
|
|
97
97
|
|
|
98
98
|
functionBindNative = !fails(function () {
|
|
99
99
|
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
100
|
-
var test =
|
|
100
|
+
var test = function () { /* empty */ }.bind();
|
|
101
101
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
102
102
|
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
103
103
|
});
|
|
@@ -576,10 +576,10 @@ function requireSharedStore () {
|
|
|
576
576
|
var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
|
|
577
577
|
|
|
578
578
|
(store.versions || (store.versions = [])).push({
|
|
579
|
-
version: '3.
|
|
579
|
+
version: '3.50.0',
|
|
580
580
|
mode: IS_PURE ? 'pure' : 'global',
|
|
581
581
|
copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
|
|
582
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
582
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',
|
|
583
583
|
source: 'https://github.com/zloirock/core-js'
|
|
584
584
|
});
|
|
585
585
|
return sharedStore.exports;
|
|
@@ -592,9 +592,11 @@ function requireShared () {
|
|
|
592
592
|
if (hasRequiredShared) return shared;
|
|
593
593
|
hasRequiredShared = 1;
|
|
594
594
|
var store = requireSharedStore();
|
|
595
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
596
|
+
var create = Object.create || Object;
|
|
595
597
|
|
|
596
598
|
shared = function (key, value) {
|
|
597
|
-
return store[key] || (store[key] = value ||
|
|
599
|
+
return store[key] || (store[key] = value || create(null));
|
|
598
600
|
};
|
|
599
601
|
return shared;
|
|
600
602
|
}
|
|
@@ -932,7 +934,7 @@ function requireFunctionName () {
|
|
|
932
934
|
|
|
933
935
|
var EXISTS = hasOwn(FunctionPrototype, 'name');
|
|
934
936
|
// additional protection from minified / mangled / dropped function names
|
|
935
|
-
var PROPER = EXISTS &&
|
|
937
|
+
var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
|
|
936
938
|
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
937
939
|
|
|
938
940
|
functionName = {
|
|
@@ -1640,6 +1642,7 @@ function requireEs_symbol_description () {
|
|
|
1640
1642
|
var $ = require_export();
|
|
1641
1643
|
var DESCRIPTORS = requireDescriptors();
|
|
1642
1644
|
var globalThis = requireGlobalThis();
|
|
1645
|
+
var call = requireFunctionCall();
|
|
1643
1646
|
var uncurryThis = requireFunctionUncurryThis();
|
|
1644
1647
|
var hasOwn = requireHasOwnProperty();
|
|
1645
1648
|
var isCallable = requireIsCallable();
|
|
@@ -1669,6 +1672,14 @@ function requireEs_symbol_description () {
|
|
|
1669
1672
|
};
|
|
1670
1673
|
|
|
1671
1674
|
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
1675
|
+
// wrap Symbol.for for correct handling of empty string descriptions
|
|
1676
|
+
var nativeFor = SymbolWrapper['for'];
|
|
1677
|
+
SymbolWrapper['for'] = { 'for': function (key) {
|
|
1678
|
+
var stringKey = toString(key);
|
|
1679
|
+
var symbol = call(nativeFor, this, stringKey);
|
|
1680
|
+
if (stringKey === '') EmptyStringDescriptionStore[symbol] = true;
|
|
1681
|
+
return symbol;
|
|
1682
|
+
} }['for'];
|
|
1672
1683
|
SymbolWrapper.prototype = SymbolPrototype;
|
|
1673
1684
|
SymbolPrototype.constructor = SymbolWrapper;
|
|
1674
1685
|
|
|
@@ -1914,7 +1925,9 @@ function requireEs_array_sort () {
|
|
|
1914
1925
|
if (y === undefined) return -1;
|
|
1915
1926
|
if (x === undefined) return 1;
|
|
1916
1927
|
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
1917
|
-
|
|
1928
|
+
var xString = toString(x);
|
|
1929
|
+
var yString = toString(y);
|
|
1930
|
+
return xString === yString ? 0 : xString > yString ? 1 : -1;
|
|
1918
1931
|
};
|
|
1919
1932
|
};
|
|
1920
1933
|
|
|
@@ -2411,178 +2424,86 @@ class DomEventsSink {
|
|
|
2411
2424
|
}
|
|
2412
2425
|
}
|
|
2413
2426
|
|
|
2414
|
-
/**
|
|
2415
|
-
* @typedef {function(index: number):(number|undefined)} VirtualListHelper~ItemHeightEstimatorFunction
|
|
2416
|
-
*/
|
|
2417
|
-
|
|
2418
|
-
/**
|
|
2419
|
-
* @typedef {function():Element} VirtualListHelper~ItemElementCreatorFunction
|
|
2420
|
-
*/
|
|
2421
|
-
|
|
2422
|
-
/**
|
|
2423
|
-
* @typedef {function(itemEl: Element, index: number)} VirtualListHelper~ItemRenderFunction
|
|
2424
|
-
*/
|
|
2425
|
-
|
|
2426
|
-
/**
|
|
2427
|
-
* @typedef {function(itemEl: Element)} VirtualListHelper~ItemUnrenderFunction
|
|
2428
|
-
*/
|
|
2429
|
-
|
|
2430
|
-
/**
|
|
2431
|
-
* @typedef {Object} VirtualListHelper~Options
|
|
2432
|
-
* @property {Element} list - the main element to operate inside of
|
|
2433
|
-
* @property {Element?} [itemsParent] - the element to use as parent for the items (automatically created in virtual mode, uses parent by default in non-virtual mode)
|
|
2434
|
-
* @property {boolean} [autoVirtualWrapperWidth=true] automatically set the width of the virtual wrapper
|
|
2435
|
-
* @property {boolean} [hookScrollEvent=true] automatically hook scroll event as needed
|
|
2436
|
-
* @property {number} [count=0] the item count
|
|
2437
|
-
* @property {boolean} [virtual=true] is virtual mode on?
|
|
2438
|
-
* @property {number} [estimatedItemHeight=20] estimated item height
|
|
2439
|
-
* @property {number} [buffer=5] the amount of buffer items to keep on each end of the list
|
|
2440
|
-
* @property {VirtualListHelper~ItemHeightEstimatorFunction} [itemHeightEstimatorFn] an optional function for providing item height estimations
|
|
2441
|
-
* @property {VirtualListHelper~ItemElementCreatorFunction} [itemElementCreatorFn] an optional function for providing fresh item elements (default creates `<li />`s)
|
|
2442
|
-
* @property {VirtualListHelper~ItemRenderFunction} [onItemRender] a function for rendering element content based on item index
|
|
2443
|
-
* @property {VirtualListHelper~ItemUnrenderFunction} [onItemUnrender] a function for freeing resources in an item element
|
|
2444
|
-
* @property {function(height: number)} [onScrollHeightChange] a function to be notified when scroll height changes
|
|
2445
|
-
*
|
|
2446
|
-
*/
|
|
2447
|
-
|
|
2448
|
-
/** */
|
|
2449
|
-
|
|
2450
2427
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2451
|
-
|
|
2452
2428
|
const hasInsertAdjacentElement = Element.prototype.insertAdjacentElement !== undefined;
|
|
2453
|
-
|
|
2454
2429
|
function insertBefore(el, before, parent) {
|
|
2455
2430
|
if (!before)
|
|
2456
2431
|
parent.appendChild(el);else
|
|
2457
2432
|
if (hasInsertAdjacentElement === false || el instanceof DocumentFragment)
|
|
2458
2433
|
parent.insertBefore(el, before);else
|
|
2434
|
+
|
|
2459
2435
|
before.insertAdjacentElement('beforebegin', el);
|
|
2460
2436
|
}
|
|
2461
|
-
/**
|
|
2462
|
-
*
|
|
2463
|
-
* @param {Element} itemEl
|
|
2464
|
-
* @param {DocumentFragment|null} fragment
|
|
2465
|
-
* @param {Node|undefined} before
|
|
2466
|
-
* @param {Element} itemParent
|
|
2467
|
-
* @returns {DocumentFragment|null}
|
|
2468
|
-
*/
|
|
2469
2437
|
function insertBeforeWithFragment(itemEl, fragment, before, itemParent) {
|
|
2470
2438
|
if (itemEl.parentNode !== itemParent) {
|
|
2471
2439
|
if (!fragment)
|
|
2472
2440
|
fragment = document.createDocumentFragment();
|
|
2473
2441
|
fragment.appendChild(itemEl);
|
|
2474
|
-
} else
|
|
2442
|
+
} else
|
|
2443
|
+
{
|
|
2475
2444
|
// insert fragment
|
|
2476
2445
|
if (fragment && fragment.childNodes.length > 0) {
|
|
2477
2446
|
insertBefore(fragment, before, itemParent);
|
|
2478
2447
|
fragment = null;
|
|
2479
2448
|
}
|
|
2480
|
-
|
|
2481
2449
|
// insert element
|
|
2482
2450
|
if (itemEl.nextSibling !== before) {
|
|
2483
2451
|
insertBefore(itemEl, before, itemParent);
|
|
2484
2452
|
}
|
|
2485
2453
|
}
|
|
2486
|
-
|
|
2487
2454
|
return fragment;
|
|
2488
2455
|
}
|
|
2489
|
-
|
|
2490
2456
|
const DestroyedSymbol = Symbol('destroyed');
|
|
2491
|
-
|
|
2492
2457
|
class VirtualListHelper {
|
|
2493
|
-
/**
|
|
2494
|
-
* @param {VirtualListHelper~Options} opts
|
|
2495
|
-
*/
|
|
2496
2458
|
constructor(opts) {var _opts$autoVirtualWrap;
|
|
2497
|
-
/** @private */
|
|
2498
2459
|
const p = this._p = {
|
|
2499
2460
|
// these come from options:
|
|
2500
|
-
|
|
2501
2461
|
list: opts.list || null,
|
|
2502
2462
|
hookScrollEvent: opts.hookScrollEvent === undefined ? true : !!opts.hookScrollEvent,
|
|
2503
2463
|
count: opts.count || 0,
|
|
2504
2464
|
virtual: opts.virtual === undefined ? true : !!opts.virtual,
|
|
2505
2465
|
userItemsParent: opts.itemsParent || null,
|
|
2506
|
-
|
|
2466
|
+
autoVirtualWrapperWidth: (_opts$autoVirtualWrap = opts.autoVirtualWrapperWidth) !== null && _opts$autoVirtualWrap !== void 0 ? _opts$autoVirtualWrap : true,
|
|
2507
2467
|
estimatedItemHeight: 20,
|
|
2508
2468
|
buffer: 5,
|
|
2509
|
-
|
|
2510
|
-
/** @type VirtualListHelper~ItemHeightEstimatorFunction|null */
|
|
2511
2469
|
itemHeightEstimatorFn: null,
|
|
2512
|
-
|
|
2513
|
-
/** @type VirtualListHelper~ItemElementCreatorFunction|null */
|
|
2514
2470
|
itemElementCreatorFn: defaultElementCreator,
|
|
2515
|
-
|
|
2516
|
-
/** @type VirtualListHelper~ItemRenderFunction|null */
|
|
2517
2471
|
onItemRender: null,
|
|
2518
|
-
|
|
2519
|
-
/** @type VirtualListHelper~ItemUnrenderFunction|null */
|
|
2520
2472
|
onItemUnrender: null,
|
|
2521
|
-
|
|
2522
|
-
/** @type {function(height: number)|null} */
|
|
2523
2473
|
onScrollHeightChange: null,
|
|
2524
|
-
|
|
2525
2474
|
// internal:
|
|
2526
|
-
|
|
2527
|
-
/** @type Element|null */
|
|
2528
2475
|
virtualWrapper: null,
|
|
2529
|
-
|
|
2530
|
-
/** @type Element|null */
|
|
2531
2476
|
currentItemsParent: null,
|
|
2532
|
-
|
|
2533
|
-
/** @type {(number|undefined)[]} */
|
|
2534
2477
|
cachedItemHeights: [],
|
|
2535
|
-
|
|
2536
|
-
/** @type {(number|undefined)[]} */
|
|
2537
2478
|
cachedItemEstimatedHeights: [],
|
|
2538
|
-
|
|
2539
|
-
/** @type {(number|undefined)[]} */
|
|
2540
2479
|
cachedItemPositions: [],
|
|
2541
|
-
|
|
2542
|
-
/** @type number */
|
|
2543
2480
|
itemPositionsNeedsUpdate: 0,
|
|
2544
|
-
|
|
2545
|
-
/** @type function */
|
|
2546
2481
|
boundRender: this.render.bind(this),
|
|
2547
|
-
|
|
2548
|
-
/** @type Element[] */
|
|
2549
2482
|
existingEls: []
|
|
2550
2483
|
};
|
|
2551
|
-
|
|
2552
2484
|
p.currentItemsParent = p.userItemsParent || p.list;
|
|
2553
|
-
|
|
2554
2485
|
this._hookEvents();
|
|
2555
|
-
|
|
2556
2486
|
if (typeof opts.count === 'number')
|
|
2557
2487
|
this.setCount(opts.count);
|
|
2558
|
-
|
|
2559
2488
|
if (typeof opts.virtual === 'boolean')
|
|
2560
2489
|
this.setVirtual(opts.virtual);
|
|
2561
|
-
|
|
2562
2490
|
if (typeof opts.estimatedItemHeight === 'number')
|
|
2563
2491
|
this.setEstimatedItemHeight(opts.estimatedItemHeight);
|
|
2564
|
-
|
|
2565
2492
|
if (typeof opts.buffer === 'number')
|
|
2566
2493
|
this.setBuffer(opts.buffer);
|
|
2567
|
-
|
|
2568
2494
|
if (typeof opts.itemHeightEstimatorFn === 'function')
|
|
2569
2495
|
this.setItemHeightEstimatorFn(opts.itemHeightEstimatorFn);
|
|
2570
|
-
|
|
2571
2496
|
if (typeof opts.itemElementCreatorFn === 'function')
|
|
2572
2497
|
this.setItemElementCreatorFn(opts.itemElementCreatorFn);
|
|
2573
|
-
|
|
2574
2498
|
if (typeof opts.onItemRender === 'function')
|
|
2575
2499
|
this.setOnItemRender(opts.onItemRender);
|
|
2576
|
-
|
|
2577
2500
|
if (typeof opts.onItemUnrender === 'function')
|
|
2578
2501
|
this.setOnItemUnrender(opts.onItemUnrender);
|
|
2579
|
-
|
|
2580
2502
|
if (typeof opts.onScrollHeightChange === 'function')
|
|
2581
2503
|
this.setOnScrollHeightChange(opts.onScrollHeightChange);
|
|
2582
2504
|
}
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
* Clean up and free up all resources.
|
|
2505
|
+
/**
|
|
2506
|
+
* Clean up and free up all resources.
|
|
2586
2507
|
*/
|
|
2587
2508
|
destroy() {
|
|
2588
2509
|
if (this[DestroyedSymbol])
|
|
@@ -2590,252 +2511,178 @@ class VirtualListHelper {
|
|
|
2590
2511
|
this[DestroyedSymbol] = true;
|
|
2591
2512
|
this._unhookEvents().invalidate()._destroyElements();
|
|
2592
2513
|
}
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
* Sets whether 'scroll' event on the list should be hooked automatically.
|
|
2596
|
-
* @param {boolean} enabled
|
|
2597
|
-
* @returns {VirtualListHelper}
|
|
2514
|
+
/**
|
|
2515
|
+
* Sets whether 'scroll' event on the list should be hooked automatically.
|
|
2598
2516
|
*/
|
|
2599
2517
|
setHookScrollEvent(enabled) {
|
|
2600
2518
|
const p = this._p;
|
|
2601
2519
|
enabled = enabled === undefined ? true : !!enabled;
|
|
2602
|
-
|
|
2603
2520
|
if (p.hookScrollEvent === enabled)
|
|
2604
2521
|
return this;
|
|
2605
|
-
|
|
2606
2522
|
p.hookScrollEvent = enabled;
|
|
2607
|
-
|
|
2608
2523
|
this._unhookEvents()._hookEvents();
|
|
2609
|
-
|
|
2610
2524
|
return this;
|
|
2611
2525
|
}
|
|
2612
|
-
|
|
2613
|
-
/**
|
|
2614
|
-
* @returns {boolean} whether 'scroll' event on the list should be hooked automatically
|
|
2615
|
-
*/
|
|
2616
2526
|
isHookScrollEventEnabled() {
|
|
2617
2527
|
const p = this._p;
|
|
2618
2528
|
return p.hookScrollEvent;
|
|
2619
2529
|
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
*
|
|
2623
|
-
* You should probably call `render()` after this.
|
|
2624
|
-
* @param {number} count
|
|
2625
|
-
* @returns {VirtualListHelper}
|
|
2530
|
+
/**
|
|
2531
|
+
* Sets the list item count. <br />
|
|
2532
|
+
* You should probably call `render()` after this.
|
|
2626
2533
|
*/
|
|
2627
2534
|
setCount(count) {
|
|
2628
2535
|
const p = this._p;
|
|
2629
2536
|
p.count = count;
|
|
2630
|
-
|
|
2631
2537
|
return this.invalidate();
|
|
2632
2538
|
}
|
|
2633
|
-
|
|
2634
|
-
/**
|
|
2635
|
-
* @returns {number} current item count
|
|
2636
|
-
*/
|
|
2637
2539
|
getCount() {
|
|
2638
2540
|
const p = this._p;
|
|
2639
2541
|
return p.count;
|
|
2640
2542
|
}
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
*
|
|
2644
|
-
*
|
|
2645
|
-
* You should call `render()` to update the view.
|
|
2646
|
-
* @param {boolean} enabled
|
|
2647
|
-
* @returns {VirtualListHelper}
|
|
2543
|
+
/**
|
|
2544
|
+
* Switches between virtual and non-virtual mode. <br />
|
|
2545
|
+
* The list is invalidated automatically. <br />
|
|
2546
|
+
* You should call `render()` to update the view.
|
|
2648
2547
|
*/
|
|
2649
2548
|
setVirtual(enabled) {
|
|
2650
2549
|
const p = this._p;
|
|
2651
2550
|
enabled = enabled === undefined ? true : !!enabled;
|
|
2652
|
-
|
|
2653
2551
|
if (p.virtual === enabled)
|
|
2654
2552
|
return this;
|
|
2655
|
-
|
|
2656
2553
|
p.virtual = enabled;
|
|
2657
|
-
|
|
2658
2554
|
this._hookEvents().invalidate()._destroyElements();
|
|
2659
|
-
|
|
2660
2555
|
return this;
|
|
2661
2556
|
}
|
|
2662
|
-
|
|
2663
|
-
/**
|
|
2664
|
-
* @returns {boolean} virtual mode
|
|
2665
|
-
*/
|
|
2666
2557
|
isVirtual() {
|
|
2667
2558
|
const p = this._p;
|
|
2668
2559
|
return p.virtual;
|
|
2669
2560
|
}
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
*
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2675
|
-
*
|
|
2676
|
-
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2677
|
-
* @param {number} height - a positive number representing estimated item height.
|
|
2678
|
-
* @returns {VirtualListHelper}
|
|
2561
|
+
/**
|
|
2562
|
+
* Sets estimated item height to a positive number. <br />
|
|
2563
|
+
* No need to be accurate. <br />
|
|
2564
|
+
* The better the estimation - the better the scrollbar behavior will be. <br />
|
|
2565
|
+
* Applicable for virtual-mode only. <br />
|
|
2566
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2679
2567
|
*/
|
|
2680
2568
|
setEstimatedItemHeight(height) {
|
|
2681
2569
|
const p = this._p;
|
|
2682
2570
|
p.estimatedItemHeight = Math.abs((typeof height === 'number' ? height : Number(height)) || 20);
|
|
2683
2571
|
return this;
|
|
2684
2572
|
}
|
|
2685
|
-
|
|
2686
|
-
/**
|
|
2687
|
-
* @returns {number} current item height estimation
|
|
2688
|
-
*/
|
|
2689
2573
|
getEstimatedItemHeight() {
|
|
2690
2574
|
const p = this._p;
|
|
2691
2575
|
return p.estimatedItemHeight;
|
|
2692
2576
|
}
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
* Sets whether the virtual wrapper width should be set automatically. <br />
|
|
2696
|
-
* @param {boolean} enabled
|
|
2697
|
-
* @returns {VirtualListHelper}
|
|
2577
|
+
/**
|
|
2578
|
+
* Sets whether the virtual wrapper width should be set automatically. <br />
|
|
2698
2579
|
*/
|
|
2699
2580
|
setAutoVirtualWrapperWidth(enabled) {
|
|
2700
2581
|
const p = this._p;
|
|
2701
2582
|
p.autoVirtualWrapperWidth = enabled === undefined ? true : !!enabled;
|
|
2702
|
-
|
|
2703
2583
|
if (p.virtualWrapper) {
|
|
2704
2584
|
if (p.autoVirtualWrapperWidth !== p.virtualWrapperWidthWasSet) {
|
|
2705
2585
|
p.virtualWrapper.style.width = p.autoVirtualWrapperWidth ? '100%' : '';
|
|
2706
2586
|
p.virtualWrapperWidthWasSet = p.autoVirtualWrapperWidth;
|
|
2707
2587
|
}
|
|
2708
2588
|
}
|
|
2709
|
-
|
|
2710
2589
|
return this;
|
|
2711
2590
|
}
|
|
2712
|
-
|
|
2713
|
-
/**
|
|
2714
|
-
* @returns {boolean} whether the virtual wrapper width should be set automatically
|
|
2715
|
-
*/
|
|
2716
2591
|
isAutoVirtualWrapperWidth() {
|
|
2717
2592
|
const p = this._p;
|
|
2718
2593
|
return p.autoVirtualWrapperWidth;
|
|
2719
2594
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
* Sets the amount of buffer items to keep on each end of the list. <br />
|
|
2723
|
-
* Applicable for virtual-mode only.
|
|
2724
|
-
* @param {number} buffer - a positive value representing the count of buffer items for each end.
|
|
2725
|
-
* @returns {VirtualListHelper}
|
|
2595
|
+
/**
|
|
2596
|
+
* The buffer is a positive count of items on each end.
|
|
2597
|
+
* Sets the amount of buffer items to keep on each end of the list. <br />
|
|
2598
|
+
* Applicable for virtual-mode only.
|
|
2726
2599
|
*/
|
|
2727
2600
|
setBuffer(buffer) {
|
|
2728
2601
|
const p = this._p;
|
|
2729
2602
|
p.buffer = Math.abs(typeof buffer === 'number' ? buffer : Number(buffer) || 5);
|
|
2730
2603
|
return this;
|
|
2731
2604
|
}
|
|
2732
|
-
|
|
2733
|
-
/**
|
|
2734
|
-
* @returns {number} current buffer value
|
|
2735
|
-
*/
|
|
2736
2605
|
getBuffer() {
|
|
2737
2606
|
const p = this._p;
|
|
2738
2607
|
return p.buffer;
|
|
2739
2608
|
}
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
*
|
|
2743
|
-
*
|
|
2744
|
-
*
|
|
2745
|
-
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2746
|
-
* @param {VirtualListHelper~ItemHeightEstimatorFunction} fn
|
|
2747
|
-
* @returns {VirtualListHelper}
|
|
2609
|
+
/**
|
|
2610
|
+
* The `itemHeightEstimatorFn` is an alternative to `estimatedItemHeight` to give better estimations for specific item. <br/>
|
|
2611
|
+
* It's optional, and if it's present - it should return either a numeric height estimation,
|
|
2612
|
+
* or `undefined` to fall back to the default estimation. <br />
|
|
2613
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2748
2614
|
*/
|
|
2749
2615
|
setItemHeightEstimatorFn(fn) {
|
|
2750
2616
|
const p = this._p;
|
|
2751
2617
|
p.itemHeightEstimatorFn = fn;
|
|
2752
2618
|
return this;
|
|
2753
2619
|
}
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
*
|
|
2757
|
-
*
|
|
2758
|
-
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2759
|
-
* @param {VirtualListHelper~ItemElementCreatorFunction} fn
|
|
2760
|
-
* @returns {VirtualListHelper}
|
|
2620
|
+
/**
|
|
2621
|
+
* The `itemElementCreatorFn` is a function creating a basic item element, that will be possibly reused later. <br />
|
|
2622
|
+
* It has no association with a specific item index. <br />
|
|
2623
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2761
2624
|
*/
|
|
2762
2625
|
setItemElementCreatorFn(fn) {
|
|
2763
2626
|
const p = this._p;
|
|
2764
2627
|
p.itemElementCreatorFn = fn || defaultElementCreator;
|
|
2765
2628
|
return this;
|
|
2766
2629
|
}
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
*
|
|
2770
|
-
*
|
|
2771
|
-
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2772
|
-
* @param {VirtualListHelper~ItemRenderFunction} fn
|
|
2773
|
-
* @returns {VirtualListHelper}
|
|
2630
|
+
/**
|
|
2631
|
+
* The `onItemRender` is a function called for rendering the contents of an item. <br />
|
|
2632
|
+
* It's passed an `Element` and an item index. <br />
|
|
2633
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2774
2634
|
*/
|
|
2775
2635
|
setOnItemRender(fn) {
|
|
2776
2636
|
const p = this._p;
|
|
2777
2637
|
p.onItemRender = fn;
|
|
2778
2638
|
return this;
|
|
2779
2639
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
*
|
|
2783
|
-
*
|
|
2784
|
-
*
|
|
2785
|
-
* as by the time it's called - the indexes are probably not valid anymore.
|
|
2786
|
-
* @param {VirtualListHelper~ItemUnrenderFunction} fn
|
|
2787
|
-
* @returns {VirtualListHelper}
|
|
2640
|
+
/**
|
|
2641
|
+
* The `onItemUnrender` is a function called for freeing resources in an item element,
|
|
2642
|
+
* if you've attached something that needs to be explicitly freed. <br />
|
|
2643
|
+
* It's passed an `Element` only, and has no association with a specific index,
|
|
2644
|
+
* as by the time it's called - the indexes are probably not valid anymore.
|
|
2788
2645
|
*/
|
|
2789
2646
|
setOnItemUnrender(fn) {
|
|
2790
2647
|
const p = this._p;
|
|
2791
2648
|
p.onItemUnrender = fn;
|
|
2792
2649
|
return this;
|
|
2793
2650
|
}
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
* The `onScrollHeightChange` is a function called when the scroll height changes.
|
|
2797
|
-
* @param {function(height: number)} fn
|
|
2798
|
-
* @returns {VirtualListHelper}
|
|
2651
|
+
/**
|
|
2652
|
+
* The `onScrollHeightChange` is a function called when the scroll height changes.
|
|
2799
2653
|
*/
|
|
2800
2654
|
setOnScrollHeightChange(fn) {
|
|
2801
2655
|
const p = this._p;
|
|
2802
2656
|
p.onScrollHeightChange = fn;
|
|
2803
2657
|
return this;
|
|
2804
2658
|
}
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
* Estimates the full scroll height. This gets better as more renderings occur.
|
|
2808
|
-
* @returns {number}
|
|
2659
|
+
/**
|
|
2660
|
+
* Estimates the full scroll height. This gets better as more renderings occur.
|
|
2809
2661
|
*/
|
|
2810
2662
|
estimateFullHeight() {
|
|
2811
2663
|
const p = this._p;
|
|
2812
|
-
|
|
2813
2664
|
if (p.count === 0)
|
|
2814
2665
|
return 0;
|
|
2815
|
-
|
|
2816
2666
|
if (p.virtual) {
|
|
2817
2667
|
return this._calculateItemPosition(p.count) || 0;
|
|
2818
|
-
} else
|
|
2668
|
+
} else
|
|
2669
|
+
{
|
|
2819
2670
|
const existingEls = p.existingEls;
|
|
2820
2671
|
if (p.count === existingEls.length) {
|
|
2821
2672
|
let rect1 = existingEls[0].getBoundingClientRect();
|
|
2822
2673
|
let rect2 = existingEls[existingEls.length - 1].getBoundingClientRect();
|
|
2823
2674
|
return rect2.top - rect1.top + rect2.height;
|
|
2824
2675
|
}
|
|
2825
|
-
|
|
2826
2676
|
return this._calculateItemPosition(p.count) || 0;
|
|
2827
2677
|
}
|
|
2828
2678
|
}
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
*
|
|
2832
|
-
*
|
|
2833
|
-
* You should probably call `render()` after this.
|
|
2834
|
-
* @returns {VirtualListHelper}
|
|
2679
|
+
/**
|
|
2680
|
+
* States that the cached positions/heights are invalid,
|
|
2681
|
+
* and needs to be completely re-calculated.<br />
|
|
2682
|
+
* You should probably call `render()` after this.
|
|
2835
2683
|
*/
|
|
2836
2684
|
invalidatePositions() {
|
|
2837
2685
|
const p = this._p;
|
|
2838
|
-
|
|
2839
2686
|
p.itemPositionsNeedsUpdate = 0;
|
|
2840
2687
|
p.cachedItemHeights = [];
|
|
2841
2688
|
p.cachedItemEstimatedHeights = [];
|
|
@@ -2843,40 +2690,31 @@ class VirtualListHelper {
|
|
|
2843
2690
|
p.cachedItemHeights.length = p.count;
|
|
2844
2691
|
p.cachedItemEstimatedHeights.length = p.count;
|
|
2845
2692
|
p.cachedItemPositions.length = p.count;
|
|
2846
|
-
|
|
2847
2693
|
return this;
|
|
2848
2694
|
}
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
* You should probably call `render()` after this.
|
|
2854
|
-
* @returns {VirtualListHelper}
|
|
2695
|
+
/**
|
|
2696
|
+
* States that the indexes/item count/rendered content are invalid,
|
|
2697
|
+
* and needs to be completely re-calculated and re-rendered. <br />
|
|
2698
|
+
* You should probably call `render()` after this.
|
|
2855
2699
|
*/
|
|
2856
2700
|
invalidate() {
|
|
2857
2701
|
const p = this._p;
|
|
2858
|
-
|
|
2859
2702
|
this.invalidatePositions();
|
|
2860
|
-
|
|
2861
2703
|
if (!p.virtual) {
|
|
2862
2704
|
this._destroyElements();
|
|
2863
2705
|
}
|
|
2864
|
-
|
|
2865
2706
|
for (let el of p.existingEls)
|
|
2866
2707
|
delete el[ItemIndexSymbol];
|
|
2867
|
-
|
|
2868
2708
|
return this;
|
|
2869
2709
|
}
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
*
|
|
2873
|
-
*
|
|
2874
|
-
* In virtual mode, this is called automatically for every scroll event.
|
|
2710
|
+
/**
|
|
2711
|
+
* Renders the current viewport. <br />
|
|
2712
|
+
* Call this after making changes to the list. <br />
|
|
2713
|
+
* In virtual mode, this is called automatically for every scroll event.
|
|
2875
2714
|
*/
|
|
2876
2715
|
render() {
|
|
2877
2716
|
if (this[DestroyedSymbol])
|
|
2878
2717
|
return;
|
|
2879
|
-
|
|
2880
2718
|
const p = this._p;
|
|
2881
2719
|
const list = p.list;
|
|
2882
2720
|
const virtual = p.virtual;
|
|
@@ -2890,210 +2728,158 @@ class VirtualListHelper {
|
|
|
2890
2728
|
let onItemUnrender = p.onItemUnrender;
|
|
2891
2729
|
let existingEls = p.existingEls;
|
|
2892
2730
|
let existingCount = existingEls.length;
|
|
2893
|
-
|
|
2894
2731
|
if (virtual) {
|
|
2895
2732
|
const originalWidth = list.clientWidth;
|
|
2896
|
-
|
|
2897
2733
|
if (!virtualWrapper) {
|
|
2898
2734
|
virtualWrapper = p.virtualWrapper = p.userItemsParent;
|
|
2899
2735
|
if (!virtualWrapper) {
|
|
2900
2736
|
virtualWrapper = p.virtualWrapper = document.createElement('div');
|
|
2901
2737
|
list.appendChild(virtualWrapper);
|
|
2902
2738
|
}
|
|
2903
|
-
|
|
2904
2739
|
this._resetCurrentItemsParent();
|
|
2905
2740
|
itemParent = p.currentItemsParent;
|
|
2906
|
-
|
|
2907
2741
|
if (p.autoVirtualWrapperWidth) {
|
|
2908
2742
|
virtualWrapper.style.width = '100%';
|
|
2909
2743
|
p.virtualWrapperWidthWasSet = true;
|
|
2910
|
-
} else
|
|
2744
|
+
} else
|
|
2745
|
+
{
|
|
2911
2746
|
p.virtualWrapperWidthWasSet = false;
|
|
2912
2747
|
}
|
|
2913
2748
|
}
|
|
2914
|
-
|
|
2915
2749
|
// Mark all of them for potential reuse
|
|
2916
2750
|
for (let i = 0; i < existingCount; i++) {
|
|
2917
2751
|
existingEls[i][ReuseElSymbol] = true;
|
|
2918
2752
|
}
|
|
2919
|
-
|
|
2920
2753
|
// Make sure we have at least estimated positions for all items so we can translate scroll position
|
|
2921
2754
|
this._calculateItemPosition(p.count - 1);
|
|
2922
|
-
|
|
2923
2755
|
// Find existing elements index range
|
|
2924
2756
|
let existingRange = this._getExistingElsRange();
|
|
2925
|
-
|
|
2926
2757
|
// Find first visible element
|
|
2927
2758
|
let firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
|
|
2928
2759
|
let firstRenderIndex = Math.max(0, firstVisibleIndex - buffer);
|
|
2929
|
-
|
|
2930
2760
|
// Iterate over viewport
|
|
2931
2761
|
let index = firstRenderIndex;
|
|
2932
2762
|
let renderPos = this._calculateItemPosition(index);
|
|
2933
2763
|
let bufferEnd = buffer;
|
|
2934
|
-
|
|
2935
2764
|
// we want to render until viewport's bottom + buffer items
|
|
2936
2765
|
let maxIndexToRender = Math.max(index, binarySearchPosition(p.cachedItemPositions, visibleBottom - 1) + 1 + buffer);
|
|
2937
|
-
|
|
2938
2766
|
let insertedItems = [];
|
|
2939
|
-
|
|
2940
|
-
/** @type DocumentFragment|null */
|
|
2941
2767
|
let fragment = null;
|
|
2942
|
-
|
|
2943
2768
|
// Find the element to insert before
|
|
2944
2769
|
let before = virtualWrapper.childNodes[0];
|
|
2945
|
-
|
|
2946
2770
|
const findElementToReuse = function (index) {
|
|
2947
2771
|
// Find existing element to reuse
|
|
2948
|
-
/** @type Element|undefined */
|
|
2949
2772
|
let existingEl = undefined;
|
|
2950
|
-
|
|
2951
2773
|
if (existingRange.firstIndex !== -1 && index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
2952
2774
|
existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
|
|
2953
2775
|
}
|
|
2954
|
-
|
|
2955
2776
|
if (existingEl === undefined) {
|
|
2956
2777
|
existingEl = (existingRange.firstIndex < firstRenderIndex || existingRange.firstValidArrayIndex > 0 ?
|
|
2957
|
-
existingEls.find((x) =>
|
|
2958
|
-
(x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
|
|
2778
|
+
existingEls.find((x) => (x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
|
|
2959
2779
|
x[ReuseElSymbol] === true) :
|
|
2960
|
-
undefined) ||
|
|
2961
|
-
findLast(existingEls, (x) => x[ReuseElSymbol] === true);
|
|
2780
|
+
undefined) || findLast(existingEls, (x) => x[ReuseElSymbol] === true);
|
|
2962
2781
|
}
|
|
2963
|
-
|
|
2964
2782
|
if (existingEl !== undefined) {
|
|
2965
2783
|
delete existingEl[ReuseElSymbol];
|
|
2966
2784
|
}
|
|
2967
|
-
|
|
2968
2785
|
return existingEl;
|
|
2969
2786
|
};
|
|
2970
|
-
|
|
2971
2787
|
// First we iterate and try to add all at once in a fragment, as much as we can.
|
|
2972
2788
|
// And then reflow the at once.
|
|
2973
2789
|
for (; index < count && index < maxIndexToRender; index++) {
|
|
2974
2790
|
let existingEl = findElementToReuse(index);
|
|
2975
|
-
|
|
2976
2791
|
if (before && before === existingEl)
|
|
2977
2792
|
before = before.nextSibling;
|
|
2978
|
-
|
|
2979
2793
|
// Dequeue the element by reusing or creating a new one
|
|
2980
2794
|
const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
|
|
2981
2795
|
insertedItems.push([itemEl, index]);
|
|
2982
|
-
|
|
2983
2796
|
fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
|
|
2984
2797
|
}
|
|
2985
|
-
|
|
2986
2798
|
// Insert any remaining fragment
|
|
2987
2799
|
if (fragment && fragment.childNodes.length > 0) {
|
|
2988
2800
|
insertBefore(fragment, before, itemParent);
|
|
2989
2801
|
}
|
|
2990
|
-
|
|
2991
2802
|
// Iterate on inserted items and reflow them
|
|
2992
2803
|
for (let item of insertedItems) {
|
|
2993
2804
|
const index = item[1];
|
|
2994
2805
|
this._insertItemAndFlow(item[0], index, false /* inserted already */);
|
|
2995
2806
|
renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
|
|
2996
2807
|
}
|
|
2997
|
-
|
|
2998
2808
|
// See if we still need to insert more items
|
|
2999
2809
|
if (renderPos < visibleBottom) {
|
|
3000
2810
|
for (; (renderPos < visibleBottom || bufferEnd-- > 0) && index < count; index++) {
|
|
3001
2811
|
let existingEl = findElementToReuse(index);
|
|
3002
|
-
|
|
3003
2812
|
if (before && before === existingEl)
|
|
3004
2813
|
before = before.nextSibling;
|
|
3005
|
-
|
|
3006
2814
|
// Dequeue the element by reusing or creating a new one
|
|
3007
2815
|
this._dequeueElementForIndex(existingEl, index, before, false);
|
|
3008
|
-
|
|
3009
2816
|
// Increment pointers
|
|
3010
2817
|
renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
|
|
3011
2818
|
}
|
|
3012
2819
|
}
|
|
3013
|
-
|
|
3014
2820
|
// Calculate up-to-date scroll height
|
|
3015
2821
|
let scrollHeight = this.estimateFullHeight();
|
|
3016
2822
|
let scrollHeightPx = scrollHeight + 'px';
|
|
3017
|
-
|
|
3018
2823
|
if (virtualWrapper.style.height !== scrollHeightPx) {var _p$onScrollHeightChan;
|
|
3019
2824
|
virtualWrapper.style.height = scrollHeightPx;
|
|
3020
2825
|
(_p$onScrollHeightChan = p.onScrollHeightChange) === null || _p$onScrollHeightChan === void 0 || _p$onScrollHeightChan.call(p, scrollHeight);
|
|
3021
2826
|
}
|
|
3022
|
-
|
|
3023
2827
|
if (originalWidth !== list.clientWidth)
|
|
3024
2828
|
this.render();
|
|
3025
|
-
} else
|
|
2829
|
+
} else
|
|
2830
|
+
{// non-virtual
|
|
3026
2831
|
if (count !== existingEls.length) {
|
|
3027
2832
|
for (let i = 0; i < existingCount; i++) {
|
|
3028
2833
|
existingEls[i][ReuseElSymbol] = true;
|
|
3029
2834
|
}
|
|
3030
|
-
|
|
3031
2835
|
// Find the element to insert before
|
|
3032
2836
|
let before = itemParent.childNodes[0];
|
|
3033
|
-
|
|
3034
|
-
/** @type DocumentFragment|null */
|
|
3035
2837
|
let fragment = null;
|
|
3036
|
-
|
|
3037
2838
|
for (let index = 0; index < count; index++) {
|
|
3038
2839
|
// Find existing element to reuse
|
|
3039
2840
|
let existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
|
|
3040
|
-
|
|
3041
2841
|
if (existingEl !== undefined) {
|
|
3042
2842
|
delete existingEl[ReuseElSymbol];
|
|
3043
2843
|
}
|
|
3044
|
-
|
|
3045
2844
|
if (before && before === existingEl)
|
|
3046
2845
|
before = before.nextSibling;
|
|
3047
|
-
|
|
3048
2846
|
// Dequeue the element by reusing or creating a new one
|
|
3049
2847
|
const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
|
|
3050
|
-
|
|
3051
2848
|
fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
|
|
3052
2849
|
}
|
|
3053
|
-
|
|
3054
2850
|
// Insert any remaining fragment
|
|
3055
2851
|
if (fragment && fragment.childNodes.length > 0) {
|
|
3056
2852
|
insertBefore(fragment, before, itemParent);
|
|
3057
2853
|
}
|
|
3058
2854
|
}
|
|
3059
2855
|
}
|
|
3060
|
-
|
|
3061
2856
|
// Cleanup extra unused elements
|
|
3062
2857
|
existingCount = existingEls.length; // May have changed
|
|
3063
2858
|
for (let i = 0; i < existingCount; i++) {
|
|
3064
2859
|
const el = existingEls[i];
|
|
3065
|
-
if (el[ReuseElSymbol] !== true)
|
|
3066
|
-
|
|
2860
|
+
if (el[ReuseElSymbol] !== true)
|
|
2861
|
+
continue;
|
|
3067
2862
|
let parent = el.parentNode;
|
|
3068
2863
|
if (parent)
|
|
3069
2864
|
parent.removeChild(el);
|
|
3070
2865
|
if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
|
|
3071
2866
|
onItemUnrender(el);
|
|
3072
2867
|
existingEls.splice(i, 1);
|
|
3073
|
-
|
|
3074
2868
|
i--;
|
|
3075
2869
|
existingCount--;
|
|
3076
2870
|
}
|
|
3077
2871
|
}
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
*
|
|
3081
|
-
* Virtual mode: Call `render()` to update the view after making changes.
|
|
3082
|
-
* @param {number} count
|
|
3083
|
-
* @param {number} [atIndex=-1]
|
|
3084
|
-
* @returns {VirtualListHelper}
|
|
2872
|
+
/**
|
|
2873
|
+
* States that items were added at a certain position in the list. <br />
|
|
2874
|
+
* Virtual mode: Call `render()` to update the view after making changes.
|
|
3085
2875
|
*/
|
|
3086
2876
|
addItemsAt(count, atIndex = -1) {
|
|
3087
2877
|
if (typeof count !== 'number' || count <= 0)
|
|
3088
2878
|
return this;
|
|
3089
|
-
|
|
3090
2879
|
const p = this._p;
|
|
3091
|
-
|
|
3092
2880
|
if (atIndex < 0 || atIndex >= p.count)
|
|
3093
2881
|
atIndex = p.count;
|
|
3094
|
-
|
|
3095
2882
|
p.count += count;
|
|
3096
|
-
|
|
3097
2883
|
if (p.virtual) {
|
|
3098
2884
|
if (atIndex >= 0 && atIndex < p.count) {
|
|
3099
2885
|
this._invalidateItemIndexesAt(atIndex, -1);
|
|
@@ -3104,54 +2890,36 @@ class VirtualListHelper {
|
|
|
3104
2890
|
let existingCount = existingEls.length;
|
|
3105
2891
|
if (existingCount !== p.count - count)
|
|
3106
2892
|
return this;
|
|
3107
|
-
|
|
3108
2893
|
let existingRange = this._getExistingElsRange();
|
|
3109
2894
|
if (existingRange.firstValidArrayIndex === -1)
|
|
3110
2895
|
return this;
|
|
3111
|
-
|
|
3112
2896
|
const itemParent = p.currentItemsParent;
|
|
3113
|
-
|
|
3114
2897
|
let startIndex = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
|
|
3115
|
-
|
|
3116
2898
|
this._pushItemIndexesAt(atIndex, count);
|
|
3117
|
-
|
|
3118
|
-
/** @type Node|undefined */
|
|
3119
2899
|
let before = existingEls[startIndex - 1] ?
|
|
3120
2900
|
existingEls[startIndex - 1].nextSibling :
|
|
3121
2901
|
existingEls[0];
|
|
3122
|
-
|
|
3123
|
-
/** @type DocumentFragment|null */
|
|
3124
2902
|
let fragment = null;
|
|
3125
|
-
|
|
3126
2903
|
for (let index = atIndex, end = atIndex + count; index < end; index++) {
|
|
3127
2904
|
const itemEl = this._dequeueElementForIndex(undefined, index, before, true);
|
|
3128
2905
|
fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
|
|
3129
2906
|
}
|
|
3130
|
-
|
|
3131
2907
|
// Insert any remaining fragment
|
|
3132
2908
|
if (fragment && fragment.childNodes.length > 0) {
|
|
3133
2909
|
insertBefore(fragment, before, itemParent);
|
|
3134
2910
|
}
|
|
3135
2911
|
}
|
|
3136
|
-
|
|
3137
2912
|
return this;
|
|
3138
2913
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
*
|
|
3142
|
-
* Virtual mode: Call `render()` to update the view after making changes.
|
|
3143
|
-
* @param {number} count
|
|
3144
|
-
* @param {number} atIndex
|
|
3145
|
-
* @returns {VirtualListHelper}
|
|
2914
|
+
/**
|
|
2915
|
+
* States that items were removed at a certain position in the list. <br />
|
|
2916
|
+
* Virtual mode: Call `render()` to update the view after making changes.
|
|
3146
2917
|
*/
|
|
3147
2918
|
removeItemsAt(count, atIndex) {
|
|
3148
2919
|
const p = this._p;
|
|
3149
|
-
|
|
3150
2920
|
if (typeof count !== 'number' || typeof atIndex !== 'number' || count <= 0 || atIndex < 0 || atIndex >= p.count)
|
|
3151
2921
|
return this;
|
|
3152
|
-
|
|
3153
2922
|
p.count -= Math.min(count, p.count - atIndex);
|
|
3154
|
-
|
|
3155
2923
|
if (p.virtual) {
|
|
3156
2924
|
this._invalidateItemIndexesAt(atIndex, -1);
|
|
3157
2925
|
} else
|
|
@@ -3160,19 +2928,15 @@ class VirtualListHelper {
|
|
|
3160
2928
|
let existingCount = existingEls.length;
|
|
3161
2929
|
if (existingCount !== p.count + count)
|
|
3162
2930
|
return this;
|
|
3163
|
-
|
|
3164
2931
|
let existingRange = this._getExistingElsRange();
|
|
3165
2932
|
if (existingRange.firstValidArrayIndex === -1)
|
|
3166
2933
|
return this;
|
|
3167
|
-
|
|
3168
2934
|
this._pushItemIndexesAt(atIndex + count, -count);
|
|
3169
|
-
|
|
3170
2935
|
const onItemUnrender = p.onItemUnrender;
|
|
3171
2936
|
let index = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
|
|
3172
2937
|
if (index < existingEls.length) {
|
|
3173
2938
|
for (let i = 0; i < count; i++) {
|
|
3174
2939
|
let itemEl = existingEls[index + i];
|
|
3175
|
-
|
|
3176
2940
|
let parent = itemEl.parentNode;
|
|
3177
2941
|
if (parent)
|
|
3178
2942
|
parent.removeChild(itemEl);
|
|
@@ -3182,23 +2946,17 @@ class VirtualListHelper {
|
|
|
3182
2946
|
existingEls.splice(index, count);
|
|
3183
2947
|
}
|
|
3184
2948
|
}
|
|
3185
|
-
|
|
3186
2949
|
return this;
|
|
3187
2950
|
}
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
*
|
|
3191
|
-
*
|
|
3192
|
-
* Non-virtual mode - the element is re-rendered immediately.
|
|
3193
|
-
* @param {number} index - the index of the element to re-render
|
|
3194
|
-
* @returns {VirtualListHelper}
|
|
2951
|
+
/**
|
|
2952
|
+
* Mark an element for a re-render. <br />
|
|
2953
|
+
* Virtual mode: Call `render()` to update the view after making changes. <br />
|
|
2954
|
+
* Non-virtual mode - the element is re-rendered immediately.
|
|
3195
2955
|
*/
|
|
3196
2956
|
refreshItemAt(index) {
|
|
3197
2957
|
const p = this._p;
|
|
3198
|
-
|
|
3199
2958
|
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3200
2959
|
return this;
|
|
3201
|
-
|
|
3202
2960
|
if (p.virtual) {
|
|
3203
2961
|
this._invalidateItemIndexesAt(index, 1);
|
|
3204
2962
|
} else
|
|
@@ -3207,128 +2965,93 @@ class VirtualListHelper {
|
|
|
3207
2965
|
let existingCount = existingEls.length;
|
|
3208
2966
|
if (existingCount !== p.count)
|
|
3209
2967
|
return this;
|
|
3210
|
-
|
|
3211
2968
|
let existingRange = this._getExistingElsRange();
|
|
3212
|
-
|
|
3213
2969
|
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3214
2970
|
let itemEl = existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
|
|
3215
2971
|
delete itemEl[ItemIndexSymbol];
|
|
3216
2972
|
this._dequeueElementForIndex(itemEl, index, itemEl.nextSibling, false);
|
|
3217
2973
|
}
|
|
3218
2974
|
}
|
|
3219
|
-
|
|
3220
2975
|
return this;
|
|
3221
2976
|
}
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
* Tests whether an item at the specified index is rendered.
|
|
3225
|
-
* @param {number} index - the index to test
|
|
3226
|
-
* @returns {boolean}
|
|
2977
|
+
/**
|
|
2978
|
+
* Tests whether an item at the specified index is rendered.
|
|
3227
2979
|
*/
|
|
3228
2980
|
isItemRendered(index) {
|
|
3229
2981
|
const p = this._p;
|
|
3230
|
-
|
|
3231
2982
|
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3232
2983
|
return false;
|
|
3233
|
-
|
|
3234
2984
|
let existingRange = this._getExistingElsRange();
|
|
3235
|
-
|
|
3236
2985
|
return index >= existingRange.firstIndex && index <= existingRange.lastIndex;
|
|
3237
2986
|
}
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
* Retrieves DOM element for the item at the specified index - if it's currently rendered.
|
|
3241
|
-
* @param {number} index - the index to retrieve
|
|
3242
|
-
* @returns {Element|undefined}
|
|
2987
|
+
/**
|
|
2988
|
+
* Retrieves DOM element for the item at the specified index - if it's currently rendered.
|
|
3243
2989
|
*/
|
|
3244
2990
|
getItemElementAt(index) {
|
|
3245
2991
|
const p = this._p;
|
|
3246
|
-
|
|
3247
2992
|
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3248
2993
|
return undefined;
|
|
3249
|
-
|
|
3250
2994
|
let existingEls = p.existingEls;
|
|
3251
2995
|
let existingRange = this._getExistingElsRange();
|
|
3252
|
-
|
|
3253
2996
|
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3254
2997
|
return existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
|
|
3255
2998
|
}
|
|
3256
|
-
|
|
3257
2999
|
return undefined;
|
|
3258
3000
|
}
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
*
|
|
3262
|
-
* Can be used to scroll to a specific item.
|
|
3263
|
-
* @param {number} index
|
|
3264
|
-
* @returns {number|undefined}
|
|
3001
|
+
/**
|
|
3002
|
+
* Retrieves the position for the specified index. <br />
|
|
3003
|
+
* Can be used to scroll to a specific item.
|
|
3265
3004
|
*/
|
|
3266
3005
|
getItemPosition(index) {
|
|
3267
3006
|
const p = this._p;
|
|
3268
|
-
|
|
3269
3007
|
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3270
3008
|
return undefined;
|
|
3271
|
-
|
|
3272
3009
|
if (p.virtual) {
|
|
3273
3010
|
return this._calculateItemPosition(index);
|
|
3274
|
-
} else
|
|
3011
|
+
} else
|
|
3012
|
+
{
|
|
3275
3013
|
let itemEl = this.getItemElementAt(index);
|
|
3276
3014
|
if (itemEl === undefined)
|
|
3277
3015
|
return undefined;
|
|
3278
|
-
|
|
3279
3016
|
const list = p.list;
|
|
3280
3017
|
return getElementOffset(itemEl).top - getElementOffset(list).top + list.scrollTop;
|
|
3281
3018
|
}
|
|
3282
3019
|
}
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
* Retrieves the item index for the specified element
|
|
3286
|
-
* @param {Element} el
|
|
3287
|
-
* @returns {number|undefined}
|
|
3020
|
+
/**
|
|
3021
|
+
* Retrieves the item index for the specified element
|
|
3288
3022
|
*/
|
|
3289
3023
|
getItemIndexFromElement(el) {
|
|
3290
3024
|
return el ? el[ItemIndexSymbol] : undefined;
|
|
3291
3025
|
}
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
* Retrieves the size (or estimated size, if unknown) for the specified index. <br />
|
|
3295
|
-
* @param {number} index
|
|
3296
|
-
* @returns {number|undefined}
|
|
3026
|
+
/**
|
|
3027
|
+
* Retrieves the size (or estimated size, if unknown) for the specified index. <br />
|
|
3297
3028
|
*/
|
|
3298
3029
|
getItemSize(index) {
|
|
3299
3030
|
const p = this._p;
|
|
3300
|
-
|
|
3301
3031
|
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3302
3032
|
return undefined;
|
|
3303
|
-
|
|
3304
|
-
let height = p.cachedItemHeights[index - 1]; // already calculated
|
|
3305
|
-
|
|
3033
|
+
let height = p.cachedItemHeights[index]; // already calculated
|
|
3306
3034
|
if (height === undefined) {
|
|
3307
|
-
height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index
|
|
3308
|
-
|
|
3035
|
+
height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index) : null; // estimated per item
|
|
3309
3036
|
if (typeof height !== 'number')
|
|
3310
3037
|
height = p.estimatedItemHeight; // estimated
|
|
3311
|
-
|
|
3312
|
-
p.cachedItemEstimatedHeights[index - 1] = height;
|
|
3038
|
+
p.cachedItemEstimatedHeights[index] = height;
|
|
3313
3039
|
}
|
|
3314
|
-
|
|
3315
3040
|
return height;
|
|
3316
3041
|
}
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
* Retrieves the number of items that fit into the current viewport.
|
|
3320
|
-
* @returns {number}
|
|
3042
|
+
/**
|
|
3043
|
+
* Retrieves the number of items that fit into the current viewport.
|
|
3321
3044
|
*/
|
|
3322
3045
|
getVisibleItemCount() {
|
|
3323
3046
|
const p = this._p,list = p.list;
|
|
3324
|
-
|
|
3325
3047
|
let scrollTop = list.scrollTop;
|
|
3326
3048
|
let visibleHeight = list.clientHeight;
|
|
3327
3049
|
let firstVisibleIndex, lastVisibleIndex;
|
|
3328
|
-
|
|
3050
|
+
if (p.count === 0 || visibleHeight === 0)
|
|
3051
|
+
return 0;
|
|
3329
3052
|
if (p.virtual) {
|
|
3330
|
-
firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
|
|
3331
|
-
lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex);
|
|
3053
|
+
firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop, 0, p.count - 1);
|
|
3054
|
+
lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex, p.count - 1);
|
|
3332
3055
|
} else
|
|
3333
3056
|
{
|
|
3334
3057
|
const retriever = (i) => {
|
|
@@ -3337,32 +3060,28 @@ class VirtualListHelper {
|
|
|
3337
3060
|
pos = Infinity;
|
|
3338
3061
|
return pos;
|
|
3339
3062
|
};
|
|
3340
|
-
|
|
3341
3063
|
firstVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop);
|
|
3342
3064
|
lastVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop + visibleHeight, firstVisibleIndex);
|
|
3343
3065
|
}
|
|
3344
|
-
|
|
3345
3066
|
if (this.getItemPosition(lastVisibleIndex) === scrollTop + visibleHeight)
|
|
3346
3067
|
lastVisibleIndex--;
|
|
3347
3068
|
return lastVisibleIndex - firstVisibleIndex + 1;
|
|
3348
3069
|
}
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
*
|
|
3352
|
-
*
|
|
3353
|
-
* @param {boolean} append - whether to append the item element to the DOM
|
|
3354
|
-
* @param {function(itemEl: Element)} ghostTester - the function that will receive the element, called synchronously.
|
|
3070
|
+
/**
|
|
3071
|
+
* The ghost index is passed directly to the renderer. The tester is called synchronously.
|
|
3072
|
+
* Appends the element to the DOM only when append is true.
|
|
3073
|
+
* Renders a temporary ghost item. Can be used for testings several aspects of a proposed element, i.e measurements.
|
|
3355
3074
|
*/
|
|
3356
3075
|
createGhostItemElement(ghostIndex, append, ghostTester) {
|
|
3357
3076
|
const p = this._p;
|
|
3358
|
-
|
|
3359
3077
|
let itemEl = this._dequeueElementForIndex(null, ghostIndex, false, true);
|
|
3360
3078
|
try {
|
|
3361
3079
|
if (append) {
|
|
3362
3080
|
p.currentItemsParent.appendChild(itemEl);
|
|
3363
3081
|
}
|
|
3364
3082
|
ghostTester(itemEl);
|
|
3365
|
-
} finally
|
|
3083
|
+
} finally
|
|
3084
|
+
{
|
|
3366
3085
|
if (append) {
|
|
3367
3086
|
let parent = itemEl.parentNode;
|
|
3368
3087
|
if (parent)
|
|
@@ -3372,38 +3091,30 @@ class VirtualListHelper {
|
|
|
3372
3091
|
p.onItemUnrender(itemEl);
|
|
3373
3092
|
}
|
|
3374
3093
|
}
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
* Reset the pointer to the current items wrapper
|
|
3378
|
-
* @private
|
|
3094
|
+
/**
|
|
3095
|
+
* Reset the pointer to the current items wrapper
|
|
3379
3096
|
*/
|
|
3380
3097
|
_resetCurrentItemsParent() {var _ref, _p$virtualWrapper;
|
|
3381
3098
|
const p = this._p;
|
|
3382
3099
|
p.currentItemsParent = (_ref = (_p$virtualWrapper = p.virtualWrapper) !== null && _p$virtualWrapper !== void 0 ? _p$virtualWrapper : p.userItemsParent) !== null && _ref !== void 0 ? _ref : p.list;
|
|
3383
3100
|
}
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
* Destroy all created elements, for cleanup
|
|
3387
|
-
* @returns {VirtualListHelper}
|
|
3388
|
-
* @private
|
|
3101
|
+
/**
|
|
3102
|
+
* Destroy all created elements, for cleanup
|
|
3389
3103
|
*/
|
|
3390
3104
|
_destroyElements() {
|
|
3391
3105
|
const p = this._p;
|
|
3392
3106
|
const onItemUnrender = p.onItemUnrender;
|
|
3393
3107
|
const existingEls = p.existingEls;
|
|
3394
|
-
|
|
3395
3108
|
for (let i = 0; i < existingEls.length; i++) {
|
|
3396
3109
|
const el = existingEls[i];
|
|
3397
|
-
|
|
3398
3110
|
let parent = el.parentNode;
|
|
3399
3111
|
if (parent)
|
|
3400
3112
|
parent.removeChild(el);
|
|
3401
|
-
|
|
3113
|
+
// Invalidation clears index metadata, but the element still owns rendered resources.
|
|
3114
|
+
if (onItemUnrender)
|
|
3402
3115
|
onItemUnrender(el);
|
|
3403
3116
|
}
|
|
3404
|
-
|
|
3405
3117
|
existingEls.length = 0;
|
|
3406
|
-
|
|
3407
3118
|
if (p.virtualWrapper) {
|
|
3408
3119
|
if (p.virtualWrapper !== p.userItemsParent) {
|
|
3409
3120
|
if (p.virtualWrapper.parentNode) {
|
|
@@ -3413,203 +3124,135 @@ class VirtualListHelper {
|
|
|
3413
3124
|
p.virtualWrapper = null;
|
|
3414
3125
|
this._resetCurrentItemsParent();
|
|
3415
3126
|
}
|
|
3416
|
-
|
|
3417
3127
|
return this;
|
|
3418
3128
|
}
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
*
|
|
3422
|
-
* Applicable for virtual mode only.
|
|
3423
|
-
* @param {number} index
|
|
3424
|
-
* @param {number} count
|
|
3425
|
-
* @private
|
|
3129
|
+
/**
|
|
3130
|
+
* Marks (an) item(s) at specific index(es) as to be re-rendered. <br />
|
|
3131
|
+
* Applicable for virtual mode only.
|
|
3426
3132
|
*/
|
|
3427
3133
|
_invalidateItemIndexesAt(index, count) {
|
|
3428
3134
|
const p = this._p;
|
|
3429
|
-
|
|
3430
3135
|
this._setItemPositionsNeedsUpdate(index);
|
|
3431
|
-
|
|
3432
3136
|
let existingEls = p.existingEls;
|
|
3433
3137
|
let existingCount = existingEls.length;
|
|
3434
3138
|
let existingRange = this._getExistingElsRange();
|
|
3435
|
-
|
|
3436
3139
|
if (existingRange.firstValidArrayIndex === -1)
|
|
3437
3140
|
return;
|
|
3438
|
-
|
|
3439
3141
|
if (count === -1)
|
|
3440
3142
|
count = existingEls.length;
|
|
3441
|
-
|
|
3442
3143
|
// Clean
|
|
3443
3144
|
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3444
|
-
for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex,
|
|
3445
|
-
c = 0;
|
|
3446
|
-
i < existingCount && c < count;
|
|
3447
|
-
i++, c++)
|
|
3145
|
+
for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex, c = 0; i < existingCount && c < count; i++, c++)
|
|
3448
3146
|
delete existingEls[i][ItemIndexSymbol];
|
|
3449
3147
|
}
|
|
3450
3148
|
}
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
*
|
|
3454
|
-
*
|
|
3455
|
-
* Applicable for non-virtual mode only.
|
|
3456
|
-
* @param {number} index
|
|
3457
|
-
* @param {number} count
|
|
3458
|
-
* @private
|
|
3149
|
+
/**
|
|
3150
|
+
* In/decrement the item-index marker for specific item(s). <br />
|
|
3151
|
+
* Used for inserting/removing items in the middle of the list, without re-rendering everything. <br />
|
|
3152
|
+
* Applicable for non-virtual mode only.
|
|
3459
3153
|
*/
|
|
3460
3154
|
_pushItemIndexesAt(index, count) {
|
|
3461
3155
|
const p = this._p;
|
|
3462
|
-
|
|
3463
3156
|
let existingEls = p.existingEls;
|
|
3464
3157
|
let existingCount = existingEls.length;
|
|
3465
3158
|
let existingRange = this._getExistingElsRange();
|
|
3466
|
-
|
|
3467
3159
|
if (existingRange.firstValidArrayIndex === -1)
|
|
3468
3160
|
return;
|
|
3469
|
-
|
|
3470
3161
|
// Clean
|
|
3471
3162
|
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3472
|
-
for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex;
|
|
3473
|
-
i < existingCount;
|
|
3474
|
-
i++)
|
|
3163
|
+
for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex; i < existingCount; i++)
|
|
3475
3164
|
existingEls[i][ItemIndexSymbol] += count;
|
|
3476
3165
|
}
|
|
3477
3166
|
}
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
* Hook relevant events
|
|
3481
|
-
* @returns {VirtualListHelper}
|
|
3482
|
-
* @private
|
|
3167
|
+
/**
|
|
3168
|
+
* Hook relevant events
|
|
3483
3169
|
*/
|
|
3484
3170
|
_hookEvents() {
|
|
3485
3171
|
const p = this._p;
|
|
3486
|
-
|
|
3487
3172
|
this._unhookEvents();
|
|
3488
|
-
|
|
3489
3173
|
if (p.virtual && p.hookScrollEvent) {
|
|
3490
|
-
p.list && p.list.addEventListener('scroll',
|
|
3174
|
+
p.list && p.list.addEventListener('scroll', p.boundRender);
|
|
3491
3175
|
}
|
|
3492
|
-
|
|
3493
3176
|
return this;
|
|
3494
3177
|
}
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
* Unhook previously hooked events
|
|
3498
|
-
* @returns {VirtualListHelper}
|
|
3499
|
-
* @private
|
|
3178
|
+
/**
|
|
3179
|
+
* Unhook previously hooked events
|
|
3500
3180
|
*/
|
|
3501
3181
|
_unhookEvents() {
|
|
3502
3182
|
const p = this._p;
|
|
3503
|
-
|
|
3504
|
-
p.list && p.list.removeEventListener('scroll', /**@type Function*/p.boundRender);
|
|
3505
|
-
|
|
3183
|
+
p.list && p.list.removeEventListener('scroll', p.boundRender);
|
|
3506
3184
|
return this;
|
|
3507
3185
|
}
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
*
|
|
3511
|
-
* Applicable for virtual mode only.
|
|
3512
|
-
* @param {number} value
|
|
3513
|
-
* @private
|
|
3186
|
+
/**
|
|
3187
|
+
* Mark item index from which the positions are not considered valid anymore. <br />
|
|
3188
|
+
* Applicable for virtual mode only.
|
|
3514
3189
|
*/
|
|
3515
3190
|
_setItemPositionsNeedsUpdate(value) {
|
|
3516
3191
|
const p = this._p;
|
|
3517
|
-
|
|
3518
3192
|
if (value < p.itemPositionsNeedsUpdate) {
|
|
3519
3193
|
p.itemPositionsNeedsUpdate = value;
|
|
3520
3194
|
}
|
|
3521
3195
|
}
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
*
|
|
3525
|
-
*
|
|
3526
|
-
* Applicable for non-virtual mode only.
|
|
3527
|
-
* @param {number} index
|
|
3528
|
-
* @returns {number|undefined}
|
|
3529
|
-
* @private
|
|
3196
|
+
/**
|
|
3197
|
+
* Calculates an item's top position (and stores in the private `cachedItemPositions` array). <br />
|
|
3198
|
+
* Allows calculating last+1 index too, to get the bottom-most position. <br />
|
|
3199
|
+
* Applicable for non-virtual mode only.
|
|
3530
3200
|
*/
|
|
3531
3201
|
_calculateItemPosition(index) {
|
|
3532
3202
|
const p = this._p;
|
|
3533
|
-
|
|
3534
3203
|
const cachedItemPositions = p.cachedItemPositions;
|
|
3535
|
-
|
|
3536
3204
|
if (index >= p.itemPositionsNeedsUpdate) {
|
|
3537
3205
|
const count = p.count;
|
|
3538
3206
|
const cachedItemHeights = p.cachedItemHeights;
|
|
3539
3207
|
const cachedItemEstimatedHeights = p.cachedItemEstimatedHeights;
|
|
3540
3208
|
const estimatedItemHeight = p.estimatedItemHeight;
|
|
3541
3209
|
const itemHeightEstimatorFn = p.itemHeightEstimatorFn;
|
|
3542
|
-
|
|
3543
3210
|
if (cachedItemHeights.length !== count) {
|
|
3544
3211
|
cachedItemHeights.length = count;
|
|
3545
3212
|
cachedItemEstimatedHeights.length = count;
|
|
3546
3213
|
cachedItemPositions.length = count;
|
|
3547
3214
|
}
|
|
3548
|
-
|
|
3549
3215
|
let fromIndex = p.itemPositionsNeedsUpdate;
|
|
3550
3216
|
let toIndex = Math.min(index, count);
|
|
3551
|
-
|
|
3552
3217
|
let pos = 0;
|
|
3553
|
-
|
|
3554
3218
|
if (fromIndex > 0) {
|
|
3555
3219
|
pos = cachedItemPositions[fromIndex - 1];
|
|
3556
3220
|
}
|
|
3557
|
-
|
|
3558
3221
|
for (let i = fromIndex; i <= toIndex; i++) {
|
|
3559
3222
|
if (i === 0) {
|
|
3560
3223
|
cachedItemPositions[i] = pos;
|
|
3561
3224
|
continue;
|
|
3562
3225
|
}
|
|
3563
|
-
|
|
3564
3226
|
const prevIndex = i - 1;
|
|
3565
|
-
|
|
3566
3227
|
let height = cachedItemHeights[prevIndex]; // already calculated
|
|
3567
|
-
|
|
3568
3228
|
if (height === undefined) {
|
|
3569
3229
|
height = itemHeightEstimatorFn ? itemHeightEstimatorFn(prevIndex) : null; // estimated per item
|
|
3570
|
-
|
|
3571
3230
|
if (typeof height !== 'number')
|
|
3572
3231
|
height = estimatedItemHeight; // estimated
|
|
3573
|
-
|
|
3574
3232
|
cachedItemEstimatedHeights[prevIndex] = height;
|
|
3575
3233
|
}
|
|
3576
|
-
|
|
3577
3234
|
pos += height;
|
|
3578
3235
|
cachedItemPositions[i] = pos;
|
|
3579
3236
|
}
|
|
3580
|
-
|
|
3581
3237
|
p.itemPositionsNeedsUpdate = toIndex + 1;
|
|
3582
3238
|
}
|
|
3583
|
-
|
|
3584
3239
|
// item after the last (calculate full height)
|
|
3585
3240
|
if (index > 0 && index === p.count) {
|
|
3586
3241
|
let height = p.cachedItemHeights[index - 1]; // already calculated
|
|
3587
|
-
|
|
3588
3242
|
if (height === undefined) {
|
|
3589
3243
|
height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
|
|
3590
|
-
|
|
3591
3244
|
if (typeof height !== 'number')
|
|
3592
3245
|
height = p.estimatedItemHeight; // estimated
|
|
3593
|
-
|
|
3594
3246
|
p.cachedItemEstimatedHeights[index - 1] = height;
|
|
3595
3247
|
}
|
|
3596
|
-
|
|
3597
3248
|
return cachedItemPositions[index - 1] + height;
|
|
3598
3249
|
}
|
|
3599
|
-
|
|
3600
3250
|
return cachedItemPositions[index];
|
|
3601
3251
|
}
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
*
|
|
3605
|
-
*
|
|
3606
|
-
* This will also update the element's position in the `existingEls` array.
|
|
3607
|
-
* @param {Element|undefined} itemEl
|
|
3608
|
-
* @param {number} index
|
|
3609
|
-
* @param {Node|boolean|undefined} insertBefore
|
|
3610
|
-
* @param {boolean|undefined} avoidDomReflow
|
|
3611
|
-
* @returns {Element}
|
|
3612
|
-
* @private
|
|
3252
|
+
/**
|
|
3253
|
+
* Create (or reuse an existing) element for an item at the specified index,
|
|
3254
|
+
* and insert physically at specified position. <br />
|
|
3255
|
+
* This will also update the element's position in the `existingEls` array.
|
|
3613
3256
|
*/
|
|
3614
3257
|
_dequeueElementForIndex(itemEl, index, insertBefore, avoidDomReflow) {
|
|
3615
3258
|
const p = this._p;
|
|
@@ -3620,138 +3263,111 @@ class VirtualListHelper {
|
|
|
3620
3263
|
const onItemUnrender = p.onItemUnrender;
|
|
3621
3264
|
const isNew = !itemEl;
|
|
3622
3265
|
const shouldReRender = isNew || index !== itemEl[ItemIndexSymbol];
|
|
3623
|
-
|
|
3624
3266
|
if (itemEl) {
|
|
3625
3267
|
if (onItemUnrender && shouldReRender) {
|
|
3626
3268
|
onItemUnrender(itemEl);
|
|
3627
3269
|
}
|
|
3628
|
-
} else
|
|
3270
|
+
} else
|
|
3271
|
+
{
|
|
3629
3272
|
itemEl = p.itemElementCreatorFn();
|
|
3630
|
-
|
|
3631
3273
|
if (virtualWrapper && insertBefore !== false) {
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3274
|
+
itemEl.style.position = 'absolute';
|
|
3275
|
+
itemEl.style.top = '0';
|
|
3276
|
+
itemEl.style.left = '0';
|
|
3277
|
+
itemEl.style.right = '0';
|
|
3636
3278
|
}
|
|
3637
3279
|
}
|
|
3638
|
-
|
|
3639
3280
|
// Render only if it's a new item element
|
|
3640
3281
|
// OR the index of the existing element is not the same of the index to render
|
|
3641
3282
|
if (shouldReRender) {
|
|
3642
3283
|
itemEl.innerHTML = ''; // Basic cleanup
|
|
3643
|
-
|
|
3644
3284
|
if (onItemRender)
|
|
3645
3285
|
onItemRender(itemEl, index);
|
|
3646
3286
|
}
|
|
3647
|
-
|
|
3648
3287
|
if (insertBefore !== false) {
|
|
3649
3288
|
if (!(insertBefore instanceof Node))
|
|
3650
3289
|
insertBefore = null;
|
|
3651
|
-
|
|
3652
3290
|
// Remove from existing list
|
|
3653
3291
|
if (!isNew) {
|
|
3654
3292
|
let i = existingEls.indexOf(itemEl);
|
|
3655
3293
|
if (i !== -1)
|
|
3656
3294
|
existingEls.splice(i, 1);
|
|
3657
3295
|
}
|
|
3658
|
-
|
|
3659
3296
|
// Insert into existing list
|
|
3660
|
-
let beforeIndex = insertBefore ? existingEls.indexOf(
|
|
3297
|
+
let beforeIndex = insertBefore ? existingEls.indexOf(insertBefore) : -1;
|
|
3661
3298
|
if (beforeIndex === -1) {
|
|
3662
3299
|
existingEls.push(itemEl);
|
|
3663
|
-
} else
|
|
3300
|
+
} else
|
|
3301
|
+
{
|
|
3664
3302
|
existingEls.splice(beforeIndex, 0, itemEl);
|
|
3665
3303
|
}
|
|
3666
|
-
|
|
3667
3304
|
if (!avoidDomReflow) {
|
|
3668
3305
|
this._insertItemAndFlow(itemEl, index, insertBefore);
|
|
3669
3306
|
}
|
|
3670
3307
|
}
|
|
3671
|
-
|
|
3672
3308
|
// Add index metadata to item
|
|
3673
3309
|
itemEl[ItemIndexSymbol] = index;
|
|
3674
|
-
|
|
3675
3310
|
return itemEl;
|
|
3676
3311
|
}
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
* Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
|
|
3680
|
-
* @param {Element|undefined} itemEl
|
|
3681
|
-
* @param {number} index
|
|
3682
|
-
* @param {Node|boolean|undefined} before
|
|
3683
|
-
* @private
|
|
3312
|
+
/**
|
|
3313
|
+
* Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
|
|
3684
3314
|
*/
|
|
3685
3315
|
_insertItemAndFlow(itemEl, index, before) {
|
|
3686
3316
|
const p = this._p;
|
|
3687
3317
|
const virtualWrapper = p.virtualWrapper;
|
|
3688
3318
|
const itemParent = p.currentItemsParent;
|
|
3689
|
-
|
|
3690
3319
|
if (before !== false) {
|
|
3691
3320
|
if (!(before instanceof Node))
|
|
3692
3321
|
before = null;
|
|
3693
|
-
|
|
3694
3322
|
// Insert into DOM
|
|
3695
3323
|
if (itemEl.parentNode !== itemParent ||
|
|
3696
3324
|
itemEl.nextSibling !== before) {
|
|
3697
3325
|
insertBefore(itemEl, before, itemParent);
|
|
3698
3326
|
}
|
|
3699
3327
|
}
|
|
3700
|
-
|
|
3701
3328
|
if (virtualWrapper) {
|
|
3702
3329
|
// Calculate height
|
|
3703
3330
|
let itemHeight = itemEl.getBoundingClientRect().height;
|
|
3704
|
-
|
|
3705
3331
|
// Put calculated height into cache, and invalidate positions if it's different
|
|
3706
3332
|
let cachedItemHeight = p.cachedItemHeights[index];
|
|
3707
3333
|
if (cachedItemHeight !== itemHeight) {
|
|
3708
3334
|
p.cachedItemHeights[index] = itemHeight;
|
|
3709
3335
|
}
|
|
3710
|
-
|
|
3711
3336
|
if (cachedItemHeight !== undefined && itemHeight !== cachedItemHeight ||
|
|
3712
3337
|
cachedItemHeight === undefined && itemHeight !== p.cachedItemEstimatedHeights[index]) {
|
|
3713
3338
|
this._setItemPositionsNeedsUpdate(index + 1);
|
|
3714
3339
|
}
|
|
3715
|
-
|
|
3716
3340
|
// Set item top position
|
|
3717
3341
|
let pos = this._calculateItemPosition(index);
|
|
3718
3342
|
const supportedTransform = getSupportedTransform();
|
|
3719
|
-
|
|
3720
3343
|
if (supportedTransform === false) {
|
|
3721
|
-
|
|
3722
|
-
} else
|
|
3723
|
-
|
|
3344
|
+
itemEl.style.top = `${pos}px`;
|
|
3345
|
+
} else
|
|
3346
|
+
{
|
|
3347
|
+
itemEl.style[supportedTransform] = `translateY(${pos}px)`;
|
|
3724
3348
|
}
|
|
3725
3349
|
}
|
|
3726
3350
|
}
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
* Fetches valid range of existingEls
|
|
3730
|
-
* @returns {{firstIndex: (*|number), firstValidArrayIndex: number, lastValidArrayIndex: number, lastIndex: (*|number)}}
|
|
3731
|
-
* @private
|
|
3351
|
+
/**
|
|
3352
|
+
* Fetches valid range of existingEls
|
|
3732
3353
|
*/
|
|
3733
3354
|
_getExistingElsRange() {
|
|
3734
3355
|
const p = this._p,existingEls = p.existingEls;
|
|
3735
|
-
|
|
3736
3356
|
let firstValidArrayIndex = -1,lastValidArrayIndex = -1;
|
|
3737
|
-
|
|
3738
3357
|
for (let i = 0, len = existingEls.length; i < len; i++) {
|
|
3739
3358
|
if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
|
|
3740
3359
|
continue;
|
|
3741
3360
|
firstValidArrayIndex = i;
|
|
3742
3361
|
break;
|
|
3743
3362
|
}
|
|
3744
|
-
|
|
3745
3363
|
for (let i = existingEls.length - 1; i >= 0; i--) {
|
|
3746
3364
|
if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
|
|
3747
3365
|
continue;
|
|
3748
3366
|
lastValidArrayIndex = i;
|
|
3749
3367
|
break;
|
|
3750
3368
|
}
|
|
3751
|
-
|
|
3752
3369
|
let firstIndex = firstValidArrayIndex !== -1 ? existingEls[firstValidArrayIndex][ItemIndexSymbol] : -1;
|
|
3753
3370
|
let lastIndex = lastValidArrayIndex !== -1 ? existingEls[lastValidArrayIndex][ItemIndexSymbol] : -1;
|
|
3754
|
-
|
|
3755
3371
|
return {
|
|
3756
3372
|
firstValidArrayIndex: firstValidArrayIndex,
|
|
3757
3373
|
lastValidArrayIndex: lastValidArrayIndex,
|
|
@@ -3760,95 +3376,64 @@ class VirtualListHelper {
|
|
|
3760
3376
|
};
|
|
3761
3377
|
}
|
|
3762
3378
|
}
|
|
3763
|
-
|
|
3764
|
-
/** Marks the item index associated with an item element */
|
|
3765
3379
|
const ItemIndexSymbol = Symbol('index');
|
|
3766
|
-
|
|
3767
|
-
/** Marks an element for reuse */
|
|
3768
3380
|
const ReuseElSymbol = Symbol('reuse');
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
* The default element creator
|
|
3772
|
-
* @returns {HTMLLIElement}
|
|
3381
|
+
/**
|
|
3382
|
+
* The default element creator
|
|
3773
3383
|
*/
|
|
3774
3384
|
const defaultElementCreator = () => {
|
|
3775
3385
|
return document.createElement('li');
|
|
3776
3386
|
};
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
* Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
|
|
3780
|
-
* @param {number[]} positions
|
|
3781
|
-
* @param {number} pos
|
|
3782
|
-
* @param {number} [start=0]
|
|
3783
|
-
* @param {number} [end=-1]
|
|
3784
|
-
* @returns {number}
|
|
3387
|
+
/**
|
|
3388
|
+
* Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
|
|
3785
3389
|
*/
|
|
3786
3390
|
const binarySearchPosition = (positions, pos, start = 0, end = -1) => {
|
|
3787
3391
|
let total = positions.length;
|
|
3788
3392
|
if (end < 0)
|
|
3789
3393
|
end += total;
|
|
3790
|
-
if (end <= start)
|
|
3791
|
-
|
|
3394
|
+
if (end <= start)
|
|
3395
|
+
return end; // 0 or 1 length array
|
|
3792
3396
|
while (start <= end) {
|
|
3793
3397
|
let mid = Math.floor(start + (end - start) / 2);
|
|
3794
3398
|
let midPos = positions[mid];
|
|
3795
|
-
|
|
3796
3399
|
if (midPos === pos || midPos <= pos && mid < total && positions[mid + 1] > pos) {
|
|
3797
3400
|
while (mid > 0 && positions[mid - 1] === midPos) // avoid bugs on 0-height items
|
|
3798
3401
|
mid--;
|
|
3799
|
-
|
|
3800
3402
|
return mid;
|
|
3801
3403
|
}
|
|
3802
|
-
|
|
3803
3404
|
if (midPos < pos)
|
|
3804
3405
|
start = mid + 1;else
|
|
3805
3406
|
|
|
3806
3407
|
end = mid - 1;
|
|
3807
3408
|
}
|
|
3808
|
-
|
|
3809
|
-
return end === -1 ? 0 : total - 1;
|
|
3409
|
+
return end === -1 ? 0 : end;
|
|
3810
3410
|
};
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
*
|
|
3814
|
-
* closest to the specified `pos` value (<= pos).
|
|
3815
|
-
* @param {number} total
|
|
3816
|
-
* @param {function(index: number):number} fn
|
|
3817
|
-
* @param {number} pos
|
|
3818
|
-
* @param {number} [start=0]
|
|
3819
|
-
* @param {number} [end=-1]
|
|
3820
|
-
* @returns {number}
|
|
3411
|
+
/**
|
|
3412
|
+
* Will look for the index in a virtual list of positions supplied by `total` and `fn`,
|
|
3413
|
+
* closest to the specified `pos` value (<= pos).
|
|
3821
3414
|
*/
|
|
3822
3415
|
const binarySearchPositionByFn = (total, fn, pos, start = 0, end = -1) => {
|
|
3823
3416
|
if (end < 0)
|
|
3824
3417
|
end += total;
|
|
3825
|
-
if (end <= start)
|
|
3826
|
-
|
|
3418
|
+
if (end <= start)
|
|
3419
|
+
return end; // 0 or 1 length array
|
|
3827
3420
|
while (start <= end) {
|
|
3828
3421
|
let mid = Math.floor(start + (end - start) / 2);
|
|
3829
3422
|
let midPos = fn(mid);
|
|
3830
|
-
|
|
3831
3423
|
if (midPos === pos || midPos <= pos && mid < total && fn(mid + 1) > pos) {
|
|
3832
3424
|
while (mid > 0 && fn(mid - 1) === midPos) // avoid bugs on 0-height items
|
|
3833
3425
|
mid--;
|
|
3834
|
-
|
|
3835
3426
|
return mid;
|
|
3836
3427
|
}
|
|
3837
|
-
|
|
3838
3428
|
if (midPos < pos)
|
|
3839
3429
|
start = mid + 1;else
|
|
3840
3430
|
|
|
3841
3431
|
end = mid - 1;
|
|
3842
3432
|
}
|
|
3843
|
-
|
|
3844
|
-
return end === -1 ? 0 : fn(total - 1);
|
|
3433
|
+
return end === -1 ? 0 : end;
|
|
3845
3434
|
};
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
* Finds the last item in the array for which `fn` returns a truthy value
|
|
3849
|
-
* @param {Array} array
|
|
3850
|
-
* @param {Function} fn
|
|
3851
|
-
* @returns {undefined|*}
|
|
3435
|
+
/**
|
|
3436
|
+
* Finds the last item in the array for which `fn` returns a truthy value
|
|
3852
3437
|
*/
|
|
3853
3438
|
const findLast = (array, fn) => {
|
|
3854
3439
|
for (let i = array.length - 1; i >= 0; i--) {
|
|
@@ -3858,9 +3443,7 @@ const findLast = (array, fn) => {
|
|
|
3858
3443
|
}
|
|
3859
3444
|
return undefined;
|
|
3860
3445
|
};
|
|
3861
|
-
|
|
3862
3446
|
let _isTransformSupported = null;
|
|
3863
|
-
|
|
3864
3447
|
const getSupportedTransform = () => {
|
|
3865
3448
|
if (_isTransformSupported === null) {
|
|
3866
3449
|
let prefixes = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
|
|
@@ -3876,9 +3459,9 @@ const getSupportedTransform = () => {
|
|
|
3876
3459
|
return _isTransformSupported;
|
|
3877
3460
|
};
|
|
3878
3461
|
|
|
3879
|
-
function u(e, t) {for (let l = 0, o = e.length; l >= 0 && l < o; l += 1) if (t(e[l], l, e)) return e[l];}function h(e) {return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """).replace(/\n/g, "<br />");}const c = Symbol("safe"),m = Symbol("hover_in"),f = Symbol("hover_out"),p = Symbol("row_click"),g = Symbol("preview_cell"),C = Symbol("cell"),v = Symbol("related_touch"),b = Symbol("original_row_index"),w = Symbol("destroyed");class W extends Array {constructor(e) {var _e$sortColumn, _e$onComparatorRequir, _e$customSortingProvi;super(), _defineProperty(this, "sortColumn", void 0), _defineProperty(this, "onComparatorRequired", null), _defineProperty(this, "customSortingProvider", null), e = e || {}, this.sortColumn = (_e$sortColumn = e.sortColumn) !== null && _e$sortColumn !== void 0 ? _e$sortColumn : [], this.onComparatorRequired = (_e$onComparatorRequir = e.onComparatorRequired) !== null && _e$onComparatorRequir !== void 0 ? _e$onComparatorRequir : null, this.customSortingProvider = (_e$customSortingProvi = e.customSortingProvider) !== null && _e$customSortingProvi !== void 0 ? _e$customSortingProvi : null;}add(e, t) {if (Array.isArray(e)) {const l = e;if ("number" == typeof t) for (let e = 0, o = l.length; e < o; e++) this.splice(t++, 0, l[e]);else for (let e = 0, t = l.length; e < t; e++) this.push(l[e]);} else {const l = e;"number" == typeof t ? this.splice(t, 0, l) : this.push(l);}}reset(e) {this.length = 0, e && this.add(e);}filteredCollection(e, t) {if (e && t) {const l = new W({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let o = 0, i = this.length; o < i; o++) {const i = this[o];e(i, t) && (i[b] = o, l.push(i));}return l;}return null;}sort(e) {let t;if ("function" == typeof e) return super.sort(e);if (this.sortColumn.length) {const e = [];for (let t = 0; t < this.sortColumn.length; t++) {const l = y(this.sortColumn[t], this.sortColumn[t].descending);let o = null;this.onComparatorRequired && (o = this.onComparatorRequired(this.sortColumn[t].column, this.sortColumn[t].descending, l)), o || (o = l), e.push(o.bind(this));}if (1 === e.length) t = e[0];else {const l = e.length;t = (t, o) => {let i = 0;for (let r = 0; r < l; r++) if (i = e[r](t, o), 0 !== i) return i;return i;};}const l = (e) => (e.sort(t), e);if (this.customSortingProvider) {const e = this.customSortingProvider(this, l);e !== this && this.splice(0, this.length, ...e);} else l(this);}return this;}}function y(e, t) {let l = e.comparePath;"string" == typeof l && (l = l.split("."));const o = l.length,i = o > 1,r = t ? 1 : -1,n = t ? -1 : 1;return function (e, t) {let s = e[l[0]],a = t[l[0]];if (i) for (let e = 1; e < o; e++) s = s && s[l[e]], a = a && a[l[e]];return s === a ? 0 : null == s ? r : null == a ? n : s < a ? r : n;};}class R extends Array {constructor() {super();}get(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].name === e) return this[t];return null;}indexOf(e) {const t = "string" == typeof e ? e : e.name;for (let e = 0, l = this.length; e < l; e++) if (this[e].name === t) return e;return -1;}getByOrder(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].order === e) return this[t];return null;}normalizeOrder() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0);for (let t = 0; t < e.length; t++) e[t].order = t;return this;}getColumns() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getVisibleColumns() {const e = [];for (let t = 0; t < this.length; t++) {const l = this[t];l.visible && e.push(l);}return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getMaxOrder() {let e = 0;for (let t = 0; t < this.length; t++) {const l = this[t];l.order > e && (e = l.order);}return e;}moveColumn(e, t) {if (e && t) {const l = e.order,o = t.order;if (l < o) for (let e = l + 1; e <= o; e++) {const t = this.getByOrder(e);t && t.order--;} else for (let e = l - 1; e >= o; e--) {const t = this.getByOrder(e);t && t.order++;}e.order = o;}return this;}}function S(e, t) {const l = t.column,o = null == t.keyword ? "" : t.keyword.toString();if (!o || !l) return true;let i = e[l];if (null == i) return false;let r = i.toString(),n = o;return t.caseSensitive || (r = r.toLowerCase(), n = n.toLowerCase()), -1 !== r.indexOf(n);}const _ = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };class N {static saveSelection(e) {const t = window.getSelection();if (!t || 0 === t.rangeCount) return null;const l = t.getRangeAt(0);if (e !== l.commonAncestorContainer && !function (e, t) {let l = e;for (; (l = (_l$parentNode = (_l = l) === null || _l === void 0 ? void 0 : _l.parentNode) !== null && _l$parentNode !== void 0 ? _l$parentNode : null) && l !== t;) {var _l$parentNode, _l;}return !!l;}(l.commonAncestorContainer, e)) return null;const o = l.cloneRange();o.selectNodeContents(e), o.setEnd(l.startContainer, l.startOffset);const i = o.toString().length;return { start: i, end: i + l.toString().length };}static restoreSelection(e, t) {let l = 0;const o = [e];let i,r = false,n = false;const s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (i = o.pop());) if (i.nodeType === Node.TEXT_NODE) {const e = l + i.length;!r && t.start >= l && t.start <= e && (s.setStart(i, t.start - l), r = true), r && t.end >= l && t.end <= e && (s.setEnd(i, t.end - l), n = true), l = e;} else {let e = i.childNodes.length;for (; e--;) o.push(i.childNodes[e]);}const a = window.getSelection();a && (a.removeAllRanges(), a.addRange(s));}}const x = Array.prototype.indexOf,k = document.createElement.bind(document);function z(e) {const t = e._p;if (t.cellPreviewCell) {var _l$rowIndex;const l = t.cellPreviewCell,o = l[C];let i;try {i = N.saveSelection(l);} catch {}t.cellPreviewCell.remove(), o && t._unbindCellHoverOut(o), t._unbindCellHoverOut(l);try {i && o && N.restoreSelection(o, i);} catch {}e.emit("cellpreviewdestroy", { el: l.firstChild, name: l.columnName, rowIndex: (_l$rowIndex = l.rowIndex) !== null && _l$rowIndex !== void 0 ? _l$rowIndex : null, rowData: null == l.rowIndex ? null : t.rows[l.rowIndex], cell: o, cellEl: o === null || o === void 0 ? void 0 : o.firstChild }), o && delete o[g], delete l[C], t.cellPreviewCell = null, t.abortCellPreview = false;} else t.abortCellPreview = true;return e;}const M = document.createElement.bind(document);function T(e) {var _ref, _e$v, _t$changedTouches;const t = e;return (_ref = (_e$v = e[v]) !== null && _e$v !== void 0 ? _e$v : (_t$changedTouches = t.changedTouches) === null || _t$changedTouches === void 0 ? void 0 : _t$changedTouches[0]) !== null && _ref !== void 0 ? _ref : e;}function L(e) {var _t$lastResizeAreaClic;const t = e._p;if (null == t.columnResizeStartTimeout) return;clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null;const n = (_t$lastResizeAreaClic = t.lastResizeAreaClick) === null || _t$lastResizeAreaClic === void 0 ? void 0 : _t$lastResizeAreaClic.columnName;t.lastResizeAreaClick = null, n && function (e, t) {const n = e._o,s = e._p,a = s.columns.get(t);if (!n.resizableColumns || !a || !a.resizable) return void A(e);const d = me(e);s.resizer = M("div"), s.resizer.className = n.resizerClassName, setCssProps(s.resizer, { position: "absolute", display: "block", zIndex: "-1", visibility: "hidden", width: "2px", background: "#000", opacity: "0.7" }), e.el.appendChild(s.resizer);const u = a.element,h = s.resizer.parentNode,c = getComputedStyle(h),m = getComputedStyle(u),f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;const g = getElementWidth(s.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(g / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(g / 2)), setCssProps(s.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(e.el, false, false, false) + "px" }), s.resizer.columnName = u.columnName;try {s.resizer.style.zIndex = "";} catch {}}(e, n);}function F(e, t) {const l = e._o,o = me(e);let n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return null;n[C] && (n = n[C]);let s = n.previousSibling;for (; s && 1 !== s.nodeType;) s = s.previousSibling;const a = !s,d = T(t),u = (d.pageX || d.clientX || 0) - getElementOffset(n).left;if (o) {var _s$columnName, _s, _n$columnName;if (!a && getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_s$columnName = (_s = s) === null || _s === void 0 ? void 0 : _s.columnName) !== null && _s$columnName !== void 0 ? _s$columnName : null;if (u <= l.resizeAreaWidth / 2) return (_n$columnName = n.columnName) !== null && _n$columnName !== void 0 ? _n$columnName : null;} else {var _s$columnName2, _s2, _n$columnName2;if (!a && u <= l.resizeAreaWidth / 2) return (_s$columnName2 = (_s2 = s) === null || _s2 === void 0 ? void 0 : _s2.columnName) !== null && _s$columnName2 !== void 0 ? _s$columnName2 : null;if (getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_n$columnName2 = n.columnName) !== null && _n$columnName2 !== void 0 ? _n$columnName2 : null;}return null;}function A(e) {const t = e._p;return null != t.columnResizeStartTimeout && (clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null), t.resizer && (t.resizer.remove(), t.resizer = null), t.eventsSink.remove(document, ".colresize"), e;}function P(e, t) {const l = t;if ("mousedown" === t.type && 0 !== l.button) return;const o = e._o,i = e._p,r = F(e, t);if (r) {const l = i.columns.get(r);if (!o.resizableColumns || !l || !l.resizable) return false;if (function (e, t, l) {const o = e._p,i = e._o,r = T(t),n = Date.now(),s = function (e) {return e.type.startsWith("touch") ? "touch" : "mouse";}(t),a = o.lastResizeAreaClick;if (o.lastResizeAreaClick = { columnName: l, time: n, pageX: r.pageX || r.clientX || 0, pageY: r.pageY || 0, pointerType: s }, !a || a.columnName !== l || a.pointerType !== s) return false;const d = n - a.time;return !(d < 0 || d > i.resizeAreaDoubleClickDuration) && Math.sqrt(Math.pow(o.lastResizeAreaClick.pageX - a.pageX, 2) + Math.pow(o.lastResizeAreaClick.pageY - a.pageY, 2)) <= Math.max(i.resizeAreaWidth, 12);}(e, t, l.name)) return A(e), function (e, t, l, _i$lastResizeAreaDoub) {const o = e._o,i = e._p,r = i.columns.get(l);if (!o.resizableColumns || !r || !r.resizable) return false;const n = Date.now();return ((_i$lastResizeAreaDoub = i.lastResizeAreaDoubleClick) === null || _i$lastResizeAreaDoub === void 0 ? void 0 : _i$lastResizeAreaDoub.columnName) === r.name && n - i.lastResizeAreaDoubleClick.time < 100 ? (t.preventDefault(), true) : (i.lastResizeAreaClick = null, i.lastResizeAreaDoubleClick = { columnName: r.name, time: n }, e.emit("columnresizeareadoubleclick", { name: r.name, columnName: r.name, event: t }), o.autoFitColumnOnResizeDoubleClick && e.autoFitColumn(r.name), t.preventDefault(), true);}(e, t, l.name);A(e), i.columnResizeStartTimeout = setTimeout(() => L(e), o.resizeAreaDoubleClickDuration), i.eventsSink.add(document, "mousemove.colresize", (t) => E(e, t)).add(document, "touchmove.colresize", (t) => E(e, t)).add(document, "mouseup.colresize", (t) => H(e, t)).add(document, "touchend.colresize", (t) => H(e, t)), t.preventDefault();}}function E(e, t) {const l = e._p;if (null != l.columnResizeStartTimeout && !function (e, t) {const l = e._p.lastResizeAreaClick;if (!l) return false;const o = T(t),i = o.pageX || o.clientX || 0,r = o.pageY || 0;return Math.sqrt(Math.pow(i - l.pageX, 2) + Math.pow(r - l.pageY, 2)) > 4;}(e, t)) return;if (L(e), !l.resizer) return;const o = l.columns.get(l.resizer.columnName);if (!o) return;const n = me(e),s = o.element,a = l.resizer.parentNode,d = getComputedStyle(a),u = getComputedStyle(s),h = getElementOffset(s),c = getElementOffset(a);c.left += parseFloat(d.borderLeftWidth) || 0, h.left -= c.left;const m = getElementWidth(l.resizer, true, true, true),f = "border-box" === u.boxSizing;let p = T(t).pageX - c.left,g = h.left;g -= Math.ceil(m / 2), n ? (g += getElementWidth(s, true, true, true), g -= o.ignoreMin ? 0 : e._o.minColumnWidth, f || (g -= Math.ceil((parseFloat(u.borderLeftWidth) || 0) / 2), g -= ae(s)), p > g && (p = g)) : (g += o.ignoreMin ? 0 : e._o.minColumnWidth, f || (g += Math.ceil((parseFloat(u.borderRightWidth) || 0) / 2), g += ae(s)), p < g && (p = g)), l.resizer.style.left = p + "px";}function H(e, t) {var _ref2, _t$v, _C$changedTouches;const l = e._o,o = e._p;if (null != o.columnResizeStartTimeout) return void A(e);if (!o.resizer) return;o.eventsSink.remove(document, ".colresize");const n = o.columns.get(o.resizer.columnName);if (!n) return o.resizer.remove(), void (o.resizer = null);const s = me(e),a = n.element,d = a.firstChild,u = o.resizer.parentNode,h = getComputedStyle(u),c = getComputedStyle(a),m = getElementOffset(a),f = getElementOffset(u);f.left += parseFloat(h.borderLeftWidth) || 0, m.left -= f.left;const p = getElementWidth(o.resizer, true, true, true),g = "border-box" === c.boxSizing,C = t;let b = ((_ref2 = (_t$v = t[v]) !== null && _t$v !== void 0 ? _t$v : (_C$changedTouches = C.changedTouches) === null || _C$changedTouches === void 0 ? void 0 : _C$changedTouches[0]) !== null && _ref2 !== void 0 ? _ref2 : t).pageX - f.left,w = m.left,W = 0;if (w -= Math.ceil(p / 2), s) {if (!g) {b += ae(a);const e = getComputedStyle(d || a);b += parseFloat(e.borderLeftWidth) || 0, b += parseFloat(e.borderRightWidth) || 0, b += n.arrowProposedWidth || 0;}w += getElementWidth(a, true, true, true);const t = w - (n.ignoreMin ? 0 : e._o.minColumnWidth);b > t && (b = t), W = w - b;} else {if (!g) {b -= ae(a);const e = getComputedStyle(d || a);b -= parseFloat(e.borderLeftWidth) || 0, b -= parseFloat(e.borderRightWidth) || 0, b -= n.arrowProposedWidth || 0;}const t = w + (n.ignoreMin ? 0 : e._o.minColumnWidth);b < t && (b = t), W = b - w;}o.resizer.remove(), o.resizer = null;let y = W;if (2 === n.widthMode) {let t = he(e),i = 0,r = 0;for (let e = 0; e < o.visibleColumns.length; e++) {var _l$actualWidth;const l = o.visibleColumns[e];l.name !== n.name && (2 === l.widthMode ? (i += l.width, r++) : t -= (_l$actualWidth = l.actualWidth) !== null && _l$actualWidth !== void 0 ? _l$actualWidth : 0);}if (t <= 0 && o.table && (t = o.table.clientWidth), t > Math.max(l.minColumnWidth, 1)) {if (y = W / t, r > 0) {const e = y / ((1 - y) / i);i += y, (i < 1 && l.relativeWidthGrowsToFillWidth || i > 1 && l.relativeWidthShrinksToFillWidth) && (y = e);}y *= 100, y += "%";}}e.setColumnWidth(n.name, y);}function I(e, t) {var _o$columns$get;const l = e._o,o = e._p;if (!l.resizableColumns) return;const i = F(e, t),r = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);r && (i && (_o$columns$get = o.columns.get(i)) !== null && _o$columns$get !== void 0 && _o$columns$get.resizable ? r.style.cursor = "e-resize" : r.style.cursor = "");}function O(e, t) {var _ref3, _t$v2, _n$changedTouches;const o = e._o,n = t,s = t,a = (_ref3 = (_t$v2 = t[v]) !== null && _t$v2 !== void 0 ? _t$v2 : (_n$changedTouches = n.changedTouches) === null || _n$changedTouches === void 0 ? void 0 : _n$changedTouches[0]) !== null && _ref3 !== void 0 ? _ref3 : { pageX: s.pageX, pageY: s.pageY },d = t.target.closest(`div.${o.tableClassName}-header-cell,div.${o.cellPreviewClassName}`);if (!d) return;const u = getElementOffset(d);u.width = getElementWidth(d, true, true, true), u.height = getElementHeight(d, true, true, true), e.emit("headercontextmenu", { columnName: d.columnName, pageX: a.pageX, pageY: a.pageY, bounds: u });}function D(e, t) {if (se(t)) return;if (F(e, t)) return;const l = e._o,o = e._p,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!i) return;if (!l.sortableColumns) return;const r = o.columns.get(i.columnName),n = o.rows.sortColumn;if (r && r.sortable) {let t = true;const o = n.length ? n[n.length - 1] : null;o && o.column === r.name && (o.descending && l.allowCancelSort ? (t = false, n.splice(n.length - 1, 1)) : o.descending = !o.descending);const i = e;t ? i.sort(r.name, void 0, true).render() : i.sort();}}function B(e, t) {const l = e._p,o = l.visibleColumns.findIndex((e) => e.movable),i = l.visibleColumns.findLastIndex((e) => e.movable),r = l.visibleColumns.findIndex((e) => e === t);return t.movable || -1 !== o && r >= o && r <= i;}const $ = Array.prototype.indexOf,q = document.createElement.bind(document);function X(e) {const t = e._p;return t.headerRow && (t.headerRow = void 0), e;}function V(e) {const t = e._o,l = e._p;if (!l.tbody) return e;if (t.virtualTable && l.virtualListHelper) {const e = l.virtualListHelper.estimateFullHeight();l._lastVirtualScrollHeight = e, l.tbody.style.height = e + "px";} else l.tbody.style.height = "";return e;}function j(e, t) {const l = e._p;if (!l.table) return e;const o = l.table.offsetWidth - l.table.clientWidth;if (o !== l.scrollbarWidth || t) {var _l$notifyRendererOfCo;l.scrollbarWidth = o;for (let e = 0; e < l.columns.length; e++) l.columns[e].actualWidthConsideringScrollbarWidth = null;if (l.scrollbarWidth > 0 && l.visibleColumns.length > 0 && l.tbody && l.headerRow) {var _l$visibleColumns$e$a;const e = l.visibleColumns.length - 1;l.visibleColumns[e].actualWidthConsideringScrollbarWidth = ((_l$visibleColumns$e$a = l.visibleColumns[e].actualWidth) !== null && _l$visibleColumns$e$a !== void 0 ? _l$visibleColumns$e$a : 0) - l.scrollbarWidth;const t = l.visibleColumns[e].actualWidthConsideringScrollbarWidth + "px",o = l.tbody.childNodes;for (let l = 0, i = o.length; l < i; l++) {const i = o[l];1 === i.nodeType && (i.childNodes[e].style.width = t);}l.headerRow.childNodes[e].style.width = t;}U(e), (_l$notifyRendererOfCo = l.notifyRendererOfColumnsConfig) === null || _l$notifyRendererOfCo === void 0 ? void 0 : _l$notifyRendererOfCo.call(l);}return e;}function Y(e, t) {const l = e._o,o = e._p;if (!o.tbody || !o.table || !o.headerRow) return e;const i = ce(e);if (o.tbody.style.minWidth = i + "px", o.headerRow.style.minWidth = i + (o.scrollbarWidth || 0) + "px", o.eventsSink.remove(o.table, "scroll"), l.width === _.AUTO) setElementWidth(o.table, getElementWidth(o.tbody, true, true, true)), setElementWidth(e.el, getElementWidth(o.table, true, true, true));else if (l.width === _.SCROLL) {if (t) {const t = o.table ? o.table.scrollTop : 0,l = o.table ? o.table.scrollLeft : 0;!function (e) {const t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(e.el), o.table.scrollTop = t, o.table.scrollLeft = l, o.header && (o.header.scrollLeft = l);}const l = () => function (e) {const t = e._p;t.header.scrollLeft = t.table.scrollLeft, G(e);}(e);o.eventsSink.add(o.table, "scroll", l);}return e;}function U(e) {var _t$scrollbarWidth;const t = e._p,l = e._o;if (!t.headerRow) return;const o = l.tableClassName + "-sticky",i = t.headerRow,r = me(e);t.lastIsRtl = r;const n = (_t$scrollbarWidth = t.scrollbarWidth) !== null && _t$scrollbarWidth !== void 0 ? _t$scrollbarWidth : 0,s = t.lastDetectedWidth,a = l.maxStickyColumnRelativeWidth,d = "number" == typeof a && s ? s * a : null;let u = 0,h = 0,c = null;const m = [],f = [];let p = null,g = [],C = null,v = 0,b = [];for (let e = i.firstElementChild; e; e = e.nextElementSibling) {var _i$actualWidth, _p;const l = e.getAttribute("data-column");if (!l) continue;const i = t.columns.get(l);if (!i) continue;i.headerScrollbarCompensation = 0;let s = "start" === i.sticky || "end" === i.sticky;if (s && null !== d && v + ((_i$actualWidth = i.actualWidth) !== null && _i$actualWidth !== void 0 ? _i$actualWidth : 0) > d && (s = false), s) {var _i$actualWidth2, _i$actualWidth3, _i$stickyPos, _i$stickyPos2, _i$stickyPos3;let l = (_i$actualWidth2 = i.actualWidth) !== null && _i$actualWidth2 !== void 0 ? _i$actualWidth2 : 0;v += 0, e.className += " " + o, e.style.position = "sticky";let s,a = null;null === c && (a = getComputedStyle(e), c = a.boxSizing), "content-box" === c && (null === a && (a = getComputedStyle(e)), l += (parseFloat(a.paddingLeft) || 0) + (parseFloat(a.paddingRight) || 0) + (parseFloat(a.borderLeftWidth) || 0) + (parseFloat(a.borderRightWidth) || 0)), "start" === i.sticky ? (s = { direction: "start", absDirection: r ? "right" : "left", offset: u }, e.style[s.absDirection] = u + "px", u += l, g.length = 0, p = [e], m.push(p)) : (C = e, s = { direction: "end", absDirection: r ? "left" : "right", offset: h }, e.style[s.absDirection] = h + n + "px", e.style.width = ((_i$actualWidth3 = i.actualWidth) !== null && _i$actualWidth3 !== void 0 ? _i$actualWidth3 : 0) + "px", h += l, f.push([e, ...g]), g.length = 0), s.direction === ((_i$stickyPos = i.stickyPos) === null || _i$stickyPos === void 0 ? void 0 : _i$stickyPos.direction) && s.offset === ((_i$stickyPos2 = i.stickyPos) === null || _i$stickyPos2 === void 0 ? void 0 : _i$stickyPos2.offset) && s.absDirection === ((_i$stickyPos3 = i.stickyPos) === null || _i$stickyPos3 === void 0 ? void 0 : _i$stickyPos3.absDirection) || b.push(t.visibleColumns.indexOf(i)), i.stickyPos = s;} else i.stickyPos && b.push(t.visibleColumns.indexOf(i)), delete i.stickyPos, (_p = p) !== null && _p !== void 0 && _p.push(e), g !== null && g !== void 0 && g.push(e), "sticky" === e.style.position && (e.classList.remove(o), e.style.position = "", e.style.left = "", e.style.right = "");}C && (C.style[r ? "left" : "right"] = "0px"), t.stickiesStart = m, t.stickiesEnd = f, b.length > 0 && e.refreshAllVirtualRows(), t.lastStickyScrollLeft = void 0, G(e);}function G(e) {const t = e._p;if (!t.table || !t.headerRow || !t.tbody) return;const l = t.stickiesStart,o = t.stickiesEnd,i = t.stickiesSetStart,r = t.stickiesSetEnd,n = t.stickiesSetStart = new Set(),s = t.stickiesSetEnd = new Set();if (l !== null && l !== void 0 && l.length || o !== null && o !== void 0 && o.length) {const e = t.table.scrollLeft;if (e === t.lastStickyScrollLeft) return;t.lastStickyScrollLeft = e;const i = t.headerRow.children,r = 1.5,a = t.lastIsRtl;let d = null;const u = (e, l, o) => {if (e && e.length) {for (const t of e) {l || (d = t);const e = t[0],n = t.slice(1),s = n[0],u = n[n.length - 1];if (!e || !e.getBoundingClientRect) continue;const h = e.getBoundingClientRect(),c = l !== a;let m = false;if (s && u) {const e = s.getBoundingClientRect(),t = u.getBoundingClientRect();m = l ? a ? h.right - r > t.left && h.left + r < e.right : h.right - r > e.left && h.left + r < t.right : a ? h.left + r < e.right && h.right - r > t.left : h.left + r < t.right && h.right - r > e.left;}e.classList.toggle(c ? "is-sticky-left" : "is-sticky-right", m), m && o.add($.call(i, e));}if (d) {var _ref4, _l$actualWidthConside, _ref5, _l$actualWidthConside2;const e = d[0],l = t.columns.get(e.getAttribute("data-column")),o = a ? "marginRight" : "marginLeft";e.style[o] = "", e.style.width = ((_ref4 = (_l$actualWidthConside = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside !== void 0 ? _l$actualWidthConside : l.actualWidth) !== null && _ref4 !== void 0 ? _ref4 : 0) + "px";let i = 0;if (t.scrollbarWidth > 0) {const l = e.getBoundingClientRect(),r = e.offsetParent.getBoundingClientRect(),n = a ? l.left - r.left : r.right - l.right;n <= t.scrollbarWidth && (i = Math.min(t.scrollbarWidth, Math.max(0, t.scrollbarWidth - n + 1)), i < t.scrollbarWidth && (e.style[o] = -i + "px"));}l.headerScrollbarCompensation = i, e.style.width = ((_ref5 = (_l$actualWidthConside2 = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside2 !== void 0 ? _l$actualWidthConside2 : l.actualWidth) !== null && _ref5 !== void 0 ? _ref5 : 0) + i + "px";}}};u(l, true, n), u(o, false, s);}const a = [],d = [];for (const e of n) (i === null || i === void 0 ? void 0 : i.has(e)) || a.push({ index: e, start: true });for (const e of s) (r === null || r === void 0 ? void 0 : r.has(e)) || a.push({ index: e, start: false });if (i) for (const e of i) n.has(e) || d.push({ index: e, start: true });if (r) for (const e of r) s.has(e) || d.push({ index: e, start: false });if (!a.length && !d.length) return;let u = t.tbody.firstElementChild;for (; u;) {const e = u.children;for (const l of d) {var _e$l$index;(_e$l$index = e[l.index]) === null || _e$l$index === void 0 || _e$l$index.classList.remove(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}for (const l of a) {var _e$l$index2;(_e$l$index2 = e[l.index]) === null || _e$l$index2 === void 0 || _e$l$index2.classList.add(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}u = u.nextElementSibling;}t.isStickyColumns = new Map();for (const e of n) t.isStickyColumns.set(e, "start");for (const e of s) t.isStickyColumns.set(e, "end");}function J(e, t) {const l = e._p,o = e._o;if (!l.headerRow || !l.tbody) return e;const i = l.headerRow.querySelectorAll(`div.${o.tableClassName}-header-cell`)[t];if (!i) return e;const r = l.columns.get(i.columnName);if (r) {var _r$headerScrollbarCom, _ref6, _r$actualWidthConside;const e = (_r$headerScrollbarCom = r.headerScrollbarCompensation) !== null && _r$headerScrollbarCom !== void 0 ? _r$headerScrollbarCom : 0;i.style.width = ((_ref6 = (_r$actualWidthConside = r.actualWidthConsideringScrollbarWidth) !== null && _r$actualWidthConside !== void 0 ? _r$actualWidthConside : r.actualWidth) !== null && _ref6 !== void 0 ? _ref6 : 0) + e + "px";const o = (r.actualWidthConsideringScrollbarWidth || r.actualWidth || 0) + "px",n = l.tbody.childNodes;for (let e = 0, l = n.length; e < l; e++) {const l = n[e];1 === l.nodeType && (l.childNodes[t].style.width = o);}}return e;}function K(e) {const t = e._p,l = e._o;if (t.table && t.headerRow) {const e = l.tableClassName,o = scopedSelectorAll(t.headerRow, `>div.${e}-header-cell.sorted`),i = Array.prototype.slice.call(o, 0).map((e) => e.querySelector(":scope>div>.sort-arrow")).filter((e) => !!e);for (const e of i) {var _e$parentNode;const l = (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.parentNode;if (l) {const e = t.columns.get(l.columnName);e && (e.arrowProposedWidth = 0);}e.remove();}for (const e of o) e.classList.remove("sorted", "desc");}return e;}function Q(e, t, l) {var _r$element$firstChild;const o = e._p,i = e._o,r = o.columns.get(t);if (!r) return false;const n = q("span");return n.className = "sort-arrow", r.element && (r.element.className += l ? " sorted desc" : " sorted", (_r$element$firstChild = r.element.firstChild) !== null && _r$element$firstChild !== void 0 && _r$element$firstChild.insertBefore(n, r.element.firstChild.firstChild)), 2 !== r.widthMode && i.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = n.scrollWidth + (parseFloat(getComputedStyle(n).marginRight) || 0) + (parseFloat(getComputedStyle(n).marginLeft) || 0)), true;}function Z(e, t) {t.firstChild, t.addEventListener("mousedown", (t) => P(e, t)), t.addEventListener("mousemove", (t) => I(e, t)), t.addEventListener("mouseup", (t) => function (e, t) {2 === t.button && O(e, t);}(e, t)), t.addEventListener("mouseleave", (t) => function (e, t) {const l = e._o,o = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);o && (o.style.cursor = "");}(e, t)), t.addEventListener("touchstart", (t) => function (e, t) {const l = e._p;if (l.currentTouchId) return;const o = t.changedTouches[0];l.currentTouchId = o.identifier;const i = t.currentTarget,r = { x: o.pageX, y: o.pageY };let n,s = r;const a = function () {l.currentTouchId = null, l.eventsSink.remove(i, ".colheader"), clearTimeout(n);};t[v] = t.changedTouches[0], true !== P(e, t) ? (n = setTimeout(() => {a(), l.eventsSink.add(i, "touchend.colheader", (e) => {se(e) || e.preventDefault(), l.eventsSink.remove(i, ".colheader");}, { once: true }).add(i, "touchcancel.colheader", (e) => {l.eventsSink.remove(i, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(s.x - r.x), 2) + Math.pow(Math.abs(s.y - r.y), 2)) < 9 && (A(e), O(e, t));}, 500), l.eventsSink.add(i, "touchend.colheader", (t) => {const o = t,i = u(Array.from(o.changedTouches), (e) => e.identifier === l.currentTouchId);i && (a(), se(t) || t.preventDefault(), s = { x: i.pageX, y: i.pageY }, (Math.sqrt(Math.pow(Math.abs(s.x - r.x), 2) + Math.pow(Math.abs(s.y - r.y), 2)) < 9 || l.resizer) && (o[v] = i, D(e, o)));}).add(i, "touchcancel.colheader", a).add(i, "touchmove.colheader", (t) => {const o = t,i = u(Array.from(o.changedTouches), (e) => e.identifier === l.currentTouchId);i && (s = { x: i.pageX, y: i.pageY }, l.resizer && (t.preventDefault(), o[v] = i, I(e, o)));})) : l.currentTouchId = null;}(e, t)), t.addEventListener("dragstart", (t) => function (e, t) {const l = e._o,o = e._p;if (l.movableColumns) {var _t$dataTransfer;const e = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!e) return void t.preventDefault();const i = o.columns.get(e.columnName);i && i.movable ? (e.style.opacity = "0.35", o.dragId = 161061273 * Math.random(), (_t$dataTransfer = t.dataTransfer) === null || _t$dataTransfer === void 0 ? void 0 : _t$dataTransfer.setData("text", JSON.stringify({ dragId: o.dragId, column: i.name }))) : t.preventDefault();} else t.preventDefault();}(e, t)), t.addEventListener("click", (t) => D(e, t)), t.addEventListener("contextmenu", (e) => e.preventDefault()), t.addEventListener("dragenter", (t) => function (e, t) {const l = e._o,o = e._p;if (l.movableColumns) {var _t$dataTransfer2;let i = null;const r = (_t$dataTransfer2 = t.dataTransfer) === null || _t$dataTransfer2 === void 0 ? void 0 : _t$dataTransfer2.getData("text");if (r) try {i = JSON.parse(r);} catch {i = null;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return;if (!i || o.dragId === i.dragId && n.columnName !== i.column) {const t = o.columns.get(n.columnName);t && B(e, t) && n.classList.add("drag-over");}}}(e, t)), t.addEventListener("dragover", (e) => {e.preventDefault();}), t.addEventListener("dragleave", (t) => function (e, t) {const l = e._o,o = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!o) return;const i = t.relatedTarget;i === o || o.contains(i) || o.classList.remove("drag-over");}(e, t)), t.addEventListener("drop", (t) => function (e, t, _t$dataTransfer3) {t.preventDefault();const l = e._o,o = e._p,i = (_t$dataTransfer3 = t.dataTransfer) === null || _t$dataTransfer3 === void 0 ? void 0 : _t$dataTransfer3.getData("text");if (!i) return;let r;try {r = JSON.parse(i);} catch {return;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (n) {if (l.movableColumns && r.dragId === o.dragId) {const t = r.column,l = n.columnName,i = o.columns.get(t),s = o.columns.get(l);i && s && i.movable && B(e, s) && e.moveColumn(t, l);}n.classList.remove("drag-over");}}(e, t));}function ee(e, t) {let l = 0;if ("string" == typeof e) {const t = e.trim().toLowerCase();if ("rest" === t) return { width: 0, mode: 3 };if ("auto" === t) return { width: 0, mode: 0 };}let o = parseFloat(e);return Number.isFinite(o) || (o = 0), o = Math.max(0, o), o > 0 && ("string" == typeof e && e.trim().endsWith("%") ? (l = 2, o /= 100) : o > 0 && o < 1 ? l = 2 : (o < t && (o = t), l = 1)), { width: o, mode: l };}function te(e, t) {var _t$allowPreview;let l = ee(t.width, t.ignoreMin ? 0 : e.minColumnWidth),o = { name: t.name, label: void 0 === t.label ? t.name : t.label, width: l.width, widthMode: l.mode, resizable: void 0 === t.resizable || t.resizable, sortable: void 0 === t.sortable || t.sortable, movable: void 0 === t.movable || t.movable, visible: void 0 === t.visible || t.visible, cellClasses: void 0 === t.cellClasses ? e.cellClasses : t.cellClasses, ignoreMin: void 0 !== t.ignoreMin && !!t.ignoreMin, sticky: void 0 === t.sticky ? null : t.sticky || null, allowPreview: !!((_t$allowPreview = t.allowPreview) !== null && _t$allowPreview !== void 0 ? _t$allowPreview : 1), dataPath: [], comparePath: [], order: 0 };const i = void 0 === t.dataPath ? o.name : t.dataPath,r = void 0 === t.comparePath ? i : t.comparePath;return o.dataPath = "string" == typeof i ? i.split(".") : i, o.comparePath = "string" == typeof r ? r.split(".") : r, o;}function le(e) {const t = e._p;0 === t.visibleColumns.length && t.columns.length && (t.columns[0].visible = true, t.visibleColumns.push(t.columns[0]), e.emit("showcolumn", t.columns[0].name));}function oe(e) {const t = e._p;if (t.filteredRows && t.filterArgs) {let l = e._o.filter || S;t.filteredRows = t.rows.filteredCollection(l, t.filterArgs);}}function ie(e, t, l) {let o = l.dataPath,i = t[o[0]];for (let e = 1; e < o.length && null != i; e++) i = i && i[o[e]];const r = e.cellFormatter;let n;if (r[c]) n = r(i, l.name, t);else try {n = r(i, l.name, t);} catch (e) {n = "[ERROR]", console.error("Failed to generate content for cell " + l.name, e);}return null == n && (n = ""), n;}const re = document.createElement.bind(document);function ne(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}function se(e) {const t = e.target;return /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(t.tagName);}function ae(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}function de(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}function ue(e, t, l = null) {const i = e._o,n = i.tableClassName,s = re("div");s.className = e.el.className, setCssProps(s, { position: "absolute", top: "-9999px", left: "0", visibility: "hidden", width: "auto", overflow: "visible" });const a = re("div");a.className = `${n}-header`;const d = re("div");d.className = `${n}-header-row`;const u = re("div");u.className = `${n}-header-cell ${t.cellClasses || ""}`, u.style.width = "auto";const h = u.cloneNode(true),c = u.cloneNode(true);u.appendChild(re("div")).innerHTML = i.headerCellFormatter(t.label, t.name), d.appendChild(h), d.appendChild(u), d.appendChild(c), a.appendChild(d), s.appendChild(a), document.body.appendChild(s);let m = getElementWidth(u, true, true, true) + i.columnAutoWidthExtraSize;if (l) {const e = re("div");e.className = `${n}-body`;const o = re("div");o.className = `${n}-row`;const a = re("div");a.className = `${n}-cell ${t.cellClasses || ""}`, a.style.width = "auto";const d = a.appendChild(re("div"));o.appendChild(a), e.appendChild(o), s.appendChild(e);for (let e = 0; e < l.length; e++) d.innerHTML = ie(i, l[e], t), m = Math.max(m, getElementWidth(a, true, true, true));}return s.remove(), m += t.arrowProposedWidth || 0, !t.ignoreMin && m < i.minColumnWidth && (m = i.minColumnWidth), Math.ceil(m);}function he(e) {const t = e._o,l = e._p;let i,n = 0,s = 0;l.table && (n = l.table ? l.table.scrollTop : 0, s = l.table ? l.table.scrollLeft : 0, t.virtualTable && (i = l.table.style.display, l.table.style.display = "none"));let a = getElementWidth(e.el);l.table && (t.virtualTable && void 0 !== i && (l.table.style.display = i), l.table.scrollTop = n, l.table.scrollLeft = s, l.header && (l.header.scrollLeft = s));const d = t.tableClassName,u = re("div");u.className = e.el.className, setCssProps(u, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px" });const h = re("div");h.className = `${d}-header`, u.appendChild(h);const c = re("div");c.index = null, c.vIndex = null, c.className = `${d}-header-row`, h.appendChild(c);for (let e = 0; e < l.visibleColumns.length; e++) {const t = l.visibleColumns[e],o = re("div");o.className = `${d}-header-cell ${t.cellClasses || ""}`, o.columnName = t.name, o.appendChild(re("div")), c.appendChild(o);}document.body.appendChild(u), a -= function (e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}(c);const m = c.querySelectorAll(`div.${d}-header-cell`);for (const e of m) {const t = getComputedStyle(e);if ("border-box" !== t.boxSizing) {a -= (parseFloat(t.borderRightWidth) || 0) + (parseFloat(t.borderLeftWidth) || 0) + ae(e);const o = e.columnName,i = l.columns.get(o);i && (a -= i.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}function ce(e) {const t = e._p,l = e._o.tableClassName,i = l + "-row",n = l + "-cell",s = t.visibleColumns,a = s.length,d = re("div");d.className = i, d.style.float = "left";let u = 0;for (let e = 0; e < a; e++) {var _t$actualWidth, _t$actualWidth2;const t = s[e],l = re("div");l.className = n, l.style.width = ((_t$actualWidth = t.actualWidth) !== null && _t$actualWidth !== void 0 ? _t$actualWidth : 0) + "px", t.cellClasses && (l.className += " " + t.cellClasses), l.appendChild(re("div")), d.appendChild(l), u += (_t$actualWidth2 = t.actualWidth) !== null && _t$actualWidth2 !== void 0 ? _t$actualWidth2 : 0;}const h = re("div");h.className = e.el.className, setCssProps(h, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const c = re("div");c.className = l, h.appendChild(c);const m = re("div");m.className = l + "-body", m.style.width = u + 1e4 + "px", c.appendChild(m), m.appendChild(d), document.body.appendChild(h);const f = re("div");setCssProps(f, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(f);const p = parseFloat(getComputedStyle(f).borderWidth),g = Math.round(p) !== p;f.remove();let C = getElementWidth(d, true, true, true);return C -= t.scrollbarWidth || 0, g && C++, h.remove(), C;}function me(e) {const t = e._p;return !!t.table && "rtl" === getComputedStyle(t.table).direction;}function fe(e) {var _e$unconvertedWidthMo;const t = null != e.unconvertedWidth ? e.unconvertedWidth : e.width,l = null != e.unconvertedWidth ? (_e$unconvertedWidthMo = e.unconvertedWidthMode) !== null && _e$unconvertedWidthMo !== void 0 ? _e$unconvertedWidthMo : e.widthMode : e.widthMode;return 0 === l ? "auto" : 2 === l ? 100 * t + "%" : 3 === l ? "rest" : t;}const pe = Object.prototype.hasOwnProperty;document.createElement.bind(document);class ge {constructor(e) {var _e$maxColumnsSortCoun, _e$sortedColumns;_defineProperty(this, "VERSION", void 0);_defineProperty(this, "el", void 0);_defineProperty(this, "_o", void 0);_defineProperty(this, "_p", void 0);_defineProperty(this, w, void 0);this.VERSION = ge.VERSION;const t = this._o = {},n = this._p = { eventsSink: new DomEventsSink(), mitt: { all: s = s || new Map(), on: function (e, t) {var l = s.get(e);l ? l.push(t) : s.set(e, [t]);}, off: function (e, t) {var l = s.get(e);l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : s.set(e, []));}, emit: function (e, t) {var l = s.get(e);l && l.slice().map(function (e) {e(t);}), (l = s.get("*")) && l.slice().map(function (l) {l(e, t);});} }, tableSkeletonNeedsRendering: true };var s;this.el = e.el && e.el instanceof HTMLElement ? e.el : document.createElement("div"), this.el !== e.el && this.el.classList.add(e.className || "dgtable-wrapper"), n.eventsSink.add(this.el, "dragend.colresize", (e) => {return t = e, void (this._p.resizer || (t.target.style.opacity = ""));var t;}), n.isWheelScrolling = false, n.eventsSink.add(this.el, "wheel", (e) => {if (n.cellPreviewCell) {let t = false,l = e.target;for (; l && l !== n.cellPreviewCell;) {const e = getComputedStyle(l),o = e.overflowY,i = e.overflowX,r = ("auto" === o || "scroll" === o) && l.scrollHeight > l.clientHeight,n = ("auto" === i || "scroll" === i) && l.scrollWidth > l.clientWidth;if (r || n) {t = true;break;}l = l.parentElement;}if (t) return;}n.isWheelScrolling = true, z(this), n.wheelScrollTimeout && clearTimeout(n.wheelScrollTimeout), n.wheelScrollTimeout = setTimeout(() => {n.isWheelScrolling = false, n.wheelScrollTimeout = void 0;}, 100);}, { passive: true }), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = e.rowsBufferSize || 3, t.minColumnWidth = Math.max(e.minColumnWidth || 35, 0), t.maxStickyColumnRelativeWidth = e.maxStickyColumnRelativeWidth || null, t.columnAutoWidthExtraSize = e.columnAutoWidthExtraSize || 0, t.resizeAreaWidth = e.resizeAreaWidth || 8, t.resizeAreaDoubleClickDuration = e.resizeAreaDoubleClickDuration || 300, t.autoFitColumnOnResizeDoubleClick = void 0 !== e.autoFitColumnOnResizeDoubleClick && !!e.autoFitColumnOnResizeDoubleClick, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns;const d = (_e$maxColumnsSortCoun = e.maxColumnsSortCount) !== null && _e$maxColumnsSortCoun !== void 0 ? _e$maxColumnsSortCoun : e.sortableColumns;t.sortableColumns = void 0 === d ? 1 : Number(d) || 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.autoFillLastColumn = void 0 === e.autoFillLastColumn || !!e.autoFillLastColumn, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? _.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let u = [];const h = (_e$sortedColumns = e.sortedColumns) !== null && _e$sortedColumns !== void 0 ? _e$sortedColumns : e.sortColumn;if (h) {let e = Array.isArray(h) ? h : [h];for (let t = 0, l = e.length; t < l; t++) {var _l$descending;let l = e[t];"string" == typeof l && (l = { column: l, descending: false });let o = n.columns.get(l.column);o && u.push({ column: l.column, comparePath: o.comparePath || o.dataPath, descending: (_l$descending = l.descending) !== null && _l$descending !== void 0 ? _l$descending : false });}}n.rows = new W({ sortColumn: u }), n.rows.onComparatorRequired = (e, l, o) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, l, o);}, n.rows.customSortingProvider = (e, l) => t.customSortingProvider ? t.customSortingProvider(e, l) : l(e), n.filteredRows = null, n.scrollbarWidth = 0, n._lastVirtualScrollHeight = 0, function (e) {const t = e._p,n = (t) => {let n = t.currentTarget,s = t.relatedTarget;s === n || n.contains(s) || n[g] && (s === n[g] || n[g].contains(s)) || function (e, t, _s$visibleColumns$x$c, _E$right) {const n = e._o,s = e._p;if (s.isWheelScrolling) return;const a = t.firstElementChild;if (!a) return;if (!(a.scrollWidth - a.clientWidth > 1 || a.scrollHeight - a.clientHeight > 1)) return;z(e), s.abortCellPreview = false;const d = t.parentElement;if (!d) return;const u = (_s$visibleColumns$x$c = s.visibleColumns[x.call(d.childNodes, t)]) === null || _s$visibleColumns$x$c === void 0 ? void 0 : _s$visibleColumns$x$c.name,h = u ? s.columns.get(u) : null;if (!h) return;const c = d.index;if (e.emit("cellhoveroverflow", { name: u, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), false === h.allowPreview) return;const m = k("div");m.innerHTML = t.innerHTML, m.className = n.cellPreviewClassName + " " + (h.cellClasses || "");const f = t.classList.contains(`${n.tableClassName}-header-cell`);f && (m.classList.add("header"), t.classList.contains("sortable") && m.classList.add("sortable"), m.draggable = true, Z(e, m));const p = getComputedStyle(t),v = getComputedStyle(a),b = "right" === p.float,w = b ? "right" : "left",W = parseFloat(p.paddingLeft) || 0,y = parseFloat(p.paddingRight) || 0,R = parseFloat(p.paddingTop) || 0,S = parseFloat(p.paddingBottom) || 0;let _ = a.scrollWidth + (t.clientWidth - a.offsetWidth);const M = "border-box" === p.boxSizing;if (M ? m.style.boxSizing = "border-box" : (_ -= W + y, m.style.marginTop = (parseFloat(p.borderTopWidth) || 0) + "px"), !s.transparentBgColor1) {const e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", s.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", s.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}const T = { "box-sizing": M ? "border-box" : "content-box", width: _ + "px", "min-height": Math.max(getElementHeight(t), /%/.test(p.minHeight) ? 0 : parseFloat(p.minHeight) || 0) + "px", "padding-left": W + "px", "padding-right": y + "px", "padding-top": R + "px", "padding-bottom": S + "px", overflow: "hidden", position: "absolute", "z-index": "-1", [w]: "0", top: "0", cursor: p.cursor };let L = p.backgroundColor;L !== s.transparentBgColor1 && L !== s.transparentBgColor2 || (L = getComputedStyle(d).backgroundColor), L !== s.transparentBgColor1 && L !== s.transparentBgColor2 || (L = "#fff"), T["background-color"] = L, setCssProps(m, T), m.firstChild && setCssProps(m.firstChild, { direction: v.direction, "white-space": v.whiteSpace, "min-height": v.minHeight, "line-height": v.lineHeight, font: v.font }), e.el.appendChild(m), f && de(m), m.rowVIndex = d.vIndex, m.rowIndex = c, m.columnName = u;try {const e = N.saveSelection(t);e && N.restoreSelection(m, e);} catch {}if (e.emit("cellpreview", { el: m.firstElementChild, name: m.columnName, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), s.abortCellPreview) return void m.remove();null != c && m.addEventListener("click", (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d.vIndex, rowIndex: c, rowEl: d, rowData: s.rows[c] });});const F = e.el,A = F === window ? document : F,P = getComputedStyle(F),E = getElementOffset(t),H = getElementOffset(F);if (b) {const e = window.innerWidth;E.right = e - (E.left + getElementWidth(t, true, true, true)), H.right = e - (H.left + getElementWidth(F, true, true, true));}E.left -= parseFloat(P.borderLeftWidth) || 0, "right" === w && void 0 !== E.right && void 0 !== H.right && (E.right -= parseFloat(P.borderRightWidth) || 0), E.top -= parseFloat(P.borderTopWidth) || 0, "left" === w ? E.left += parseFloat(p.borderLeftWidth) || 0 : void 0 !== E.right && (E.right += parseFloat(p.borderRightWidth) || 0), E.top += parseFloat(p.borderTopWidth) || parseFloat(p.borderBottomWidth) || 0, E.left -= H.left, "right" === w && void 0 !== E.right && void 0 !== H.right && (E.right -= H.right), E.top -= H.top;const I = getElementWidth(F, false, false, false) - getElementWidth(m, true, true, true),O = "left" === w ? E.left : (_E$right = E.right) !== null && _E$right !== void 0 ? _E$right : 0,D = O < 0 ? 0 : O > I ? I : O;"left" === w ? E.left = D : E.right = D;const B = getElementHeight(t, true, true, true),$ = ("scrollTop" in A ? A.scrollTop : 0) + getElementHeight(F, true) - B;E.top > $ && (E.top = Math.max(0, $));const q = { top: E.top + "px", "z-index": 9999 };q[w] = ("left" === w ? E.left : E.right) + "px", setCssProps(m, q), m[C] = t, s.cellPreviewCell = m, t[g] = m, s._bindCellHoverOut(t), s._bindCellHoverOut(m);}(e, n);},s = (t) => {let l = t.currentTarget[C] || t.currentTarget,o = t.relatedTarget;o === e.el || l.contains(o) || l[g] && (o === l[g] || l[g].contains(o)) || function (e) {z(e);}(e);};t._bindCellHoverIn = (e) => {e[m] || e.addEventListener("mouseover", e[m] = n);}, t._unbindCellHoverIn = (e) => {e[m] && (e.removeEventListener("mouseover", e[m]), e[m] = null);}, t._bindCellHoverOut = (e) => {e[f] || e.addEventListener("mouseout", e[f] = s);}, t._unbindCellHoverOut = (e) => {e[f] && (e.removeEventListener("mouseout", e[f]), e[f] = null);};}(this);}on(e, t) {return this[w] || this._p.mitt.on(e, t), this;}once(e, t) {if (this[w]) return this;const l = (o) => {this._p.mitt.off(e, l), t(o);};return this._p.mitt.on(e, l), this;}off(e, t) {return this[w] || (e || t ? this._p.mitt.off(e, t) : this._p.mitt.all.clear()), this;}emit(e, t) {return this[w] || this._p.mitt.emit(e, t), this;}destroy() {var _e$virtualListHelper, _e$table, _e$tbody;const e = this._p,t = this.el;if (this[w] || !e) return this;if (A(this), (_e$virtualListHelper = e.virtualListHelper) !== null && _e$virtualListHelper !== void 0 && _e$virtualListHelper.destroy(), e.virtualListHelper = null, X(this), (_e$table = e.table) !== null && _e$table !== void 0 && _e$table.remove(), (_e$tbody = e.tbody) !== null && _e$tbody !== void 0 && _e$tbody.remove(), e.workerListeners) {for (let t = 0; t < e.workerListeners.length; t++) {let l = e.workerListeners[t];l.worker.removeEventListener("message", l.listener, false);}e.workerListeners.length = 0;}e.rows.length = e.columns.length = 0, e._deferredRender && clearTimeout(e._deferredRender);for (let e in this) pe.call(this, e) && (this[e] = null);return this[w] = true, t && t.remove(), this;}close() {this.destroy();}remove() {this.destroy();}render() {const i = this._o,r = this._p;if (!this.el.offsetParent) return r._deferredRender || (r._deferredRender = setTimeout(() => {r._deferredRender = null, !this[w] && this.el.offsetParent && this.render();})), this;if (true === r.tableSkeletonNeedsRendering) {var _r$filteredRows;r.tableSkeletonNeedsRendering = false, i.width === _.AUTO && K(this);let n = r.table && r.table.parentNode ? r.table.scrollTop : NaN,s = r.table && r.table.parentNode ? getScrollHorz(r.table) : NaN;!function (e, _t$virtualListHelper) {const t = e._p,o = e._o;(_t$virtualListHelper = t.virtualListHelper) !== null && _t$virtualListHelper !== void 0 && _t$virtualListHelper.destroy(), t.virtualListHelper = null, t.table && o.virtualTable && (t.table.remove(), t.table = void 0, t.tbody = void 0), X(e), t.currentTouchId = null, t.header && t.header.remove();const i = o.tableClassName,r = q("div"),n = q("div");r.className = `${i}-header`, n.className = `${i}-header-row`, t.header = r, t.headerRow = n, r.appendChild(n), e.el.prepend(r), ne(e.el), o.width === _.SCROLL ? e.el.style.overflow = "hidden" : e.el.style.overflow = "", !o.height && o.virtualTable && (o.height = getElementHeight(e.el, true));}(this), function (e) {const t = e._p,i = e._o,r = i.tableClassName;if (i.virtualTable && !t.virtualRowHeight) {const i = () => {const e = q("div"),t = e.appendChild(q("div")),l = t.appendChild(q("div"));return e.className = `${r}-row`, t.className = `${r}-cell`, l.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;},n = q("div");n.className = e.el.className, setCssProps(n, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const s = q("div");s.className = r, n.appendChild(s);const a = q("div");a.className = `${r}-body`, a.style.width = "99999px", s.appendChild(a), document.body.appendChild(n);const d = i(),u = i(),h = i();a.appendChild(d), a.appendChild(u), a.appendChild(h), t.virtualRowHeight = getElementHeight(u, true, true, true), n.remove();}if (!t.table) {var _i$height;const n = document.createDocumentFragment(),s = q("div");s.className = r, i.virtualTable && (s.className += " virtual");const a = getComputedStyle(s);let u = ((_i$height = i.height) !== null && _i$height !== void 0 ? _i$height : 0) - getElementHeight(t.header, true, true, true);"border-box" !== a.boxSizing && (u -= parseFloat(a.borderTopWidth) || 0, u -= parseFloat(a.borderBottomWidth) || 0, u -= parseFloat(a.paddingTop) || 0, u -= parseFloat(a.paddingBottom) || 0), setCssProps(s, { height: i.height ? u + "px" : "auto", display: "block", overflowY: "auto", overflowX: i.width === _.SCROLL ? "auto" : "hidden" }), n.appendChild(s);const h = q("div");h.className = i.tableClassName + "-body", h.style.minHeight = "1px", t.table = s, t.tbody = h, ne(h), ne(s), s.appendChild(h), e.el.appendChild(n), function (e, _t$filteredRows) {const t = e._p,l = e._o,o = l.tableClassName,i = o + "-row",r = o + "-row-alt",n = o + "-cell",s = o + "-sticky";let a = t.visibleColumns,u = a.length;t.notifyRendererOfColumnsConfig = () => {a = t.visibleColumns, u = a.length;for (let e = 0; e < u; e++) {const t = a[e];t._finalWidth = t.actualWidthConsideringScrollbarWidth || t.actualWidth;}}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: l.virtualTable, buffer: l.rowsBufferSize, estimatedItemHeight: l.estimatedRowHeight ? l.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => q("div"), onItemRender: (o, d) => {const h = t.filteredRows || t.rows,c = !!t.filteredRows,m = t.isStickyColumns;o.className = i, d % 2 == 1 && (o.className += " " + r);const f = h[d],g = c ? f[b] : d;o.vIndex = d, o.index = g;for (let e = 0; e < u; e++) {var _i$_finalWidth;const i = a[e],r = q("div");if (r.columnName = i.name, r.setAttribute("data-column", i.name), r.className = n, r.style.width = ((_i$_finalWidth = i._finalWidth) !== null && _i$_finalWidth !== void 0 ? _i$_finalWidth : 0) + "px", i.cellClasses && (r.className += " " + i.cellClasses), i.stickyPos) {r.className += " " + s, r.style.position = "sticky", r.style[i.stickyPos.absDirection] = i.stickyPos.offset + "px";const l = m === null || m === void 0 ? void 0 : m.get(e);"start" === l && !t.lastIsRtl || "end" === l && t.lastIsRtl ? r.classList.add("is-sticky-left") : ("start" === l && t.lastIsRtl || "end" === l && !t.lastIsRtl) && r.classList.add("is-sticky-right");}t._bindCellHoverIn(r), r.appendChild(q("div")).innerHTML = ie(l, f, i), o.appendChild(r);}o.addEventListener("click", o[p] = (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d, rowIndex: g, rowEl: o, rowData: f });}), e.emit("rowcreate", { filteredRowIndex: d, rowIndex: g, rowEl: o, rowData: f });}, onItemUnrender: (t) => {t[p] && t.removeEventListener("click", t[p]), function (e, t) {const l = e._p;for (let e = 0, o = t.childNodes, i = o.length; e < i; e++) l._unbindCellHoverIn(o[e]);}(e, t), e.emit("rowdestroy", t);}, onScrollHeightChange: (l) => {l > t._lastVirtualScrollHeight && !t.scrollbarWidth && j(e), t._lastVirtualScrollHeight = l;} }), t.virtualListHelper.setCount(((_t$filteredRows = t.filteredRows) !== null && _t$filteredRows !== void 0 ? _t$filteredRows : t.rows).length), t.notifyRendererOfColumnsConfig();}(e);}}(this), this.tableWidthChanged(true, false), function (e) {const t = e._p,l = e._o,o = l.tableClassName + "-header-cell",i = t.headerRow;for (let r = 0; r < t.visibleColumns.length; r++) {const n = t.visibleColumns[r];if (n.visible) {var _n$actualWidth;const s = q("div");s.draggable = true, s.className = o, s.style.width = ((_n$actualWidth = n.actualWidth) !== null && _n$actualWidth !== void 0 ? _n$actualWidth : 0) + "px", l.sortableColumns && n.sortable && (s.className += " sortable"), s.columnName = n.name, s.setAttribute("data-column", n.name);const a = q("div");a.innerHTML = l.headerCellFormatter(n.label, n.name), s.appendChild(a), t._bindCellHoverIn(s), i.appendChild(s), t.visibleColumns[r].element = s, Z(e, s), de(s);}}U(e), e.emit("headerrowcreate", i);}(this), r.virtualListHelper.setCount(((_r$filteredRows = r.filteredRows) !== null && _r$filteredRows !== void 0 ? _r$filteredRows : r.rows).length), V(this), j(this, true), Y(this, true);for (let e = 0; e < r.rows.sortColumn.length; e++) Q(this, r.rows.sortColumn[e].column, r.rows.sortColumn[e].descending);i.adjustColumnWidthForSortArrow && r.rows.sortColumn.length ? this.tableWidthChanged(true) : i.virtualTable || this.tableWidthChanged(), isNaN(n) || (r.table.scrollTop = n), isNaN(s) || (setScrollHorz(r.table, s), setScrollHorz(r.header, s)), U(this), this.emit("renderskeleton");}return r.virtualListHelper.render(), this.emit("render"), this;}clearAndRender(e) {var _t$notifyRendererOfCo;let t = this._p;return t.tableSkeletonNeedsRendering = true, (_t$notifyRendererOfCo = t.notifyRendererOfColumnsConfig) !== null && _t$notifyRendererOfCo !== void 0 && _t$notifyRendererOfCo.call(t), (void 0 === e || e) && this.render(), this;}setColumns(e, t) {const l = this._p;e = e || [];let o = new R();for (let t = 0, l = 0; t < e.length; t++) {let i = e[t],r = te(this._o, i);void 0 !== i.order ? (i.order > l && (l = i.order + 1), r.order = i.order) : r.order = l++, o.push(r);}return o.normalizeOrder(), l.columns = o, l.visibleColumns = o.getVisibleColumns(), le(this), this.clearAndRender(t), this;}addColumn(e, t, l) {const o = this._p;let i = o.columns;if (e && !i.get(e.name)) {let r = null;void 0 !== t && (r = "string" == typeof t ? i.get(t) : i.getByOrder(t));let n = te(this._o, e);n.order = r ? r.order : i.getMaxOrder() + 1;for (let e = i.getMaxOrder(), t = n.order; e >= t; e--) {let t = i.getByOrder(e);t && t.order++;}i.push(n), i.normalizeOrder(), o.visibleColumns = i.getVisibleColumns(), le(this), this.clearAndRender(l), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const l = this._p;let o = l.columns,i = o.indexOf(e);return i > -1 && (o.splice(i, 1), o.normalizeOrder(), l.visibleColumns = o.getVisibleColumns(), le(this), this.clearAndRender(t), this.emit("removecolumn", e)), this;}setColumnLabel(e, t) {let l = this._p.columns.get(e);if (l && (l.label = void 0 === t ? l.name : t, l.element)) for (let e = 0; e < l.element.firstChild.childNodes.length; e++) {let t = l.element.firstChild.childNodes[e];if (3 === t.nodeType) {t.textContent = l.label;break;}}return this;}moveColumn(e, t, l = true) {const o = this._o,i = this._p;let r,n,a = i.columns,d = l ? i.visibleColumns : a.getColumns();if ("string" == typeof e ? r = a.get(e) : "number" == typeof e && (r = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), r && n && e !== t) {let e = r.order,t = n.order,l = a.moveColumn(r, n).getVisibleColumns();if (i.visibleColumns.length !== l.length || i.visibleColumns.some((e, t) => e !== l[t])) if (i.visibleColumns = l, le(this), o.virtualTable) this.clearAndRender();else {var _ref7, _ref8;const l = scopedSelectorAll(i.headerRow, `>div.${o.tableClassName}-header-cell`);let r = e < t ? t + 1 : t,n = e;l[0].parentNode.insertBefore(l[n], l[r]);let a = i.visibleColumns[e],d = ((_ref7 = a.actualWidthConsideringScrollbarWidth || a.actualWidth) !== null && _ref7 !== void 0 ? _ref7 : 0) + "px",u = i.visibleColumns[t],h = ((_ref8 = u.actualWidthConsideringScrollbarWidth || u.actualWidth) !== null && _ref8 !== void 0 ? _ref8 : 0) + "px",c = i.tbody.childNodes;for (let l = 0, o = c.length; l < o; l++) {let o = c[l];1 === o.nodeType && (o.insertBefore(o.childNodes[n], o.childNodes[r]), o.childNodes[t].firstChild.style.width = h, o.childNodes[e].firstChild.style.width = d);}this.tableWidthChanged(true);}this.emit("movecolumn", { name: r.name, src: e, dest: t });}return this;}setColumnVisible(e, t) {const l = this._p;let o = l.columns.get(e);return t = !!t, o && !!o.visible !== t && (o.visible = t, l.visibleColumns = l.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), le(this), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setColumnAutoWidthExtraSize(e) {let t = this._o;return e = Math.max(e, 0), t.columnAutoWidthExtraSize !== e && (t.columnAutoWidthExtraSize = e, this.tableWidthChanged(true)), this;}getColumnAutoWidthExtraSize() {return this._o.columnAutoWidthExtraSize;}setResizeAreaWidth(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaWidth !== e && (t.resizeAreaWidth = e, this.tableWidthChanged(true)), this;}getResizeAreaWidth() {return this._o.resizeAreaWidth;}setResizeAreaDoubleClickDuration(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaDoubleClickDuration !== e && (t.resizeAreaDoubleClickDuration = e, this.tableWidthChanged(true)), this;}getResizeAreaDoubleClickDuration() {return this._o.resizeAreaDoubleClickDuration;}setMaxStickyColumnRelativeWidth(e) {let t = this._o;return e = e || null, t.maxStickyColumnRelativeWidth !== e && (t.maxStickyColumnRelativeWidth = e, this.tableWidthChanged(true)), this;}getMaxStickyColumnRelativeWidth() {return this._o.maxStickyColumnRelativeWidth;}setColumnWidth(e, t) {let l = this._p.columns.get(e);if (l) {let e = ee(t, l.ignoreMin ? 0 : this._o.minColumnWidth),o = fe(l);l.width = e.width, l.widthMode = e.mode, l.unconvertedWidth = null, l.unconvertedWidthMode = null;let i = fe(l);o !== i && this.tableWidthChanged(true), this.emit("columnwidth", { name: l.name, width: i, oldWidth: o });}return this;}autoFitColumn(e) {const t = this._p,l = t.filteredRows || t.rows,o = t.columns.get(e);if (!o || l.length < 1) return this;const i = ue(this, o, l);return i > 0 && this.setColumnWidth(e, i), this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? fe(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);if (t) {var _t$unconvertedWidthMo, _t$dataPath, _t$comparePath;const e = t.width,l = t.widthMode;null != t.unconvertedWidth && (t.width = t.unconvertedWidth, t.widthMode = (_t$unconvertedWidthMo = t.unconvertedWidthMode) !== null && _t$unconvertedWidthMo !== void 0 ? _t$unconvertedWidthMo : t.widthMode);const o = fe(t);return null != t.unconvertedWidth && (t.width = e, t.widthMode = l), { name: t.name, label: t.label, width: o, dataPath: (_t$dataPath = t.dataPath) === null || _t$dataPath === void 0 ? void 0 : _t$dataPath.join("."), comparePath: (_t$comparePath = t.comparePath) === null || _t$comparePath === void 0 ? void 0 : _t$comparePath.join("."), resizable: t.resizable, movable: t.movable, sortable: t.sortable, visible: t.visible, cellClasses: t.cellClasses, ignoreMin: t.ignoreMin, sticky: t.sticky, order: t.order };}return null;}getColumnsConfig() {const e = this._p;let t = {};for (let l = 0; l < e.columns.length; l++) t[e.columns[l].name] = this.getColumnConfig(e.columns[l].name);return t;}setMaxColumnSortCount(e) {const t = this._p,l = this._o;if (l.sortableColumns !== e && (l.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, `>div.${l.tableClassName}-header-cell`);for (let o = 0, i = e.length; o < i; o++) e[o].classList[l.sortableColumns > 0 && t.visibleColumns[o].sortable ? "add" : "remove"]("sortable");}return this;}getMaxColumnSortCount() {return this._o.sortableColumns;}setSortableColumns(e) {return this.setMaxColumnSortCount(e);}getSortableColumns() {return this.getMaxColumnSortCount();}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}getConvertColumnWidthsToRelative() {return this._o.convertColumnWidthsToRelative;}setConvertColumnWidthsToRelative(e, t = true) {let l = this._o;return e = !!e, l.convertColumnWidthsToRelative !== e && (l.convertColumnWidthsToRelative = e, t && this.tableWidthChanged(true)), this;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}sort(e, t, l) {const o = this._o,i = this._p;let r = i.columns.get(e),n = i.rows.sortColumn.map((e) => ({ column: e.column, descending: e.descending }));if (r) {if (l) {for (let e = 0; e < n.length; e++) if (n[e].column === r.name) {e < n.length - 1 ? n.length = 0 : (t = n[n.length - 1].descending, n.splice(n.length - 1, 1));break;}(o.sortableColumns > 0 && n.length >= o.sortableColumns || n.length >= i.visibleColumns.length) && (n.length = 0);} else n.length = 0;t = void 0 !== t && t, n.push({ column: r.name, descending: !!t });} else n.length = 0;return this.setSortedColumns(n);}resort() {const e = this._p;let t = e.columns,l = e.rows.sortColumn;if (l.length) {var _e$virtualListHelper2;for (let e = 0; e < l.length; e++) t.get(l[e].column) || l.splice(e--, 1);e.rows.sortColumn = l, l.length && (e.rows.sort(), e.filteredRows && (e.filteredRows.sortColumn = e.rows.sortColumn, e.filteredRows.onComparatorRequired = e.rows.onComparatorRequired, e.filteredRows.customSortingProvider = e.rows.customSortingProvider, e.filteredRows.sort())), (_e$virtualListHelper2 = e.virtualListHelper) === null || _e$virtualListHelper2 === void 0 ? void 0 : _e$virtualListHelper2.invalidate();let o = [];for (let e = 0; e < l.length; e++) o.push({ column: l[e].column, descending: l[e].descending });this.emit("sort", { sorts: o, resort: true });}return this;}setSortedColumns(e, t = { immediate: true, render: true }) {var _o$virtualListHelper;const l = this._o,o = this._p;let i = o.columns,r = e.filter((e) => i.get(e.column)).map((e) => {let t = i.get(e.column);return { column: t.name, comparePath: t.comparePath || t.dataPath, descending: !!e.descending };});l.sortableColumns > 0 && r.length > l.sortableColumns && (r.length = l.sortableColumns), K(this);for (let e = 0; e < r.length; e++) Q(this, r[e].column, r[e].descending);l.adjustColumnWidthForSortArrow && !o.tableSkeletonNeedsRendering && this.tableWidthChanged(true), o.rows.sortColumn = r, r.length && t.immediate && (o.rows.sort(), o.filteredRows && (o.filteredRows.sortColumn = o.rows.sortColumn, o.filteredRows.onComparatorRequired = o.rows.onComparatorRequired, o.filteredRows.customSortingProvider = o.rows.customSortingProvider, o.filteredRows.sort()), (_o$virtualListHelper = o.virtualListHelper) !== null && _o$virtualListHelper !== void 0 && _o$virtualListHelper.invalidate(), o.virtualListHelper && t.render && o.virtualListHelper.render());let n = [];for (let e = 0; e < r.length; e++) n.push({ column: r[e].column, descending: r[e].descending });return this.emit("sort", { sorts: n }), this;}getSortedColumns() {const e = this._p;let t = [];for (let l = 0; l < e.rows.sortColumn.length; l++) {let o = e.rows.sortColumn[l];t.push({ column: o.column, descending: o.descending });}return t;}setCellFormatter(e) {if (!e) {const t = (e) => "string" == typeof e ? h(e) : e;t[c] = true, e = t;}return this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? h(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let l = this._o.filter || S,o = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(l, t.filterArgs), (o || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}getHtmlForRowCell(e, t) {const l = this._p;if (e < 0 || e > l.rows.length - 1) return null;let o = l.columns.get(t);if (!o) return null;let i = l.rows[e];return ie(this._o, i, o);}getHtmlForRowDataCell(e, t) {let l = this._p.columns.get(t);return l ? ie(this._o, e, l) : null;}getRowYPos(e) {return this._p.virtualListHelper.getItemPosition(e) || null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}addRows(e, t, l, o) {let i = this._p;"boolean" == typeof t && (o = l, l = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > i.rows.length) && (t = i.rows.length), o = void 0 === o || !!o;const r = (Array.isArray(e) ? e : [e]).length;return e && (i.rows.add(e, t), i.filteredRows || l && i.rows.sortColumn.length ? (l && i.rows.sortColumn.length ? this.resort() : oe(this), i.tableSkeletonNeedsRendering = true, o && this.render()) : o && (i.virtualListHelper.addItemsAt(r, t), this._o.virtualTable ? (V(this), j(this), this.render(), Y(this, false)) : i.tbody && (this.render(), j(this), Y(this, true))), this.emit("addrows", { count: r, clear: false })), this;}removeRows(e, t, l) {let o = this._p;return "number" != typeof t || t <= 0 || e < 0 || e > o.rows.length - 1 || (o.rows.splice(e, t), l = void 0 === l || !!l, o.filteredRows ? (oe(this), o.tableSkeletonNeedsRendering = true, l && this.render()) : l && (o.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable ? (V(this), j(this), this.render(), Y(this, false)) : (this.render(), j(this), Y(this, true)))), this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e, t = true) {let l = this._p;if (e < 0 || e > l.rows.length - 1) return this;let o = -1;return l.filteredRows && -1 === (o = l.filteredRows.indexOf(l.rows[e])) || (-1 === o && (o = e), l.virtualListHelper.refreshItemAt(o), t && l.virtualListHelper.render()), this;}getRowElement(e) {let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = -1;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === l && (l = e), t.virtualListHelper.getItemElementAt(l) || null);}refreshAllVirtualRows() {return this._p.virtualListHelper.invalidate().render(), this;}setRows(e, t) {let l = this._p;return l.rows.reset(e), t && l.rows.sortColumn.length ? this.resort() : oe(this), this.clearAndRender().emit("addrows", { count: e.length, clear: true }), this;}tableWidthChanged(e, t) {let l = this._o,o = this._p,i = he(this),r = i,n = 0;if (!o.table) return this;t = void 0 === t || t;let s = 0;if (o.tbody || (t = false), t && (s = parseFloat(o.tbody.style.minWidth) || 0), r !== o.lastDetectedWidth || e) {var _o$notifyRendererOfCo;o.lastDetectedWidth = i;let e = 0,a = [],d = 0,u = 0;for (let e = 0; e < o.columns.length; e++) o.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < o.visibleColumns.length; t++) {var _i$unconvertedWidthMo;let i = o.visibleColumns[t];if (null != i.unconvertedWidth && (i.width = i.unconvertedWidth, i.widthMode = (_i$unconvertedWidthMo = i.unconvertedWidthMode) !== null && _i$unconvertedWidthMo !== void 0 ? _i$unconvertedWidthMo : i.widthMode, i.unconvertedWidth = null, i.unconvertedWidthMode = null), 1 === i.widthMode) {let o = i.width;o += i.arrowProposedWidth || 0, !i.ignoreMin && o < l.minColumnWidth && (o = l.minColumnWidth), r -= o, e += o, o !== i.actualWidth && (i.actualWidth = o, a.push(t));} else if (0 === i.widthMode) {let n = ue(this, i);i === o.visibleColumns[o.visibleColumns.length - 1] && (n += o.scrollbarWidth), r -= n, e += n, n !== i.actualWidth && (i.actualWidth = n, l.convertColumnWidthsToRelative || a.push(t));} else 2 === i.widthMode ? (d += i.width, n++) : 3 === i.widthMode && u++;}if (l.convertColumnWidthsToRelative) for (let t = 0; t < o.visibleColumns.length; t++) {let l = o.visibleColumns[t];if (0 === l.widthMode) {const t = l.width,o = l.widthMode;null == l.unconvertedWidth && (l.unconvertedWidth = t, l.unconvertedWidthMode = o), l.widthMode = 2, r += l.actualWidth, l.width = l.actualWidth / e, d += l.width, n++;}}if (n && (d < 1 && !u && l.relativeWidthGrowsToFillWidth || d > 1 && l.relativeWidthShrinksToFillWidth)) for (let e = 0; e < o.visibleColumns.length; e++) {let t = o.visibleColumns[e];2 === t.widthMode && (null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width /= d);}let h = Math.max(0, r);0 === h && (h = o.table.clientWidth);let c = l.minColumnWidth / h;if (Number.isFinite(c) || (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < o.visibleColumns.length; e++) {let l = o.visibleColumns[e];2 === l.widthMode && !l.ignoreMin && l.width < c && (t += c - l.width, l.width = c);}for (let l = 0; l < o.visibleColumns.length; l++) {let i = o.visibleColumns[l];2 === i.widthMode && !i.ignoreMin && i.width > c && t > 0 && (null == i.unconvertedWidth && (i.unconvertedWidth = i.width, i.unconvertedWidthMode = i.widthMode), e = Math.min(t, i.width - c), i.width -= e, t -= e);}}if (!u && l.autoFillTableWidth && r > 0) {let e = 0,t = r;for (let l = 0; l < o.visibleColumns.length; l++) {let i = o.visibleColumns[l];i.resizable || 1 !== i.widthMode || (e += i.width), 2 === i.widthMode && (t -= Math.round(h * i.width));}let l = (i - e) / (i - t - e) || NaN;for (let e = 0; e < o.visibleColumns.length && t > 0; e++) {let t = o.visibleColumns[e];if (t.resizable || 1 !== t.widthMode) if (2 === t.widthMode) null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width *= l;else {let o = t.actualWidth * l;t.actualWidth !== o && (t.actualWidth = o, -1 === a.indexOf(e) && a.push(e));}}}for (let e = 0; e < o.visibleColumns.length; e++) {let t = o.visibleColumns[e];if (2 === t.widthMode) {let l = Math.round(h * t.width);r -= l, n--, 0 === n && 1 === r && (l++, r--), -1 === r && (l--, r++), l !== t.actualWidth && (t.actualWidth = l, a.push(e));}}if (u) {let e = Math.max(0, r),t = u;for (let i = 0; i < o.visibleColumns.length; i++) {let r = o.visibleColumns[i];if (3 === r.widthMode) {let o = Math.floor(e / t);!r.ignoreMin && o < l.minColumnWidth && (o = l.minColumnWidth), e -= o, t--, o !== r.actualWidth && (r.actualWidth = o, a.push(i));}}}if (l.autoFillLastColumn && o.visibleColumns.length) {var _l$actualWidth2;let e = 0;for (let t = 0; t < o.visibleColumns.length; t++) {var _o$visibleColumns$t$a;e += (_o$visibleColumns$t$a = o.visibleColumns[t].actualWidth) !== null && _o$visibleColumns$t$a !== void 0 ? _o$visibleColumns$t$a : 0;}const t = o.visibleColumns.length - 1,l = o.visibleColumns[t],r = i - e;r > 0 && (l.actualWidth = ((_l$actualWidth2 = l.actualWidth) !== null && _l$actualWidth2 !== void 0 ? _l$actualWidth2 : 0) + r, -1 === a.indexOf(t) && a.push(t));}if (o.visibleColumns.length && (o.visibleColumns[o.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = o.visibleColumns[o.visibleColumns.length - 1].actualWidth - (o.scrollbarWidth || 0)), (_o$notifyRendererOfCo = o.notifyRendererOfColumnsConfig) !== null && _o$notifyRendererOfCo !== void 0 && _o$notifyRendererOfCo.call(o), t) {let e = ce(this);s < e && Y(this, false);for (let e = 0; e < a.length; e++) J(this, a[e]);s > e && Y(this, false);}U(this);}return this;}tableHeightChanged() {let e = this._o,t = this._p;if (!t.table) return this;const o = getComputedStyle(t.table);let i = getElementHeight(this.el, true) - (parseFloat(o.borderTopWidth) || 0) - (parseFloat(o.borderBottomWidth) || 0);return i !== e.height && (e.height = i, t.tbody && (t.tbody.style.height = Math.max(e.height - getElementHeight(t.header, true, true, true), 1) + "px"), e.virtualTable && this.clearAndRender()), this;}hideCellPreview() {return z(this), this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {return A(this), this;}getUrlForElementContent(e) {let t,l = document.getElementById(e);if (l) {let e = l.textContent;if ("function" == typeof Blob) t = new Blob([e || ""]);else {const l = window,o = l.BlobBuilder || l.WebKitBlobBuilder || l.MozBlobBuilder || l.MSBlobBuilder;if (!o) return null;const i = new o();i.append(e || ""), t = i.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, l) {if (this.isWorkerSupported()) {let o = this._p,i = new Worker(e),r = (e) => {e.data.append ? this.addRows(e.data.rows, l) : this.setRows(e.data.rows, l);};return i.addEventListener("message", r, false), o.workerListeners || (o.workerListeners = []), o.workerListeners.push({ worker: i, listener: r }), (t || void 0 === t) && i.postMessage(null), i;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let l = 0; l < t.workerListeners.length; l++) t.workerListeners[l].worker === e && (e.removeEventListener("message", t.workerListeners[l].listener, false), t.workerListeners.splice(l, 1), l--);return this;}}_defineProperty(ge, "VERSION", "@@VERSION");_defineProperty(ge, "Width", _);
|
|
3462
|
+
function u(e, t) {for (let l = 0, i = e.length; l >= 0 && l < i; l += 1) if (t(e[l], l, e)) return e[l];}function h(e) {return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """).replace(/\n/g, "<br />");}const c = Symbol("safe"),m = Symbol("hover_in"),f = Symbol("hover_out"),p = Symbol("row_click"),g = Symbol("preview_cell"),v = Symbol("cell"),C = Symbol("related_touch"),b = Symbol("original_row_index"),w = Symbol("destroyed");class W extends Array {constructor(e) {var _e$sortColumn, _e$onComparatorRequir, _e$customSortingProvi;super(), _defineProperty(this, "sortColumn", void 0), _defineProperty(this, "onComparatorRequired", null), _defineProperty(this, "customSortingProvider", null), e = e || {}, this.sortColumn = (_e$sortColumn = e.sortColumn) !== null && _e$sortColumn !== void 0 ? _e$sortColumn : [], this.onComparatorRequired = (_e$onComparatorRequir = e.onComparatorRequired) !== null && _e$onComparatorRequir !== void 0 ? _e$onComparatorRequir : null, this.customSortingProvider = (_e$customSortingProvi = e.customSortingProvider) !== null && _e$customSortingProvi !== void 0 ? _e$customSortingProvi : null;}add(e, t) {if (Array.isArray(e)) {const l = e;if ("number" == typeof t) {const e = l.length,i = this.length;t = t < 0 ? Math.max(i + t, 0) : Math.min(t, i), this.length = i + e;for (let l = i - 1; l >= t; l--) this[l + e] = this[l];for (let i = 0; i < e; i++) this[t + i] = l[i];} else for (let e = 0, t = l.length; e < t; e++) this.push(l[e]);} else {const l = e;"number" == typeof t ? this.splice(t, 0, l) : this.push(l);}}reset(e) {this.length = 0, e && this.add(e);}filteredCollection(e, t) {if (e && t) {const l = new W({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let i = 0, o = this.length; i < o; i++) {const o = this[i];e(o, t) && (o[b] = i, l.push(o));}return l;}return null;}sort(e) {let t;if ("function" == typeof e) return super.sort(e);if (this.sortColumn.length) {const e = [];for (let t = 0; t < this.sortColumn.length; t++) {const l = y(this.sortColumn[t], this.sortColumn[t].descending);let i = null;this.onComparatorRequired && (i = this.onComparatorRequired(this.sortColumn[t].column, this.sortColumn[t].descending, l)), i || (i = l), e.push(i.bind(this));}if (1 === e.length) t = e[0];else {const l = e.length;t = (t, i) => {let o = 0;for (let r = 0; r < l; r++) if (o = e[r](t, i), 0 !== o) return o;return o;};}const l = (e) => (e.sort(t), e);if (this.customSortingProvider) {const e = this.customSortingProvider(this, l);if (e !== this) {this.length = e.length;for (let t = 0, l = e.length; t < l; t++) this[t] = e[t];}} else l(this);}return this;}}function y(e, t) {let l = e.comparePath;"string" == typeof l && (l = l.split("."));const i = l.length,o = i > 1,r = t ? 1 : -1,n = t ? -1 : 1;return function (e, t) {let s = e[l[0]],a = t[l[0]];if (o) for (let e = 1; e < i; e++) s = s && s[l[e]], a = a && a[l[e]];return s === a || null == s && null == a ? 0 : null == s ? r : null == a ? n : s < a ? r : n;};}class S extends Array {constructor() {super();}get(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].name === e) return this[t];return null;}indexOf(e) {const t = "string" == typeof e ? e : e.name;for (let e = 0, l = this.length; e < l; e++) if (this[e].name === t) return e;return -1;}getByOrder(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].order === e) return this[t];return null;}normalizeOrder() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0);for (let t = 0; t < e.length; t++) e[t].order = t;return this;}getColumns() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getVisibleColumns() {const e = [];for (let t = 0; t < this.length; t++) {const l = this[t];l.visible && e.push(l);}return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getMaxOrder() {let e = 0;for (let t = 0; t < this.length; t++) {const l = this[t];l.order > e && (e = l.order);}return e;}moveColumn(e, t) {if (e && t) {const l = e.order,i = t.order;if (l < i) for (let e = l + 1; e <= i; e++) {const t = this.getByOrder(e);t && t.order--;} else for (let e = l - 1; e >= i; e--) {const t = this.getByOrder(e);t && t.order++;}e.order = i;}return this;}}function R(e, t) {const l = t.column,i = null == t.keyword ? "" : t.keyword.toString();if (!i || !l) return true;let o = e[l];if (null == o) return false;let r = o.toString(),n = i;return t.caseSensitive || (r = r.toLowerCase(), n = n.toLowerCase()), -1 !== r.indexOf(n);}const _ = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };class x {static saveSelection(e) {const t = window.getSelection();if (!t || 0 === t.rangeCount) return null;const l = t.getRangeAt(0);if (e !== l.commonAncestorContainer && !function (e, t) {let l = e;for (; (l = (_l$parentNode = (_l = l) === null || _l === void 0 ? void 0 : _l.parentNode) !== null && _l$parentNode !== void 0 ? _l$parentNode : null) && l !== t;) {var _l$parentNode, _l;}return !!l;}(l.commonAncestorContainer, e)) return null;const i = l.cloneRange();i.selectNodeContents(e), i.setEnd(l.startContainer, l.startOffset);const o = i.toString().length;return { start: o, end: o + l.toString().length };}static restoreSelection(e, t) {let l = 0;const i = [e];let o,r = false,n = false;const s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (o = i.pop());) if (o.nodeType === Node.TEXT_NODE) {const e = l + o.length;!r && t.start >= l && t.start <= e && (s.setStart(o, t.start - l), r = true), r && t.end >= l && t.end <= e && (s.setEnd(o, t.end - l), n = true), l = e;} else {let e = o.childNodes.length;for (; e--;) i.push(o.childNodes[e]);}const a = window.getSelection();a && (a.removeAllRanges(), a.addRange(s));}}const N = Array.prototype.indexOf,k = document.createElement.bind(document);function z(e) {const t = e._p;if (t.cellPreviewCell) {var _l$rowIndex;const l = t.cellPreviewCell,i = l[v];let o;try {o = x.saveSelection(l);} catch {}t.cellPreviewCell.remove(), i && t._unbindCellHoverOut(i), t._unbindCellHoverOut(l);try {o && i && x.restoreSelection(i, o);} catch {}e.emit("cellpreviewdestroy", { el: l.firstChild, name: l.columnName, rowIndex: (_l$rowIndex = l.rowIndex) !== null && _l$rowIndex !== void 0 ? _l$rowIndex : null, rowData: null == l.rowIndex ? null : t.rows[l.rowIndex], cell: i, cellEl: i === null || i === void 0 ? void 0 : i.firstChild }), i && delete i[g], delete l[v], t.cellPreviewCell = null, t.abortCellPreview = false;} else t.abortCellPreview = true;return e;}const M = document.createElement.bind(document);function T(e) {var _ref, _e$C, _t$changedTouches;const t = e;return (_ref = (_e$C = e[C]) !== null && _e$C !== void 0 ? _e$C : (_t$changedTouches = t.changedTouches) === null || _t$changedTouches === void 0 ? void 0 : _t$changedTouches[0]) !== null && _ref !== void 0 ? _ref : e;}function L(e) {var _t$lastResizeAreaClic;const t = e._p;if (null == t.columnResizeStartTimeout) return;clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null;const n = (_t$lastResizeAreaClic = t.lastResizeAreaClick) === null || _t$lastResizeAreaClic === void 0 ? void 0 : _t$lastResizeAreaClic.columnName;t.lastResizeAreaClick = null, n && function (e, t) {const n = e._o,s = e._p,a = s.columns.get(t);if (!n.resizableColumns || !a || !a.resizable) return void A(e);const d = ve(e);s.resizer = M("div"), s.resizer.className = n.resizerClassName, setCssProps(s.resizer, { position: "absolute", display: "block", zIndex: "-1", visibility: "hidden", width: "2px", background: "#000", opacity: "0.7" }), e.el.appendChild(s.resizer);const u = a.element,h = s.resizer.parentNode,c = getComputedStyle(h),m = getComputedStyle(u),f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;const g = getElementWidth(s.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(g / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(g / 2)), setCssProps(s.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(e.el, false, false, false) + "px" }), s.resizer.columnName = u.columnName;try {s.resizer.style.zIndex = "";} catch {}}(e, n);}function F(e, t) {const l = e._o,i = ve(e);let n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return null;n[v] && (n = n[v]);let s = n.previousSibling;for (; s && 1 !== s.nodeType;) s = s.previousSibling;const a = !s,d = T(t),u = (d.pageX || d.clientX || 0) - getElementOffset(n).left;if (i) {var _s$columnName, _s, _n$columnName;if (!a && getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_s$columnName = (_s = s) === null || _s === void 0 ? void 0 : _s.columnName) !== null && _s$columnName !== void 0 ? _s$columnName : null;if (u <= l.resizeAreaWidth / 2) return (_n$columnName = n.columnName) !== null && _n$columnName !== void 0 ? _n$columnName : null;} else {var _s$columnName2, _s2, _n$columnName2;if (!a && u <= l.resizeAreaWidth / 2) return (_s$columnName2 = (_s2 = s) === null || _s2 === void 0 ? void 0 : _s2.columnName) !== null && _s$columnName2 !== void 0 ? _s$columnName2 : null;if (getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_n$columnName2 = n.columnName) !== null && _n$columnName2 !== void 0 ? _n$columnName2 : null;}return null;}function A(e) {const t = e._p;return null != t.columnResizeStartTimeout && (clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null), t.resizer && (t.resizer.remove(), t.resizer = null), t.eventsSink.remove(document, ".colresize"), e;}function P(e, t) {const l = t;if ("mousedown" === t.type && 0 !== l.button) return;const i = e._o,o = e._p,r = F(e, t);if (r) {const l = o.columns.get(r);return !!(i.resizableColumns && l && l.resizable) && (function (e, t, l) {const i = e._p,o = e._o,r = T(t),n = Date.now(),s = function (e) {return e.type.startsWith("touch") ? "touch" : "mouse";}(t),a = i.lastResizeAreaClick;if (i.lastResizeAreaClick = { columnName: l, time: n, pageX: r.pageX || r.clientX || 0, pageY: r.pageY || 0, pointerType: s }, !a || a.columnName !== l || a.pointerType !== s) return false;const d = n - a.time;return !(d < 0 || d > o.resizeAreaDoubleClickDuration) && Math.sqrt(Math.pow(i.lastResizeAreaClick.pageX - a.pageX, 2) + Math.pow(i.lastResizeAreaClick.pageY - a.pageY, 2)) <= Math.max(o.resizeAreaWidth, 12);}(e, t, l.name) ? (A(e), function (e, t, l, _o$lastResizeAreaDoub) {const i = e._o,o = e._p,r = o.columns.get(l);if (!i.resizableColumns || !r || !r.resizable) return false;const n = Date.now();return ((_o$lastResizeAreaDoub = o.lastResizeAreaDoubleClick) === null || _o$lastResizeAreaDoub === void 0 ? void 0 : _o$lastResizeAreaDoub.columnName) === r.name && n - o.lastResizeAreaDoubleClick.time < 100 ? (t.preventDefault(), true) : (o.lastResizeAreaClick = null, o.lastResizeAreaDoubleClick = { columnName: r.name, time: n }, e.emit("columnresizeareadoubleclick", { name: r.name, columnName: r.name, event: t }), i.autoFitColumnOnResizeDoubleClick && e.autoFitColumn(r.name), t.preventDefault(), true);}(e, t, l.name)) : (A(e), o.columnResizeStartTimeout = setTimeout(() => L(e), i.resizeAreaDoubleClickDuration), o.eventsSink.add(document, "mousemove.colresize", (t) => H(e, t)).add(document, "touchmove.colresize", (t) => H(e, t)).add(document, "mouseup.colresize", (t) => E(e, t)).add(document, "touchend.colresize", (t) => E(e, t)), t.preventDefault(), true));}}function H(e, t) {const l = e._p;if (null != l.columnResizeStartTimeout && !function (e, t) {const l = e._p.lastResizeAreaClick;if (!l) return false;const i = T(t),o = i.pageX || i.clientX || 0,r = i.pageY || 0;return Math.sqrt(Math.pow(o - l.pageX, 2) + Math.pow(r - l.pageY, 2)) > 4;}(e, t)) return;if (L(e), !l.resizer) return;const i = l.columns.get(l.resizer.columnName);if (!i) return;const n = ve(e),s = i.element,a = l.resizer.parentNode,d = getComputedStyle(a),u = getComputedStyle(s),h = getElementOffset(s),c = getElementOffset(a);c.left += parseFloat(d.borderLeftWidth) || 0, h.left -= c.left;const m = getElementWidth(l.resizer, true, true, true),f = "border-box" === u.boxSizing;let p = T(t).pageX - c.left,g = h.left;g -= Math.ceil(m / 2), n ? (g += getElementWidth(s, true, true, true), g -= i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g -= Math.ceil((parseFloat(u.borderLeftWidth) || 0) / 2), g -= ce(s)), p > g && (p = g)) : (g += i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g += Math.ceil((parseFloat(u.borderRightWidth) || 0) / 2), g += ce(s)), p < g && (p = g)), l.resizer.style.left = p + "px";}function E(e, t) {var _ref2, _t$C, _v$changedTouches;const l = e._o,i = e._p;if (null != i.columnResizeStartTimeout) return void A(e);if (!i.resizer) return;i.eventsSink.remove(document, ".colresize");const n = i.columns.get(i.resizer.columnName);if (!n) return i.resizer.remove(), void (i.resizer = null);const s = ve(e),a = n.element,d = a.firstChild,u = i.resizer.parentNode,h = getComputedStyle(u),c = getComputedStyle(a),m = getElementOffset(a),f = getElementOffset(u);f.left += parseFloat(h.borderLeftWidth) || 0, m.left -= f.left;const p = getElementWidth(i.resizer, true, true, true),g = "border-box" === c.boxSizing,v = t;let b = ((_ref2 = (_t$C = t[C]) !== null && _t$C !== void 0 ? _t$C : (_v$changedTouches = v.changedTouches) === null || _v$changedTouches === void 0 ? void 0 : _v$changedTouches[0]) !== null && _ref2 !== void 0 ? _ref2 : t).pageX - f.left,w = m.left,W = 0;if (s) {if (!g) {b += ce(a);const e = getComputedStyle(d || a);b += parseFloat(e.borderLeftWidth) || 0, b += parseFloat(e.borderRightWidth) || 0;}b += n.arrowProposedWidth || 0, w += Math.ceil(p / 2), w += getElementWidth(a, true, true, true);const t = w - (n.ignoreMin ? 0 : e._o.minColumnWidth);b > t && (b = t), W = w - b;} else {if (!g) {b -= ce(a);const e = getComputedStyle(d || a);b -= parseFloat(e.borderLeftWidth) || 0, b -= parseFloat(e.borderRightWidth) || 0;}b -= n.arrowProposedWidth || 0, w -= Math.ceil(p / 2);const t = w + (n.ignoreMin ? 0 : e._o.minColumnWidth);b < t && (b = t), W = b - w;}i.resizer.remove(), i.resizer = null;let y = W;if (2 === n.widthMode) {let t = pe(e),o = 0,r = 0;for (let e = 0; e < i.visibleColumns.length; e++) {var _l$actualWidth;const l = i.visibleColumns[e];l.name !== n.name && (2 === l.widthMode ? (o += l.width, r++) : t -= (_l$actualWidth = l.actualWidth) !== null && _l$actualWidth !== void 0 ? _l$actualWidth : 0);}if (t <= 0 && i.table && (t = i.table.clientWidth), t > Math.max(l.minColumnWidth, 1)) {if (y = W / t, r > 0) {const e = y / ((1 - y) / o);o += y, (o < 1 && l.relativeWidthGrowsToFillWidth || o > 1 && l.relativeWidthShrinksToFillWidth) && (y = e);}y *= 100, y += "%";}}e.setColumnWidth(n.name, y);}function O(e, t) {var _i$columns$get;const l = e._o,i = e._p;if (!l.resizableColumns) return;const o = F(e, t),r = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);r && (o && (_i$columns$get = i.columns.get(o)) !== null && _i$columns$get !== void 0 && _i$columns$get.resizable ? r.style.cursor = "e-resize" : r.style.cursor = "");}function I(e, t) {var _ref3, _t$C2, _n$changedTouches;const i = e._o,n = t,s = t,a = (_ref3 = (_t$C2 = t[C]) !== null && _t$C2 !== void 0 ? _t$C2 : (_n$changedTouches = n.changedTouches) === null || _n$changedTouches === void 0 ? void 0 : _n$changedTouches[0]) !== null && _ref3 !== void 0 ? _ref3 : { pageX: s.pageX, pageY: s.pageY },d = t.target.closest(`div.${i.tableClassName}-header-cell,div.${i.cellPreviewClassName}`);if (!d) return;const u = getElementOffset(d);u.width = getElementWidth(d, true, true, true), u.height = getElementHeight(d, true, true, true), e.emit("headercontextmenu", { columnName: d.columnName, pageX: a.pageX, pageY: a.pageY, bounds: u });}function D(e, t) {if (he(t)) return;if (F(e, t)) return;const l = e._o,i = e._p,o = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!o) return;if (!l.sortableColumns) return;const r = i.columns.get(o.columnName),n = i.rows.sortColumn;if (r && r.sortable) {let t = true;const i = n.length ? n[n.length - 1] : null;i && i.column === r.name && (i.descending && l.allowCancelSort ? (t = false, n.splice(n.length - 1, 1)) : i.descending = !i.descending);const o = e;t ? o.sort(r.name, void 0, true).render() : o.setSortedColumns(n.map((e) => ({ column: e.column, descending: e.descending })));}}function B(e, t) {const l = e._p,i = l.visibleColumns.findIndex((e) => e.movable),o = l.visibleColumns.findLastIndex((e) => e.movable),r = l.visibleColumns.findIndex((e) => e === t);return t.movable || -1 !== i && r >= i && r <= o;}const $ = Array.prototype.indexOf,q = document.createElement.bind(document);function X(e, t) {const l = t[p];l && (t.removeEventListener("click", l), t[p] = null, function (e, t) {const l = e._p;for (let e = 0, i = t.childNodes, o = i.length; e < o; e++) l._unbindCellHoverIn(i[e]);}(e, t), e.emit("rowdestroy", t));}function V(e) {const t = e._p.tbody;if (t) for (let l = t.firstElementChild; l; l = l.nextElementSibling) X(e, l);}function j(e) {const t = e._p,i = e._o;if (!t.table || !t.header) return e;if (!i.height) return t.table.style.height = "auto", e;const o = getComputedStyle(t.table);let r = i.height - getElementHeight(t.header, true, true, true);return "border-box" !== o.boxSizing && (r -= parseFloat(o.borderTopWidth) || 0, r -= parseFloat(o.borderBottomWidth) || 0, r -= parseFloat(o.paddingTop) || 0, r -= parseFloat(o.paddingBottom) || 0), t.table.style.height = Math.max(r, 0) + "px", e;}function Y(e) {const t = e._p;return t.headerRow && (t.headerRow = void 0), e;}function U(e) {const t = e._o,l = e._p;if (!l.tbody) return e;if (t.virtualTable && l.virtualListHelper) {const e = l.virtualListHelper.estimateFullHeight();l._lastVirtualScrollHeight = e, l.tbody.style.height = e + "px";} else l.tbody.style.height = "";return e;}function G(e, t) {const l = e._p;if (!l.table) return e;const i = l.table.offsetWidth - l.table.clientWidth;if (i !== l.scrollbarWidth || t) {var _l$notifyRendererOfCo;l.scrollbarWidth = i;for (let e = 0; e < l.columns.length; e++) l.columns[e].actualWidthConsideringScrollbarWidth = null;if (l.visibleColumns.length > 0 && l.tbody && l.headerRow) {var _t$actualWidth, _ref4, _t$actualWidthConside;const e = l.visibleColumns.length - 1,t = l.visibleColumns[e];t.actualWidthConsideringScrollbarWidth = l.scrollbarWidth > 0 ? ((_t$actualWidth = t.actualWidth) !== null && _t$actualWidth !== void 0 ? _t$actualWidth : 0) - l.scrollbarWidth : null;const i = ((_ref4 = (_t$actualWidthConside = t.actualWidthConsideringScrollbarWidth) !== null && _t$actualWidthConside !== void 0 ? _t$actualWidthConside : t.actualWidth) !== null && _ref4 !== void 0 ? _ref4 : 0) + "px",o = l.tbody.childNodes;for (let t = 0, l = o.length; t < l; t++) {const l = o[t];1 === l.nodeType && (l.childNodes[e].style.width = i);}l.headerRow.childNodes[e].style.width = i;}K(e), (_l$notifyRendererOfCo = l.notifyRendererOfColumnsConfig) === null || _l$notifyRendererOfCo === void 0 ? void 0 : _l$notifyRendererOfCo.call(l);}return e;}function J(e, t) {const l = e._o,i = e._p;if (!i.tbody || !i.table || !i.headerRow) return e;const o = ge(e);if (i.tbody.style.minWidth = o + "px", i.headerRow.style.minWidth = o + (i.scrollbarWidth || 0) + "px", i.eventsSink.remove(i.table, "scroll"), l.width === _.AUTO) setElementWidth(i.table, getElementWidth(i.tbody, true, true, true)), setElementWidth(e.el, getElementWidth(i.table, true, true, true));else if (l.width === _.SCROLL) {if (t) {const t = i.table ? i.table.scrollTop : 0,l = i.table ? i.table.scrollLeft : 0;!function (e) {const t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(e.el), i.table.scrollTop = t, i.table.scrollLeft = l, i.header && (i.header.scrollLeft = l);}const l = () => function (e) {const t = e._p;t.header.scrollLeft = t.table.scrollLeft, Q(e);}(e);i.eventsSink.add(i.table, "scroll", l);}return e;}function K(e) {var _t$scrollbarWidth;const t = e._p,l = e._o;if (!t.headerRow) return;const i = l.tableClassName + "-sticky",o = t.headerRow,r = ve(e);t.lastIsRtl = r;const n = (_t$scrollbarWidth = t.scrollbarWidth) !== null && _t$scrollbarWidth !== void 0 ? _t$scrollbarWidth : 0,s = t.lastDetectedWidth,a = l.maxStickyColumnRelativeWidth,d = "number" == typeof a && s ? s * a : null;let u = 0,h = 0,c = null;const m = [],f = [];let p = null,g = [],v = null,C = 0,b = [];for (let e = o.firstElementChild; e; e = e.nextElementSibling) {var _o$actualWidth, _p;const l = e.getAttribute("data-column");if (!l) continue;const o = t.columns.get(l);if (!o) continue;o.headerScrollbarCompensation = 0;let s = "start" === o.sticky || "end" === o.sticky;if (s && null !== d && C + ((_o$actualWidth = o.actualWidth) !== null && _o$actualWidth !== void 0 ? _o$actualWidth : 0) > d && (s = false), s) {var _o$actualWidth2, _o$actualWidth3, _o$stickyPos, _o$stickyPos2, _o$stickyPos3;let l = (_o$actualWidth2 = o.actualWidth) !== null && _o$actualWidth2 !== void 0 ? _o$actualWidth2 : 0;C += 0, e.className += " " + i, e.style.position = "sticky";let s,a = null;null === c && (a = getComputedStyle(e), c = a.boxSizing), "content-box" === c && (null === a && (a = getComputedStyle(e)), l += (parseFloat(a.paddingLeft) || 0) + (parseFloat(a.paddingRight) || 0) + (parseFloat(a.borderLeftWidth) || 0) + (parseFloat(a.borderRightWidth) || 0)), "start" === o.sticky ? (s = { direction: "start", absDirection: r ? "right" : "left", offset: u }, e.style[s.absDirection] = u + "px", u += l, g.length = 0, p = [e], m.push(p)) : (v = e, s = { direction: "end", absDirection: r ? "left" : "right", offset: h }, e.style[s.absDirection] = h + n + "px", e.style.width = ((_o$actualWidth3 = o.actualWidth) !== null && _o$actualWidth3 !== void 0 ? _o$actualWidth3 : 0) + "px", h += l, f.push([e, ...g]), g.length = 0), s.direction === ((_o$stickyPos = o.stickyPos) === null || _o$stickyPos === void 0 ? void 0 : _o$stickyPos.direction) && s.offset === ((_o$stickyPos2 = o.stickyPos) === null || _o$stickyPos2 === void 0 ? void 0 : _o$stickyPos2.offset) && s.absDirection === ((_o$stickyPos3 = o.stickyPos) === null || _o$stickyPos3 === void 0 ? void 0 : _o$stickyPos3.absDirection) || b.push(t.visibleColumns.indexOf(o)), o.stickyPos = s;} else o.stickyPos && b.push(t.visibleColumns.indexOf(o)), delete o.stickyPos, (_p = p) !== null && _p !== void 0 && _p.push(e), g !== null && g !== void 0 && g.push(e), "sticky" === e.style.position && (e.classList.remove(i), e.style.position = "", e.style.left = "", e.style.right = "");}v && (v.style[r ? "left" : "right"] = "0px"), t.stickiesStart = m, t.stickiesEnd = f, b.length > 0 && e.refreshAllVirtualRows(), t.lastStickyScrollLeft = void 0, Q(e);}function Q(e) {const t = e._p;if (!t.table || !t.headerRow || !t.tbody) return;const l = t.stickiesStart,i = t.stickiesEnd,o = t.stickiesSetStart,r = t.stickiesSetEnd,n = t.stickiesSetStart = new Set(),s = t.stickiesSetEnd = new Set();if (l !== null && l !== void 0 && l.length || i !== null && i !== void 0 && i.length) {const e = t.table.scrollLeft;if (e === t.lastStickyScrollLeft) return;t.lastStickyScrollLeft = e;const o = t.headerRow.children,r = 1.5,a = t.lastIsRtl;let d = null;const u = (e, l, i) => {if (e && e.length) {for (const t of e) {l || (d = t);const e = t[0],n = t.slice(1),s = n[0],u = n[n.length - 1];if (!e || !e.getBoundingClientRect) continue;const h = e.getBoundingClientRect(),c = l !== a;let m = false;if (s && u) {const e = s.getBoundingClientRect(),t = u.getBoundingClientRect();m = l ? a ? h.right - r > t.left && h.left + r < e.right : h.right - r > e.left && h.left + r < t.right : a ? h.left + r < e.right && h.right - r > t.left : h.left + r < t.right && h.right - r > e.left;}e.classList.toggle(c ? "is-sticky-left" : "is-sticky-right", m), m && i.add($.call(o, e));}if (d) {var _ref5, _l$actualWidthConside, _ref6, _l$actualWidthConside2;const e = d[0],l = t.columns.get(e.getAttribute("data-column")),i = a ? "marginRight" : "marginLeft";e.style[i] = "", e.style.width = ((_ref5 = (_l$actualWidthConside = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside !== void 0 ? _l$actualWidthConside : l.actualWidth) !== null && _ref5 !== void 0 ? _ref5 : 0) + "px";let o = 0;if (t.scrollbarWidth > 0) {const l = e.getBoundingClientRect(),r = e.offsetParent.getBoundingClientRect(),n = a ? l.left - r.left : r.right - l.right;n <= t.scrollbarWidth && (o = Math.min(t.scrollbarWidth, Math.max(0, t.scrollbarWidth - n + 1)), o < t.scrollbarWidth && (e.style[i] = -o + "px"));}l.headerScrollbarCompensation = o, e.style.width = ((_ref6 = (_l$actualWidthConside2 = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside2 !== void 0 ? _l$actualWidthConside2 : l.actualWidth) !== null && _ref6 !== void 0 ? _ref6 : 0) + o + "px";}}};u(l, true, n), u(i, false, s);}const a = [],d = [];for (const e of n) (o === null || o === void 0 ? void 0 : o.has(e)) || a.push({ index: e, start: true });for (const e of s) (r === null || r === void 0 ? void 0 : r.has(e)) || a.push({ index: e, start: false });if (o) for (const e of o) n.has(e) || d.push({ index: e, start: true });if (r) for (const e of r) s.has(e) || d.push({ index: e, start: false });if (!a.length && !d.length) return;let u = t.tbody.firstElementChild;for (; u;) {const e = u.children;for (const l of d) {var _e$l$index;(_e$l$index = e[l.index]) === null || _e$l$index === void 0 || _e$l$index.classList.remove(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}for (const l of a) {var _e$l$index2;(_e$l$index2 = e[l.index]) === null || _e$l$index2 === void 0 || _e$l$index2.classList.add(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}u = u.nextElementSibling;}t.isStickyColumns = new Map();for (const e of n) t.isStickyColumns.set(e, "start");for (const e of s) t.isStickyColumns.set(e, "end");}function Z(e, t) {const l = e._p,i = e._o;if (!l.headerRow || !l.tbody) return e;const o = l.headerRow.querySelectorAll(`div.${i.tableClassName}-header-cell`)[t];if (!o) return e;const r = l.columns.get(o.columnName);if (r) {var _r$headerScrollbarCom, _ref7, _r$actualWidthConside;const e = (_r$headerScrollbarCom = r.headerScrollbarCompensation) !== null && _r$headerScrollbarCom !== void 0 ? _r$headerScrollbarCom : 0;o.style.width = ((_ref7 = (_r$actualWidthConside = r.actualWidthConsideringScrollbarWidth) !== null && _r$actualWidthConside !== void 0 ? _r$actualWidthConside : r.actualWidth) !== null && _ref7 !== void 0 ? _ref7 : 0) + e + "px";const i = (r.actualWidthConsideringScrollbarWidth || r.actualWidth || 0) + "px",n = l.tbody.childNodes;for (let e = 0, l = n.length; e < l; e++) {const l = n[e];1 === l.nodeType && (l.childNodes[t].style.width = i);}}return e;}function ee(e) {const t = e._p,l = e._o;if (t.table && t.headerRow) {const e = l.tableClassName,i = scopedSelectorAll(t.headerRow, `>div.${e}-header-cell.sorted`),o = Array.prototype.slice.call(i, 0).map((e) => e.querySelector(":scope>div>.sort-arrow")).filter((e) => !!e);for (const e of o) {var _e$parentNode;const l = (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.parentNode;if (l) {const e = t.columns.get(l.columnName);e && (e.arrowProposedWidth = 0);}e.remove();}for (const e of i) e.classList.remove("sorted", "desc");}return e;}function te(e, t, l) {var _r$element$firstChild;const i = e._p,o = e._o,r = i.columns.get(t);if (!r) return false;const n = q("span");return n.className = "sort-arrow", r.element && (r.element.className += l ? " sorted desc" : " sorted", (_r$element$firstChild = r.element.firstChild) !== null && _r$element$firstChild !== void 0 && _r$element$firstChild.insertBefore(n, r.element.firstChild.firstChild)), 2 !== r.widthMode && o.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = n.scrollWidth + (parseFloat(getComputedStyle(n).marginRight) || 0) + (parseFloat(getComputedStyle(n).marginLeft) || 0)), true;}function le(e, t) {t.firstChild, t.addEventListener("mousedown", (t) => P(e, t)), t.addEventListener("mousemove", (t) => O(e, t)), t.addEventListener("mouseup", (t) => function (e, t) {2 === t.button && I(e, t);}(e, t)), t.addEventListener("mouseleave", (t) => function (e, t) {const l = e._o,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);i && (i.style.cursor = "");}(e, t)), t.addEventListener("touchstart", (t) => function (e, t) {const l = e._p;if (l.currentTouchId) return;const i = t.changedTouches[0];l.currentTouchId = i.identifier;const o = t.currentTarget,r = { x: i.pageX, y: i.pageY };let n = r;const s = function () {l.currentTouchId = null, l.eventsSink.remove(o, ".colheader"), clearTimeout(l.tapAndHoldTimeout), l.tapAndHoldTimeout = null;};t[C] = t.changedTouches[0], true !== P(e, t) ? (l.tapAndHoldTimeout = setTimeout(() => {s(), l.eventsSink.add(o, "touchend.colheader", (e) => {he(e) || e.preventDefault(), l.eventsSink.remove(o, ".colheader");}, { once: true }).add(o, "touchcancel.colheader", (e) => {l.eventsSink.remove(o, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 && (A(e), I(e, t));}, 500), l.eventsSink.add(o, "touchend.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (s(), he(t) || t.preventDefault(), n = { x: o.pageX, y: o.pageY }, (Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 || l.resizer) && (i[C] = o, D(e, i)));}).add(o, "touchcancel.colheader", s).add(o, "touchmove.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (n = { x: o.pageX, y: o.pageY }, l.resizer && (t.preventDefault(), i[C] = o, O(e, i)));})) : l.currentTouchId = null;}(e, t)), t.addEventListener("dragstart", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer;const e = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!e) return void t.preventDefault();const o = i.columns.get(e.columnName);o && o.movable ? (e.style.opacity = "0.35", i.dragId = 161061273 * Math.random(), (_t$dataTransfer = t.dataTransfer) === null || _t$dataTransfer === void 0 ? void 0 : _t$dataTransfer.setData("text", JSON.stringify({ dragId: i.dragId, column: o.name }))) : t.preventDefault();} else t.preventDefault();}(e, t)), t.addEventListener("click", (t) => D(e, t)), t.addEventListener("contextmenu", (e) => e.preventDefault()), t.addEventListener("dragenter", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer2;let o = null;const r = (_t$dataTransfer2 = t.dataTransfer) === null || _t$dataTransfer2 === void 0 ? void 0 : _t$dataTransfer2.getData("text");if (r) try {o = JSON.parse(r);} catch {o = null;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!n) return;if (!o || i.dragId === o.dragId && n.columnName !== o.column) {const t = i.columns.get(n.columnName);t && B(e, t) && n.classList.add("drag-over");}}}(e, t)), t.addEventListener("dragover", (e) => {e.preventDefault();}), t.addEventListener("dragleave", (t) => function (e, t) {const l = e._o,i = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (!i) return;const o = t.relatedTarget;o === i || i.contains(o) || i.classList.remove("drag-over");}(e, t)), t.addEventListener("drop", (t) => function (e, t, _t$dataTransfer3) {t.preventDefault();const l = e._o,i = e._p,o = (_t$dataTransfer3 = t.dataTransfer) === null || _t$dataTransfer3 === void 0 ? void 0 : _t$dataTransfer3.getData("text");if (!o) return;let r;try {r = JSON.parse(o);} catch {return;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${l.cellPreviewClassName}`);if (n) {if (l.movableColumns && r.dragId === i.dragId) {const t = r.column,l = n.columnName,o = i.columns.get(t),s = i.columns.get(l);o && s && o.movable && B(e, s) && e.moveColumn(t, l);}n.classList.remove("drag-over");}}(e, t));}function ie(e, t) {let l = 0;if ("string" == typeof e) {const t = e.trim().toLowerCase();if ("rest" === t) return { width: 0, mode: 3 };if ("auto" === t) return { width: 0, mode: 0 };}let i = parseFloat(e);return Number.isFinite(i) || (i = 0), i = Math.max(0, i), i > 0 && ("string" == typeof e && e.trim().endsWith("%") ? (l = 2, i /= 100) : i > 0 && i < 1 ? l = 2 : (i < t && (i = t), l = 1)), { width: i, mode: l };}function oe(e, t) {var _t$allowPreview;let l = ie(t.width, t.ignoreMin ? 0 : e.minColumnWidth),i = { name: t.name, label: void 0 === t.label ? t.name : t.label, width: l.width, widthMode: l.mode, resizable: void 0 === t.resizable || t.resizable, sortable: void 0 === t.sortable || t.sortable, movable: void 0 === t.movable || t.movable, visible: void 0 === t.visible || t.visible, cellClasses: void 0 === t.cellClasses ? e.cellClasses : t.cellClasses, ignoreMin: void 0 !== t.ignoreMin && !!t.ignoreMin, sticky: void 0 === t.sticky ? null : t.sticky || null, allowPreview: !!((_t$allowPreview = t.allowPreview) !== null && _t$allowPreview !== void 0 ? _t$allowPreview : true), dataPath: [], comparePath: [], order: 0 };const o = void 0 === t.dataPath ? i.name : t.dataPath,r = void 0 === t.comparePath ? o : t.comparePath;return i.dataPath = "string" == typeof o ? o.split(".") : o, i.comparePath = "string" == typeof r ? r.split(".") : r, i;}function re(e) {const t = e._p;0 === t.visibleColumns.length && t.columns.length && (t.columns[0].visible = true, t.visibleColumns.push(t.columns[0]), e.emit("showcolumn", t.columns[0].name));}function ne(e) {const t = e._p;if (t.filteredRows && t.filterArgs) {let l = e._o.filter || R;t.filteredRows = t.rows.filteredCollection(l, t.filterArgs);}}function se(e) {const t = e._p;if (!t.filteredRows) return;const l = new Set(t.filteredRows),i = new W({ sortColumn: t.rows.sortColumn, onComparatorRequired: t.rows.onComparatorRequired, customSortingProvider: t.rows.customSortingProvider });for (let e = 0, o = t.rows.length; e < o; e++) {const o = t.rows[e];l.has(o) && (o[b] = e, i.push(o));}t.filteredRows = i;}function ae(e, t, l) {let i = l.dataPath,o = t[i[0]];for (let e = 1; e < i.length && null != o; e++) o = o && o[i[e]];const r = e.cellFormatter;let n;if (r[c]) n = r(o, l.name, t);else try {n = r(o, l.name, t);} catch (e) {n = "[ERROR]", console.error("Failed to generate content for cell " + l.name, e);}return null == n && (n = ""), n;}const de = document.createElement.bind(document);function ue(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}function he(e) {const t = e.target;return /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(t.tagName);}function ce(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}function me(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}function fe(e, t, l = null) {const o = e._o,n = o.tableClassName,s = de("div");s.className = e.el.className, setCssProps(s, { position: "absolute", top: "-9999px", left: "0", visibility: "hidden", width: "auto", overflow: "visible" });const a = de("div");a.className = `${n}-header`;const d = de("div");d.className = `${n}-header-row`;const u = de("div");u.className = `${n}-header-cell ${t.cellClasses || ""}`, u.style.width = "auto";const h = u.cloneNode(true),c = u.cloneNode(true);u.appendChild(de("div")).innerHTML = o.headerCellFormatter(t.label, t.name), d.appendChild(h), d.appendChild(u), d.appendChild(c), a.appendChild(d), s.appendChild(a), document.body.appendChild(s);let m = getElementWidth(u, true, true, true) + o.columnAutoWidthExtraSize;if (l) {const e = de("div");e.className = `${n}-body`;const i = de("div");i.className = `${n}-row`;const a = de("div");a.className = `${n}-cell ${t.cellClasses || ""}`, a.style.width = "auto";const d = a.appendChild(de("div"));i.appendChild(a), e.appendChild(i), s.appendChild(e);for (let e = 0; e < l.length; e++) d.innerHTML = ae(o, l[e], t), m = Math.max(m, getElementWidth(a, true, true, true));}return s.remove(), m += t.arrowProposedWidth || 0, !t.ignoreMin && m < o.minColumnWidth && (m = o.minColumnWidth), Math.ceil(m);}function pe(e) {const t = e._o,l = e._p;let o,n = 0,s = 0;l.table && (n = l.table ? l.table.scrollTop : 0, s = l.table ? l.table.scrollLeft : 0, t.virtualTable && (o = l.table.style.display, l.table.style.display = "none"));let a = getElementWidth(e.el);l.table && (t.virtualTable && void 0 !== o && (l.table.style.display = o), l.table.scrollTop = n, l.table.scrollLeft = s, l.header && (l.header.scrollLeft = s));const d = t.tableClassName,u = de("div");u.className = e.el.className, setCssProps(u, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px" });const h = de("div");h.className = `${d}-header`, u.appendChild(h);const c = de("div");c.index = null, c.vIndex = null, c.className = `${d}-header-row`, h.appendChild(c);for (let e = 0; e < l.visibleColumns.length; e++) {const t = l.visibleColumns[e],i = de("div");i.className = `${d}-header-cell ${t.cellClasses || ""}`, i.columnName = t.name, i.appendChild(de("div")), c.appendChild(i);}document.body.appendChild(u), a -= function (e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}(c);const m = c.querySelectorAll(`div.${d}-header-cell`);for (const e of m) {const t = getComputedStyle(e);if ("border-box" !== t.boxSizing) {a -= (parseFloat(t.borderRightWidth) || 0) + (parseFloat(t.borderLeftWidth) || 0) + ce(e);const i = e.columnName,o = l.columns.get(i);o && (a -= o.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}function ge(e) {const t = e._p,l = e._o.tableClassName,o = l + "-row",n = l + "-cell",s = t.visibleColumns,a = s.length,d = de("div");d.className = o, d.style.float = "left";let u = 0;for (let e = 0; e < a; e++) {var _t$actualWidth2, _t$actualWidth3;const t = s[e],l = de("div");l.className = n, l.style.width = ((_t$actualWidth2 = t.actualWidth) !== null && _t$actualWidth2 !== void 0 ? _t$actualWidth2 : 0) + "px", t.cellClasses && (l.className += " " + t.cellClasses), l.appendChild(de("div")), d.appendChild(l), u += (_t$actualWidth3 = t.actualWidth) !== null && _t$actualWidth3 !== void 0 ? _t$actualWidth3 : 0;}const h = de("div");h.className = e.el.className, setCssProps(h, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const c = de("div");c.className = l, h.appendChild(c);const m = de("div");m.className = l + "-body", m.style.width = u + 1e4 + "px", c.appendChild(m), m.appendChild(d), document.body.appendChild(h);const f = de("div");setCssProps(f, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(f);const p = parseFloat(getComputedStyle(f).borderWidth),g = Math.round(p) !== p;f.remove();let v = getElementWidth(d, true, true, true);return v -= t.scrollbarWidth || 0, g && v++, h.remove(), v;}function ve(e) {const t = e._p;return !!t.table && "rtl" === getComputedStyle(t.table).direction;}function Ce(e) {var _e$unconvertedWidthMo;const t = null != e.unconvertedWidth ? e.unconvertedWidth : e.width,l = null != e.unconvertedWidth ? (_e$unconvertedWidthMo = e.unconvertedWidthMode) !== null && _e$unconvertedWidthMo !== void 0 ? _e$unconvertedWidthMo : e.widthMode : e.widthMode;return 0 === l ? "auto" : 2 === l ? parseFloat((100 * t).toPrecision(12)) + "%" : 3 === l ? "rest" : t;}const be = Object.prototype.hasOwnProperty,we = Symbol("once_original_handler");document.createElement.bind(document);class We {constructor(e) {var _e$rowsBufferSize, _e$minColumnWidth, _e$resizeAreaWidth, _e$resizeAreaDoubleCl, _e$maxColumnsSortCoun, _e$sortedColumns;_defineProperty(this, "VERSION", void 0);_defineProperty(this, "el", void 0);_defineProperty(this, "_o", void 0);_defineProperty(this, "_p", void 0);_defineProperty(this, w, void 0);e = e || {}, this.VERSION = We.VERSION;const t = this._o = {},n = this._p = { eventsSink: new DomEventsSink(), mitt: { all: s = s || new Map(), on: function (e, t) {var l = s.get(e);l ? l.push(t) : s.set(e, [t]);}, off: function (e, t) {var l = s.get(e);l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : s.set(e, []));}, emit: function (e, t) {var l = s.get(e);l && l.slice().map(function (e) {e(t);}), (l = s.get("*")) && l.slice().map(function (l) {l(e, t);});} }, tableSkeletonNeedsRendering: true };var s;if (this.el = e.el && e.el instanceof HTMLElement ? e.el : document.createElement("div"), this.el !== e.el) {const t = (e.className || "dgtable-wrapper").split(/\s+/).filter(Boolean);this.el.classList.add(...t);}n.eventsSink.add(this.el, "dragend.colresize", (e) => {return t = e, void (this._p.resizer || (t.target.style.opacity = ""));var t;}), n.isWheelScrolling = false, n.eventsSink.add(this.el, "wheel", (e) => {if (n.cellPreviewCell) {let t = false,l = e.target;for (; l && l !== n.cellPreviewCell;) {const e = getComputedStyle(l),i = e.overflowY,o = e.overflowX,r = ("auto" === i || "scroll" === i) && l.scrollHeight > l.clientHeight,n = ("auto" === o || "scroll" === o) && l.scrollWidth > l.clientWidth;if (r || n) {t = true;break;}l = l.parentElement;}if (t) return;}n.isWheelScrolling = true, z(this), n.wheelScrollTimeout && clearTimeout(n.wheelScrollTimeout), n.wheelScrollTimeout = setTimeout(() => {n.isWheelScrolling = false, n.wheelScrollTimeout = void 0;}, 100);}, { passive: true }), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = Math.max((_e$rowsBufferSize = e.rowsBufferSize) !== null && _e$rowsBufferSize !== void 0 ? _e$rowsBufferSize : 3, 0), t.minColumnWidth = Math.max((_e$minColumnWidth = e.minColumnWidth) !== null && _e$minColumnWidth !== void 0 ? _e$minColumnWidth : 35, 0), t.maxStickyColumnRelativeWidth = e.maxStickyColumnRelativeWidth || null, t.columnAutoWidthExtraSize = e.columnAutoWidthExtraSize || 0, t.resizeAreaWidth = Math.max((_e$resizeAreaWidth = e.resizeAreaWidth) !== null && _e$resizeAreaWidth !== void 0 ? _e$resizeAreaWidth : 8, 0), t.resizeAreaDoubleClickDuration = Math.max((_e$resizeAreaDoubleCl = e.resizeAreaDoubleClickDuration) !== null && _e$resizeAreaDoubleCl !== void 0 ? _e$resizeAreaDoubleCl : 300, 0), t.autoFitColumnOnResizeDoubleClick = void 0 !== e.autoFitColumnOnResizeDoubleClick && !!e.autoFitColumnOnResizeDoubleClick, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns;const d = (_e$maxColumnsSortCoun = e.maxColumnsSortCount) !== null && _e$maxColumnsSortCoun !== void 0 ? _e$maxColumnsSortCoun : e.sortableColumns,u = Number(d !== null && d !== void 0 ? d : 1);t.sortableColumns = Number.isFinite(u) ? Math.max(u, 0) : 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.autoFillLastColumn = void 0 === e.autoFillLastColumn || !!e.autoFillLastColumn, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? _.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let h = [];const c = (_e$sortedColumns = e.sortedColumns) !== null && _e$sortedColumns !== void 0 ? _e$sortedColumns : e.sortColumn;if (c) {let e = Array.isArray(c) ? c : [c];for (let t = 0, l = e.length; t < l; t++) {var _l$descending;let l = e[t];"string" == typeof l && (l = { column: l, descending: false });let i = n.columns.get(l.column);i && h.push({ column: l.column, comparePath: i.comparePath || i.dataPath, descending: (_l$descending = l.descending) !== null && _l$descending !== void 0 ? _l$descending : false });}}n.rows = new W({ sortColumn: h }), n.rows.onComparatorRequired = (e, l, i) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, l, i);}, n.rows.customSortingProvider = (e, l) => t.customSortingProvider ? t.customSortingProvider(e, l) : l(e), n.filteredRows = null, n.scrollbarWidth = 0, n._lastVirtualScrollHeight = 0, function (e) {const t = e._p,n = (t) => {let n = t.currentTarget,s = t.relatedTarget;s === n || n.contains(s) || n[g] && (s === n[g] || n[g].contains(s)) || function (e, t, _s$visibleColumns$N$c, _P$right) {const n = e._o,s = e._p;if (s.isWheelScrolling) return;const a = t.firstElementChild;if (!a) return;if (!(a.scrollWidth - a.clientWidth > 1 || a.scrollHeight - a.clientHeight > 1)) return;z(e), s.abortCellPreview = false;const d = t.parentElement;if (!d) return;const u = (_s$visibleColumns$N$c = s.visibleColumns[N.call(d.childNodes, t)]) === null || _s$visibleColumns$N$c === void 0 ? void 0 : _s$visibleColumns$N$c.name,h = u ? s.columns.get(u) : null;if (!h) return;const c = d.index;if (e.emit("cellhoveroverflow", { name: u, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), false === h.allowPreview) return;const m = t.classList.contains(`${n.tableClassName}-header-cell`);if (m ? !n.allowHeaderCellPreview : !n.allowCellPreview) return;const f = k("div");f.innerHTML = t.innerHTML, f.className = n.cellPreviewClassName + " " + (h.cellClasses || ""), m && (f.classList.add("header"), t.classList.contains("sortable") && f.classList.add("sortable"), f.draggable = true, le(e, f));const p = getComputedStyle(t),C = getComputedStyle(a),b = "right" === p.float,w = b ? "right" : "left",W = parseFloat(p.paddingLeft) || 0,y = parseFloat(p.paddingRight) || 0,S = parseFloat(p.paddingTop) || 0,R = parseFloat(p.paddingBottom) || 0;let _ = a.scrollWidth + (t.clientWidth - a.offsetWidth);const M = "border-box" === p.boxSizing;if (M ? f.style.boxSizing = "border-box" : (_ -= W + y, f.style.marginTop = (parseFloat(p.borderTopWidth) || 0) + "px"), !s.transparentBgColor1) {const e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", s.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", s.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}const T = { "box-sizing": M ? "border-box" : "content-box", width: _ + "px", "min-height": Math.max(getElementHeight(t), /%/.test(p.minHeight) ? 0 : parseFloat(p.minHeight) || 0) + "px", "padding-left": W + "px", "padding-right": y + "px", "padding-top": S + "px", "padding-bottom": R + "px", overflow: "hidden", position: "absolute", "z-index": "-1", [w]: "0", top: "0", cursor: p.cursor };if (n.cellPreviewAutoBackground) {let e = p.backgroundColor;e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = getComputedStyle(d).backgroundColor), e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = "#fff"), T["background-color"] = e;}setCssProps(f, T), f.firstChild && setCssProps(f.firstChild, { direction: C.direction, "white-space": C.whiteSpace, "min-height": C.minHeight, "line-height": C.lineHeight, font: C.font }), e.el.appendChild(f), m && me(f), f.rowVIndex = d.vIndex, f.rowIndex = c, f.columnName = u;try {const e = x.saveSelection(t);e && x.restoreSelection(f, e);} catch {}if (e.emit("cellpreview", { el: f.firstElementChild, name: f.columnName, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), s.abortCellPreview) return void f.remove();null != c && f.addEventListener("click", (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d.vIndex, rowIndex: c, rowEl: d, rowData: s.rows[c] });});const L = e.el,F = L === window ? document : L,A = getComputedStyle(L),P = getElementOffset(t),H = getElementOffset(L);if (b) {const e = window.innerWidth;P.right = e - (P.left + getElementWidth(t, true, true, true)), H.right = e - (H.left + getElementWidth(L, true, true, true));}P.left -= parseFloat(A.borderLeftWidth) || 0, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= parseFloat(A.borderRightWidth) || 0), P.top -= parseFloat(A.borderTopWidth) || 0, "left" === w ? P.left += parseFloat(p.borderLeftWidth) || 0 : void 0 !== P.right && (P.right += parseFloat(p.borderRightWidth) || 0), P.top += parseFloat(p.borderTopWidth) || parseFloat(p.borderBottomWidth) || 0, P.left -= H.left, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= H.right), P.top -= H.top;const E = getElementWidth(L, false, false, false) - getElementWidth(f, true, true, true),O = "left" === w ? P.left : (_P$right = P.right) !== null && _P$right !== void 0 ? _P$right : 0,I = Math.max(0, Math.min(E, O));"left" === w ? P.left = I : P.right = I;const D = getElementHeight(t, true, true, true),B = ("scrollTop" in F ? F.scrollTop : 0) + getElementHeight(L, true) - D;P.top > B && (P.top = Math.max(0, B));const $ = { top: P.top + "px", "z-index": 9999 };$[w] = ("left" === w ? P.left : P.right) + "px", setCssProps(f, $), f[v] = t, s.cellPreviewCell = f, t[g] = f, s._bindCellHoverOut(t), s._bindCellHoverOut(f);}(e, n);},s = (t) => {let l = t.currentTarget[v] || t.currentTarget,i = t.relatedTarget;i === e.el || l.contains(i) || l[g] && (i === l[g] || l[g].contains(i)) || function (e) {z(e);}(e);};t._bindCellHoverIn = (e) => {e[m] || e.addEventListener("mouseover", e[m] = n);}, t._unbindCellHoverIn = (e) => {e[m] && (e.removeEventListener("mouseover", e[m]), e[m] = null);}, t._bindCellHoverOut = (e) => {e[f] || e.addEventListener("mouseout", e[f] = s);}, t._unbindCellHoverOut = (e) => {e[f] && (e.removeEventListener("mouseout", e[f]), e[f] = null);};}(this);}on(e, t) {return this[w] || this._p.mitt.on(e, t), this;}once(e, t) {if (this[w]) return this;const l = (i) => {this._p.mitt.off(e, l), t(i);};return l[we] = t, this._p.mitt.on(e, l), this;}off(e, t) {if (this[w]) return this;if (e || t) {if (this._p.mitt.off(e, t), t) {var _this$_p$mitt$all$get;const l = (_this$_p$mitt$all$get = this._p.mitt.all.get(e)) !== null && _this$_p$mitt$all$get !== void 0 ? _this$_p$mitt$all$get : [];for (const i of l.slice()) i[we] === t && this._p.mitt.off(e, i);}} else this._p.mitt.all.clear();return this;}emit(e, t) {return this[w] || this._p.mitt.emit(e, t), this;}destroy() {var _e$virtualListHelper, _e$table, _e$tbody;const e = this._p,t = this.el;if (this[w] || !e) return this;if (A(this), V(this), (_e$virtualListHelper = e.virtualListHelper) !== null && _e$virtualListHelper !== void 0 && _e$virtualListHelper.destroy(), e.virtualListHelper = null, Y(this), (_e$table = e.table) !== null && _e$table !== void 0 && _e$table.remove(), (_e$tbody = e.tbody) !== null && _e$tbody !== void 0 && _e$tbody.remove(), e.workerListeners) {for (let t = 0; t < e.workerListeners.length; t++) {let l = e.workerListeners[t];l.worker.removeEventListener("message", l.listener, false);}e.workerListeners.length = 0;}e.rows.length = e.columns.length = 0, e._deferredRender && clearTimeout(e._deferredRender), e.wheelScrollTimeout && clearTimeout(e.wheelScrollTimeout), e.tapAndHoldTimeout && clearTimeout(e.tapAndHoldTimeout), e.eventsSink.remove();for (let e in this) be.call(this, e) && (this[e] = null);return this[w] = true, t && t.remove(), this;}close() {this.destroy();}remove() {this.destroy();}render() {const o = this._o,r = this._p;if (!this.el.offsetParent) return r._deferredRender || (r._deferredRender = setTimeout(() => {r._deferredRender = null, !this[w] && this.el.offsetParent && this.render();})), this;if (true === r.tableSkeletonNeedsRendering) {var _r$filteredRows;r.tableSkeletonNeedsRendering = false, o.width === _.AUTO && ee(this);let n = r.table && r.table.parentNode ? r.table.scrollTop : NaN,s = r.table && r.table.parentNode ? getScrollHorz(r.table) : NaN;!function (e, _t$virtualListHelper) {const t = e._p,i = e._o;V(e), (_t$virtualListHelper = t.virtualListHelper) !== null && _t$virtualListHelper !== void 0 && _t$virtualListHelper.destroy(), t.virtualListHelper = null, t.table && i.virtualTable && (t.table.remove(), t.table = void 0, t.tbody = void 0), Y(e), t.currentTouchId = null, t.header && t.header.remove();const o = i.tableClassName,r = q("div"),n = q("div");r.className = `${o}-header`, n.className = `${o}-header-row`, t.header = r, t.headerRow = n, r.appendChild(n), e.el.prepend(r), ue(e.el), i.width === _.SCROLL ? e.el.style.overflow = "hidden" : e.el.style.overflow = "", !i.height && i.virtualTable && (i.height = getElementHeight(e.el, true));}(this), function (e) {const t = e._p,o = e._o,r = o.tableClassName;if (o.virtualTable && !t.virtualRowHeight) {const o = () => {const e = q("div"),t = e.appendChild(q("div")),l = t.appendChild(q("div"));return e.className = `${r}-row`, t.className = `${r}-cell`, l.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;},n = q("div");n.className = e.el.className, setCssProps(n, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const s = q("div");s.className = r, n.appendChild(s);const a = q("div");a.className = `${r}-body`, a.style.width = "99999px", s.appendChild(a), document.body.appendChild(n);const d = o(),u = o(),h = o();a.appendChild(d), a.appendChild(u), a.appendChild(h), t.virtualRowHeight = getElementHeight(u, true, true, true), n.remove();}if (!t.table) {var _o$height;const n = document.createDocumentFragment(),s = q("div");s.className = r, o.virtualTable && (s.className += " virtual");const a = getComputedStyle(s);let d = ((_o$height = o.height) !== null && _o$height !== void 0 ? _o$height : 0) - getElementHeight(t.header, true, true, true);"border-box" !== a.boxSizing && (d -= parseFloat(a.borderTopWidth) || 0, d -= parseFloat(a.borderBottomWidth) || 0, d -= parseFloat(a.paddingTop) || 0, d -= parseFloat(a.paddingBottom) || 0), setCssProps(s, { height: o.height ? d + "px" : "auto", display: "block", overflowY: "auto", overflowX: o.width === _.SCROLL ? "auto" : "hidden" }), n.appendChild(s);const u = q("div");u.className = o.tableClassName + "-body", u.style.minHeight = "1px", t.table = s, t.tbody = u, ue(u), ue(s), s.appendChild(u), e.el.appendChild(n);}t.virtualListHelper || function (e, _t$filteredRows) {const t = e._p,l = e._o,i = l.tableClassName,o = i + "-row",r = i + "-row-alt",n = i + "-cell",s = i + "-sticky";let a = t.visibleColumns,u = a.length;t.notifyRendererOfColumnsConfig = () => {a = t.visibleColumns, u = a.length;for (let e = 0; e < u; e++) {const t = a[e];t._finalWidth = t.actualWidthConsideringScrollbarWidth || t.actualWidth;}}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: l.virtualTable, buffer: l.rowsBufferSize, estimatedItemHeight: l.estimatedRowHeight ? l.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => q("div"), onItemRender: (i, d) => {const h = i,c = t.filteredRows || t.rows,m = !!t.filteredRows,f = t.isStickyColumns;h.className = o, d % 2 == 1 && (h.className += " " + r);const g = c[d],v = m ? g[b] : d;h.vIndex = d, h.index = v;for (let e = 0; e < u; e++) {var _i$_finalWidth;const i = a[e],o = q("div");if (o.columnName = i.name, o.setAttribute("data-column", i.name), o.className = n, o.style.width = ((_i$_finalWidth = i._finalWidth) !== null && _i$_finalWidth !== void 0 ? _i$_finalWidth : 0) + "px", i.cellClasses && (o.className += " " + i.cellClasses), i.stickyPos) {o.className += " " + s, o.style.position = "sticky", o.style[i.stickyPos.absDirection] = i.stickyPos.offset + "px";const l = f === null || f === void 0 ? void 0 : f.get(e);"start" === l && !t.lastIsRtl || "end" === l && t.lastIsRtl ? o.classList.add("is-sticky-left") : ("start" === l && t.lastIsRtl || "end" === l && !t.lastIsRtl) && o.classList.add("is-sticky-right");}t._bindCellHoverIn(o), o.appendChild(q("div")).innerHTML = ae(l, g, i), h.appendChild(o);}h.addEventListener("click", h[p] = (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}), e.emit("rowcreate", { filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}, onItemUnrender: (t) => X(e, t), onScrollHeightChange: (l) => {l > t._lastVirtualScrollHeight && !t.scrollbarWidth && G(e), t._lastVirtualScrollHeight = l;} }), t.virtualListHelper.setCount(((_t$filteredRows = t.filteredRows) !== null && _t$filteredRows !== void 0 ? _t$filteredRows : t.rows).length), t.notifyRendererOfColumnsConfig();}(e);}(this), this.tableWidthChanged(true, false), function (e) {const t = e._p,l = e._o,i = l.tableClassName + "-header-cell",o = t.headerRow;for (let r = 0; r < t.visibleColumns.length; r++) {const n = t.visibleColumns[r];if (n.visible) {var _n$actualWidth;const s = q("div");s.draggable = true, s.className = i, s.style.width = ((_n$actualWidth = n.actualWidth) !== null && _n$actualWidth !== void 0 ? _n$actualWidth : 0) + "px", l.sortableColumns && n.sortable && (s.className += " sortable"), s.columnName = n.name, s.setAttribute("data-column", n.name);const a = q("div");a.innerHTML = l.headerCellFormatter(n.label, n.name), s.appendChild(a), t._bindCellHoverIn(s), o.appendChild(s), t.visibleColumns[r].element = s, le(e, s), me(s);}}K(e), e.emit("headerrowcreate", o);}(this), r.virtualListHelper.setCount(((_r$filteredRows = r.filteredRows) !== null && _r$filteredRows !== void 0 ? _r$filteredRows : r.rows).length), U(this), G(this, true), J(this, true), j(this), G(this);for (let e = 0; e < r.rows.sortColumn.length; e++) te(this, r.rows.sortColumn[e].column, r.rows.sortColumn[e].descending);o.adjustColumnWidthForSortArrow && r.rows.sortColumn.length ? this.tableWidthChanged(true) : o.virtualTable || this.tableWidthChanged(), isNaN(n) || (r.table.scrollTop = n), isNaN(s) || (setScrollHorz(r.table, s), setScrollHorz(r.header, s)), K(this), this.emit("renderskeleton");}r.virtualListHelper.render();const n = r.scrollbarWidth;return G(this), r.scrollbarWidth !== n && J(this, false), this.emit("render"), this;}clearAndRender(e) {var _t$notifyRendererOfCo;let t = this._p;return t.tableSkeletonNeedsRendering = true, (_t$notifyRendererOfCo = t.notifyRendererOfColumnsConfig) !== null && _t$notifyRendererOfCo !== void 0 && _t$notifyRendererOfCo.call(t), (void 0 === e || e) && this.render(), this;}setColumns(e, t) {const l = this._p;e = e || [];let i = new S();for (let t = 0, l = 0; t < e.length; t++) {let o = e[t],r = oe(this._o, o);void 0 !== o.order ? (o.order > l && (l = o.order + 1), r.order = o.order) : r.order = l++, i.push(r);}return i.normalizeOrder(), l.columns = i, l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this;}addColumn(e, t, l) {const i = this._p;let o = i.columns;if (e && !o.get(e.name)) {let r = null;void 0 !== t && (r = "string" == typeof t ? o.get(t) : o.getByOrder(t));let n = oe(this._o, e);n.order = r ? r.order : o.getMaxOrder() + 1;for (let e = o.getMaxOrder(), t = n.order; e >= t; e--) {let t = o.getByOrder(e);t && t.order++;}o.push(n), o.normalizeOrder(), i.visibleColumns = o.getVisibleColumns(), re(this), this.clearAndRender(l), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const l = this._p;let i = l.columns,o = i.indexOf(e);return o > -1 && (i.splice(o, 1), i.normalizeOrder(), l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this.emit("removecolumn", e)), this;}setColumnLabel(e, t) {let l = this._p.columns.get(e);if (l && (l.label = void 0 === t ? l.name : t, l.element)) {const e = l.element.firstChild,t = e.querySelector(":scope > .sort-arrow");e.innerHTML = this._o.headerCellFormatter(l.label, l.name), t && e.insertBefore(t, e.firstChild);}return this;}moveColumn(e, t, l = true) {const i = this._o,o = this._p;let r,n,a = o.columns,d = l ? o.visibleColumns : a.getColumns();if ("string" == typeof e ? r = a.get(e) : "number" == typeof e && (r = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), r && n && e !== t) {let e = r.order,t = n.order,l = a.moveColumn(r, n).getVisibleColumns();if (o.visibleColumns.length !== l.length || o.visibleColumns.some((e, t) => e !== l[t])) {const e = o.visibleColumns.indexOf(r),t = o.visibleColumns.indexOf(n);if (o.visibleColumns = l, re(this), !i.virtualTable && -1 !== e && -1 !== t && o.headerRow && o.tbody) {var _ref8, _ref9;const l = scopedSelectorAll(o.headerRow, `>div.${i.tableClassName}-header-cell`),r = e < t ? t + 1 : t;l[0].parentNode.insertBefore(l[e], l[r]);const n = o.visibleColumns[t],a = ((_ref8 = n.actualWidthConsideringScrollbarWidth || n.actualWidth) !== null && _ref8 !== void 0 ? _ref8 : 0) + "px",d = o.visibleColumns[e],u = ((_ref9 = d.actualWidthConsideringScrollbarWidth || d.actualWidth) !== null && _ref9 !== void 0 ? _ref9 : 0) + "px",h = o.tbody.childNodes;for (let l = 0, i = h.length; l < i; l++) {const i = h[l];1 === i.nodeType && (i.insertBefore(i.childNodes[e], i.childNodes[r]), i.childNodes[t].firstChild.style.width = a, i.childNodes[e].firstChild.style.width = u);}this.tableWidthChanged(true);} else this.clearAndRender();}this.emit("movecolumn", { name: r.name, src: e, dest: t });}return this;}setColumnVisible(e, t) {const l = this._p;let i = l.columns.get(e);return t = !!t, i && !!i.visible !== t && (i.visible = t, l.visibleColumns = l.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), re(this), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setColumnAutoWidthExtraSize(e) {let t = this._o;return e = Math.max(e, 0), t.columnAutoWidthExtraSize !== e && (t.columnAutoWidthExtraSize = e, this.tableWidthChanged(true)), this;}getColumnAutoWidthExtraSize() {return this._o.columnAutoWidthExtraSize;}setResizeAreaWidth(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaWidth !== e && (t.resizeAreaWidth = e, this.tableWidthChanged(true)), this;}getResizeAreaWidth() {return this._o.resizeAreaWidth;}setResizeAreaDoubleClickDuration(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaDoubleClickDuration !== e && (t.resizeAreaDoubleClickDuration = e, this.tableWidthChanged(true)), this;}getResizeAreaDoubleClickDuration() {return this._o.resizeAreaDoubleClickDuration;}setMaxStickyColumnRelativeWidth(e) {let t = this._o;return e = e || null, t.maxStickyColumnRelativeWidth !== e && (t.maxStickyColumnRelativeWidth = e, this.tableWidthChanged(true)), this;}getMaxStickyColumnRelativeWidth() {return this._o.maxStickyColumnRelativeWidth;}setColumnWidth(e, t) {let l = this._p.columns.get(e);if (l) {let e = ie(t, l.ignoreMin ? 0 : this._o.minColumnWidth),i = Ce(l);l.width = e.width, l.widthMode = e.mode, l.unconvertedWidth = null, l.unconvertedWidthMode = null;let o = Ce(l);i !== o && this.tableWidthChanged(true), this.emit("columnwidth", { name: l.name, width: o, oldWidth: i });}return this;}autoFitColumn(e) {const t = this._p,l = t.filteredRows || t.rows,i = t.columns.get(e);if (!i || l.length < 1) return this;const o = fe(this, i, l);return o > 0 && this.setColumnWidth(e, o), this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? Ce(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);if (t) {var _t$unconvertedWidthMo, _t$dataPath, _t$comparePath;const e = t.width,l = t.widthMode;null != t.unconvertedWidth && (t.width = t.unconvertedWidth, t.widthMode = (_t$unconvertedWidthMo = t.unconvertedWidthMode) !== null && _t$unconvertedWidthMo !== void 0 ? _t$unconvertedWidthMo : t.widthMode);const i = Ce(t);return null != t.unconvertedWidth && (t.width = e, t.widthMode = l), { name: t.name, label: t.label, width: i, dataPath: (_t$dataPath = t.dataPath) === null || _t$dataPath === void 0 ? void 0 : _t$dataPath.join("."), comparePath: (_t$comparePath = t.comparePath) === null || _t$comparePath === void 0 ? void 0 : _t$comparePath.join("."), resizable: t.resizable, movable: t.movable, sortable: t.sortable, visible: t.visible, cellClasses: t.cellClasses, ignoreMin: t.ignoreMin, sticky: t.sticky, order: t.order, allowPreview: t.allowPreview };}return null;}getColumnsConfig() {const e = this._p;let t = {};for (let l = 0; l < e.columns.length; l++) t[e.columns[l].name] = this.getColumnConfig(e.columns[l].name);return t;}setMaxColumnSortCount(e) {const t = this._p,l = this._o;if (l.sortableColumns !== e && (l.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, `>div.${l.tableClassName}-header-cell`);for (let i = 0, o = e.length; i < o; i++) e[i].classList[l.sortableColumns > 0 && t.visibleColumns[i].sortable ? "add" : "remove"]("sortable");}return this;}getMaxColumnSortCount() {return this._o.sortableColumns;}setSortableColumns(e) {return this.setMaxColumnSortCount(e);}getSortableColumns() {return this.getMaxColumnSortCount();}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}getConvertColumnWidthsToRelative() {return this._o.convertColumnWidthsToRelative;}setConvertColumnWidthsToRelative(e, t = true) {let l = this._o;return e = !!e, l.convertColumnWidthsToRelative !== e && (l.convertColumnWidthsToRelative = e, t && this.tableWidthChanged(true)), this;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}sort(e, t, l) {const i = this._o,o = this._p;let r = o.columns.get(e),n = o.rows.sortColumn.map((e) => ({ column: e.column, descending: e.descending }));if (r) {if (l) {for (let e = 0; e < n.length; e++) if (n[e].column === r.name) {e < n.length - 1 ? n.length = 0 : (t = n[n.length - 1].descending, n.splice(n.length - 1, 1));break;}(i.sortableColumns > 0 && n.length >= i.sortableColumns || n.length >= o.visibleColumns.length) && (n.length = 0);} else n.length = 0;t = void 0 !== t && t, n.push({ column: r.name, descending: !!t });} else n.length = 0;return this.setSortedColumns(n);}resort() {const e = this._p;let t = e.columns,l = e.rows.sortColumn;if (l.length) {var _e$virtualListHelper2;for (let e = 0; e < l.length; e++) t.get(l[e].column) || l.splice(e--, 1);e.rows.sortColumn = l, l.length && (e.rows.sort(), se(this)), (_e$virtualListHelper2 = e.virtualListHelper) === null || _e$virtualListHelper2 === void 0 ? void 0 : _e$virtualListHelper2.invalidate();let i = [];for (let e = 0; e < l.length; e++) i.push({ column: l[e].column, descending: l[e].descending });this.emit("sort", { sorts: i, resort: true });}return this;}setSortedColumns(e, t = { immediate: true, render: true }) {var _i$virtualListHelper;const l = this._o,i = this._p;let o = i.columns,r = e.filter((e) => o.get(e.column)).map((e) => {let t = o.get(e.column);return { column: t.name, comparePath: t.comparePath || t.dataPath, descending: !!e.descending };});l.sortableColumns > 0 && r.length > l.sortableColumns && (r.length = l.sortableColumns), ee(this);for (let e = 0; e < r.length; e++) te(this, r[e].column, r[e].descending);l.adjustColumnWidthForSortArrow && !i.tableSkeletonNeedsRendering && this.tableWidthChanged(true), i.rows.sortColumn = r, r.length && t.immediate && (i.rows.sort(), se(this), (_i$virtualListHelper = i.virtualListHelper) !== null && _i$virtualListHelper !== void 0 && _i$virtualListHelper.invalidate(), i.virtualListHelper && t.render && i.virtualListHelper.render());let n = [];for (let e = 0; e < r.length; e++) n.push({ column: r[e].column, descending: r[e].descending });return this.emit("sort", { sorts: n }), this;}getSortedColumns() {const e = this._p;let t = [];for (let l = 0; l < e.rows.sortColumn.length; l++) {let i = e.rows.sortColumn[l];t.push({ column: i.column, descending: i.descending });}return t;}setCellFormatter(e) {if (!e) {const t = (e) => "string" == typeof e ? h(e) : e;t[c] = true, e = t;}return this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? h(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let l = this._o.filter || R,i = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(l, t.filterArgs), (i || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}getHtmlForRowCell(e, t) {const l = this._p;if (e < 0 || e > l.rows.length - 1) return null;let i = l.columns.get(t);if (!i) return null;let o = l.rows[e];return ae(this._o, o, i);}getHtmlForRowDataCell(e, t) {let l = this._p.columns.get(t);return l ? ae(this._o, e, l) : null;}getRowYPos(e) {var _t$virtualListHelper$, _t$virtualListHelper2;const t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = e;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (_t$virtualListHelper$ = (_t$virtualListHelper2 = t.virtualListHelper) === null || _t$virtualListHelper2 === void 0 ? void 0 : _t$virtualListHelper2.getItemPosition(l)) !== null && _t$virtualListHelper$ !== void 0 ? _t$virtualListHelper$ : null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}addRows(e, t, l, i) {let o = this._p;"boolean" == typeof t && (i = l, l = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > o.rows.length) && (t = o.rows.length), i = void 0 === i || !!i;const r = (Array.isArray(e) ? e : [e]).length;if (e) {if (o.rows.add(e, t), o.filteredRows || l && o.rows.sortColumn.length) ne(this), l && o.rows.sortColumn.length && this.resort(), o.tableSkeletonNeedsRendering = true, i && this.render();else if (i && o.virtualListHelper) {if (o.virtualListHelper.addItemsAt(r, t), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else if (o.tbody) {for (let e = t + r, l = o.virtualListHelper.getCount(); e < l; e++) o.virtualListHelper.refreshItemAt(e);this.render(), G(this), J(this, true);}} else o.tableSkeletonNeedsRendering = true;this.emit("addrows", { count: r, clear: false });}return this;}removeRows(e, t, l) {let i = this._p;if ("number" != typeof t || t <= 0) return this;if (e < 0 || e > i.rows.length - 1) return this;if (i.rows.splice(e, t), l = void 0 === l || !!l, i.filteredRows) ne(this), i.tableSkeletonNeedsRendering = true, l && this.render();else if (l && i.virtualListHelper) {if (i.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else {for (let t = e, l = i.virtualListHelper.getCount(); t < l; t++) i.virtualListHelper.refreshItemAt(t);this.render(), G(this), J(this, true);}} else i.tableSkeletonNeedsRendering = true;return this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e, t = true) {let l = this._p;if (e < 0 || e > l.rows.length - 1) return this;let i = -1;return l.filteredRows && -1 === (i = l.filteredRows.indexOf(l.rows[e])) ? this : (-1 === i && (i = e), l.virtualListHelper ? (l.virtualListHelper.refreshItemAt(i), t && l.virtualListHelper.render(), this) : this);}getRowElement(e) {var _t$virtualListHelper3;let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = -1;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === l && (l = e), ((_t$virtualListHelper3 = t.virtualListHelper) === null || _t$virtualListHelper3 === void 0 ? void 0 : _t$virtualListHelper3.getItemElementAt(l)) || null);}refreshAllVirtualRows() {var _e$virtualListHelper3;const e = this._p;return (_e$virtualListHelper3 = e.virtualListHelper) !== null && _e$virtualListHelper3 !== void 0 && _e$virtualListHelper3.invalidate().render(), this;}setRows(e, t) {let l = this._p;return l.rows.reset(e), ne(this), t && l.rows.sortColumn.length && this.resort(), this.clearAndRender().emit("addrows", { count: e.length, clear: true }), this;}tableWidthChanged(e, t) {let l = this._o,i = this._p,o = pe(this),r = o,n = 0;if (!i.table) return this;t = void 0 === t || t;let s = 0;if (i.tbody || (t = false), t && (s = parseFloat(i.tbody.style.minWidth) || 0), r !== i.lastDetectedWidth || e) {var _i$notifyRendererOfCo;i.lastDetectedWidth = o;let e = 0,a = [],d = 0,u = 0;for (let e = 0; e < i.columns.length; e++) i.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < i.visibleColumns.length; t++) {var _o$unconvertedWidthMo;let o = i.visibleColumns[t];if (null != o.unconvertedWidth && (o.width = o.unconvertedWidth, o.widthMode = (_o$unconvertedWidthMo = o.unconvertedWidthMode) !== null && _o$unconvertedWidthMo !== void 0 ? _o$unconvertedWidthMo : o.widthMode, o.unconvertedWidth = null, o.unconvertedWidthMode = null), 1 === o.widthMode) {let i = o.width;i += o.arrowProposedWidth || 0, !o.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), r -= i, e += i, i !== o.actualWidth && (o.actualWidth = i, a.push(t));} else if (0 === o.widthMode) {let n = fe(this, o);o === i.visibleColumns[i.visibleColumns.length - 1] && (n += i.scrollbarWidth), r -= n, e += n, n !== o.actualWidth && (o.actualWidth = n, l.convertColumnWidthsToRelative || a.push(t));} else 2 === o.widthMode ? (d += o.width, n++) : 3 === o.widthMode && u++;}if (l.convertColumnWidthsToRelative) for (let t = 0; t < i.visibleColumns.length; t++) {let l = i.visibleColumns[t];if (0 === l.widthMode) {const t = l.width,i = l.widthMode;null == l.unconvertedWidth && (l.unconvertedWidth = t, l.unconvertedWidthMode = i), l.widthMode = 2, r += l.actualWidth, l.width = l.actualWidth / e, d += l.width, n++;}}if (n && (d < 1 && !u && l.relativeWidthGrowsToFillWidth || d > 1 && l.relativeWidthShrinksToFillWidth)) for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];2 === t.widthMode && (null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width /= d);}let h = Math.max(0, r);0 === h && (h = i.table.clientWidth);let c = l.minColumnWidth / h;if (Number.isFinite(c) || (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < i.visibleColumns.length; e++) {let l = i.visibleColumns[e];2 === l.widthMode && !l.ignoreMin && l.width < c && (t += c - l.width, l.width = c);}for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];2 === o.widthMode && !o.ignoreMin && o.width > c && t > 0 && (null == o.unconvertedWidth && (o.unconvertedWidth = o.width, o.unconvertedWidthMode = o.widthMode), e = Math.min(t, o.width - c), o.width -= e, t -= e);}}if (!u && l.autoFillTableWidth && r > 0) {let e = 0,t = r;for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];o.resizable || 1 !== o.widthMode || (e += o.width), 2 === o.widthMode && (t -= Math.round(h * o.width));}let l = (o - e) / (o - t - e) || NaN;for (let e = 0; e < i.visibleColumns.length && t > 0; e++) {let t = i.visibleColumns[e];if (t.resizable || 1 !== t.widthMode) if (2 === t.widthMode) null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width *= l;else {let i = t.actualWidth * l;t.actualWidth !== i && (t.actualWidth = i, -1 === a.indexOf(e) && a.push(e));}}}for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];if (2 === t.widthMode) {let l = Math.round(h * t.width);r -= l, n--, 0 === n && 1 === r && (l++, r--), -1 === r && (l--, r++), l !== t.actualWidth && (t.actualWidth = l, a.push(e));}}if (u) {let e = Math.max(0, r),t = u;for (let o = 0; o < i.visibleColumns.length; o++) {let r = i.visibleColumns[o];if (3 === r.widthMode) {let i = Math.max(0, Math.floor(e / t));!r.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), e -= i, t--, i !== r.actualWidth && (r.actualWidth = i, a.push(o));}}}if (l.autoFillLastColumn && i.visibleColumns.length) {var _l$actualWidth2;let e = 0;for (let t = 0; t < i.visibleColumns.length; t++) {var _i$visibleColumns$t$a;e += (_i$visibleColumns$t$a = i.visibleColumns[t].actualWidth) !== null && _i$visibleColumns$t$a !== void 0 ? _i$visibleColumns$t$a : 0;}const t = i.visibleColumns.length - 1,l = i.visibleColumns[t],r = o - e;r > 0 && (l.actualWidth = ((_l$actualWidth2 = l.actualWidth) !== null && _l$actualWidth2 !== void 0 ? _l$actualWidth2 : 0) + r, -1 === a.indexOf(t) && a.push(t));}if (i.visibleColumns.length && (i.visibleColumns[i.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = i.visibleColumns[i.visibleColumns.length - 1].actualWidth - (i.scrollbarWidth || 0)), (_i$notifyRendererOfCo = i.notifyRendererOfColumnsConfig) !== null && _i$notifyRendererOfCo !== void 0 && _i$notifyRendererOfCo.call(i), t) {let e = ge(this);s < e && J(this, false);for (let e = 0; e < a.length; e++) Z(this, a[e]);s > e && J(this, false);}K(this);}return this;}tableHeightChanged() {let e = this._o;if (!this._p.table) return this;let t = getElementHeight(this.el, true);return t !== e.height && (e.height = t, j(this), e.virtualTable && this.clearAndRender()), this;}hideCellPreview() {return z(this), this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {return A(this), this;}getUrlForElementContent(e) {let t,l = document.getElementById(e);if (l) {let e = l.textContent;if ("function" == typeof Blob) t = new Blob([e || ""]);else {const l = window,i = l.BlobBuilder || l.WebKitBlobBuilder || l.MozBlobBuilder || l.MSBlobBuilder;if (!i) return null;const o = new i();o.append(e || ""), t = o.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, l) {if (this.isWorkerSupported()) {let i = this._p,o = new Worker(e),r = (e) => {e.data.append ? this.addRows(e.data.rows, l) : this.setRows(e.data.rows, l);};return o.addEventListener("message", r, false), i.workerListeners || (i.workerListeners = []), i.workerListeners.push({ worker: o, listener: r }), (t || void 0 === t) && o.postMessage(null), o;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let l = 0; l < t.workerListeners.length; l++) t.workerListeners[l].worker === e && (e.removeEventListener("message", t.workerListeners[l].listener, false), t.workerListeners.splice(l, 1), l--);return this;}}_defineProperty(We, "VERSION", "2.0.39");_defineProperty(We, "Width", _);
|
|
3880
3463
|
|
|
3881
|
-
class DGTableJQuery extends
|
|
3464
|
+
class DGTableJQuery extends We {
|
|
3882
3465
|
constructor(options) {
|
|
3883
3466
|
super(options);
|
|
3884
3467
|
|