-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
903 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/erd-editor/src/engine/modules/index-column/actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Reducer } from '@dineug/r-html'; | ||
|
||
import { EngineContext } from '@/engine/context'; | ||
import { RootState } from '@/engine/state'; | ||
import { ValuesType } from '@/internal-types'; | ||
|
||
export const ActionType = { | ||
addIndexColumn: 'indexColumn.add', | ||
removeIndexColumn: 'indexColumn.remove', | ||
moveIndexColumn: 'indexColumn.move', | ||
changeIndexColumnOrderType: 'indexColumn.changeOrderType', | ||
} as const; | ||
export type ActionType = ValuesType<typeof ActionType>; | ||
|
||
export type ActionMap = { | ||
[ActionType.addIndexColumn]: { | ||
id: string; | ||
indexId: string; | ||
tableId: string; | ||
columnId: string; | ||
}; | ||
[ActionType.removeIndexColumn]: { | ||
id: string; | ||
indexId: string; | ||
tableId: string; | ||
}; | ||
[ActionType.moveIndexColumn]: { | ||
id: string; | ||
indexId: string; | ||
tableId: string; | ||
targetId: string; | ||
}; | ||
[ActionType.changeIndexColumnOrderType]: { | ||
id: string; | ||
indexId: string; | ||
columnId: string; | ||
value: number; | ||
}; | ||
}; | ||
|
||
export type ReducerType<T extends keyof ActionMap> = Reducer< | ||
RootState, | ||
T, | ||
ActionMap, | ||
EngineContext | ||
>; |
Oops, something went wrong.