@infinite-table/infinite-react 4.3.3 → 4.3.5
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/index.css +4 -1
- package/index.d.ts +402 -400
- package/index.dev.js +152 -133
- package/index.dev.mjs +152 -133
- package/index.js +152 -133
- package/index.mjs +152 -133
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -13351,11 +13351,17 @@ function concludeReducer(params) {
|
|
|
13351
13351
|
if (state.lazyLoad || state.livePagination) {
|
|
13352
13352
|
shouldSort = false;
|
|
13353
13353
|
}
|
|
13354
|
+
const refetchKeyChanged = haveDepsChanged(previousState, state, [
|
|
13355
|
+
"refetchKey"
|
|
13356
|
+
]);
|
|
13354
13357
|
let originalDataArrayChanged = haveDepsChanged(previousState, state, [
|
|
13355
13358
|
"cache",
|
|
13356
13359
|
"originalDataArray",
|
|
13357
13360
|
"originalLazyGroupDataChangeDetect"
|
|
13358
13361
|
]);
|
|
13362
|
+
if (Array.isArray(state.data) && refetchKeyChanged) {
|
|
13363
|
+
originalDataArrayChanged = true;
|
|
13364
|
+
}
|
|
13359
13365
|
const lazyLoadGroupDataChange = false;
|
|
13360
13366
|
if (lazyLoadGroupDataChange) {
|
|
13361
13367
|
state.originalLazyGroupData = new DeepMap();
|
|
@@ -14071,6 +14077,11 @@ See http://infinite-table.com/docs/reference/error-codes#DS001 for more info.`
|
|
|
14071
14077
|
if (changes.filterValue && getComponentState().filterMode === "local") {
|
|
14072
14078
|
return;
|
|
14073
14079
|
}
|
|
14080
|
+
const originalData = getComponentState().data;
|
|
14081
|
+
if (Array.isArray(originalData) && changes.refetchKey) {
|
|
14082
|
+
actions.originalDataArray = originalData;
|
|
14083
|
+
return;
|
|
14084
|
+
}
|
|
14074
14085
|
}
|
|
14075
14086
|
const masterContext = getMasterContext();
|
|
14076
14087
|
const { isDetail, isDetailReady } = getDetailReady(
|
|
@@ -14872,136 +14883,6 @@ function useDataSourceInternal(props) {
|
|
|
14872
14883
|
};
|
|
14873
14884
|
}
|
|
14874
14885
|
|
|
14875
|
-
// src/utils/FixedSizeMap.ts
|
|
14876
|
-
var _FixedSizeMap = class {
|
|
14877
|
-
constructor(clone, size) {
|
|
14878
|
-
this.keysInOrder = [];
|
|
14879
|
-
if (typeof clone === "number") {
|
|
14880
|
-
this.maxSize = clone;
|
|
14881
|
-
this.currentMap = /* @__PURE__ */ new Map();
|
|
14882
|
-
} else {
|
|
14883
|
-
this.maxSize = size != null ? size : _FixedSizeMap.DEFAULT_SIZE;
|
|
14884
|
-
if (clone) {
|
|
14885
|
-
const arr = Array.from(clone);
|
|
14886
|
-
if (this.maxSize < arr.length) {
|
|
14887
|
-
arr.slice(arr.length - this.maxSize);
|
|
14888
|
-
}
|
|
14889
|
-
this.currentMap = /* @__PURE__ */ new Map();
|
|
14890
|
-
arr.forEach(([k, v]) => {
|
|
14891
|
-
this.set(k, v);
|
|
14892
|
-
});
|
|
14893
|
-
} else {
|
|
14894
|
-
this.currentMap = /* @__PURE__ */ new Map();
|
|
14895
|
-
}
|
|
14896
|
-
}
|
|
14897
|
-
}
|
|
14898
|
-
values() {
|
|
14899
|
-
return this.currentMap.values();
|
|
14900
|
-
}
|
|
14901
|
-
get size() {
|
|
14902
|
-
return this.currentMap.size;
|
|
14903
|
-
}
|
|
14904
|
-
delete(key) {
|
|
14905
|
-
if (this.currentMap.has(key)) {
|
|
14906
|
-
this.currentMap.delete(key);
|
|
14907
|
-
this.keysInOrder = this.keysInOrder.filter((k) => k !== key);
|
|
14908
|
-
return true;
|
|
14909
|
-
}
|
|
14910
|
-
return false;
|
|
14911
|
-
}
|
|
14912
|
-
has(key) {
|
|
14913
|
-
return this.currentMap.has(key);
|
|
14914
|
-
}
|
|
14915
|
-
get(key) {
|
|
14916
|
-
return this.currentMap.get(key);
|
|
14917
|
-
}
|
|
14918
|
-
set(key, el) {
|
|
14919
|
-
if (this.has(key)) {
|
|
14920
|
-
this.delete(key);
|
|
14921
|
-
}
|
|
14922
|
-
const canAddCount = this.maxSize - this.currentMap.size;
|
|
14923
|
-
if (canAddCount <= 0) {
|
|
14924
|
-
const [removedKey] = this.keysInOrder.splice(0, 1);
|
|
14925
|
-
if (removedKey != void 0) {
|
|
14926
|
-
this.currentMap.delete(removedKey);
|
|
14927
|
-
}
|
|
14928
|
-
}
|
|
14929
|
-
this.keysInOrder.push(key);
|
|
14930
|
-
this.currentMap.set(key, el);
|
|
14931
|
-
return this;
|
|
14932
|
-
}
|
|
14933
|
-
};
|
|
14934
|
-
var FixedSizeMap = _FixedSizeMap;
|
|
14935
|
-
FixedSizeMap.DEFAULT_SIZE = 10;
|
|
14936
|
-
|
|
14937
|
-
// src/components/DataSource/RowDetailCache.ts
|
|
14938
|
-
var RowDetailNoCacheStorage = class {
|
|
14939
|
-
add(_key, _value) {
|
|
14940
|
-
return;
|
|
14941
|
-
}
|
|
14942
|
-
get(_key) {
|
|
14943
|
-
return void 0;
|
|
14944
|
-
}
|
|
14945
|
-
delete(_key) {
|
|
14946
|
-
return;
|
|
14947
|
-
}
|
|
14948
|
-
has(_key) {
|
|
14949
|
-
return false;
|
|
14950
|
-
}
|
|
14951
|
-
};
|
|
14952
|
-
var RowDetailFixedSizeCacheStorage = class {
|
|
14953
|
-
constructor(maxSize) {
|
|
14954
|
-
this.storage = new FixedSizeMap(maxSize);
|
|
14955
|
-
}
|
|
14956
|
-
add(key, value) {
|
|
14957
|
-
this.storage.set(key, value);
|
|
14958
|
-
}
|
|
14959
|
-
get(key) {
|
|
14960
|
-
return this.storage.get(key);
|
|
14961
|
-
}
|
|
14962
|
-
delete(key) {
|
|
14963
|
-
this.storage.delete(key);
|
|
14964
|
-
}
|
|
14965
|
-
has(key) {
|
|
14966
|
-
return this.storage.has(key);
|
|
14967
|
-
}
|
|
14968
|
-
};
|
|
14969
|
-
var RowDetailFullCacheStorage = class {
|
|
14970
|
-
constructor() {
|
|
14971
|
-
this.storage = /* @__PURE__ */ new Map();
|
|
14972
|
-
}
|
|
14973
|
-
add(key, value) {
|
|
14974
|
-
this.storage.set(key, value);
|
|
14975
|
-
}
|
|
14976
|
-
get(key) {
|
|
14977
|
-
return this.storage.get(key);
|
|
14978
|
-
}
|
|
14979
|
-
delete(key) {
|
|
14980
|
-
this.storage.delete(key);
|
|
14981
|
-
}
|
|
14982
|
-
has(key) {
|
|
14983
|
-
return this.storage.has(key);
|
|
14984
|
-
}
|
|
14985
|
-
};
|
|
14986
|
-
var RowDetailCache = class {
|
|
14987
|
-
// public instanceIndex: number = 0;
|
|
14988
|
-
constructor(cache) {
|
|
14989
|
-
this.cacheStorage = cache === false ? new RowDetailNoCacheStorage() : cache === true ? new RowDetailFullCacheStorage() : typeof cache === "number" ? new RowDetailFixedSizeCacheStorage(cache) : new RowDetailFixedSizeCacheStorage(5);
|
|
14990
|
-
}
|
|
14991
|
-
add(key, value) {
|
|
14992
|
-
this.cacheStorage.add(key, value);
|
|
14993
|
-
}
|
|
14994
|
-
get(key) {
|
|
14995
|
-
return this.cacheStorage.get(key);
|
|
14996
|
-
}
|
|
14997
|
-
delete(key) {
|
|
14998
|
-
this.cacheStorage.delete(key);
|
|
14999
|
-
}
|
|
15000
|
-
has(key) {
|
|
15001
|
-
return this.cacheStorage.has(key);
|
|
15002
|
-
}
|
|
15003
|
-
};
|
|
15004
|
-
|
|
15005
14886
|
// src/components/DataSource/BooleanCollectionState.ts
|
|
15006
14887
|
var BooleanCollectionState = class {
|
|
15007
14888
|
constructor(state) {
|
|
@@ -15199,6 +15080,136 @@ var RowDetailState = class extends BooleanCollectionState {
|
|
|
15199
15080
|
}
|
|
15200
15081
|
};
|
|
15201
15082
|
|
|
15083
|
+
// src/utils/FixedSizeMap.ts
|
|
15084
|
+
var _FixedSizeMap = class {
|
|
15085
|
+
constructor(clone, size) {
|
|
15086
|
+
this.keysInOrder = [];
|
|
15087
|
+
if (typeof clone === "number") {
|
|
15088
|
+
this.maxSize = clone;
|
|
15089
|
+
this.currentMap = /* @__PURE__ */ new Map();
|
|
15090
|
+
} else {
|
|
15091
|
+
this.maxSize = size != null ? size : _FixedSizeMap.DEFAULT_SIZE;
|
|
15092
|
+
if (clone) {
|
|
15093
|
+
const arr = Array.from(clone);
|
|
15094
|
+
if (this.maxSize < arr.length) {
|
|
15095
|
+
arr.slice(arr.length - this.maxSize);
|
|
15096
|
+
}
|
|
15097
|
+
this.currentMap = /* @__PURE__ */ new Map();
|
|
15098
|
+
arr.forEach(([k, v]) => {
|
|
15099
|
+
this.set(k, v);
|
|
15100
|
+
});
|
|
15101
|
+
} else {
|
|
15102
|
+
this.currentMap = /* @__PURE__ */ new Map();
|
|
15103
|
+
}
|
|
15104
|
+
}
|
|
15105
|
+
}
|
|
15106
|
+
values() {
|
|
15107
|
+
return this.currentMap.values();
|
|
15108
|
+
}
|
|
15109
|
+
get size() {
|
|
15110
|
+
return this.currentMap.size;
|
|
15111
|
+
}
|
|
15112
|
+
delete(key) {
|
|
15113
|
+
if (this.currentMap.has(key)) {
|
|
15114
|
+
this.currentMap.delete(key);
|
|
15115
|
+
this.keysInOrder = this.keysInOrder.filter((k) => k !== key);
|
|
15116
|
+
return true;
|
|
15117
|
+
}
|
|
15118
|
+
return false;
|
|
15119
|
+
}
|
|
15120
|
+
has(key) {
|
|
15121
|
+
return this.currentMap.has(key);
|
|
15122
|
+
}
|
|
15123
|
+
get(key) {
|
|
15124
|
+
return this.currentMap.get(key);
|
|
15125
|
+
}
|
|
15126
|
+
set(key, el) {
|
|
15127
|
+
if (this.has(key)) {
|
|
15128
|
+
this.delete(key);
|
|
15129
|
+
}
|
|
15130
|
+
const canAddCount = this.maxSize - this.currentMap.size;
|
|
15131
|
+
if (canAddCount <= 0) {
|
|
15132
|
+
const [removedKey] = this.keysInOrder.splice(0, 1);
|
|
15133
|
+
if (removedKey != void 0) {
|
|
15134
|
+
this.currentMap.delete(removedKey);
|
|
15135
|
+
}
|
|
15136
|
+
}
|
|
15137
|
+
this.keysInOrder.push(key);
|
|
15138
|
+
this.currentMap.set(key, el);
|
|
15139
|
+
return this;
|
|
15140
|
+
}
|
|
15141
|
+
};
|
|
15142
|
+
var FixedSizeMap = _FixedSizeMap;
|
|
15143
|
+
FixedSizeMap.DEFAULT_SIZE = 10;
|
|
15144
|
+
|
|
15145
|
+
// src/components/DataSource/RowDetailCache.ts
|
|
15146
|
+
var RowDetailNoCacheStorage = class {
|
|
15147
|
+
add(_key, _value) {
|
|
15148
|
+
return;
|
|
15149
|
+
}
|
|
15150
|
+
get(_key) {
|
|
15151
|
+
return void 0;
|
|
15152
|
+
}
|
|
15153
|
+
delete(_key) {
|
|
15154
|
+
return;
|
|
15155
|
+
}
|
|
15156
|
+
has(_key) {
|
|
15157
|
+
return false;
|
|
15158
|
+
}
|
|
15159
|
+
};
|
|
15160
|
+
var RowDetailFixedSizeCacheStorage = class {
|
|
15161
|
+
constructor(maxSize) {
|
|
15162
|
+
this.storage = new FixedSizeMap(maxSize);
|
|
15163
|
+
}
|
|
15164
|
+
add(key, value) {
|
|
15165
|
+
this.storage.set(key, value);
|
|
15166
|
+
}
|
|
15167
|
+
get(key) {
|
|
15168
|
+
return this.storage.get(key);
|
|
15169
|
+
}
|
|
15170
|
+
delete(key) {
|
|
15171
|
+
this.storage.delete(key);
|
|
15172
|
+
}
|
|
15173
|
+
has(key) {
|
|
15174
|
+
return this.storage.has(key);
|
|
15175
|
+
}
|
|
15176
|
+
};
|
|
15177
|
+
var RowDetailFullCacheStorage = class {
|
|
15178
|
+
constructor() {
|
|
15179
|
+
this.storage = /* @__PURE__ */ new Map();
|
|
15180
|
+
}
|
|
15181
|
+
add(key, value) {
|
|
15182
|
+
this.storage.set(key, value);
|
|
15183
|
+
}
|
|
15184
|
+
get(key) {
|
|
15185
|
+
return this.storage.get(key);
|
|
15186
|
+
}
|
|
15187
|
+
delete(key) {
|
|
15188
|
+
this.storage.delete(key);
|
|
15189
|
+
}
|
|
15190
|
+
has(key) {
|
|
15191
|
+
return this.storage.has(key);
|
|
15192
|
+
}
|
|
15193
|
+
};
|
|
15194
|
+
var RowDetailCache = class {
|
|
15195
|
+
// public instanceIndex: number = 0;
|
|
15196
|
+
constructor(cache) {
|
|
15197
|
+
this.cacheStorage = cache === false ? new RowDetailNoCacheStorage() : cache === true ? new RowDetailFullCacheStorage() : typeof cache === "number" ? new RowDetailFixedSizeCacheStorage(cache) : new RowDetailFixedSizeCacheStorage(5);
|
|
15198
|
+
}
|
|
15199
|
+
add(key, value) {
|
|
15200
|
+
this.cacheStorage.add(key, value);
|
|
15201
|
+
}
|
|
15202
|
+
get(key) {
|
|
15203
|
+
return this.cacheStorage.get(key);
|
|
15204
|
+
}
|
|
15205
|
+
delete(key) {
|
|
15206
|
+
this.cacheStorage.delete(key);
|
|
15207
|
+
}
|
|
15208
|
+
has(key) {
|
|
15209
|
+
return this.cacheStorage.has(key);
|
|
15210
|
+
}
|
|
15211
|
+
};
|
|
15212
|
+
|
|
15202
15213
|
// src/components/DataSource/types.ts
|
|
15203
15214
|
var DataSourceActionType = /* @__PURE__ */ ((DataSourceActionType2) => {
|
|
15204
15215
|
DataSourceActionType2["INIT"] = "INIT";
|
|
@@ -16866,6 +16877,12 @@ function useCellRendering(param) {
|
|
|
16866
16877
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
16867
16878
|
});
|
|
16868
16879
|
}, [brain]);
|
|
16880
|
+
(0, import_react40.useEffect)(() => {
|
|
16881
|
+
return brain.onRenderRangeChange((range) => {
|
|
16882
|
+
var _a, _b;
|
|
16883
|
+
(_b = (_a = getState()).onRenderRangeChange) == null ? void 0 : _b.call(_a, range);
|
|
16884
|
+
});
|
|
16885
|
+
}, [brain]);
|
|
16869
16886
|
(0, import_react40.useEffect)(() => {
|
|
16870
16887
|
return brain.onScrollStop((scrollPosition) => {
|
|
16871
16888
|
const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = scrollPosition;
|
|
@@ -17467,6 +17484,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
17467
17484
|
onBlurWithin: 1,
|
|
17468
17485
|
onContextMenu: 1,
|
|
17469
17486
|
onCellContextMenu: 1,
|
|
17487
|
+
onRenderRangeChange: 1,
|
|
17470
17488
|
onScrollToTop: 1,
|
|
17471
17489
|
onScrollToBottom: 1,
|
|
17472
17490
|
onScrollStop: 1,
|
|
@@ -18825,7 +18843,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18825
18843
|
}
|
|
18826
18844
|
let valid2 = isValidLicense(licenseKey, {
|
|
18827
18845
|
publishedAt: 1624970570587,
|
|
18828
|
-
version: "4.3.
|
|
18846
|
+
version: "4.3.5"
|
|
18829
18847
|
});
|
|
18830
18848
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18831
18849
|
return true;
|
|
@@ -22542,7 +22560,8 @@ function InfiniteTableBody() {
|
|
|
22542
22560
|
components: components2,
|
|
22543
22561
|
bodySize,
|
|
22544
22562
|
activeCellIndex,
|
|
22545
|
-
rowDetailRenderer
|
|
22563
|
+
rowDetailRenderer,
|
|
22564
|
+
showHoverRows
|
|
22546
22565
|
} = componentState;
|
|
22547
22566
|
const LoadMaskCmp = (_a = components2 == null ? void 0 : components2.LoadMask) != null ? _a : LoadMask;
|
|
22548
22567
|
const computed = getComputed();
|
|
@@ -22610,7 +22629,7 @@ function InfiniteTableBody() {
|
|
|
22610
22629
|
activeCellRowHeight,
|
|
22611
22630
|
renderCell,
|
|
22612
22631
|
renderDetailRow: rowDetailRenderer ? renderDetailRow : void 0,
|
|
22613
|
-
cellHoverClassNames: HOVERED_CLASS_NAMES,
|
|
22632
|
+
cellHoverClassNames: showHoverRows ? HOVERED_CLASS_NAMES : void 0,
|
|
22614
22633
|
scrollerDOMRef
|
|
22615
22634
|
}
|
|
22616
22635
|
), /* @__PURE__ */ React68.createElement(LoadMaskCmp, { visible: loading }, loadingText));
|
package/index.dev.mjs
CHANGED
|
@@ -13314,11 +13314,17 @@ function concludeReducer(params) {
|
|
|
13314
13314
|
if (state.lazyLoad || state.livePagination) {
|
|
13315
13315
|
shouldSort = false;
|
|
13316
13316
|
}
|
|
13317
|
+
const refetchKeyChanged = haveDepsChanged(previousState, state, [
|
|
13318
|
+
"refetchKey"
|
|
13319
|
+
]);
|
|
13317
13320
|
let originalDataArrayChanged = haveDepsChanged(previousState, state, [
|
|
13318
13321
|
"cache",
|
|
13319
13322
|
"originalDataArray",
|
|
13320
13323
|
"originalLazyGroupDataChangeDetect"
|
|
13321
13324
|
]);
|
|
13325
|
+
if (Array.isArray(state.data) && refetchKeyChanged) {
|
|
13326
|
+
originalDataArrayChanged = true;
|
|
13327
|
+
}
|
|
13322
13328
|
const lazyLoadGroupDataChange = false;
|
|
13323
13329
|
if (lazyLoadGroupDataChange) {
|
|
13324
13330
|
state.originalLazyGroupData = new DeepMap();
|
|
@@ -14034,6 +14040,11 @@ See http://infinite-table.com/docs/reference/error-codes#DS001 for more info.`
|
|
|
14034
14040
|
if (changes.filterValue && getComponentState().filterMode === "local") {
|
|
14035
14041
|
return;
|
|
14036
14042
|
}
|
|
14043
|
+
const originalData = getComponentState().data;
|
|
14044
|
+
if (Array.isArray(originalData) && changes.refetchKey) {
|
|
14045
|
+
actions.originalDataArray = originalData;
|
|
14046
|
+
return;
|
|
14047
|
+
}
|
|
14037
14048
|
}
|
|
14038
14049
|
const masterContext = getMasterContext();
|
|
14039
14050
|
const { isDetail, isDetailReady } = getDetailReady(
|
|
@@ -14840,136 +14851,6 @@ function useDataSourceInternal(props) {
|
|
|
14840
14851
|
};
|
|
14841
14852
|
}
|
|
14842
14853
|
|
|
14843
|
-
// src/utils/FixedSizeMap.ts
|
|
14844
|
-
var _FixedSizeMap = class {
|
|
14845
|
-
constructor(clone, size) {
|
|
14846
|
-
this.keysInOrder = [];
|
|
14847
|
-
if (typeof clone === "number") {
|
|
14848
|
-
this.maxSize = clone;
|
|
14849
|
-
this.currentMap = /* @__PURE__ */ new Map();
|
|
14850
|
-
} else {
|
|
14851
|
-
this.maxSize = size != null ? size : _FixedSizeMap.DEFAULT_SIZE;
|
|
14852
|
-
if (clone) {
|
|
14853
|
-
const arr = Array.from(clone);
|
|
14854
|
-
if (this.maxSize < arr.length) {
|
|
14855
|
-
arr.slice(arr.length - this.maxSize);
|
|
14856
|
-
}
|
|
14857
|
-
this.currentMap = /* @__PURE__ */ new Map();
|
|
14858
|
-
arr.forEach(([k, v]) => {
|
|
14859
|
-
this.set(k, v);
|
|
14860
|
-
});
|
|
14861
|
-
} else {
|
|
14862
|
-
this.currentMap = /* @__PURE__ */ new Map();
|
|
14863
|
-
}
|
|
14864
|
-
}
|
|
14865
|
-
}
|
|
14866
|
-
values() {
|
|
14867
|
-
return this.currentMap.values();
|
|
14868
|
-
}
|
|
14869
|
-
get size() {
|
|
14870
|
-
return this.currentMap.size;
|
|
14871
|
-
}
|
|
14872
|
-
delete(key) {
|
|
14873
|
-
if (this.currentMap.has(key)) {
|
|
14874
|
-
this.currentMap.delete(key);
|
|
14875
|
-
this.keysInOrder = this.keysInOrder.filter((k) => k !== key);
|
|
14876
|
-
return true;
|
|
14877
|
-
}
|
|
14878
|
-
return false;
|
|
14879
|
-
}
|
|
14880
|
-
has(key) {
|
|
14881
|
-
return this.currentMap.has(key);
|
|
14882
|
-
}
|
|
14883
|
-
get(key) {
|
|
14884
|
-
return this.currentMap.get(key);
|
|
14885
|
-
}
|
|
14886
|
-
set(key, el) {
|
|
14887
|
-
if (this.has(key)) {
|
|
14888
|
-
this.delete(key);
|
|
14889
|
-
}
|
|
14890
|
-
const canAddCount = this.maxSize - this.currentMap.size;
|
|
14891
|
-
if (canAddCount <= 0) {
|
|
14892
|
-
const [removedKey] = this.keysInOrder.splice(0, 1);
|
|
14893
|
-
if (removedKey != void 0) {
|
|
14894
|
-
this.currentMap.delete(removedKey);
|
|
14895
|
-
}
|
|
14896
|
-
}
|
|
14897
|
-
this.keysInOrder.push(key);
|
|
14898
|
-
this.currentMap.set(key, el);
|
|
14899
|
-
return this;
|
|
14900
|
-
}
|
|
14901
|
-
};
|
|
14902
|
-
var FixedSizeMap = _FixedSizeMap;
|
|
14903
|
-
FixedSizeMap.DEFAULT_SIZE = 10;
|
|
14904
|
-
|
|
14905
|
-
// src/components/DataSource/RowDetailCache.ts
|
|
14906
|
-
var RowDetailNoCacheStorage = class {
|
|
14907
|
-
add(_key, _value) {
|
|
14908
|
-
return;
|
|
14909
|
-
}
|
|
14910
|
-
get(_key) {
|
|
14911
|
-
return void 0;
|
|
14912
|
-
}
|
|
14913
|
-
delete(_key) {
|
|
14914
|
-
return;
|
|
14915
|
-
}
|
|
14916
|
-
has(_key) {
|
|
14917
|
-
return false;
|
|
14918
|
-
}
|
|
14919
|
-
};
|
|
14920
|
-
var RowDetailFixedSizeCacheStorage = class {
|
|
14921
|
-
constructor(maxSize) {
|
|
14922
|
-
this.storage = new FixedSizeMap(maxSize);
|
|
14923
|
-
}
|
|
14924
|
-
add(key, value) {
|
|
14925
|
-
this.storage.set(key, value);
|
|
14926
|
-
}
|
|
14927
|
-
get(key) {
|
|
14928
|
-
return this.storage.get(key);
|
|
14929
|
-
}
|
|
14930
|
-
delete(key) {
|
|
14931
|
-
this.storage.delete(key);
|
|
14932
|
-
}
|
|
14933
|
-
has(key) {
|
|
14934
|
-
return this.storage.has(key);
|
|
14935
|
-
}
|
|
14936
|
-
};
|
|
14937
|
-
var RowDetailFullCacheStorage = class {
|
|
14938
|
-
constructor() {
|
|
14939
|
-
this.storage = /* @__PURE__ */ new Map();
|
|
14940
|
-
}
|
|
14941
|
-
add(key, value) {
|
|
14942
|
-
this.storage.set(key, value);
|
|
14943
|
-
}
|
|
14944
|
-
get(key) {
|
|
14945
|
-
return this.storage.get(key);
|
|
14946
|
-
}
|
|
14947
|
-
delete(key) {
|
|
14948
|
-
this.storage.delete(key);
|
|
14949
|
-
}
|
|
14950
|
-
has(key) {
|
|
14951
|
-
return this.storage.has(key);
|
|
14952
|
-
}
|
|
14953
|
-
};
|
|
14954
|
-
var RowDetailCache = class {
|
|
14955
|
-
// public instanceIndex: number = 0;
|
|
14956
|
-
constructor(cache) {
|
|
14957
|
-
this.cacheStorage = cache === false ? new RowDetailNoCacheStorage() : cache === true ? new RowDetailFullCacheStorage() : typeof cache === "number" ? new RowDetailFixedSizeCacheStorage(cache) : new RowDetailFixedSizeCacheStorage(5);
|
|
14958
|
-
}
|
|
14959
|
-
add(key, value) {
|
|
14960
|
-
this.cacheStorage.add(key, value);
|
|
14961
|
-
}
|
|
14962
|
-
get(key) {
|
|
14963
|
-
return this.cacheStorage.get(key);
|
|
14964
|
-
}
|
|
14965
|
-
delete(key) {
|
|
14966
|
-
this.cacheStorage.delete(key);
|
|
14967
|
-
}
|
|
14968
|
-
has(key) {
|
|
14969
|
-
return this.cacheStorage.has(key);
|
|
14970
|
-
}
|
|
14971
|
-
};
|
|
14972
|
-
|
|
14973
14854
|
// src/components/DataSource/BooleanCollectionState.ts
|
|
14974
14855
|
var BooleanCollectionState = class {
|
|
14975
14856
|
constructor(state) {
|
|
@@ -15167,6 +15048,136 @@ var RowDetailState = class extends BooleanCollectionState {
|
|
|
15167
15048
|
}
|
|
15168
15049
|
};
|
|
15169
15050
|
|
|
15051
|
+
// src/utils/FixedSizeMap.ts
|
|
15052
|
+
var _FixedSizeMap = class {
|
|
15053
|
+
constructor(clone, size) {
|
|
15054
|
+
this.keysInOrder = [];
|
|
15055
|
+
if (typeof clone === "number") {
|
|
15056
|
+
this.maxSize = clone;
|
|
15057
|
+
this.currentMap = /* @__PURE__ */ new Map();
|
|
15058
|
+
} else {
|
|
15059
|
+
this.maxSize = size != null ? size : _FixedSizeMap.DEFAULT_SIZE;
|
|
15060
|
+
if (clone) {
|
|
15061
|
+
const arr = Array.from(clone);
|
|
15062
|
+
if (this.maxSize < arr.length) {
|
|
15063
|
+
arr.slice(arr.length - this.maxSize);
|
|
15064
|
+
}
|
|
15065
|
+
this.currentMap = /* @__PURE__ */ new Map();
|
|
15066
|
+
arr.forEach(([k, v]) => {
|
|
15067
|
+
this.set(k, v);
|
|
15068
|
+
});
|
|
15069
|
+
} else {
|
|
15070
|
+
this.currentMap = /* @__PURE__ */ new Map();
|
|
15071
|
+
}
|
|
15072
|
+
}
|
|
15073
|
+
}
|
|
15074
|
+
values() {
|
|
15075
|
+
return this.currentMap.values();
|
|
15076
|
+
}
|
|
15077
|
+
get size() {
|
|
15078
|
+
return this.currentMap.size;
|
|
15079
|
+
}
|
|
15080
|
+
delete(key) {
|
|
15081
|
+
if (this.currentMap.has(key)) {
|
|
15082
|
+
this.currentMap.delete(key);
|
|
15083
|
+
this.keysInOrder = this.keysInOrder.filter((k) => k !== key);
|
|
15084
|
+
return true;
|
|
15085
|
+
}
|
|
15086
|
+
return false;
|
|
15087
|
+
}
|
|
15088
|
+
has(key) {
|
|
15089
|
+
return this.currentMap.has(key);
|
|
15090
|
+
}
|
|
15091
|
+
get(key) {
|
|
15092
|
+
return this.currentMap.get(key);
|
|
15093
|
+
}
|
|
15094
|
+
set(key, el) {
|
|
15095
|
+
if (this.has(key)) {
|
|
15096
|
+
this.delete(key);
|
|
15097
|
+
}
|
|
15098
|
+
const canAddCount = this.maxSize - this.currentMap.size;
|
|
15099
|
+
if (canAddCount <= 0) {
|
|
15100
|
+
const [removedKey] = this.keysInOrder.splice(0, 1);
|
|
15101
|
+
if (removedKey != void 0) {
|
|
15102
|
+
this.currentMap.delete(removedKey);
|
|
15103
|
+
}
|
|
15104
|
+
}
|
|
15105
|
+
this.keysInOrder.push(key);
|
|
15106
|
+
this.currentMap.set(key, el);
|
|
15107
|
+
return this;
|
|
15108
|
+
}
|
|
15109
|
+
};
|
|
15110
|
+
var FixedSizeMap = _FixedSizeMap;
|
|
15111
|
+
FixedSizeMap.DEFAULT_SIZE = 10;
|
|
15112
|
+
|
|
15113
|
+
// src/components/DataSource/RowDetailCache.ts
|
|
15114
|
+
var RowDetailNoCacheStorage = class {
|
|
15115
|
+
add(_key, _value) {
|
|
15116
|
+
return;
|
|
15117
|
+
}
|
|
15118
|
+
get(_key) {
|
|
15119
|
+
return void 0;
|
|
15120
|
+
}
|
|
15121
|
+
delete(_key) {
|
|
15122
|
+
return;
|
|
15123
|
+
}
|
|
15124
|
+
has(_key) {
|
|
15125
|
+
return false;
|
|
15126
|
+
}
|
|
15127
|
+
};
|
|
15128
|
+
var RowDetailFixedSizeCacheStorage = class {
|
|
15129
|
+
constructor(maxSize) {
|
|
15130
|
+
this.storage = new FixedSizeMap(maxSize);
|
|
15131
|
+
}
|
|
15132
|
+
add(key, value) {
|
|
15133
|
+
this.storage.set(key, value);
|
|
15134
|
+
}
|
|
15135
|
+
get(key) {
|
|
15136
|
+
return this.storage.get(key);
|
|
15137
|
+
}
|
|
15138
|
+
delete(key) {
|
|
15139
|
+
this.storage.delete(key);
|
|
15140
|
+
}
|
|
15141
|
+
has(key) {
|
|
15142
|
+
return this.storage.has(key);
|
|
15143
|
+
}
|
|
15144
|
+
};
|
|
15145
|
+
var RowDetailFullCacheStorage = class {
|
|
15146
|
+
constructor() {
|
|
15147
|
+
this.storage = /* @__PURE__ */ new Map();
|
|
15148
|
+
}
|
|
15149
|
+
add(key, value) {
|
|
15150
|
+
this.storage.set(key, value);
|
|
15151
|
+
}
|
|
15152
|
+
get(key) {
|
|
15153
|
+
return this.storage.get(key);
|
|
15154
|
+
}
|
|
15155
|
+
delete(key) {
|
|
15156
|
+
this.storage.delete(key);
|
|
15157
|
+
}
|
|
15158
|
+
has(key) {
|
|
15159
|
+
return this.storage.has(key);
|
|
15160
|
+
}
|
|
15161
|
+
};
|
|
15162
|
+
var RowDetailCache = class {
|
|
15163
|
+
// public instanceIndex: number = 0;
|
|
15164
|
+
constructor(cache) {
|
|
15165
|
+
this.cacheStorage = cache === false ? new RowDetailNoCacheStorage() : cache === true ? new RowDetailFullCacheStorage() : typeof cache === "number" ? new RowDetailFixedSizeCacheStorage(cache) : new RowDetailFixedSizeCacheStorage(5);
|
|
15166
|
+
}
|
|
15167
|
+
add(key, value) {
|
|
15168
|
+
this.cacheStorage.add(key, value);
|
|
15169
|
+
}
|
|
15170
|
+
get(key) {
|
|
15171
|
+
return this.cacheStorage.get(key);
|
|
15172
|
+
}
|
|
15173
|
+
delete(key) {
|
|
15174
|
+
this.cacheStorage.delete(key);
|
|
15175
|
+
}
|
|
15176
|
+
has(key) {
|
|
15177
|
+
return this.cacheStorage.has(key);
|
|
15178
|
+
}
|
|
15179
|
+
};
|
|
15180
|
+
|
|
15170
15181
|
// src/components/DataSource/types.ts
|
|
15171
15182
|
var DataSourceActionType = /* @__PURE__ */ ((DataSourceActionType2) => {
|
|
15172
15183
|
DataSourceActionType2["INIT"] = "INIT";
|
|
@@ -16838,6 +16849,12 @@ function useCellRendering(param) {
|
|
|
16838
16849
|
scrollTopMaxRef.current = brain.scrollTopMax;
|
|
16839
16850
|
});
|
|
16840
16851
|
}, [brain]);
|
|
16852
|
+
useEffect22(() => {
|
|
16853
|
+
return brain.onRenderRangeChange((range) => {
|
|
16854
|
+
var _a, _b;
|
|
16855
|
+
(_b = (_a = getState()).onRenderRangeChange) == null ? void 0 : _b.call(_a, range);
|
|
16856
|
+
});
|
|
16857
|
+
}, [brain]);
|
|
16841
16858
|
useEffect22(() => {
|
|
16842
16859
|
return brain.onScrollStop((scrollPosition) => {
|
|
16843
16860
|
const { scrollTop: scrollTop2, scrollLeft: scrollLeft2 } = scrollPosition;
|
|
@@ -17439,6 +17456,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
17439
17456
|
onBlurWithin: 1,
|
|
17440
17457
|
onContextMenu: 1,
|
|
17441
17458
|
onCellContextMenu: 1,
|
|
17459
|
+
onRenderRangeChange: 1,
|
|
17442
17460
|
onScrollToTop: 1,
|
|
17443
17461
|
onScrollToBottom: 1,
|
|
17444
17462
|
onScrollStop: 1,
|
|
@@ -18797,7 +18815,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18797
18815
|
}
|
|
18798
18816
|
let valid2 = isValidLicense(licenseKey, {
|
|
18799
18817
|
publishedAt: 1624970570587,
|
|
18800
|
-
version: "4.3.
|
|
18818
|
+
version: "4.3.5"
|
|
18801
18819
|
});
|
|
18802
18820
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18803
18821
|
return true;
|
|
@@ -22524,7 +22542,8 @@ function InfiniteTableBody() {
|
|
|
22524
22542
|
components: components2,
|
|
22525
22543
|
bodySize,
|
|
22526
22544
|
activeCellIndex,
|
|
22527
|
-
rowDetailRenderer
|
|
22545
|
+
rowDetailRenderer,
|
|
22546
|
+
showHoverRows
|
|
22528
22547
|
} = componentState;
|
|
22529
22548
|
const LoadMaskCmp = (_a = components2 == null ? void 0 : components2.LoadMask) != null ? _a : LoadMask;
|
|
22530
22549
|
const computed = getComputed();
|
|
@@ -22592,7 +22611,7 @@ function InfiniteTableBody() {
|
|
|
22592
22611
|
activeCellRowHeight,
|
|
22593
22612
|
renderCell,
|
|
22594
22613
|
renderDetailRow: rowDetailRenderer ? renderDetailRow : void 0,
|
|
22595
|
-
cellHoverClassNames: HOVERED_CLASS_NAMES,
|
|
22614
|
+
cellHoverClassNames: showHoverRows ? HOVERED_CLASS_NAMES : void 0,
|
|
22596
22615
|
scrollerDOMRef
|
|
22597
22616
|
}
|
|
22598
22617
|
), /* @__PURE__ */ React68.createElement(LoadMaskCmp, { visible: loading }, loadingText));
|