(input: GridSelection, offset: number)
| 166 | } |
| 167 | |
| 168 | function shiftSelection(input: GridSelection, offset: number): GridSelection { |
| 169 | if (input === undefined || offset === 0 || (input.columns.length === 0 && input.current === undefined)) |
| 170 | return input; |
| 171 | |
| 172 | return { |
| 173 | current: |
| 174 | input.current === undefined |
| 175 | ? undefined |
| 176 | : { |
| 177 | cell: [input.current.cell[0] + offset, input.current.cell[1]], |
| 178 | range: { |
| 179 | ...input.current.range, |
| 180 | x: input.current.range.x + offset, |
| 181 | }, |
| 182 | rangeStack: input.current.rangeStack.map(r => ({ |
| 183 | ...r, |
| 184 | x: r.x + offset, |
| 185 | })), |
| 186 | }, |
| 187 | rows: input.rows, |
| 188 | columns: input.columns.offset(offset), |
| 189 | }; |
| 190 | } |
| 191 | |
| 192 | /** |
| 193 | * @category DataEditor |
no test coverage detected
searching dependent graphs…