-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unitedSchema JSON add requiredMode configuration (#150)
requiredMode:default, drip-form delete empty fieldData. requiredMode:empty, configure minLength、minItems keywords to verify required.
- Loading branch information
1 parent
4636dcf
commit 7e717ef
Showing
23 changed files
with
199 additions
and
108 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* @Author: jiangxiaowei | ||
* @Date: 2022-03-08 17:48:49 | ||
* @Last Modified by: jiangxiaowei | ||
* @Last Modified time: 2022-03-09 17:10:13 | ||
*/ | ||
|
||
import { createContext, useContext } from 'react' | ||
|
||
// 必填校验模式 default:必填同JSON schema reuqired关键字校验模式(会清空当前表单项) empty: 使用@jdfed/utils isEmpty判断(不会清空当前表单项) | ||
type RequiredMode = 'default' | 'empty' | ||
export const RequiredModeContext = createContext<RequiredMode>('default') | ||
|
||
// 返回上一次的value值 | ||
const useRequiredModeContext = (): RequiredMode => { | ||
const requiredMode = useContext(RequiredModeContext) | ||
return requiredMode | ||
} | ||
|
||
export default useRequiredModeContext |
Oops, something went wrong.