- Slot-Nr.-Anzeige nach links im ActionBar verschoben. - Datum-Labels („Von“ & „Bis“) und Eingabefelder horizontal ausgerichtet. - Verbesserte UI/UX der Chart-Steuerungskomponenten.
40 lines
913 B
TypeScript
40 lines
913 B
TypeScript
// brushSlice.ts
|
|
import { createSlice } from "@reduxjs/toolkit";
|
|
|
|
interface BrushState {
|
|
startIndex: number;
|
|
endIndex: number;
|
|
startDate: string | null;
|
|
endDate: string | null;
|
|
}
|
|
|
|
const initialState: BrushState = {
|
|
startIndex: 0,
|
|
endIndex: 0,
|
|
startDate: null,
|
|
endDate: null,
|
|
};
|
|
|
|
const brushSlice = createSlice({
|
|
name: "brush",
|
|
initialState,
|
|
reducers: {
|
|
setBrushRange(state, action) {
|
|
state.startIndex = action.payload.startIndex;
|
|
state.endIndex = action.payload.endIndex;
|
|
state.startDate = action.payload.startDate || state.startDate;
|
|
state.endDate = action.payload.endDate || state.endDate;
|
|
},
|
|
resetBrushRange(state) {
|
|
state.startIndex = 0;
|
|
state.endIndex = 0;
|
|
state.startDate = null;
|
|
state.endDate = null;
|
|
},
|
|
},
|
|
});
|
|
|
|
export const { setBrushRange, resetBrushRange } = brushSlice.actions;
|
|
|
|
export default brushSlice.reducer;
|