Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
6138c036
Commit
6138c036
authored
Aug 07, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add hideCheckAll in TagSelect
parent
d2de675e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
src/components/TagSelect/index.d.ts
src/components/TagSelect/index.d.ts
+1
-0
src/components/TagSelect/index.js
src/components/TagSelect/index.js
+9
-4
src/components/TagSelect/index.md
src/components/TagSelect/index.md
+1
-1
No files found.
src/components/TagSelect/index.d.ts
View file @
6138c036
...
@@ -6,6 +6,7 @@ export interface ITagSelectProps {
...
@@ -6,6 +6,7 @@ export interface ITagSelectProps {
expandable
?:
boolean
;
expandable
?:
boolean
;
value
?:
string
[]
|
number
[];
value
?:
string
[]
|
number
[];
style
?:
React
.
CSSProperties
;
style
?:
React
.
CSSProperties
;
hideCheckAll
?:
boolean
;
}
}
export
default
class
TagSelect
extends
React
.
Component
<
ITagSelectProps
,
any
>
{
export
default
class
TagSelect
extends
React
.
Component
<
ITagSelectProps
,
any
>
{
...
...
src/components/TagSelect/index.js
View file @
6138c036
...
@@ -15,6 +15,9 @@ const TagSelectOption = ({ children, checked, onChange, value }) => (
...
@@ -15,6 +15,9 @@ const TagSelectOption = ({ children, checked, onChange, value }) => (
TagSelectOption
.
isTagSelectOption
=
true
;
TagSelectOption
.
isTagSelectOption
=
true
;
class
TagSelect
extends
Component
{
class
TagSelect
extends
Component
{
static
defaultProps
=
{
hideCheckAll
:
false
,
};
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
...
@@ -87,7 +90,7 @@ class TagSelect extends Component {
...
@@ -87,7 +90,7 @@ class TagSelect extends Component {
render
()
{
render
()
{
const
{
value
,
expand
}
=
this
.
state
;
const
{
value
,
expand
}
=
this
.
state
;
const
{
children
,
className
,
style
,
expandable
}
=
this
.
props
;
const
{
children
,
hideCheckAll
,
className
,
style
,
expandable
}
=
this
.
props
;
const
checkedAll
=
this
.
getAllTags
().
length
===
value
.
length
;
const
checkedAll
=
this
.
getAllTags
().
length
===
value
.
length
;
...
@@ -97,9 +100,11 @@ class TagSelect extends Component {
...
@@ -97,9 +100,11 @@ class TagSelect extends Component {
});
});
return
(
return
(
<
div
className
=
{
cls
}
style
=
{
style
}
>
<
div
className
=
{
cls
}
style
=
{
style
}
>
<
CheckableTag
checked
=
{
checkedAll
}
key
=
"
tag-select-__all__
"
onChange
=
{
this
.
onSelectAll
}
>
{
hideCheckAll
?
null
:
(
全部
<
CheckableTag
checked
=
{
checkedAll
}
key
=
"
tag-select-__all__
"
onChange
=
{
this
.
onSelectAll
}
>
<
/CheckableTag
>
全部
<
/CheckableTag
>
)}
{
value
&&
{
value
&&
React
.
Children
.
map
(
children
,
child
=>
{
React
.
Children
.
map
(
children
,
child
=>
{
if
(
this
.
isTagSelectOption
(
child
))
{
if
(
this
.
isTagSelectOption
(
child
))
{
...
...
src/components/TagSelect/index.md
View file @
6138c036
...
@@ -19,7 +19,7 @@ order: 13
...
@@ -19,7 +19,7 @@ order: 13
| defaultValue |默认选中的项 |string[]
\|
number[] | |
| defaultValue |默认选中的项 |string[]
\|
number[] | |
| onChange | 标签选择的回调函数 | Function(checkedTags) | |
| onChange | 标签选择的回调函数 | Function(checkedTags) | |
| expandable | 是否展示
`展开/收起`
按钮 | Boolean | false |
| expandable | 是否展示
`展开/收起`
按钮 | Boolean | false |
| hideCheckAll | 隐藏
`全部`
按钮 | Boolean | false |
### TagSelectOption
### TagSelectOption
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment