-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.x' of https://github.com/open-amdocs/webrix into 2.x
- Loading branch information
Showing
22 changed files
with
131 additions
and
84 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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export {default as useAnimationFrame} from './useAnimationFrame'; | ||
export {default as useBooleanState, useVisibilityState, useFocusabilityState} from './useBooleanState'; | ||
export {default as useBoundingRectObserver} from './useBoundingRectObserver'; | ||
export {default as useClickOutside, ClickOutside, ClickOutsideOverride} from './useClickOutside'; | ||
export {default as useClickOutside} from './useClickOutside'; | ||
export {default as useMounted} from './useMounted'; | ||
export {default as useDebounce} from './useDebounce'; | ||
export {default as useDimensions} from './useDimensions'; | ||
export {default as useResizeObserver} from './useResizeObserver'; | ||
export {default as useEventListener} from './useEventListener'; | ||
export {default as useThrottle} from './useThrottle'; | ||
export {default as useObject} from './useObject'; | ||
export {default as usePrevious} from './usePrevious'; | ||
export {default as useTimeout} from './useTimeout'; | ||
export {default as useTimeout} from './useTimeout'; |
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 was deleted.
Oops, something went wrong.
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,2 @@ | ||
See the full documentation of `useResizeObserver` at the | ||
[Official Webrix Documentation Site](https://webrix.amdocs.com/docs/hooks/useResizeObserver) |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...hooks/useDimensions/useDimensions.test.js → ...eResizeObserver/useResizeObserver.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
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,42 @@ | ||
/** | ||
* Copyright (c) 2020, Amdocs Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import {func, node} from 'prop-types'; | ||
import OverrideContext from 'hooks/useClickOutside/useClickOutside.context'; | ||
import {useClickOutside} from 'hooks'; | ||
|
||
export const ClickOutside = ({children, onClickOutside}) => { | ||
const handleOnMouseDownCapture = useClickOutside(onClickOutside); | ||
// We're updating the contained element instead of adding a wrapper since adding | ||
// a wrapper can may affect the styling/behavior | ||
return React.cloneElement( | ||
React.Children.only(children), {onMouseDownCapture: handleOnMouseDownCapture} | ||
); | ||
}; | ||
|
||
// It is sometimes necessary to modify the condition of the click-outside handler | ||
// of one or more elements. This can be done using the ClickOutsideOverride | ||
export const ClickOutsideOverride = ({condition, children}) => ( | ||
<OverrideContext.Provider value={condition}> | ||
{children} | ||
</OverrideContext.Provider> | ||
); | ||
|
||
ClickOutsideOverride.propTypes = { | ||
condition: func, | ||
children: node, | ||
}; |
Oops, something went wrong.