@infinite-table/infinite-react 6.0.6 → 6.0.7
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.dev.js +31 -27
- package/index.dev.mjs +31 -27
- package/index.js +31 -27
- package/index.mjs +31 -27
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -12099,9 +12099,9 @@ function getRowInfoArray(getState) {
|
|
|
12099
12099
|
}
|
|
12100
12100
|
|
|
12101
12101
|
// src/components/DataSource/TreeApi.ts
|
|
12102
|
-
function cloneTreeSelection(
|
|
12102
|
+
function cloneTreeSelection(treeSelection2, stateOrGetState) {
|
|
12103
12103
|
return new TreeSelectionState(
|
|
12104
|
-
|
|
12104
|
+
treeSelection2,
|
|
12105
12105
|
treeSelectionStateConfigGetter(stateOrGetState)
|
|
12106
12106
|
);
|
|
12107
12107
|
}
|
|
@@ -12116,7 +12116,7 @@ function treeSelectionStateConfigGetter(stateOrStateGetter) {
|
|
|
12116
12116
|
var TreeApiImpl = class {
|
|
12117
12117
|
constructor(param) {
|
|
12118
12118
|
this.setNodeSelection = (nodePath, selected) => {
|
|
12119
|
-
const { treeSelectionState:
|
|
12119
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12120
12120
|
if (selectionMode === "single-row") {
|
|
12121
12121
|
this.actions.treeSelection = selected ? nodePath[nodePath.length - 1] : null;
|
|
12122
12122
|
return;
|
|
@@ -12124,11 +12124,11 @@ var TreeApiImpl = class {
|
|
|
12124
12124
|
if (selectionMode !== "multi-row") {
|
|
12125
12125
|
throw "Selection mode is not multi-row or single-row";
|
|
12126
12126
|
}
|
|
12127
|
-
if (!(
|
|
12127
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12128
12128
|
throw "Invalid tree selection";
|
|
12129
12129
|
}
|
|
12130
12130
|
const treeSelectionState = new TreeSelectionState(
|
|
12131
|
-
|
|
12131
|
+
treeSelection2,
|
|
12132
12132
|
treeSelectionStateConfigGetter(this.getState)
|
|
12133
12133
|
);
|
|
12134
12134
|
treeSelectionState.setNodeSelection(nodePath, selected);
|
|
@@ -12251,15 +12251,15 @@ var TreeApiImpl = class {
|
|
|
12251
12251
|
return null;
|
|
12252
12252
|
}
|
|
12253
12253
|
selectAll() {
|
|
12254
|
-
const { treeSelectionState:
|
|
12254
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12255
12255
|
if (selectionMode !== "multi-row") {
|
|
12256
12256
|
throw "Selection mode is not multi-row";
|
|
12257
12257
|
}
|
|
12258
|
-
if (!(
|
|
12258
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12259
12259
|
throw "Invalid node selection";
|
|
12260
12260
|
}
|
|
12261
12261
|
const treeSelectionState = new TreeSelectionState(
|
|
12262
|
-
|
|
12262
|
+
treeSelection2,
|
|
12263
12263
|
treeSelectionStateConfigGetter(this.getState)
|
|
12264
12264
|
);
|
|
12265
12265
|
treeSelectionState.selectAll();
|
|
@@ -12267,15 +12267,15 @@ var TreeApiImpl = class {
|
|
|
12267
12267
|
this.actions.treeSelection = treeSelectionState;
|
|
12268
12268
|
}
|
|
12269
12269
|
deselectAll() {
|
|
12270
|
-
const { treeSelectionState:
|
|
12270
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12271
12271
|
if (selectionMode !== "multi-row") {
|
|
12272
12272
|
throw "Selection mode is not multi-row";
|
|
12273
12273
|
}
|
|
12274
|
-
if (!(
|
|
12274
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12275
12275
|
throw "Invalid node selection";
|
|
12276
12276
|
}
|
|
12277
12277
|
const treeSelectionState = new TreeSelectionState(
|
|
12278
|
-
|
|
12278
|
+
treeSelection2,
|
|
12279
12279
|
treeSelectionStateConfigGetter(this.getState)
|
|
12280
12280
|
);
|
|
12281
12281
|
treeSelectionState.deselectAll();
|
|
@@ -12283,21 +12283,25 @@ var TreeApiImpl = class {
|
|
|
12283
12283
|
this.actions.treeSelection = treeSelectionState;
|
|
12284
12284
|
}
|
|
12285
12285
|
isNodeSelected(nodePath) {
|
|
12286
|
-
const {
|
|
12286
|
+
const {
|
|
12287
|
+
treeSelectionState,
|
|
12288
|
+
treeSelection: singleTreeSelection,
|
|
12289
|
+
selectionMode
|
|
12290
|
+
} = this.getState();
|
|
12287
12291
|
if (selectionMode === "single-row") {
|
|
12288
12292
|
const pk = nodePath[nodePath.length - 1];
|
|
12289
|
-
if (Array.isArray(
|
|
12293
|
+
if (Array.isArray(singleTreeSelection)) {
|
|
12290
12294
|
return treeSelection.join(",") === nodePath.join(",");
|
|
12291
12295
|
}
|
|
12292
|
-
return
|
|
12296
|
+
return singleTreeSelection === pk;
|
|
12293
12297
|
}
|
|
12294
12298
|
if (selectionMode !== "multi-row") {
|
|
12295
12299
|
throw "Selection mode is not multi-row or single-row";
|
|
12296
12300
|
}
|
|
12297
|
-
if (!(
|
|
12301
|
+
if (!(treeSelectionState instanceof TreeSelectionState)) {
|
|
12298
12302
|
throw "Invalid tree selection";
|
|
12299
12303
|
}
|
|
12300
|
-
return
|
|
12304
|
+
return treeSelectionState.isNodeSelected(nodePath);
|
|
12301
12305
|
}
|
|
12302
12306
|
selectNode(nodePath) {
|
|
12303
12307
|
this.setNodeSelection(nodePath, true);
|
|
@@ -12817,10 +12821,10 @@ function getMappedCallbacks() {
|
|
|
12817
12821
|
]
|
|
12818
12822
|
};
|
|
12819
12823
|
},
|
|
12820
|
-
treeSelection: (
|
|
12824
|
+
treeSelection: (treeSelection2, state) => {
|
|
12821
12825
|
if (state.selectionMode === "single-row") {
|
|
12822
12826
|
const callbackParams2 = [
|
|
12823
|
-
|
|
12827
|
+
treeSelection2,
|
|
12824
12828
|
{ selectionMode: "single-row" }
|
|
12825
12829
|
];
|
|
12826
12830
|
return {
|
|
@@ -12828,7 +12832,7 @@ function getMappedCallbacks() {
|
|
|
12828
12832
|
};
|
|
12829
12833
|
}
|
|
12830
12834
|
const callbackParams = [
|
|
12831
|
-
|
|
12835
|
+
treeSelection2.getState(),
|
|
12832
12836
|
{
|
|
12833
12837
|
selectionMode: "multi-row",
|
|
12834
12838
|
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
@@ -22141,7 +22145,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
22141
22145
|
}
|
|
22142
22146
|
let valid2 = isValidLicense(licenseKey, {
|
|
22143
22147
|
publishedAt: 1624970570587,
|
|
22144
|
-
version: "6.0.
|
|
22148
|
+
version: "6.0.7"
|
|
22145
22149
|
});
|
|
22146
22150
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
22147
22151
|
return true;
|
|
@@ -22693,7 +22697,7 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22693
22697
|
selectionMode,
|
|
22694
22698
|
groupBy,
|
|
22695
22699
|
rowSelection,
|
|
22696
|
-
treeSelectionState:
|
|
22700
|
+
treeSelectionState: treeSelection2,
|
|
22697
22701
|
isTree
|
|
22698
22702
|
} = dataSourceState;
|
|
22699
22703
|
if (keyboardSelection === false) {
|
|
@@ -22712,9 +22716,9 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22712
22716
|
return false;
|
|
22713
22717
|
}
|
|
22714
22718
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
22715
|
-
if (isTree &&
|
|
22719
|
+
if (isTree && treeSelection2) {
|
|
22716
22720
|
const treeSelectionState = cloneTreeSelection2(
|
|
22717
|
-
|
|
22721
|
+
treeSelection2
|
|
22718
22722
|
);
|
|
22719
22723
|
treeSelectionState.selectAll();
|
|
22720
22724
|
dataSourceActions.treeSelection = treeSelectionState;
|
|
@@ -23116,8 +23120,8 @@ async function onKeyDown(context, event) {
|
|
|
23116
23120
|
cloneRowSelection: (rowSelection) => {
|
|
23117
23121
|
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
23118
23122
|
},
|
|
23119
|
-
cloneTreeSelection: (
|
|
23120
|
-
return cloneTreeSelection(
|
|
23123
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23124
|
+
return cloneTreeSelection(treeSelection2, context.getDataSourceState);
|
|
23121
23125
|
}
|
|
23122
23126
|
};
|
|
23123
23127
|
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
@@ -23196,8 +23200,8 @@ function useEventHandlersContext() {
|
|
|
23196
23200
|
actions,
|
|
23197
23201
|
getDataSourceState,
|
|
23198
23202
|
dataSourceActions,
|
|
23199
|
-
cloneTreeSelection: (
|
|
23200
|
-
return cloneTreeSelection(
|
|
23203
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23204
|
+
return cloneTreeSelection(treeSelection2, getDataSourceState);
|
|
23201
23205
|
},
|
|
23202
23206
|
cloneRowSelection: (rowSelection) => {
|
|
23203
23207
|
return cloneRowSelection(rowSelection, getDataSourceState);
|
package/index.dev.mjs
CHANGED
|
@@ -12048,9 +12048,9 @@ function getRowInfoArray(getState) {
|
|
|
12048
12048
|
}
|
|
12049
12049
|
|
|
12050
12050
|
// src/components/DataSource/TreeApi.ts
|
|
12051
|
-
function cloneTreeSelection(
|
|
12051
|
+
function cloneTreeSelection(treeSelection2, stateOrGetState) {
|
|
12052
12052
|
return new TreeSelectionState(
|
|
12053
|
-
|
|
12053
|
+
treeSelection2,
|
|
12054
12054
|
treeSelectionStateConfigGetter(stateOrGetState)
|
|
12055
12055
|
);
|
|
12056
12056
|
}
|
|
@@ -12065,7 +12065,7 @@ function treeSelectionStateConfigGetter(stateOrStateGetter) {
|
|
|
12065
12065
|
var TreeApiImpl = class {
|
|
12066
12066
|
constructor(param) {
|
|
12067
12067
|
this.setNodeSelection = (nodePath, selected) => {
|
|
12068
|
-
const { treeSelectionState:
|
|
12068
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12069
12069
|
if (selectionMode === "single-row") {
|
|
12070
12070
|
this.actions.treeSelection = selected ? nodePath[nodePath.length - 1] : null;
|
|
12071
12071
|
return;
|
|
@@ -12073,11 +12073,11 @@ var TreeApiImpl = class {
|
|
|
12073
12073
|
if (selectionMode !== "multi-row") {
|
|
12074
12074
|
throw "Selection mode is not multi-row or single-row";
|
|
12075
12075
|
}
|
|
12076
|
-
if (!(
|
|
12076
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12077
12077
|
throw "Invalid tree selection";
|
|
12078
12078
|
}
|
|
12079
12079
|
const treeSelectionState = new TreeSelectionState(
|
|
12080
|
-
|
|
12080
|
+
treeSelection2,
|
|
12081
12081
|
treeSelectionStateConfigGetter(this.getState)
|
|
12082
12082
|
);
|
|
12083
12083
|
treeSelectionState.setNodeSelection(nodePath, selected);
|
|
@@ -12200,15 +12200,15 @@ var TreeApiImpl = class {
|
|
|
12200
12200
|
return null;
|
|
12201
12201
|
}
|
|
12202
12202
|
selectAll() {
|
|
12203
|
-
const { treeSelectionState:
|
|
12203
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12204
12204
|
if (selectionMode !== "multi-row") {
|
|
12205
12205
|
throw "Selection mode is not multi-row";
|
|
12206
12206
|
}
|
|
12207
|
-
if (!(
|
|
12207
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12208
12208
|
throw "Invalid node selection";
|
|
12209
12209
|
}
|
|
12210
12210
|
const treeSelectionState = new TreeSelectionState(
|
|
12211
|
-
|
|
12211
|
+
treeSelection2,
|
|
12212
12212
|
treeSelectionStateConfigGetter(this.getState)
|
|
12213
12213
|
);
|
|
12214
12214
|
treeSelectionState.selectAll();
|
|
@@ -12216,15 +12216,15 @@ var TreeApiImpl = class {
|
|
|
12216
12216
|
this.actions.treeSelection = treeSelectionState;
|
|
12217
12217
|
}
|
|
12218
12218
|
deselectAll() {
|
|
12219
|
-
const { treeSelectionState:
|
|
12219
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12220
12220
|
if (selectionMode !== "multi-row") {
|
|
12221
12221
|
throw "Selection mode is not multi-row";
|
|
12222
12222
|
}
|
|
12223
|
-
if (!(
|
|
12223
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12224
12224
|
throw "Invalid node selection";
|
|
12225
12225
|
}
|
|
12226
12226
|
const treeSelectionState = new TreeSelectionState(
|
|
12227
|
-
|
|
12227
|
+
treeSelection2,
|
|
12228
12228
|
treeSelectionStateConfigGetter(this.getState)
|
|
12229
12229
|
);
|
|
12230
12230
|
treeSelectionState.deselectAll();
|
|
@@ -12232,21 +12232,25 @@ var TreeApiImpl = class {
|
|
|
12232
12232
|
this.actions.treeSelection = treeSelectionState;
|
|
12233
12233
|
}
|
|
12234
12234
|
isNodeSelected(nodePath) {
|
|
12235
|
-
const {
|
|
12235
|
+
const {
|
|
12236
|
+
treeSelectionState,
|
|
12237
|
+
treeSelection: singleTreeSelection,
|
|
12238
|
+
selectionMode
|
|
12239
|
+
} = this.getState();
|
|
12236
12240
|
if (selectionMode === "single-row") {
|
|
12237
12241
|
const pk = nodePath[nodePath.length - 1];
|
|
12238
|
-
if (Array.isArray(
|
|
12242
|
+
if (Array.isArray(singleTreeSelection)) {
|
|
12239
12243
|
return treeSelection.join(",") === nodePath.join(",");
|
|
12240
12244
|
}
|
|
12241
|
-
return
|
|
12245
|
+
return singleTreeSelection === pk;
|
|
12242
12246
|
}
|
|
12243
12247
|
if (selectionMode !== "multi-row") {
|
|
12244
12248
|
throw "Selection mode is not multi-row or single-row";
|
|
12245
12249
|
}
|
|
12246
|
-
if (!(
|
|
12250
|
+
if (!(treeSelectionState instanceof TreeSelectionState)) {
|
|
12247
12251
|
throw "Invalid tree selection";
|
|
12248
12252
|
}
|
|
12249
|
-
return
|
|
12253
|
+
return treeSelectionState.isNodeSelected(nodePath);
|
|
12250
12254
|
}
|
|
12251
12255
|
selectNode(nodePath) {
|
|
12252
12256
|
this.setNodeSelection(nodePath, true);
|
|
@@ -12766,10 +12770,10 @@ function getMappedCallbacks() {
|
|
|
12766
12770
|
]
|
|
12767
12771
|
};
|
|
12768
12772
|
},
|
|
12769
|
-
treeSelection: (
|
|
12773
|
+
treeSelection: (treeSelection2, state) => {
|
|
12770
12774
|
if (state.selectionMode === "single-row") {
|
|
12771
12775
|
const callbackParams2 = [
|
|
12772
|
-
|
|
12776
|
+
treeSelection2,
|
|
12773
12777
|
{ selectionMode: "single-row" }
|
|
12774
12778
|
];
|
|
12775
12779
|
return {
|
|
@@ -12777,7 +12781,7 @@ function getMappedCallbacks() {
|
|
|
12777
12781
|
};
|
|
12778
12782
|
}
|
|
12779
12783
|
const callbackParams = [
|
|
12780
|
-
|
|
12784
|
+
treeSelection2.getState(),
|
|
12781
12785
|
{
|
|
12782
12786
|
selectionMode: "multi-row",
|
|
12783
12787
|
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
@@ -22099,7 +22103,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
22099
22103
|
}
|
|
22100
22104
|
let valid2 = isValidLicense(licenseKey, {
|
|
22101
22105
|
publishedAt: 1624970570587,
|
|
22102
|
-
version: "6.0.
|
|
22106
|
+
version: "6.0.7"
|
|
22103
22107
|
});
|
|
22104
22108
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
22105
22109
|
return true;
|
|
@@ -22651,7 +22655,7 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22651
22655
|
selectionMode,
|
|
22652
22656
|
groupBy,
|
|
22653
22657
|
rowSelection,
|
|
22654
|
-
treeSelectionState:
|
|
22658
|
+
treeSelectionState: treeSelection2,
|
|
22655
22659
|
isTree
|
|
22656
22660
|
} = dataSourceState;
|
|
22657
22661
|
if (keyboardSelection === false) {
|
|
@@ -22670,9 +22674,9 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22670
22674
|
return false;
|
|
22671
22675
|
}
|
|
22672
22676
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
22673
|
-
if (isTree &&
|
|
22677
|
+
if (isTree && treeSelection2) {
|
|
22674
22678
|
const treeSelectionState = cloneTreeSelection2(
|
|
22675
|
-
|
|
22679
|
+
treeSelection2
|
|
22676
22680
|
);
|
|
22677
22681
|
treeSelectionState.selectAll();
|
|
22678
22682
|
dataSourceActions.treeSelection = treeSelectionState;
|
|
@@ -23074,8 +23078,8 @@ async function onKeyDown(context, event) {
|
|
|
23074
23078
|
cloneRowSelection: (rowSelection) => {
|
|
23075
23079
|
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
23076
23080
|
},
|
|
23077
|
-
cloneTreeSelection: (
|
|
23078
|
-
return cloneTreeSelection(
|
|
23081
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23082
|
+
return cloneTreeSelection(treeSelection2, context.getDataSourceState);
|
|
23079
23083
|
}
|
|
23080
23084
|
};
|
|
23081
23085
|
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
@@ -23154,8 +23158,8 @@ function useEventHandlersContext() {
|
|
|
23154
23158
|
actions,
|
|
23155
23159
|
getDataSourceState,
|
|
23156
23160
|
dataSourceActions,
|
|
23157
|
-
cloneTreeSelection: (
|
|
23158
|
-
return cloneTreeSelection(
|
|
23161
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23162
|
+
return cloneTreeSelection(treeSelection2, getDataSourceState);
|
|
23159
23163
|
},
|
|
23160
23164
|
cloneRowSelection: (rowSelection) => {
|
|
23161
23165
|
return cloneRowSelection(rowSelection, getDataSourceState);
|
package/index.js
CHANGED
|
@@ -12099,9 +12099,9 @@ function getRowInfoArray(getState) {
|
|
|
12099
12099
|
}
|
|
12100
12100
|
|
|
12101
12101
|
// src/components/DataSource/TreeApi.ts
|
|
12102
|
-
function cloneTreeSelection(
|
|
12102
|
+
function cloneTreeSelection(treeSelection2, stateOrGetState) {
|
|
12103
12103
|
return new TreeSelectionState(
|
|
12104
|
-
|
|
12104
|
+
treeSelection2,
|
|
12105
12105
|
treeSelectionStateConfigGetter(stateOrGetState)
|
|
12106
12106
|
);
|
|
12107
12107
|
}
|
|
@@ -12116,7 +12116,7 @@ function treeSelectionStateConfigGetter(stateOrStateGetter) {
|
|
|
12116
12116
|
var TreeApiImpl = class {
|
|
12117
12117
|
constructor(param) {
|
|
12118
12118
|
this.setNodeSelection = (nodePath, selected) => {
|
|
12119
|
-
const { treeSelectionState:
|
|
12119
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12120
12120
|
if (selectionMode === "single-row") {
|
|
12121
12121
|
this.actions.treeSelection = selected ? nodePath[nodePath.length - 1] : null;
|
|
12122
12122
|
return;
|
|
@@ -12124,11 +12124,11 @@ var TreeApiImpl = class {
|
|
|
12124
12124
|
if (selectionMode !== "multi-row") {
|
|
12125
12125
|
throw "Selection mode is not multi-row or single-row";
|
|
12126
12126
|
}
|
|
12127
|
-
if (!(
|
|
12127
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12128
12128
|
throw "Invalid tree selection";
|
|
12129
12129
|
}
|
|
12130
12130
|
const treeSelectionState = new TreeSelectionState(
|
|
12131
|
-
|
|
12131
|
+
treeSelection2,
|
|
12132
12132
|
treeSelectionStateConfigGetter(this.getState)
|
|
12133
12133
|
);
|
|
12134
12134
|
treeSelectionState.setNodeSelection(nodePath, selected);
|
|
@@ -12251,15 +12251,15 @@ var TreeApiImpl = class {
|
|
|
12251
12251
|
return null;
|
|
12252
12252
|
}
|
|
12253
12253
|
selectAll() {
|
|
12254
|
-
const { treeSelectionState:
|
|
12254
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12255
12255
|
if (selectionMode !== "multi-row") {
|
|
12256
12256
|
throw "Selection mode is not multi-row";
|
|
12257
12257
|
}
|
|
12258
|
-
if (!(
|
|
12258
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12259
12259
|
throw "Invalid node selection";
|
|
12260
12260
|
}
|
|
12261
12261
|
const treeSelectionState = new TreeSelectionState(
|
|
12262
|
-
|
|
12262
|
+
treeSelection2,
|
|
12263
12263
|
treeSelectionStateConfigGetter(this.getState)
|
|
12264
12264
|
);
|
|
12265
12265
|
treeSelectionState.selectAll();
|
|
@@ -12267,15 +12267,15 @@ var TreeApiImpl = class {
|
|
|
12267
12267
|
this.actions.treeSelection = treeSelectionState;
|
|
12268
12268
|
}
|
|
12269
12269
|
deselectAll() {
|
|
12270
|
-
const { treeSelectionState:
|
|
12270
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12271
12271
|
if (selectionMode !== "multi-row") {
|
|
12272
12272
|
throw "Selection mode is not multi-row";
|
|
12273
12273
|
}
|
|
12274
|
-
if (!(
|
|
12274
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12275
12275
|
throw "Invalid node selection";
|
|
12276
12276
|
}
|
|
12277
12277
|
const treeSelectionState = new TreeSelectionState(
|
|
12278
|
-
|
|
12278
|
+
treeSelection2,
|
|
12279
12279
|
treeSelectionStateConfigGetter(this.getState)
|
|
12280
12280
|
);
|
|
12281
12281
|
treeSelectionState.deselectAll();
|
|
@@ -12283,21 +12283,25 @@ var TreeApiImpl = class {
|
|
|
12283
12283
|
this.actions.treeSelection = treeSelectionState;
|
|
12284
12284
|
}
|
|
12285
12285
|
isNodeSelected(nodePath) {
|
|
12286
|
-
const {
|
|
12286
|
+
const {
|
|
12287
|
+
treeSelectionState,
|
|
12288
|
+
treeSelection: singleTreeSelection,
|
|
12289
|
+
selectionMode
|
|
12290
|
+
} = this.getState();
|
|
12287
12291
|
if (selectionMode === "single-row") {
|
|
12288
12292
|
const pk = nodePath[nodePath.length - 1];
|
|
12289
|
-
if (Array.isArray(
|
|
12293
|
+
if (Array.isArray(singleTreeSelection)) {
|
|
12290
12294
|
return treeSelection.join(",") === nodePath.join(",");
|
|
12291
12295
|
}
|
|
12292
|
-
return
|
|
12296
|
+
return singleTreeSelection === pk;
|
|
12293
12297
|
}
|
|
12294
12298
|
if (selectionMode !== "multi-row") {
|
|
12295
12299
|
throw "Selection mode is not multi-row or single-row";
|
|
12296
12300
|
}
|
|
12297
|
-
if (!(
|
|
12301
|
+
if (!(treeSelectionState instanceof TreeSelectionState)) {
|
|
12298
12302
|
throw "Invalid tree selection";
|
|
12299
12303
|
}
|
|
12300
|
-
return
|
|
12304
|
+
return treeSelectionState.isNodeSelected(nodePath);
|
|
12301
12305
|
}
|
|
12302
12306
|
selectNode(nodePath) {
|
|
12303
12307
|
this.setNodeSelection(nodePath, true);
|
|
@@ -12817,10 +12821,10 @@ function getMappedCallbacks() {
|
|
|
12817
12821
|
]
|
|
12818
12822
|
};
|
|
12819
12823
|
},
|
|
12820
|
-
treeSelection: (
|
|
12824
|
+
treeSelection: (treeSelection2, state) => {
|
|
12821
12825
|
if (state.selectionMode === "single-row") {
|
|
12822
12826
|
const callbackParams2 = [
|
|
12823
|
-
|
|
12827
|
+
treeSelection2,
|
|
12824
12828
|
{ selectionMode: "single-row" }
|
|
12825
12829
|
];
|
|
12826
12830
|
return {
|
|
@@ -12828,7 +12832,7 @@ function getMappedCallbacks() {
|
|
|
12828
12832
|
};
|
|
12829
12833
|
}
|
|
12830
12834
|
const callbackParams = [
|
|
12831
|
-
|
|
12835
|
+
treeSelection2.getState(),
|
|
12832
12836
|
{
|
|
12833
12837
|
selectionMode: "multi-row",
|
|
12834
12838
|
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
@@ -22141,7 +22145,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
22141
22145
|
}
|
|
22142
22146
|
let valid2 = isValidLicense(licenseKey, {
|
|
22143
22147
|
publishedAt: 1624970570587,
|
|
22144
|
-
version: "6.0.
|
|
22148
|
+
version: "6.0.7"
|
|
22145
22149
|
});
|
|
22146
22150
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
22147
22151
|
return true;
|
|
@@ -22693,7 +22697,7 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22693
22697
|
selectionMode,
|
|
22694
22698
|
groupBy,
|
|
22695
22699
|
rowSelection,
|
|
22696
|
-
treeSelectionState:
|
|
22700
|
+
treeSelectionState: treeSelection2,
|
|
22697
22701
|
isTree
|
|
22698
22702
|
} = dataSourceState;
|
|
22699
22703
|
if (keyboardSelection === false) {
|
|
@@ -22712,9 +22716,9 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22712
22716
|
return false;
|
|
22713
22717
|
}
|
|
22714
22718
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
22715
|
-
if (isTree &&
|
|
22719
|
+
if (isTree && treeSelection2) {
|
|
22716
22720
|
const treeSelectionState = cloneTreeSelection2(
|
|
22717
|
-
|
|
22721
|
+
treeSelection2
|
|
22718
22722
|
);
|
|
22719
22723
|
treeSelectionState.selectAll();
|
|
22720
22724
|
dataSourceActions.treeSelection = treeSelectionState;
|
|
@@ -23116,8 +23120,8 @@ async function onKeyDown(context, event) {
|
|
|
23116
23120
|
cloneRowSelection: (rowSelection) => {
|
|
23117
23121
|
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
23118
23122
|
},
|
|
23119
|
-
cloneTreeSelection: (
|
|
23120
|
-
return cloneTreeSelection(
|
|
23123
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23124
|
+
return cloneTreeSelection(treeSelection2, context.getDataSourceState);
|
|
23121
23125
|
}
|
|
23122
23126
|
};
|
|
23123
23127
|
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
@@ -23196,8 +23200,8 @@ function useEventHandlersContext() {
|
|
|
23196
23200
|
actions,
|
|
23197
23201
|
getDataSourceState,
|
|
23198
23202
|
dataSourceActions,
|
|
23199
|
-
cloneTreeSelection: (
|
|
23200
|
-
return cloneTreeSelection(
|
|
23203
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23204
|
+
return cloneTreeSelection(treeSelection2, getDataSourceState);
|
|
23201
23205
|
},
|
|
23202
23206
|
cloneRowSelection: (rowSelection) => {
|
|
23203
23207
|
return cloneRowSelection(rowSelection, getDataSourceState);
|
package/index.mjs
CHANGED
|
@@ -12048,9 +12048,9 @@ function getRowInfoArray(getState) {
|
|
|
12048
12048
|
}
|
|
12049
12049
|
|
|
12050
12050
|
// src/components/DataSource/TreeApi.ts
|
|
12051
|
-
function cloneTreeSelection(
|
|
12051
|
+
function cloneTreeSelection(treeSelection2, stateOrGetState) {
|
|
12052
12052
|
return new TreeSelectionState(
|
|
12053
|
-
|
|
12053
|
+
treeSelection2,
|
|
12054
12054
|
treeSelectionStateConfigGetter(stateOrGetState)
|
|
12055
12055
|
);
|
|
12056
12056
|
}
|
|
@@ -12065,7 +12065,7 @@ function treeSelectionStateConfigGetter(stateOrStateGetter) {
|
|
|
12065
12065
|
var TreeApiImpl = class {
|
|
12066
12066
|
constructor(param) {
|
|
12067
12067
|
this.setNodeSelection = (nodePath, selected) => {
|
|
12068
|
-
const { treeSelectionState:
|
|
12068
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12069
12069
|
if (selectionMode === "single-row") {
|
|
12070
12070
|
this.actions.treeSelection = selected ? nodePath[nodePath.length - 1] : null;
|
|
12071
12071
|
return;
|
|
@@ -12073,11 +12073,11 @@ var TreeApiImpl = class {
|
|
|
12073
12073
|
if (selectionMode !== "multi-row") {
|
|
12074
12074
|
throw "Selection mode is not multi-row or single-row";
|
|
12075
12075
|
}
|
|
12076
|
-
if (!(
|
|
12076
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12077
12077
|
throw "Invalid tree selection";
|
|
12078
12078
|
}
|
|
12079
12079
|
const treeSelectionState = new TreeSelectionState(
|
|
12080
|
-
|
|
12080
|
+
treeSelection2,
|
|
12081
12081
|
treeSelectionStateConfigGetter(this.getState)
|
|
12082
12082
|
);
|
|
12083
12083
|
treeSelectionState.setNodeSelection(nodePath, selected);
|
|
@@ -12200,15 +12200,15 @@ var TreeApiImpl = class {
|
|
|
12200
12200
|
return null;
|
|
12201
12201
|
}
|
|
12202
12202
|
selectAll() {
|
|
12203
|
-
const { treeSelectionState:
|
|
12203
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12204
12204
|
if (selectionMode !== "multi-row") {
|
|
12205
12205
|
throw "Selection mode is not multi-row";
|
|
12206
12206
|
}
|
|
12207
|
-
if (!(
|
|
12207
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12208
12208
|
throw "Invalid node selection";
|
|
12209
12209
|
}
|
|
12210
12210
|
const treeSelectionState = new TreeSelectionState(
|
|
12211
|
-
|
|
12211
|
+
treeSelection2,
|
|
12212
12212
|
treeSelectionStateConfigGetter(this.getState)
|
|
12213
12213
|
);
|
|
12214
12214
|
treeSelectionState.selectAll();
|
|
@@ -12216,15 +12216,15 @@ var TreeApiImpl = class {
|
|
|
12216
12216
|
this.actions.treeSelection = treeSelectionState;
|
|
12217
12217
|
}
|
|
12218
12218
|
deselectAll() {
|
|
12219
|
-
const { treeSelectionState:
|
|
12219
|
+
const { treeSelectionState: treeSelection2, selectionMode } = this.getState();
|
|
12220
12220
|
if (selectionMode !== "multi-row") {
|
|
12221
12221
|
throw "Selection mode is not multi-row";
|
|
12222
12222
|
}
|
|
12223
|
-
if (!(
|
|
12223
|
+
if (!(treeSelection2 instanceof TreeSelectionState)) {
|
|
12224
12224
|
throw "Invalid node selection";
|
|
12225
12225
|
}
|
|
12226
12226
|
const treeSelectionState = new TreeSelectionState(
|
|
12227
|
-
|
|
12227
|
+
treeSelection2,
|
|
12228
12228
|
treeSelectionStateConfigGetter(this.getState)
|
|
12229
12229
|
);
|
|
12230
12230
|
treeSelectionState.deselectAll();
|
|
@@ -12232,21 +12232,25 @@ var TreeApiImpl = class {
|
|
|
12232
12232
|
this.actions.treeSelection = treeSelectionState;
|
|
12233
12233
|
}
|
|
12234
12234
|
isNodeSelected(nodePath) {
|
|
12235
|
-
const {
|
|
12235
|
+
const {
|
|
12236
|
+
treeSelectionState,
|
|
12237
|
+
treeSelection: singleTreeSelection,
|
|
12238
|
+
selectionMode
|
|
12239
|
+
} = this.getState();
|
|
12236
12240
|
if (selectionMode === "single-row") {
|
|
12237
12241
|
const pk = nodePath[nodePath.length - 1];
|
|
12238
|
-
if (Array.isArray(
|
|
12242
|
+
if (Array.isArray(singleTreeSelection)) {
|
|
12239
12243
|
return treeSelection.join(",") === nodePath.join(",");
|
|
12240
12244
|
}
|
|
12241
|
-
return
|
|
12245
|
+
return singleTreeSelection === pk;
|
|
12242
12246
|
}
|
|
12243
12247
|
if (selectionMode !== "multi-row") {
|
|
12244
12248
|
throw "Selection mode is not multi-row or single-row";
|
|
12245
12249
|
}
|
|
12246
|
-
if (!(
|
|
12250
|
+
if (!(treeSelectionState instanceof TreeSelectionState)) {
|
|
12247
12251
|
throw "Invalid tree selection";
|
|
12248
12252
|
}
|
|
12249
|
-
return
|
|
12253
|
+
return treeSelectionState.isNodeSelected(nodePath);
|
|
12250
12254
|
}
|
|
12251
12255
|
selectNode(nodePath) {
|
|
12252
12256
|
this.setNodeSelection(nodePath, true);
|
|
@@ -12766,10 +12770,10 @@ function getMappedCallbacks() {
|
|
|
12766
12770
|
]
|
|
12767
12771
|
};
|
|
12768
12772
|
},
|
|
12769
|
-
treeSelection: (
|
|
12773
|
+
treeSelection: (treeSelection2, state) => {
|
|
12770
12774
|
if (state.selectionMode === "single-row") {
|
|
12771
12775
|
const callbackParams2 = [
|
|
12772
|
-
|
|
12776
|
+
treeSelection2,
|
|
12773
12777
|
{ selectionMode: "single-row" }
|
|
12774
12778
|
];
|
|
12775
12779
|
return {
|
|
@@ -12777,7 +12781,7 @@ function getMappedCallbacks() {
|
|
|
12777
12781
|
};
|
|
12778
12782
|
}
|
|
12779
12783
|
const callbackParams = [
|
|
12780
|
-
|
|
12784
|
+
treeSelection2.getState(),
|
|
12781
12785
|
{
|
|
12782
12786
|
selectionMode: "multi-row",
|
|
12783
12787
|
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
@@ -22099,7 +22103,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
22099
22103
|
}
|
|
22100
22104
|
let valid2 = isValidLicense(licenseKey, {
|
|
22101
22105
|
publishedAt: 1624970570587,
|
|
22102
|
-
version: "6.0.
|
|
22106
|
+
version: "6.0.7"
|
|
22103
22107
|
});
|
|
22104
22108
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
22105
22109
|
return true;
|
|
@@ -22651,7 +22655,7 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22651
22655
|
selectionMode,
|
|
22652
22656
|
groupBy,
|
|
22653
22657
|
rowSelection,
|
|
22654
|
-
treeSelectionState:
|
|
22658
|
+
treeSelectionState: treeSelection2,
|
|
22655
22659
|
isTree
|
|
22656
22660
|
} = dataSourceState;
|
|
22657
22661
|
if (keyboardSelection === false) {
|
|
@@ -22670,9 +22674,9 @@ function handleKeyboardSelection(context, keyboardEvent) {
|
|
|
22670
22674
|
return false;
|
|
22671
22675
|
}
|
|
22672
22676
|
if (key === "a" && (ctrlKey || metaKey)) {
|
|
22673
|
-
if (isTree &&
|
|
22677
|
+
if (isTree && treeSelection2) {
|
|
22674
22678
|
const treeSelectionState = cloneTreeSelection2(
|
|
22675
|
-
|
|
22679
|
+
treeSelection2
|
|
22676
22680
|
);
|
|
22677
22681
|
treeSelectionState.selectAll();
|
|
22678
22682
|
dataSourceActions.treeSelection = treeSelectionState;
|
|
@@ -23074,8 +23078,8 @@ async function onKeyDown(context, event) {
|
|
|
23074
23078
|
cloneRowSelection: (rowSelection) => {
|
|
23075
23079
|
return cloneRowSelection(rowSelection, context.getDataSourceState);
|
|
23076
23080
|
},
|
|
23077
|
-
cloneTreeSelection: (
|
|
23078
|
-
return cloneTreeSelection(
|
|
23081
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23082
|
+
return cloneTreeSelection(treeSelection2, context.getDataSourceState);
|
|
23079
23083
|
}
|
|
23080
23084
|
};
|
|
23081
23085
|
if (handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
@@ -23154,8 +23158,8 @@ function useEventHandlersContext() {
|
|
|
23154
23158
|
actions,
|
|
23155
23159
|
getDataSourceState,
|
|
23156
23160
|
dataSourceActions,
|
|
23157
|
-
cloneTreeSelection: (
|
|
23158
|
-
return cloneTreeSelection(
|
|
23161
|
+
cloneTreeSelection: (treeSelection2) => {
|
|
23162
|
+
return cloneTreeSelection(treeSelection2, getDataSourceState);
|
|
23159
23163
|
},
|
|
23160
23164
|
cloneRowSelection: (rowSelection) => {
|
|
23161
23165
|
return cloneRowSelection(rowSelection, getDataSourceState);
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/infinite-table/infinite-react/issues"
|
|
27
27
|
},
|
|
28
|
-
"version": "6.0.
|
|
28
|
+
"version": "6.0.7",
|
|
29
29
|
"main": "index.js",
|
|
30
30
|
"module": "index.mjs",
|
|
31
31
|
"typings": "index.d.ts",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "Commercial & Open Source",
|
|
36
36
|
"//": "will be updated at build time",
|
|
37
|
-
"publishedAt":
|
|
37
|
+
"publishedAt": 1730215290304
|
|
38
38
|
}
|