From cb3b422935e006e04c7ba701d4749672d30c89c4 Mon Sep 17 00:00:00 2001 From: catchonme Date: Tue, 20 Aug 2019 13:51:01 +0800 Subject: [PATCH 01/13] =?UTF-8?q?form=E5=A2=9E=E5=8A=A0trim=EF=BC=8CtreeSe?= =?UTF-8?q?lect=E5=A2=9E=E5=8A=A0maxLength/minLength?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tree.tsx | 11 +++++++++++ src/renderers/Form/TreeSelect.tsx | 6 +++++- src/renderers/Form/index.tsx | 9 +++++++-- src/store/form.ts | 5 +++++ src/store/formItem.ts | 11 +++++++++-- src/utils/helper.ts | 14 ++++++++++++++ 6 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/components/Tree.tsx b/src/components/Tree.tsx index 72f75280d..35eb260ac 100644 --- a/src/components/Tree.tsx +++ b/src/components/Tree.tsx @@ -51,6 +51,8 @@ interface TreeSelectorProps { rootValue?: any; cascade?: boolean; selfDisabledAffectChildren?: boolean; + minLength?: number; + maxLength?: number; } interface TreeSelectorState { @@ -292,6 +294,8 @@ export class TreeSelector extends React.Component= maxLength) + || (minLength && selfChecked && this.state.value.length <= minLength) + ) { + nodeDisabled = true; + } + const checkbox: JSX.Element | null = multiple ? (