@ishibashi0112/spreadsheet-grid-core 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/activeRowFollowController.cjs +1 -0
- package/dist/controllers/activeRowFollowController.d.ts +18 -0
- package/dist/controllers/activeRowFollowController.js +68 -0
- package/dist/controllers/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.js +17 -17
- package/dist/controllers/clipboardController.cjs +1 -1
- package/dist/controllers/clipboardController.d.ts +2 -0
- package/dist/controllers/clipboardController.js +74 -64
- package/dist/controllers/columnAutosizeRunner.cjs +1 -1
- package/dist/controllers/columnAutosizeRunner.js +10 -10
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.d.ts +1 -0
- package/dist/controllers/contextMenuController.js +12 -7
- package/dist/controllers/detailRowController.cjs +1 -0
- package/dist/controllers/detailRowController.d.ts +41 -0
- package/dist/controllers/detailRowController.js +96 -0
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.d.ts +1 -0
- package/dist/controllers/editController.js +106 -99
- package/dist/controllers/fillHandleController.cjs +1 -1
- package/dist/controllers/fillHandleController.js +78 -78
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.js +6 -6
- package/dist/controllers/findController.cjs +1 -1
- package/dist/controllers/findController.d.ts +1 -0
- package/dist/controllers/findController.js +16 -15
- package/dist/controllers/imeInputController.cjs +1 -1
- package/dist/controllers/imeInputController.js +65 -54
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +1 -0
- package/dist/controllers/keyboardController.js +113 -111
- package/dist/controllers/liveUiState.cjs +1 -0
- package/dist/controllers/liveUiState.d.ts +7 -0
- package/dist/controllers/liveUiState.js +4 -0
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +157 -156
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +1 -0
- package/dist/controllers/rowDragController.js +117 -104
- package/dist/controllers/scrollSyncController.cjs +1 -1
- package/dist/controllers/scrollSyncController.js +45 -43
- package/dist/controllers/serverSideRowModel.cjs +1 -1
- package/dist/controllers/serverSideRowModel.js +19 -19
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +1 -0
- package/dist/controllers/viewportSyncController.js +1 -1
- package/dist/engine/cellCommands.cjs +1 -0
- package/dist/engine/cellCommands.d.ts +27 -0
- package/dist/engine/cellCommands.js +89 -0
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.js +113 -113
- package/dist/engine/createGridEngine.cjs +3 -3
- package/dist/engine/createGridEngine.d.ts +2 -0
- package/dist/engine/createGridEngine.js +72 -70
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.js +4 -2
- package/dist/engine/fullFeatures.cjs +1 -1
- package/dist/engine/fullFeatures.js +6 -6
- package/dist/engine/gridApi.cjs +6 -6
- package/dist/engine/gridApi.d.ts +4 -0
- package/dist/engine/gridApi.js +208 -192
- package/dist/engine/notifiers.cjs +1 -1
- package/dist/engine/notifiers.d.ts +4 -0
- package/dist/engine/notifiers.js +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/locales/en.cjs +1 -1
- package/dist/locales/en.js +2 -0
- package/dist/logic/cellPlacement.cjs +1 -0
- package/dist/logic/cellPlacement.d.ts +22 -0
- package/dist/logic/cellPlacement.js +44 -0
- package/dist/logic/density.cjs +1 -0
- package/dist/logic/density.d.ts +5 -0
- package/dist/logic/density.js +17 -0
- package/dist/logic/detailRow.cjs +1 -1
- package/dist/logic/detailRow.d.ts +4 -0
- package/dist/logic/detailRow.js +10 -7
- package/dist/logic/domGuards.cjs +1 -1
- package/dist/logic/domGuards.d.ts +5 -0
- package/dist/logic/domGuards.js +8 -2
- package/dist/logic/editorKeys.cjs +1 -0
- package/dist/logic/editorKeys.d.ts +30 -0
- package/dist/logic/editorKeys.js +34 -0
- package/dist/logic/editorStart.cjs +1 -0
- package/dist/logic/editorStart.d.ts +7 -0
- package/dist/logic/editorStart.js +23 -0
- package/dist/logic/exportCsv.cjs +2 -2
- package/dist/logic/exportCsv.d.ts +2 -1
- package/dist/logic/exportCsv.js +13 -13
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +2 -1
- package/dist/logic/exportData.js +18 -18
- package/dist/logic/geometry.cjs +1 -1
- package/dist/logic/geometry.d.ts +2 -0
- package/dist/logic/geometry.js +41 -20
- package/dist/logic/gridBarSummary.cjs +1 -0
- package/dist/logic/gridBarSummary.d.ts +27 -0
- package/dist/logic/gridBarSummary.js +137 -0
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.d.ts +3 -2
- package/dist/logic/gridState.js +32 -23
- package/dist/logic/grouping.cjs +1 -1
- package/dist/logic/grouping.js +1 -1
- package/dist/logic/imeInput.cjs +1 -1
- package/dist/logic/imeInput.js +6 -4
- package/dist/logic/localeTextFeatures.cjs +1 -1
- package/dist/logic/localeTextFeatures.d.ts +4 -0
- package/dist/logic/localeTextFeatures.js +8 -5
- package/dist/logic/pasteFill.cjs +1 -0
- package/dist/logic/pasteFill.d.ts +2 -0
- package/dist/logic/pasteFill.js +25 -0
- package/dist/logic/selectEditorState.cjs +1 -1
- package/dist/logic/selectEditorState.d.ts +28 -2
- package/dist/logic/selectEditorState.js +29 -14
- package/dist/logic/selectionAggregates.cjs +1 -1
- package/dist/logic/selectionAggregates.js +2 -3
- package/dist/logic/validation.cjs +1 -1
- package/dist/logic/validation.d.ts +1 -1
- package/dist/logic/validation.js +21 -21
- package/dist/model/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +13 -0
- package/dist/model/gridActions.js +11 -0
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +128 -65
- package/dist/model/gridTypes.core.d.ts +172 -26
- package/dist/utils/editorVisibleBounds.cjs +1 -0
- package/dist/utils/editorVisibleBounds.d.ts +10 -0
- package/dist/utils/editorVisibleBounds.js +40 -0
- package/dist/utils/errorBubblePlacement.cjs +1 -0
- package/dist/utils/errorBubblePlacement.d.ts +8 -0
- package/dist/utils/errorBubblePlacement.js +26 -0
- package/dist/utils/gridVisibleBand.cjs +1 -0
- package/dist/utils/gridVisibleBand.d.ts +4 -0
- package/dist/utils/gridVisibleBand.js +24 -0
- package/dist/utils/multilineEditor.cjs +2 -0
- package/dist/utils/multilineEditor.d.ts +7 -0
- package/dist/utils/multilineEditor.js +22 -0
- package/dist/utils/scrollBottom.cjs +1 -0
- package/dist/utils/scrollBottom.d.ts +1 -0
- package/dist/utils/scrollBottom.js +4 -0
- package/dist/utils/topAlignedInput.cjs +1 -0
- package/dist/utils/topAlignedInput.d.ts +3 -0
- package/dist/utils/topAlignedInput.js +23 -0
- package/package.json +1 -1
|
@@ -62,7 +62,45 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
62
62
|
anchorRow: a
|
|
63
63
|
}
|
|
64
64
|
})), o;
|
|
65
|
-
}, c = (e, t) => {
|
|
65
|
+
}, c = (e, t, n) => {
|
|
66
|
+
let { activeCell: r, selection: i } = e;
|
|
67
|
+
if (r === null || r.row === t.row && r.col === t.col) return e;
|
|
68
|
+
let a = r.row, o = t.row, s = r.col === t.col, c = {
|
|
69
|
+
row: o,
|
|
70
|
+
col: t.col
|
|
71
|
+
}, l = {
|
|
72
|
+
type: "cell",
|
|
73
|
+
range: {
|
|
74
|
+
start: c,
|
|
75
|
+
end: c
|
|
76
|
+
}
|
|
77
|
+
}, u = (e, t) => n !== void 0 && n > 0 && Math.min(e, t) <= 0 && Math.max(e, t) >= n - 1, d = i;
|
|
78
|
+
if (i?.type === "cell") {
|
|
79
|
+
let { start: e, end: t } = i.range;
|
|
80
|
+
d = e.row === a && t.row === a && s ? {
|
|
81
|
+
type: "cell",
|
|
82
|
+
range: {
|
|
83
|
+
start: {
|
|
84
|
+
row: o,
|
|
85
|
+
col: e.col
|
|
86
|
+
},
|
|
87
|
+
end: {
|
|
88
|
+
row: o,
|
|
89
|
+
col: t.col
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} : u(e.row, t.row) && s ? i : l;
|
|
93
|
+
} else i?.type === "row" && (d = i.startRow === a && i.endRow === a ? {
|
|
94
|
+
type: "row",
|
|
95
|
+
startRow: o,
|
|
96
|
+
endRow: o
|
|
97
|
+
} : u(i.startRow, i.endRow) ? i : l);
|
|
98
|
+
return {
|
|
99
|
+
...e,
|
|
100
|
+
activeCell: c,
|
|
101
|
+
selection: d
|
|
102
|
+
};
|
|
103
|
+
}, l = (e, t) => {
|
|
66
104
|
let { activeCell: n, selection: r, dragState: i } = e;
|
|
67
105
|
if (t <= 0) {
|
|
68
106
|
let t = r !== null && r.type !== "row", a = i?.type === "selection" && i.selectionKind !== "row";
|
|
@@ -122,7 +160,7 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
122
160
|
anchorCol: a
|
|
123
161
|
}
|
|
124
162
|
})), o;
|
|
125
|
-
},
|
|
163
|
+
}, u = (e, t, n) => {
|
|
126
164
|
if (t === null) return e;
|
|
127
165
|
let r = new Set(n.map((e) => e.key)), i = new Set(t.filter((e) => !r.has(e.key)).map((e) => e.key));
|
|
128
166
|
if (i.size === 0) return e;
|
|
@@ -142,7 +180,7 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
142
180
|
...a,
|
|
143
181
|
sort: e.sort.filter((e) => !i.has(e.columnKey))
|
|
144
182
|
}), a;
|
|
145
|
-
},
|
|
183
|
+
}, d = () => ({
|
|
146
184
|
activeCell: null,
|
|
147
185
|
selection: null,
|
|
148
186
|
rowSelection: t(),
|
|
@@ -156,86 +194,86 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
156
194
|
sort: [],
|
|
157
195
|
collapsedGroupKeys: /* @__PURE__ */ new Set(),
|
|
158
196
|
expandedDetailRowKeys: /* @__PURE__ */ new Set()
|
|
159
|
-
}),
|
|
160
|
-
switch (
|
|
161
|
-
case "cell/activate": return
|
|
197
|
+
}), f = (t, d) => {
|
|
198
|
+
switch (d.type) {
|
|
199
|
+
case "cell/activate": return d.cell === t.activeCell || d.cell !== null && t.activeCell !== null && d.cell.row === t.activeCell.row && d.cell.col === t.activeCell.col ? t : {
|
|
162
200
|
...t,
|
|
163
|
-
activeCell:
|
|
201
|
+
activeCell: d.cell
|
|
164
202
|
};
|
|
165
203
|
case "selection/start": return {
|
|
166
204
|
...t,
|
|
167
|
-
activeCell:
|
|
205
|
+
activeCell: d.cell,
|
|
168
206
|
selection: {
|
|
169
207
|
type: "cell",
|
|
170
208
|
range: {
|
|
171
|
-
start:
|
|
172
|
-
end:
|
|
209
|
+
start: d.cell,
|
|
210
|
+
end: d.cell
|
|
173
211
|
}
|
|
174
212
|
},
|
|
175
213
|
dragState: {
|
|
176
214
|
type: "selection",
|
|
177
215
|
selectionKind: "cell",
|
|
178
|
-
anchor:
|
|
216
|
+
anchor: d.cell
|
|
179
217
|
}
|
|
180
218
|
};
|
|
181
219
|
case "rowSelection/start": return {
|
|
182
220
|
...t,
|
|
183
221
|
activeCell: {
|
|
184
|
-
row:
|
|
185
|
-
col: t.activeCell?.col ??
|
|
222
|
+
row: d.row,
|
|
223
|
+
col: t.activeCell?.col ?? d.col ?? 0
|
|
186
224
|
},
|
|
187
225
|
selection: {
|
|
188
226
|
type: "row",
|
|
189
|
-
startRow:
|
|
190
|
-
endRow:
|
|
227
|
+
startRow: d.row,
|
|
228
|
+
endRow: d.row
|
|
191
229
|
},
|
|
192
230
|
dragState: {
|
|
193
231
|
type: "selection",
|
|
194
232
|
selectionKind: "row",
|
|
195
|
-
anchorRow:
|
|
233
|
+
anchorRow: d.row
|
|
196
234
|
}
|
|
197
235
|
};
|
|
198
|
-
case "rowSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "row" || t.selection?.type === "row" && t.selection.endRow ===
|
|
236
|
+
case "rowSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "row" || t.selection?.type === "row" && t.selection.endRow === d.row ? t : {
|
|
199
237
|
...t,
|
|
200
238
|
selection: {
|
|
201
239
|
type: "row",
|
|
202
240
|
startRow: t.dragState.anchorRow,
|
|
203
|
-
endRow:
|
|
241
|
+
endRow: d.row
|
|
204
242
|
}
|
|
205
243
|
};
|
|
206
|
-
case "selection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "cell" || t.selection?.type === "cell" && t.selection.range.end.row ===
|
|
244
|
+
case "selection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "cell" || t.selection?.type === "cell" && t.selection.range.end.row === d.cell.row && t.selection.range.end.col === d.cell.col ? t : {
|
|
207
245
|
...t,
|
|
208
246
|
selection: {
|
|
209
247
|
type: "cell",
|
|
210
248
|
range: {
|
|
211
249
|
start: t.dragState.anchor,
|
|
212
|
-
end:
|
|
250
|
+
end: d.cell
|
|
213
251
|
}
|
|
214
252
|
}
|
|
215
253
|
};
|
|
216
254
|
case "columnSelection/start": return {
|
|
217
255
|
...t,
|
|
218
256
|
activeCell: {
|
|
219
|
-
row: t.activeCell?.row ??
|
|
220
|
-
col:
|
|
257
|
+
row: t.activeCell?.row ?? d.row ?? 0,
|
|
258
|
+
col: d.col
|
|
221
259
|
},
|
|
222
260
|
selection: {
|
|
223
261
|
type: "col",
|
|
224
|
-
startCol:
|
|
225
|
-
endCol:
|
|
262
|
+
startCol: d.col,
|
|
263
|
+
endCol: d.col
|
|
226
264
|
},
|
|
227
265
|
dragState: {
|
|
228
266
|
type: "selection",
|
|
229
267
|
selectionKind: "col",
|
|
230
|
-
anchorCol:
|
|
268
|
+
anchorCol: d.col
|
|
231
269
|
}
|
|
232
270
|
};
|
|
233
|
-
case "columnSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "col" || t.selection?.type === "col" && t.selection.endCol ===
|
|
271
|
+
case "columnSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "col" || t.selection?.type === "col" && t.selection.endCol === d.col ? t : {
|
|
234
272
|
...t,
|
|
235
273
|
selection: {
|
|
236
274
|
type: "col",
|
|
237
275
|
startCol: t.dragState.anchorCol,
|
|
238
|
-
endCol:
|
|
276
|
+
endCol: d.col
|
|
239
277
|
}
|
|
240
278
|
};
|
|
241
279
|
case "selection/end": return t.dragState?.type === "selection" ? {
|
|
@@ -247,15 +285,40 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
247
285
|
selection: null,
|
|
248
286
|
dragState: null
|
|
249
287
|
};
|
|
288
|
+
case "selection/followActiveRow": return t.activeCell === null ? t : c(t, {
|
|
289
|
+
row: d.row,
|
|
290
|
+
col: t.activeCell.col
|
|
291
|
+
}, d.rowCount);
|
|
292
|
+
case "selection/collapseToActiveCell": {
|
|
293
|
+
let { activeCell: e, selection: n } = t;
|
|
294
|
+
return e === null || n?.type === "cell" && n.range.start.row === e.row && n.range.end.row === e.row && n.range.start.col === e.col && n.range.end.col === e.col ? t : {
|
|
295
|
+
...t,
|
|
296
|
+
selection: {
|
|
297
|
+
type: "cell",
|
|
298
|
+
range: {
|
|
299
|
+
start: e,
|
|
300
|
+
end: e
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
}
|
|
250
305
|
case "selection/clampToRowCount": {
|
|
251
|
-
let e = s(t,
|
|
252
|
-
return
|
|
306
|
+
let e = s(t, d.rowCount);
|
|
307
|
+
return d.colCount === void 0 ? e : l(e, d.colCount);
|
|
253
308
|
}
|
|
254
309
|
case "edit/start": return {
|
|
255
310
|
...t,
|
|
256
|
-
editingCell:
|
|
257
|
-
activeCell:
|
|
311
|
+
editingCell: d.cell,
|
|
312
|
+
activeCell: d.cell
|
|
258
313
|
};
|
|
314
|
+
case "edit/retarget": {
|
|
315
|
+
let e = c(t, d.cell, d.rowCount), n = t.editingCell;
|
|
316
|
+
return n !== null && n.row === d.cell.row && n.col === d.cell.col && e === t ? t : {
|
|
317
|
+
...e,
|
|
318
|
+
editingCell: d.cell,
|
|
319
|
+
activeCell: e.activeCell ?? d.cell
|
|
320
|
+
};
|
|
321
|
+
}
|
|
259
322
|
case "edit/stop": return t.editingCell === null ? t : {
|
|
260
323
|
...t,
|
|
261
324
|
editingCell: null
|
|
@@ -264,16 +327,16 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
264
327
|
...t,
|
|
265
328
|
dragState: {
|
|
266
329
|
type: "columnResize",
|
|
267
|
-
columnKey:
|
|
268
|
-
startX:
|
|
269
|
-
startWidth:
|
|
270
|
-
minWidth:
|
|
271
|
-
maxWidth:
|
|
330
|
+
columnKey: d.columnKey,
|
|
331
|
+
startX: d.startX,
|
|
332
|
+
startWidth: d.startWidth,
|
|
333
|
+
minWidth: d.minWidth ?? a,
|
|
334
|
+
maxWidth: d.maxWidth ?? Infinity
|
|
272
335
|
}
|
|
273
336
|
};
|
|
274
337
|
case "column/resizeUpdate": {
|
|
275
338
|
if (t.dragState?.type !== "columnResize") return t;
|
|
276
|
-
let e = o(t.dragState.startWidth + (
|
|
339
|
+
let e = o(t.dragState.startWidth + (d.clientX - t.dragState.startX), t.dragState.minWidth, t.dragState.maxWidth);
|
|
277
340
|
return t.columnWidths[t.dragState.columnKey] === e ? t : {
|
|
278
341
|
...t,
|
|
279
342
|
columnWidths: {
|
|
@@ -290,44 +353,44 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
290
353
|
...t,
|
|
291
354
|
columnWidths: {
|
|
292
355
|
...t.columnWidths,
|
|
293
|
-
...
|
|
356
|
+
...d.widths
|
|
294
357
|
}
|
|
295
358
|
};
|
|
296
359
|
case "columnWidths/reset": return {
|
|
297
360
|
...t,
|
|
298
|
-
columnWidths:
|
|
361
|
+
columnWidths: d.widths
|
|
299
362
|
};
|
|
300
363
|
case "columnWidths/reconcile": {
|
|
301
|
-
let n = e(t.columnWidths,
|
|
302
|
-
return
|
|
364
|
+
let n = e(t.columnWidths, d.prevColumns, d.nextColumns);
|
|
365
|
+
return u(n === t.columnWidths ? t : {
|
|
303
366
|
...t,
|
|
304
367
|
columnWidths: n
|
|
305
|
-
},
|
|
368
|
+
}, d.prevColumns, d.nextColumns);
|
|
306
369
|
}
|
|
307
|
-
case "filter/setGlobal": return t.filters.globalText ===
|
|
370
|
+
case "filter/setGlobal": return t.filters.globalText === d.value ? t : {
|
|
308
371
|
...t,
|
|
309
372
|
filters: {
|
|
310
373
|
...t.filters,
|
|
311
|
-
globalText:
|
|
374
|
+
globalText: d.value
|
|
312
375
|
}
|
|
313
376
|
};
|
|
314
377
|
case "filter/setColumn": {
|
|
315
|
-
let e = t.filters.columnFilters[
|
|
316
|
-
return e !== void 0 && (e ===
|
|
378
|
+
let e = t.filters.columnFilters[d.columnKey];
|
|
379
|
+
return e !== void 0 && (e === d.value || r(e, d.value)) ? t : {
|
|
317
380
|
...t,
|
|
318
381
|
filters: {
|
|
319
382
|
...t.filters,
|
|
320
383
|
columnFilters: {
|
|
321
384
|
...t.filters.columnFilters,
|
|
322
|
-
[
|
|
385
|
+
[d.columnKey]: d.value
|
|
323
386
|
}
|
|
324
387
|
}
|
|
325
388
|
};
|
|
326
389
|
}
|
|
327
390
|
case "filter/clearColumn": {
|
|
328
|
-
if (!(
|
|
391
|
+
if (!(d.columnKey in t.filters.columnFilters)) return t;
|
|
329
392
|
let e = { ...t.filters.columnFilters };
|
|
330
|
-
return delete e[
|
|
393
|
+
return delete e[d.columnKey], {
|
|
331
394
|
...t,
|
|
332
395
|
filters: {
|
|
333
396
|
...t.filters,
|
|
@@ -344,60 +407,60 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
344
407
|
};
|
|
345
408
|
case "filter/setAll": return {
|
|
346
409
|
...t,
|
|
347
|
-
filters:
|
|
410
|
+
filters: d.filters
|
|
348
411
|
};
|
|
349
|
-
case "sort/set": return i(t.sort,
|
|
412
|
+
case "sort/set": return i(t.sort, d.entries) ? t : {
|
|
350
413
|
...t,
|
|
351
|
-
sort:
|
|
414
|
+
sort: d.entries
|
|
352
415
|
};
|
|
353
416
|
case "sort/clear": return t.sort.length === 0 ? t : {
|
|
354
417
|
...t,
|
|
355
418
|
sort: []
|
|
356
419
|
};
|
|
357
|
-
case "rowSelect/set": return n(t.rowSelection,
|
|
420
|
+
case "rowSelect/set": return n(t.rowSelection, d.state) ? t : {
|
|
358
421
|
...t,
|
|
359
|
-
rowSelection:
|
|
422
|
+
rowSelection: d.state
|
|
360
423
|
};
|
|
361
424
|
case "group/toggleCollapsed": {
|
|
362
425
|
let e = new Set(t.collapsedGroupKeys);
|
|
363
|
-
return e.has(
|
|
426
|
+
return e.has(d.groupKey) ? e.delete(d.groupKey) : e.add(d.groupKey), {
|
|
364
427
|
...t,
|
|
365
428
|
collapsedGroupKeys: e
|
|
366
429
|
};
|
|
367
430
|
}
|
|
368
431
|
case "group/setCollapsed": {
|
|
369
|
-
if (t.collapsedGroupKeys.has(
|
|
432
|
+
if (t.collapsedGroupKeys.has(d.groupKey) === d.collapsed) return t;
|
|
370
433
|
let e = new Set(t.collapsedGroupKeys);
|
|
371
|
-
return
|
|
434
|
+
return d.collapsed ? e.add(d.groupKey) : e.delete(d.groupKey), {
|
|
372
435
|
...t,
|
|
373
436
|
collapsedGroupKeys: e
|
|
374
437
|
};
|
|
375
438
|
}
|
|
376
|
-
case "group/setCollapsedKeys": return
|
|
439
|
+
case "group/setCollapsedKeys": return d.keys === t.collapsedGroupKeys || d.keys.size === 0 && t.collapsedGroupKeys.size === 0 ? t : {
|
|
377
440
|
...t,
|
|
378
|
-
collapsedGroupKeys:
|
|
441
|
+
collapsedGroupKeys: d.keys
|
|
379
442
|
};
|
|
380
443
|
case "detail/toggle": {
|
|
381
444
|
let e = new Set(t.expandedDetailRowKeys);
|
|
382
|
-
return e.has(
|
|
445
|
+
return e.has(d.rowKey) ? e.delete(d.rowKey) : e.add(d.rowKey), {
|
|
383
446
|
...t,
|
|
384
447
|
expandedDetailRowKeys: e
|
|
385
448
|
};
|
|
386
449
|
}
|
|
387
450
|
case "detail/setExpanded": {
|
|
388
|
-
if (t.expandedDetailRowKeys.has(
|
|
451
|
+
if (t.expandedDetailRowKeys.has(d.rowKey) === d.expanded) return t;
|
|
389
452
|
let e = new Set(t.expandedDetailRowKeys);
|
|
390
|
-
return
|
|
453
|
+
return d.expanded ? e.add(d.rowKey) : e.delete(d.rowKey), {
|
|
391
454
|
...t,
|
|
392
455
|
expandedDetailRowKeys: e
|
|
393
456
|
};
|
|
394
457
|
}
|
|
395
|
-
case "detail/setKeys": return
|
|
458
|
+
case "detail/setKeys": return d.keys === t.expandedDetailRowKeys || d.keys.size === 0 && t.expandedDetailRowKeys.size === 0 ? t : {
|
|
396
459
|
...t,
|
|
397
|
-
expandedDetailRowKeys:
|
|
460
|
+
expandedDetailRowKeys: d.keys
|
|
398
461
|
};
|
|
399
462
|
default: return t;
|
|
400
463
|
}
|
|
401
464
|
};
|
|
402
465
|
//#endregion
|
|
403
|
-
export {
|
|
466
|
+
export { d as createInitialGridUiState, f as gridUiReducer };
|