@ishibashi0112/spreadsheet-grid-core 1.0.1 → 1.1.0
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/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.js +4 -2
- package/dist/controllers/clipboardController.cjs +1 -2
- package/dist/controllers/clipboardController.d.ts +3 -0
- package/dist/controllers/clipboardController.js +78 -59
- package/dist/controllers/columnAutosizeRunner.cjs +1 -1
- package/dist/controllers/columnAutosizeRunner.d.ts +3 -1
- package/dist/controllers/columnAutosizeRunner.js +12 -10
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +146 -140
- package/dist/controllers/columnMenuController.cjs +1 -1
- package/dist/controllers/columnMenuController.js +71 -69
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.d.ts +4 -1
- package/dist/controllers/contextMenuController.js +55 -38
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.js +78 -78
- package/dist/controllers/escapeClaimController.cjs +1 -1
- package/dist/controllers/escapeClaimController.d.ts +1 -0
- package/dist/controllers/escapeClaimController.js +11 -5
- package/dist/controllers/fillHandleController.cjs +1 -1
- package/dist/controllers/fillHandleController.d.ts +1 -0
- package/dist/controllers/fillHandleController.js +148 -147
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.js +81 -77
- package/dist/controllers/findController.cjs +1 -1
- package/dist/controllers/findController.d.ts +1 -0
- package/dist/controllers/findController.js +36 -29
- package/dist/controllers/historyController.cjs +1 -1
- package/dist/controllers/historyController.d.ts +6 -0
- package/dist/controllers/historyController.js +79 -37
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +1 -0
- package/dist/controllers/keyboardController.js +116 -116
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +142 -142
- package/dist/controllers/popoverSupport.cjs +1 -1
- package/dist/controllers/popoverSupport.d.ts +1 -0
- package/dist/controllers/popoverSupport.js +17 -7
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +1 -0
- package/dist/controllers/rowDragController.js +151 -149
- package/dist/controllers/rowEnterController.cjs +1 -1
- package/dist/controllers/rowEnterController.d.ts +1 -0
- package/dist/controllers/rowEnterController.js +47 -42
- package/dist/controllers/toolPanelController.cjs +1 -1
- package/dist/controllers/toolPanelController.js +26 -14
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +85 -66
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +4 -1
- package/dist/controllers/viewportSyncController.js +89 -30
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.js +16 -9
- package/dist/engine/filterPopoverCommands.cjs +1 -1
- package/dist/engine/filterPopoverCommands.d.ts +2 -0
- package/dist/engine/filterPopoverCommands.js +15 -15
- package/dist/engine/fullFeatures.cjs +1 -1
- package/dist/engine/fullFeatures.js +17 -17
- package/dist/engine/gridApi.cjs +3 -3
- package/dist/engine/gridApi.d.ts +7 -2
- package/dist/engine/gridApi.js +16 -16
- package/dist/engine/rowSelectionCommands.cjs +1 -1
- package/dist/engine/rowSelectionCommands.d.ts +1 -0
- package/dist/engine/rowSelectionCommands.js +21 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -6
- package/dist/locales/en.cjs +1 -1
- package/dist/locales/en.js +10 -4
- package/dist/logic/autoScrollGeometry.cjs +1 -1
- package/dist/logic/autoScrollGeometry.d.ts +2 -0
- package/dist/logic/autoScrollGeometry.js +3 -3
- package/dist/logic/columnAutosize.cjs +1 -1
- package/dist/logic/columnAutosize.d.ts +8 -2
- package/dist/logic/columnAutosize.js +102 -87
- package/dist/logic/detailRow.cjs +1 -1
- package/dist/logic/detailRow.d.ts +4 -0
- package/dist/logic/detailRow.js +18 -15
- package/dist/logic/editorValues.cjs +1 -1
- package/dist/logic/editorValues.d.ts +1 -0
- package/dist/logic/editorValues.js +37 -34
- package/dist/logic/exportCsv.cjs +3 -3
- package/dist/logic/exportCsv.d.ts +3 -1
- package/dist/logic/exportCsv.js +22 -20
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +3 -1
- package/dist/logic/exportData.js +40 -36
- package/dist/logic/filterSummary.cjs +1 -1
- package/dist/logic/filterSummary.js +9 -2
- package/dist/logic/filtering.cjs +1 -1
- package/dist/logic/filtering.d.ts +2 -1
- package/dist/logic/filtering.js +16 -3
- package/dist/logic/find.cjs +1 -1
- package/dist/logic/find.d.ts +4 -3
- package/dist/logic/find.js +27 -13
- package/dist/logic/gridAsk.cjs +2 -2
- package/dist/logic/gridAsk.d.ts +7 -7
- package/dist/logic/gridAsk.js +140 -122
- package/dist/logic/gridAskLocaleText.cjs +1 -1
- package/dist/logic/gridAskLocaleText.d.ts +2 -0
- package/dist/logic/gridAskLocaleText.js +1 -0
- package/dist/logic/gridState.d.ts +2 -2
- package/dist/logic/groupExport.cjs +1 -1
- package/dist/logic/groupExport.js +28 -27
- package/dist/logic/grouping.cjs +1 -1
- package/dist/logic/grouping.d.ts +1 -0
- package/dist/logic/grouping.js +52 -41
- package/dist/logic/historyRebase.cjs +1 -0
- package/dist/logic/historyRebase.d.ts +5 -0
- package/dist/logic/historyRebase.js +36 -0
- package/dist/logic/localeText.cjs +1 -1
- package/dist/logic/localeText.d.ts +2 -0
- package/dist/logic/localeText.js +1 -0
- package/dist/logic/localeTextFeatures.cjs +1 -1
- package/dist/logic/localeTextFeatures.d.ts +4 -0
- package/dist/logic/localeTextFeatures.js +10 -7
- package/dist/logic/localeTextFilters.cjs +1 -1
- package/dist/logic/localeTextFilters.d.ts +1 -0
- package/dist/logic/localeTextFilters.js +1 -0
- package/dist/logic/localeTextPopups.cjs +1 -1
- package/dist/logic/localeTextPopups.d.ts +1 -0
- package/dist/logic/localeTextPopups.js +3 -2
- package/dist/logic/numberFilterCondition.cjs +1 -1
- package/dist/logic/numberFilterCondition.d.ts +1 -1
- package/dist/logic/numberFilterCondition.js +5 -5
- package/dist/logic/scrollTargets.cjs +1 -1
- package/dist/logic/scrollTargets.js +2 -2
- package/dist/logic/selectEditorState.cjs +1 -1
- package/dist/logic/selectEditorState.d.ts +1 -0
- package/dist/logic/selectEditorState.js +8 -1
- package/dist/logic/selectLabels.cjs +1 -0
- package/dist/logic/selectLabels.d.ts +3 -0
- package/dist/logic/selectLabels.js +41 -0
- package/dist/logic/valueFormatters.d.ts +5 -5
- package/dist/logic/valueParsers.cjs +1 -0
- package/dist/logic/valueParsers.d.ts +14 -0
- package/dist/logic/valueParsers.js +23 -0
- package/dist/logic/verticalGeometry.cjs +1 -1
- package/dist/logic/verticalGeometry.d.ts +1 -0
- package/dist/logic/verticalGeometry.js +12 -8
- package/dist/model/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +2 -1
- package/dist/model/gridActions.js +3 -2
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +145 -62
- package/dist/model/gridTypes.core.d.ts +492 -315
- package/dist/utils/clipboard.cjs +4 -6
- package/dist/utils/clipboard.d.ts +15 -2
- package/dist/utils/clipboard.js +103 -48
- package/dist/utils/popupContainer.cjs +1 -0
- package/dist/utils/popupContainer.d.ts +8 -0
- package/dist/utils/popupContainer.js +60 -0
- package/package.json +1 -1
|
@@ -62,7 +62,87 @@ 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 = () =>
|
|
65
|
+
}, c = (e, t) => {
|
|
66
|
+
let { activeCell: n, selection: r, dragState: i } = e;
|
|
67
|
+
if (t <= 0) {
|
|
68
|
+
let t = r !== null && r.type !== "row", a = i?.type === "selection" && i.selectionKind !== "row";
|
|
69
|
+
return n === null && !t && !a ? e : {
|
|
70
|
+
...e,
|
|
71
|
+
activeCell: null,
|
|
72
|
+
selection: t ? null : r,
|
|
73
|
+
dragState: a ? null : i
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
let a = t - 1, o = e;
|
|
77
|
+
if (n !== null && n.col > a && (o = {
|
|
78
|
+
...o,
|
|
79
|
+
activeCell: {
|
|
80
|
+
row: n.row,
|
|
81
|
+
col: a
|
|
82
|
+
}
|
|
83
|
+
}), r?.type === "cell") {
|
|
84
|
+
let { start: e, end: t } = r.range;
|
|
85
|
+
(e.col > a || t.col > a) && (o = {
|
|
86
|
+
...o,
|
|
87
|
+
selection: {
|
|
88
|
+
type: "cell",
|
|
89
|
+
range: {
|
|
90
|
+
start: {
|
|
91
|
+
row: e.row,
|
|
92
|
+
col: Math.min(e.col, a)
|
|
93
|
+
},
|
|
94
|
+
end: {
|
|
95
|
+
row: t.row,
|
|
96
|
+
col: Math.min(t.col, a)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
} else r?.type === "col" && (r.startCol > a || r.endCol > a) && (o = {
|
|
102
|
+
...o,
|
|
103
|
+
selection: {
|
|
104
|
+
type: "col",
|
|
105
|
+
startCol: Math.min(r.startCol, a),
|
|
106
|
+
endCol: Math.min(r.endCol, a)
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return i?.type === "selection" && (i.selectionKind === "cell" && i.anchor.col > a ? o = {
|
|
110
|
+
...o,
|
|
111
|
+
dragState: {
|
|
112
|
+
...i,
|
|
113
|
+
anchor: {
|
|
114
|
+
row: i.anchor.row,
|
|
115
|
+
col: a
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
} : i.selectionKind === "col" && i.anchorCol > a && (o = {
|
|
119
|
+
...o,
|
|
120
|
+
dragState: {
|
|
121
|
+
...i,
|
|
122
|
+
anchorCol: a
|
|
123
|
+
}
|
|
124
|
+
})), o;
|
|
125
|
+
}, l = (e, t, n) => {
|
|
126
|
+
if (t === null) return e;
|
|
127
|
+
let r = new Set(n.map((e) => e.key)), i = new Set(t.filter((e) => !r.has(e.key)).map((e) => e.key));
|
|
128
|
+
if (i.size === 0) return e;
|
|
129
|
+
let a = e, o = e.filters.columnFilters;
|
|
130
|
+
if (Object.keys(o).some((e) => i.has(e))) {
|
|
131
|
+
let e = {};
|
|
132
|
+
for (let [t, n] of Object.entries(o)) i.has(t) || (e[t] = n);
|
|
133
|
+
a = {
|
|
134
|
+
...a,
|
|
135
|
+
filters: {
|
|
136
|
+
...a.filters,
|
|
137
|
+
columnFilters: e
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return e.sort.some((e) => i.has(e.columnKey)) && (a = {
|
|
142
|
+
...a,
|
|
143
|
+
sort: e.sort.filter((e) => !i.has(e.columnKey))
|
|
144
|
+
}), a;
|
|
145
|
+
}, u = () => ({
|
|
66
146
|
activeCell: null,
|
|
67
147
|
selection: null,
|
|
68
148
|
rowSelection: t(),
|
|
@@ -76,86 +156,86 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
76
156
|
sort: [],
|
|
77
157
|
collapsedGroupKeys: /* @__PURE__ */ new Set(),
|
|
78
158
|
expandedDetailRowKeys: /* @__PURE__ */ new Set()
|
|
79
|
-
}),
|
|
80
|
-
switch (
|
|
81
|
-
case "cell/activate": return
|
|
159
|
+
}), d = (t, u) => {
|
|
160
|
+
switch (u.type) {
|
|
161
|
+
case "cell/activate": return u.cell === t.activeCell || u.cell !== null && t.activeCell !== null && u.cell.row === t.activeCell.row && u.cell.col === t.activeCell.col ? t : {
|
|
82
162
|
...t,
|
|
83
|
-
activeCell:
|
|
163
|
+
activeCell: u.cell
|
|
84
164
|
};
|
|
85
165
|
case "selection/start": return {
|
|
86
166
|
...t,
|
|
87
|
-
activeCell:
|
|
167
|
+
activeCell: u.cell,
|
|
88
168
|
selection: {
|
|
89
169
|
type: "cell",
|
|
90
170
|
range: {
|
|
91
|
-
start:
|
|
92
|
-
end:
|
|
171
|
+
start: u.cell,
|
|
172
|
+
end: u.cell
|
|
93
173
|
}
|
|
94
174
|
},
|
|
95
175
|
dragState: {
|
|
96
176
|
type: "selection",
|
|
97
177
|
selectionKind: "cell",
|
|
98
|
-
anchor:
|
|
178
|
+
anchor: u.cell
|
|
99
179
|
}
|
|
100
180
|
};
|
|
101
181
|
case "rowSelection/start": return {
|
|
102
182
|
...t,
|
|
103
183
|
activeCell: {
|
|
104
|
-
row:
|
|
105
|
-
col: t.activeCell?.col ??
|
|
184
|
+
row: u.row,
|
|
185
|
+
col: t.activeCell?.col ?? u.col ?? 0
|
|
106
186
|
},
|
|
107
187
|
selection: {
|
|
108
188
|
type: "row",
|
|
109
|
-
startRow:
|
|
110
|
-
endRow:
|
|
189
|
+
startRow: u.row,
|
|
190
|
+
endRow: u.row
|
|
111
191
|
},
|
|
112
192
|
dragState: {
|
|
113
193
|
type: "selection",
|
|
114
194
|
selectionKind: "row",
|
|
115
|
-
anchorRow:
|
|
195
|
+
anchorRow: u.row
|
|
116
196
|
}
|
|
117
197
|
};
|
|
118
|
-
case "rowSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "row" || t.selection?.type === "row" && t.selection.endRow ===
|
|
198
|
+
case "rowSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "row" || t.selection?.type === "row" && t.selection.endRow === u.row ? t : {
|
|
119
199
|
...t,
|
|
120
200
|
selection: {
|
|
121
201
|
type: "row",
|
|
122
202
|
startRow: t.dragState.anchorRow,
|
|
123
|
-
endRow:
|
|
203
|
+
endRow: u.row
|
|
124
204
|
}
|
|
125
205
|
};
|
|
126
|
-
case "selection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "cell" || t.selection?.type === "cell" && t.selection.range.end.row ===
|
|
206
|
+
case "selection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "cell" || t.selection?.type === "cell" && t.selection.range.end.row === u.cell.row && t.selection.range.end.col === u.cell.col ? t : {
|
|
127
207
|
...t,
|
|
128
208
|
selection: {
|
|
129
209
|
type: "cell",
|
|
130
210
|
range: {
|
|
131
211
|
start: t.dragState.anchor,
|
|
132
|
-
end:
|
|
212
|
+
end: u.cell
|
|
133
213
|
}
|
|
134
214
|
}
|
|
135
215
|
};
|
|
136
216
|
case "columnSelection/start": return {
|
|
137
217
|
...t,
|
|
138
218
|
activeCell: {
|
|
139
|
-
row: t.activeCell?.row ??
|
|
140
|
-
col:
|
|
219
|
+
row: t.activeCell?.row ?? u.row ?? 0,
|
|
220
|
+
col: u.col
|
|
141
221
|
},
|
|
142
222
|
selection: {
|
|
143
223
|
type: "col",
|
|
144
|
-
startCol:
|
|
145
|
-
endCol:
|
|
224
|
+
startCol: u.col,
|
|
225
|
+
endCol: u.col
|
|
146
226
|
},
|
|
147
227
|
dragState: {
|
|
148
228
|
type: "selection",
|
|
149
229
|
selectionKind: "col",
|
|
150
|
-
anchorCol:
|
|
230
|
+
anchorCol: u.col
|
|
151
231
|
}
|
|
152
232
|
};
|
|
153
|
-
case "columnSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "col" || t.selection?.type === "col" && t.selection.endCol ===
|
|
233
|
+
case "columnSelection/update": return t.dragState?.type !== "selection" || t.dragState.selectionKind !== "col" || t.selection?.type === "col" && t.selection.endCol === u.col ? t : {
|
|
154
234
|
...t,
|
|
155
235
|
selection: {
|
|
156
236
|
type: "col",
|
|
157
237
|
startCol: t.dragState.anchorCol,
|
|
158
|
-
endCol:
|
|
238
|
+
endCol: u.col
|
|
159
239
|
}
|
|
160
240
|
};
|
|
161
241
|
case "selection/end": return t.dragState?.type === "selection" ? {
|
|
@@ -167,11 +247,14 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
167
247
|
selection: null,
|
|
168
248
|
dragState: null
|
|
169
249
|
};
|
|
170
|
-
case "selection/clampToRowCount":
|
|
250
|
+
case "selection/clampToRowCount": {
|
|
251
|
+
let e = s(t, u.rowCount);
|
|
252
|
+
return u.colCount === void 0 ? e : c(e, u.colCount);
|
|
253
|
+
}
|
|
171
254
|
case "edit/start": return {
|
|
172
255
|
...t,
|
|
173
|
-
editingCell:
|
|
174
|
-
activeCell:
|
|
256
|
+
editingCell: u.cell,
|
|
257
|
+
activeCell: u.cell
|
|
175
258
|
};
|
|
176
259
|
case "edit/stop": return t.editingCell === null ? t : {
|
|
177
260
|
...t,
|
|
@@ -181,16 +264,16 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
181
264
|
...t,
|
|
182
265
|
dragState: {
|
|
183
266
|
type: "columnResize",
|
|
184
|
-
columnKey:
|
|
185
|
-
startX:
|
|
186
|
-
startWidth:
|
|
187
|
-
minWidth:
|
|
188
|
-
maxWidth:
|
|
267
|
+
columnKey: u.columnKey,
|
|
268
|
+
startX: u.startX,
|
|
269
|
+
startWidth: u.startWidth,
|
|
270
|
+
minWidth: u.minWidth ?? a,
|
|
271
|
+
maxWidth: u.maxWidth ?? Infinity
|
|
189
272
|
}
|
|
190
273
|
};
|
|
191
274
|
case "column/resizeUpdate": {
|
|
192
275
|
if (t.dragState?.type !== "columnResize") return t;
|
|
193
|
-
let e = o(t.dragState.startWidth + (
|
|
276
|
+
let e = o(t.dragState.startWidth + (u.clientX - t.dragState.startX), t.dragState.minWidth, t.dragState.maxWidth);
|
|
194
277
|
return t.columnWidths[t.dragState.columnKey] === e ? t : {
|
|
195
278
|
...t,
|
|
196
279
|
columnWidths: {
|
|
@@ -207,44 +290,44 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
207
290
|
...t,
|
|
208
291
|
columnWidths: {
|
|
209
292
|
...t.columnWidths,
|
|
210
|
-
...
|
|
293
|
+
...u.widths
|
|
211
294
|
}
|
|
212
295
|
};
|
|
213
296
|
case "columnWidths/reset": return {
|
|
214
297
|
...t,
|
|
215
|
-
columnWidths:
|
|
298
|
+
columnWidths: u.widths
|
|
216
299
|
};
|
|
217
300
|
case "columnWidths/reconcile": {
|
|
218
|
-
let n = e(t.columnWidths,
|
|
219
|
-
return n === t.columnWidths ? t : {
|
|
301
|
+
let n = e(t.columnWidths, u.prevColumns, u.nextColumns);
|
|
302
|
+
return l(n === t.columnWidths ? t : {
|
|
220
303
|
...t,
|
|
221
304
|
columnWidths: n
|
|
222
|
-
};
|
|
305
|
+
}, u.prevColumns, u.nextColumns);
|
|
223
306
|
}
|
|
224
|
-
case "filter/setGlobal": return t.filters.globalText ===
|
|
307
|
+
case "filter/setGlobal": return t.filters.globalText === u.value ? t : {
|
|
225
308
|
...t,
|
|
226
309
|
filters: {
|
|
227
310
|
...t.filters,
|
|
228
|
-
globalText:
|
|
311
|
+
globalText: u.value
|
|
229
312
|
}
|
|
230
313
|
};
|
|
231
314
|
case "filter/setColumn": {
|
|
232
|
-
let e = t.filters.columnFilters[
|
|
233
|
-
return e !== void 0 && (e ===
|
|
315
|
+
let e = t.filters.columnFilters[u.columnKey];
|
|
316
|
+
return e !== void 0 && (e === u.value || r(e, u.value)) ? t : {
|
|
234
317
|
...t,
|
|
235
318
|
filters: {
|
|
236
319
|
...t.filters,
|
|
237
320
|
columnFilters: {
|
|
238
321
|
...t.filters.columnFilters,
|
|
239
|
-
[
|
|
322
|
+
[u.columnKey]: u.value
|
|
240
323
|
}
|
|
241
324
|
}
|
|
242
325
|
};
|
|
243
326
|
}
|
|
244
327
|
case "filter/clearColumn": {
|
|
245
|
-
if (!(
|
|
328
|
+
if (!(u.columnKey in t.filters.columnFilters)) return t;
|
|
246
329
|
let e = { ...t.filters.columnFilters };
|
|
247
|
-
return delete e[
|
|
330
|
+
return delete e[u.columnKey], {
|
|
248
331
|
...t,
|
|
249
332
|
filters: {
|
|
250
333
|
...t.filters,
|
|
@@ -261,60 +344,60 @@ var a = 60, o = (e, t, n) => Math.min(Math.max(e, t), n), s = (e, t) => {
|
|
|
261
344
|
};
|
|
262
345
|
case "filter/setAll": return {
|
|
263
346
|
...t,
|
|
264
|
-
filters:
|
|
347
|
+
filters: u.filters
|
|
265
348
|
};
|
|
266
|
-
case "sort/set": return i(t.sort,
|
|
349
|
+
case "sort/set": return i(t.sort, u.entries) ? t : {
|
|
267
350
|
...t,
|
|
268
|
-
sort:
|
|
351
|
+
sort: u.entries
|
|
269
352
|
};
|
|
270
353
|
case "sort/clear": return t.sort.length === 0 ? t : {
|
|
271
354
|
...t,
|
|
272
355
|
sort: []
|
|
273
356
|
};
|
|
274
|
-
case "rowSelect/set": return n(t.rowSelection,
|
|
357
|
+
case "rowSelect/set": return n(t.rowSelection, u.state) ? t : {
|
|
275
358
|
...t,
|
|
276
|
-
rowSelection:
|
|
359
|
+
rowSelection: u.state
|
|
277
360
|
};
|
|
278
361
|
case "group/toggleCollapsed": {
|
|
279
362
|
let e = new Set(t.collapsedGroupKeys);
|
|
280
|
-
return e.has(
|
|
363
|
+
return e.has(u.groupKey) ? e.delete(u.groupKey) : e.add(u.groupKey), {
|
|
281
364
|
...t,
|
|
282
365
|
collapsedGroupKeys: e
|
|
283
366
|
};
|
|
284
367
|
}
|
|
285
368
|
case "group/setCollapsed": {
|
|
286
|
-
if (t.collapsedGroupKeys.has(
|
|
369
|
+
if (t.collapsedGroupKeys.has(u.groupKey) === u.collapsed) return t;
|
|
287
370
|
let e = new Set(t.collapsedGroupKeys);
|
|
288
|
-
return
|
|
371
|
+
return u.collapsed ? e.add(u.groupKey) : e.delete(u.groupKey), {
|
|
289
372
|
...t,
|
|
290
373
|
collapsedGroupKeys: e
|
|
291
374
|
};
|
|
292
375
|
}
|
|
293
|
-
case "group/setCollapsedKeys": return
|
|
376
|
+
case "group/setCollapsedKeys": return u.keys === t.collapsedGroupKeys || u.keys.size === 0 && t.collapsedGroupKeys.size === 0 ? t : {
|
|
294
377
|
...t,
|
|
295
|
-
collapsedGroupKeys:
|
|
378
|
+
collapsedGroupKeys: u.keys
|
|
296
379
|
};
|
|
297
380
|
case "detail/toggle": {
|
|
298
381
|
let e = new Set(t.expandedDetailRowKeys);
|
|
299
|
-
return e.has(
|
|
382
|
+
return e.has(u.rowKey) ? e.delete(u.rowKey) : e.add(u.rowKey), {
|
|
300
383
|
...t,
|
|
301
384
|
expandedDetailRowKeys: e
|
|
302
385
|
};
|
|
303
386
|
}
|
|
304
387
|
case "detail/setExpanded": {
|
|
305
|
-
if (t.expandedDetailRowKeys.has(
|
|
388
|
+
if (t.expandedDetailRowKeys.has(u.rowKey) === u.expanded) return t;
|
|
306
389
|
let e = new Set(t.expandedDetailRowKeys);
|
|
307
|
-
return
|
|
390
|
+
return u.expanded ? e.add(u.rowKey) : e.delete(u.rowKey), {
|
|
308
391
|
...t,
|
|
309
392
|
expandedDetailRowKeys: e
|
|
310
393
|
};
|
|
311
394
|
}
|
|
312
|
-
case "detail/setKeys": return
|
|
395
|
+
case "detail/setKeys": return u.keys === t.expandedDetailRowKeys || u.keys.size === 0 && t.expandedDetailRowKeys.size === 0 ? t : {
|
|
313
396
|
...t,
|
|
314
|
-
expandedDetailRowKeys:
|
|
397
|
+
expandedDetailRowKeys: u.keys
|
|
315
398
|
};
|
|
316
399
|
default: return t;
|
|
317
400
|
}
|
|
318
401
|
};
|
|
319
402
|
//#endregion
|
|
320
|
-
export {
|
|
403
|
+
export { u as createInitialGridUiState, d as gridUiReducer };
|