-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: feat(Table): support inline editing in PF4
- Loading branch information
Showing
32 changed files
with
8,646 additions
and
306 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// TODO: better sharing util components between modules | ||
export function debounce(func, wait) { | ||
let timeout; | ||
return (...args) => { | ||
clearTimeout(timeout); | ||
timeout = setTimeout(() => func.apply(this, args), wait); | ||
}; | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/patternfly-4/react-table/src/components/CancelButton/CancelButton.js
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 @@ | ||
import React from 'react'; | ||
import { CloseIcon } from '@patternfly/react-icons'; | ||
import { Button } from '@patternfly/react-core'; | ||
|
||
const CancelButton = props => ( | ||
<Button {...props}> | ||
<CloseIcon /> | ||
</Button> | ||
); | ||
|
||
CancelButton.propTypes = { | ||
...Button.propTypes | ||
}; | ||
|
||
CancelButton.defaultProps = { | ||
...Button.defaultProps, | ||
variant: 'plain' | ||
}; | ||
|
||
export default CancelButton; |
9 changes: 9 additions & 0 deletions
9
packages/patternfly-4/react-table/src/components/CancelButton/CancelButton.test.js
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,9 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { CancelButton } from './index'; | ||
|
||
test('it renders properly', () => { | ||
const component = shallow(<CancelButton />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); |
22 changes: 22 additions & 0 deletions
22
...ternfly-4/react-table/src/components/CancelButton/__snapshots__/CancelButton.test.js.snap
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,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`it renders properly 1`] = ` | ||
<Button | ||
aria-label={null} | ||
className="" | ||
component="button" | ||
isActive={false} | ||
isBlock={false} | ||
isDisabled={false} | ||
isFocus={false} | ||
isHover={false} | ||
type="button" | ||
variant="plain" | ||
> | ||
<CloseIcon | ||
color="currentColor" | ||
size="sm" | ||
title={null} | ||
/> | ||
</Button> | ||
`; |
1 change: 1 addition & 0 deletions
1
packages/patternfly-4/react-table/src/components/CancelButton/index.js
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 @@ | ||
export { default as CancelButton } from './CancelButton'; |
20 changes: 20 additions & 0 deletions
20
packages/patternfly-4/react-table/src/components/ConfirmButton/ConfirmButton.js
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 @@ | ||
import React from 'react'; | ||
import { CheckIcon } from '@patternfly/react-icons'; | ||
import { Button } from '@patternfly/react-core'; | ||
|
||
const ConfirmButton = props => ( | ||
<Button {...props}> | ||
<CheckIcon /> | ||
</Button> | ||
); | ||
|
||
ConfirmButton.propTypes = { | ||
...Button.propTypes | ||
}; | ||
|
||
ConfirmButton.defaultProps = { | ||
...Button.defaultProps, | ||
variant: 'primary' | ||
}; | ||
|
||
export default ConfirmButton; |
9 changes: 9 additions & 0 deletions
9
packages/patternfly-4/react-table/src/components/ConfirmButton/ConfirmButton.test.js
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,9 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { ConfirmButton } from './index'; | ||
|
||
test('it renders properly', () => { | ||
const component = shallow(<ConfirmButton />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); |
22 changes: 22 additions & 0 deletions
22
...rnfly-4/react-table/src/components/ConfirmButton/__snapshots__/ConfirmButton.test.js.snap
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,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`it renders properly 1`] = ` | ||
<Button | ||
aria-label={null} | ||
className="" | ||
component="button" | ||
isActive={false} | ||
isBlock={false} | ||
isDisabled={false} | ||
isFocus={false} | ||
isHover={false} | ||
type="button" | ||
variant="primary" | ||
> | ||
<CheckIcon | ||
color="currentColor" | ||
size="sm" | ||
title={null} | ||
/> | ||
</Button> | ||
`; |
1 change: 1 addition & 0 deletions
1
packages/patternfly-4/react-table/src/components/ConfirmButton/index.js
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 @@ | ||
export { default as ConfirmButton } from './ConfirmButton'; |
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
Oops, something went wrong.