@onepercentio/one-ui 0.19.2 → 0.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +17 -0
- package/.prod.babelrc +22 -0
- package/dist/assets/styles/variables.scss +1 -0
- package/dist/components/AdaptiveButton/AdaptiveButton.js +24 -25
- package/dist/components/AdaptiveButton/index.js +12 -8
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js +95 -114
- package/dist/components/AdaptiveContainer/index.js +12 -8
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +85 -65
- package/dist/components/AdaptiveDialog/index.js +12 -8
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +84 -76
- package/dist/components/AdaptiveSidebar/index.js +12 -8
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js +155 -160
- package/dist/components/AnchoredTooltip/index.js +12 -8
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js +172 -139
- package/dist/components/AnimatedEntrance/index.js +26 -10
- package/dist/components/AsyncWrapper/AsyncWrapper.js +33 -21
- package/dist/components/AsyncWrapper/index.js +12 -8
- package/dist/components/Avatar/Avatar.js +34 -40
- package/dist/components/Avatar/index.js +12 -8
- package/dist/components/BucketFill/BucketFill.js +47 -58
- package/dist/components/BucketFill/index.js +12 -8
- package/dist/components/Button/Button.js +32 -49
- package/dist/components/Button/README.md +8 -0
- package/dist/components/Button/index.js +12 -8
- package/dist/components/Card/Card.js +16 -11
- package/dist/components/Card/index.js +12 -8
- package/dist/components/Chart/Chart.logic.js +10 -10
- package/dist/components/Chart/Chart.types.js +4 -2
- package/dist/components/Chart/Chart.view.js +212 -131
- package/dist/components/Chart/index.js +12 -8
- package/dist/components/CheckBox/CheckBox.d.ts +3 -1
- package/dist/components/CheckBox/CheckBox.js +43 -30
- package/dist/components/CheckBox/CheckBox.module.scss +4 -0
- package/dist/components/CheckBox/index.js +12 -8
- package/dist/components/Collapsable/Collapsable.d.ts +26 -27
- package/dist/components/Collapsable/Collapsable.js +173 -143
- package/dist/components/Collapsable/index.js +12 -8
- package/dist/components/Countdown/Countdown.js +87 -100
- package/dist/components/Countdown/index.js +12 -8
- package/dist/components/Divider/Divider.js +15 -12
- package/dist/components/Divider/index.js +12 -8
- package/dist/components/EmailInput/EmailInput.d.ts +4 -3
- package/dist/components/EmailInput/EmailInput.js +45 -43
- package/dist/components/EmailInput/README.md +10 -0
- package/dist/components/EmailInput/index.js +20 -9
- package/dist/components/FadeIn/FadeIn.js +62 -69
- package/dist/components/FadeIn/index.js +12 -8
- package/dist/components/FileInput/FileInput.d.ts +25 -9
- package/dist/components/FileInput/FileInput.js +41 -70
- package/dist/components/FileInput/FileInput.module.scss +0 -21
- package/dist/components/FileInput/View/BigFactory/BigFactory.d.ts +6 -0
- package/dist/components/FileInput/View/BigFactory/BigFactory.js +46 -0
- package/dist/components/FileInput/View/BigFactory/BigFactory.module.scss +20 -0
- package/dist/components/FileInput/View/BigFactory/index.d.ts +1 -0
- package/dist/components/FileInput/View/BigFactory/index.js +13 -0
- package/dist/components/FileInput/View/Compact/Compact.d.ts +5 -0
- package/dist/components/FileInput/View/Compact/Compact.js +88 -0
- package/dist/components/FileInput/View/Compact/Compact.module.scss +59 -0
- package/dist/components/FileInput/View/Compact/index.d.ts +1 -0
- package/dist/components/FileInput/View/Compact/index.js +13 -0
- package/dist/components/FileInput/View/View.types.d.ts +8 -0
- package/dist/components/FileInput/View/View.types.js +5 -0
- package/dist/components/FileInput/index.js +12 -8
- package/dist/components/FlowController/FlowController.js +60 -29
- package/dist/components/FlowController/README.md +13 -0
- package/dist/components/FlowController/index.js +12 -8
- package/dist/components/Form/Form.js +157 -96
- package/dist/components/Form/index.js +12 -8
- package/dist/components/Freeze/Freeze.js +11 -10
- package/dist/components/Freeze/index.js +12 -8
- package/dist/components/HSForms/HSForms.js +48 -68
- package/dist/components/HSForms/index.js +12 -8
- package/dist/components/Header/Header.js +100 -69
- package/dist/components/Header/index.js +12 -8
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +17 -13
- package/dist/components/HeaderCloseBtn/index.js +12 -8
- package/dist/components/InfinityScroll/InfinityScroll.js +137 -117
- package/dist/components/InfinityScroll/index.js +12 -8
- package/dist/components/Input/Input.d.ts +8 -6
- package/dist/components/Input/Input.js +105 -90
- package/dist/components/Input/Input.module.scss +4 -2
- package/dist/components/Input/README.md +10 -0
- package/dist/components/Input/index.js +12 -8
- package/dist/components/InstantCounter/InstantCounter.js +61 -52
- package/dist/components/InstantCounter/index.js +12 -8
- package/dist/components/LavaLamp/LavaLamp.data.js +95 -87
- package/dist/components/LavaLamp/LavaLamp.js +107 -70
- package/dist/components/LavaLamp/index.js +12 -8
- package/dist/components/LavaLamp/v2/LavaLamp.js +200 -182
- package/dist/components/LinkToId/LinkToId.js +42 -28
- package/dist/components/LinkToId/index.js +20 -9
- package/dist/components/Loader/Loader.js +20 -26
- package/dist/components/Loader/index.js +12 -8
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +34 -37
- package/dist/components/LoaderDotsIndicator/index.js +12 -8
- package/dist/components/LoopableVideo/LoopableVideo.js +29 -30
- package/dist/components/LoopableVideo/index.js +12 -8
- package/dist/components/MainGrid/MainGrid.js +44 -50
- package/dist/components/MainGrid/index.js +12 -8
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +26 -26
- package/dist/components/MutableHamburgerButton/index.js +12 -8
- package/dist/components/Notification/Notification.js +16 -12
- package/dist/components/Notification/index.js +12 -8
- package/dist/components/OrderableList/OrderableList.js +406 -374
- package/dist/components/OrderableList/index.js +12 -8
- package/dist/components/PaginationIndicator/PaginationIndicator.js +230 -196
- package/dist/components/PaginationIndicator/index.js +12 -8
- package/dist/components/Parallax/Parallax.js +164 -161
- package/dist/components/Parallax/index.js +12 -8
- package/dist/components/Parallax/math/helpers.js +128 -217
- package/dist/components/PasswordInput/PasswordInput.d.ts +4 -3
- package/dist/components/PasswordInput/PasswordInput.js +120 -97
- package/dist/components/PasswordInput/index.js +12 -8
- package/dist/components/PixelatedScan/PixelatedScan.js +140 -97
- package/dist/components/PixelatedScan/index.js +12 -8
- package/dist/components/Portal/Portal.js +54 -64
- package/dist/components/Portal/index.js +20 -9
- package/dist/components/ProgressBar/ProgressBar.js +48 -45
- package/dist/components/ProgressBar/index.js +20 -9
- package/dist/components/ProgressTexts/ProgressTexts.js +42 -34
- package/dist/components/ProgressTexts/README.md +12 -0
- package/dist/components/ProgressTexts/index.js +12 -8
- package/dist/components/Radio/Radio.d.ts +13 -0
- package/dist/components/Radio/Radio.js +47 -0
- package/dist/components/Radio/Radio.module.scss +33 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/index.js +13 -0
- package/dist/components/SectionContainer/SectionContainer.js +35 -39
- package/dist/components/SectionContainer/index.js +12 -8
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +133 -82
- package/dist/components/Select/Select.module.scss +14 -2
- package/dist/components/Select/index.js +12 -8
- package/dist/components/Skeleton/Skeleton.js +21 -15
- package/dist/components/Skeleton/index.js +12 -8
- package/dist/components/Spacing/Spacing.js +14 -11
- package/dist/components/Spacing/index.js +12 -8
- package/dist/components/StaticScroller/StaticScroller.js +61 -81
- package/dist/components/StaticScroller/index.js +12 -8
- package/dist/components/Switch/Switch.js +29 -25
- package/dist/components/Switch/index.js +12 -8
- package/dist/components/Table/Table.js +111 -80
- package/dist/components/Table/index.js +12 -8
- package/dist/components/Tabs/Tabs.js +42 -52
- package/dist/components/Tabs/index.js +12 -8
- package/dist/components/Text/Text.js +31 -50
- package/dist/components/Text/index.js +12 -8
- package/dist/components/Transition/MasksFactory/DiagonalReveal.js +46 -22
- package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +71 -57
- package/dist/components/Transition/MasksFactory/PhysicsSquares.js +97 -80
- package/dist/components/Transition/MasksFactory/SquareToBalls.js +59 -50
- package/dist/components/Transition/MasksFactory/utils.js +25 -28
- package/dist/components/Transition/Transition.js +316 -309
- package/dist/components/Transition/index.js +20 -9
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js +110 -86
- package/dist/components/UncontrolledTransition/index.js +12 -8
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +116 -105
- package/dist/components/WalletConnectionWrapper/index.js +20 -9
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +51 -69
- package/dist/components/utilitary/ScrollAndFocusLock/index.js +12 -8
- package/dist/context/AsyncProcess.js +77 -63
- package/dist/context/CustomBrowserRouter.js +40 -52
- package/dist/context/OneUIProvider.d.ts +8 -2
- package/dist/context/OneUIProvider.js +90 -104
- package/dist/hooks/logs/README.md +3 -0
- package/dist/hooks/logs/useDependencyChangeDetection.js +17 -17
- package/dist/hooks/logs/useIsMounting.js +10 -8
- package/dist/hooks/persistence/useLocalStorage.js +40 -30
- package/dist/hooks/shims/ObjectWatchShim.d.ts +1 -0
- package/dist/hooks/shims/ObjectWatchShim.js +49 -46
- package/dist/hooks/ui/useAdaptiveImage.js +43 -35
- package/dist/hooks/ui/useBreakpoint.js +34 -19
- package/dist/hooks/ui/useCustomScrollbar.js +26 -21
- package/dist/hooks/ui/useMouseHover.js +29 -16
- package/dist/hooks/ui/usePaginationControls.d.ts +0 -4
- package/dist/hooks/ui/usePaginationControls.e2e.d.ts +4 -0
- package/dist/hooks/ui/usePaginationControls.js +125 -153
- package/dist/hooks/ui/useTilt.js +156 -128
- package/dist/hooks/ui/useZoomable.js +114 -138
- package/dist/hooks/useAsyncControl.js +82 -47
- package/dist/hooks/useContainedRepositioning.js +75 -72
- package/dist/hooks/useCustomHistory.js +21 -13
- package/dist/hooks/useElementFit.js +42 -34
- package/dist/hooks/useFirestoreWatch.js +54 -35
- package/dist/hooks/useForm.js +47 -22
- package/dist/hooks/useFreeze.js +11 -9
- package/dist/hooks/useHero.d.ts +4 -0
- package/dist/hooks/useHero.js +171 -159
- package/dist/hooks/useIntersection.js +33 -27
- package/dist/hooks/useMergeRefs.js +26 -23
- package/dist/hooks/useObserve.js +28 -15
- package/dist/hooks/usePagination.js +151 -129
- package/dist/hooks/usePooledOperation.js +43 -58
- package/dist/hooks/usePooling.js +62 -48
- package/dist/hooks/useRebound.js +36 -22
- package/dist/hooks/useShortIntl.js +79 -51
- package/dist/hooks/utility/useEvents.js +28 -22
- package/dist/hooks/utility/useModule.js +21 -10
- package/dist/hooks/utility/useQuery.js +14 -8
- package/dist/models/DebugLogger.js +7 -6
- package/dist/models/GenericContract.js +39 -12
- package/dist/reac-app-env.d.js +1 -0
- package/dist/storybook/assets/video/txt-reversed.mp4 +0 -0
- package/dist/storybookUtils/index.js +42 -24
- package/dist/type-utils.js +4 -2
- package/dist/types.js +4 -2
- package/dist/utility.d.js +17 -0
- package/dist/utils/blockchain.js +60 -54
- package/dist/utils/flatten.js +23 -13
- package/dist/utils/html.utils.js +9 -6
- package/dist/utils/ownEvent.js +9 -8
- package/package.json +13 -8
- package/tsconfig.json +3 -2
- package/cypress/support/commands.ts +0 -49
- package/cypress/support/component-index.html +0 -30
- package/cypress/support/component.ts +0 -39
- package/cypress/support/e2e.js +0 -49
- package/dist/components/AdaptiveButton/AdaptiveButton.js.map +0 -1
- package/dist/components/AdaptiveButton/index.js.map +0 -1
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js.map +0 -1
- package/dist/components/AdaptiveContainer/index.js.map +0 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +0 -1
- package/dist/components/AdaptiveDialog/index.js.map +0 -1
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +0 -1
- package/dist/components/AdaptiveSidebar/index.js.map +0 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js.map +0 -1
- package/dist/components/AnchoredTooltip/index.js.map +0 -1
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +0 -1
- package/dist/components/AnimatedEntrance/index.js.map +0 -1
- package/dist/components/AsyncWrapper/AsyncWrapper.js.map +0 -1
- package/dist/components/AsyncWrapper/index.js.map +0 -1
- package/dist/components/Avatar/Avatar.js.map +0 -1
- package/dist/components/Avatar/index.js.map +0 -1
- package/dist/components/BucketFill/BucketFill.js.map +0 -1
- package/dist/components/BucketFill/index.js.map +0 -1
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Card/Card.js.map +0 -1
- package/dist/components/Card/index.js.map +0 -1
- package/dist/components/Chart/Chart.e2e.js +0 -9
- package/dist/components/Chart/Chart.e2e.js.map +0 -1
- package/dist/components/Chart/Chart.logic.js.map +0 -1
- package/dist/components/Chart/Chart.types.js.map +0 -1
- package/dist/components/Chart/Chart.view.js.map +0 -1
- package/dist/components/Chart/index.js.map +0 -1
- package/dist/components/CheckBox/CheckBox.js.map +0 -1
- package/dist/components/CheckBox/index.js.map +0 -1
- package/dist/components/Collapsable/Collapsable.js.map +0 -1
- package/dist/components/Collapsable/index.js.map +0 -1
- package/dist/components/Countdown/Countdown.js.map +0 -1
- package/dist/components/Countdown/index.js.map +0 -1
- package/dist/components/Divider/Divider.js.map +0 -1
- package/dist/components/Divider/index.js.map +0 -1
- package/dist/components/EmailInput/EmailInput.js.map +0 -1
- package/dist/components/EmailInput/index.js.map +0 -1
- package/dist/components/FadeIn/FadeIn.js.map +0 -1
- package/dist/components/FadeIn/index.js.map +0 -1
- package/dist/components/FileInput/FileInput.js.map +0 -1
- package/dist/components/FileInput/index.js.map +0 -1
- package/dist/components/FlowController/FlowController.js.map +0 -1
- package/dist/components/FlowController/index.js.map +0 -1
- package/dist/components/Form/Form.js.map +0 -1
- package/dist/components/Form/index.js.map +0 -1
- package/dist/components/Freeze/Freeze.js.map +0 -1
- package/dist/components/Freeze/index.js.map +0 -1
- package/dist/components/HSForms/HSForms.js.map +0 -1
- package/dist/components/HSForms/index.js.map +0 -1
- package/dist/components/Header/Header.js.map +0 -1
- package/dist/components/Header/index.js.map +0 -1
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js.map +0 -1
- package/dist/components/HeaderCloseBtn/index.js.map +0 -1
- package/dist/components/InfinityScroll/InfinityScroll.js.map +0 -1
- package/dist/components/InfinityScroll/index.js.map +0 -1
- package/dist/components/Input/Input.js.map +0 -1
- package/dist/components/Input/index.js.map +0 -1
- package/dist/components/InstantCounter/InstantCounter.js.map +0 -1
- package/dist/components/InstantCounter/index.js.map +0 -1
- package/dist/components/LavaLamp/LavaLamp.data.js.map +0 -1
- package/dist/components/LavaLamp/LavaLamp.js.map +0 -1
- package/dist/components/LavaLamp/index.js.map +0 -1
- package/dist/components/LavaLamp/v2/LavaLamp.js.map +0 -1
- package/dist/components/LinkToId/LinkToId.js.map +0 -1
- package/dist/components/LinkToId/index.js.map +0 -1
- package/dist/components/Loader/Loader.js.map +0 -1
- package/dist/components/Loader/index.js.map +0 -1
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js.map +0 -1
- package/dist/components/LoaderDotsIndicator/index.js.map +0 -1
- package/dist/components/LoopableVideo/LoopableVideo.js.map +0 -1
- package/dist/components/LoopableVideo/index.js.map +0 -1
- package/dist/components/MainGrid/MainGrid.js.map +0 -1
- package/dist/components/MainGrid/index.js.map +0 -1
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js.map +0 -1
- package/dist/components/MutableHamburgerButton/index.js.map +0 -1
- package/dist/components/Notification/Notification.js.map +0 -1
- package/dist/components/Notification/index.js.map +0 -1
- package/dist/components/OrderableList/OrderableList.js.map +0 -1
- package/dist/components/OrderableList/index.js.map +0 -1
- package/dist/components/PaginationIndicator/PaginationIndicator.js.map +0 -1
- package/dist/components/PaginationIndicator/index.js.map +0 -1
- package/dist/components/Parallax/Parallax.js.map +0 -1
- package/dist/components/Parallax/index.js.map +0 -1
- package/dist/components/Parallax/math/helpers.js.map +0 -1
- package/dist/components/PasswordInput/PasswordInput.js.map +0 -1
- package/dist/components/PasswordInput/index.js.map +0 -1
- package/dist/components/PixelatedScan/PixelatedScan.js.map +0 -1
- package/dist/components/PixelatedScan/index.js.map +0 -1
- package/dist/components/Portal/Portal.js.map +0 -1
- package/dist/components/Portal/index.js.map +0 -1
- package/dist/components/ProgressBar/ProgressBar.js.map +0 -1
- package/dist/components/ProgressBar/index.js.map +0 -1
- package/dist/components/ProgressTexts/ProgressTexts.js.map +0 -1
- package/dist/components/ProgressTexts/index.js.map +0 -1
- package/dist/components/SectionContainer/SectionContainer.js.map +0 -1
- package/dist/components/SectionContainer/index.js.map +0 -1
- package/dist/components/Select/Select.js.map +0 -1
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Skeleton/Skeleton.js.map +0 -1
- package/dist/components/Skeleton/index.js.map +0 -1
- package/dist/components/Spacing/Spacing.js.map +0 -1
- package/dist/components/Spacing/index.js.map +0 -1
- package/dist/components/StaticScroller/StaticScroller.js.map +0 -1
- package/dist/components/StaticScroller/index.js.map +0 -1
- package/dist/components/Switch/Switch.js.map +0 -1
- package/dist/components/Switch/index.js.map +0 -1
- package/dist/components/Table/Table.js.map +0 -1
- package/dist/components/Table/index.js.map +0 -1
- package/dist/components/Tabs/Tabs.js.map +0 -1
- package/dist/components/Tabs/index.js.map +0 -1
- package/dist/components/Text/Text.js.map +0 -1
- package/dist/components/Text/index.js.map +0 -1
- package/dist/components/Transition/MasksFactory/DiagonalReveal.js.map +0 -1
- package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js.map +0 -1
- package/dist/components/Transition/MasksFactory/PhysicsSquares.js.map +0 -1
- package/dist/components/Transition/MasksFactory/SquareToBalls.js.map +0 -1
- package/dist/components/Transition/MasksFactory/utils.js.map +0 -1
- package/dist/components/Transition/Transition.js.map +0 -1
- package/dist/components/Transition/index.js.map +0 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +0 -1
- package/dist/components/UncontrolledTransition/index.js.map +0 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +0 -1
- package/dist/components/WalletConnectionWrapper/index.js.map +0 -1
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js.map +0 -1
- package/dist/components/utilitary/ScrollAndFocusLock/index.js.map +0 -1
- package/dist/context/AsyncProcess.js.map +0 -1
- package/dist/context/CustomBrowserRouter.js.map +0 -1
- package/dist/context/OneUIProvider.js.map +0 -1
- package/dist/hooks/logs/useDependencyChangeDetection.js.map +0 -1
- package/dist/hooks/logs/useIsMounting.js.map +0 -1
- package/dist/hooks/persistence/useLocalStorage.js.map +0 -1
- package/dist/hooks/shims/ObjectWatchShim.js.map +0 -1
- package/dist/hooks/ui/useAdaptiveImage.js.map +0 -1
- package/dist/hooks/ui/useBreakpoint.js.map +0 -1
- package/dist/hooks/ui/useCustomScrollbar.js.map +0 -1
- package/dist/hooks/ui/useMouseHover.js.map +0 -1
- package/dist/hooks/ui/usePaginationControls.js.map +0 -1
- package/dist/hooks/ui/useTilt.js.map +0 -1
- package/dist/hooks/ui/useZoomable.js.map +0 -1
- package/dist/hooks/useAsyncControl.js.map +0 -1
- package/dist/hooks/useContainedRepositioning.js.map +0 -1
- package/dist/hooks/useCustomHistory.js.map +0 -1
- package/dist/hooks/useElementFit.js.map +0 -1
- package/dist/hooks/useFirestoreWatch.js.map +0 -1
- package/dist/hooks/useForm.js.map +0 -1
- package/dist/hooks/useFreeze.js.map +0 -1
- package/dist/hooks/useHero.js.map +0 -1
- package/dist/hooks/useHero.module.scss +0 -5
- package/dist/hooks/useIntersection.js.map +0 -1
- package/dist/hooks/useMergeRefs.js.map +0 -1
- package/dist/hooks/useObserve.js.map +0 -1
- package/dist/hooks/usePagination.js.map +0 -1
- package/dist/hooks/usePooledOperation.js.map +0 -1
- package/dist/hooks/usePooling.js.map +0 -1
- package/dist/hooks/useRebound.js.map +0 -1
- package/dist/hooks/useShortIntl.js.map +0 -1
- package/dist/hooks/utility/useEvents.js.map +0 -1
- package/dist/hooks/utility/useModule.js.map +0 -1
- package/dist/hooks/utility/useQuery.js.map +0 -1
- package/dist/models/DebugLogger.js.map +0 -1
- package/dist/models/GenericContract.js.map +0 -1
- package/dist/storybookUtils/index.js.map +0 -1
- package/dist/type-utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/blockchain.js.map +0 -1
- package/dist/utils/flatten.js.map +0 -1
- package/dist/utils/html.utils.js.map +0 -1
- package/dist/utils/ownEvent.js.map +0 -1
|
@@ -1,76 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
17
6
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
Object.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
exports.default = Header;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _OneUIProvider = require("../../context/OneUIProvider");
|
|
10
|
+
var _AnchoredTooltip = require("../AnchoredTooltip/AnchoredTooltip");
|
|
11
|
+
var _Collapsable = _interopRequireDefault(require("../Collapsable"));
|
|
12
|
+
var _Text = _interopRequireDefault(require("../Text"));
|
|
13
|
+
var _HeaderModule = _interopRequireDefault(require("./Header.module.scss"));
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
22
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
23
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
24
|
/**
|
|
36
25
|
* A generic header implementation
|
|
37
26
|
**/
|
|
38
27
|
function Header(props) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
28
|
+
const user = props.user,
|
|
29
|
+
moreOptions = props.moreOptions;
|
|
30
|
+
const _useState = (0, _react.useState)(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
showMoreOptions = _useState2[0],
|
|
33
|
+
setShowMoreOptions = _useState2[1];
|
|
34
|
+
const _useOneUIContext$comp = (0, _OneUIProvider.useOneUIContext)().component.header,
|
|
35
|
+
_useOneUIContext$comp2 = _useOneUIContext$comp.LogoImage,
|
|
36
|
+
LogoImage = _useOneUIContext$comp2 === void 0 ? function () {
|
|
37
|
+
return null;
|
|
38
|
+
} : _useOneUIContext$comp2,
|
|
39
|
+
_useOneUIContext$comp3 = _useOneUIContext$comp.MoreOptions,
|
|
40
|
+
MoreOptions = _useOneUIContext$comp3 === void 0 ? function () {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("div", null, "v");
|
|
42
|
+
} : _useOneUIContext$comp3;
|
|
43
|
+
(0, _react.useEffect)(function () {
|
|
44
|
+
if (showMoreOptions) {
|
|
45
|
+
const close = function close() {
|
|
46
|
+
return setShowMoreOptions(false);
|
|
47
|
+
};
|
|
48
|
+
window.addEventListener("click", close);
|
|
49
|
+
return function () {
|
|
50
|
+
window.removeEventListener("click", close);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}, [showMoreOptions]);
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement("header", {
|
|
55
|
+
className: "".concat(_HeaderModule.default.header, " ").concat(_HeaderModule.default["options-".concat(props.optionsAlignment || "left")])
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
className: _HeaderModule.default.logo
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(LogoImage, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: _HeaderModule.default.logoDivider
|
|
60
|
+
})), /*#__PURE__*/_react.default.createElement(Controls, _extends({}, props, {
|
|
61
|
+
mode: "desktop"
|
|
62
|
+
})), user ? user.profilePicture ? /*#__PURE__*/_react.default.createElement("img", {
|
|
63
|
+
className: _HeaderModule.default.profile,
|
|
64
|
+
src: user.profilePicture
|
|
65
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
className: _HeaderModule.default.profile
|
|
67
|
+
}, user.name.split(" ").slice(0, 2).map(function (a) {
|
|
68
|
+
return a.charAt(0).toUpperCase();
|
|
69
|
+
}).join("")) : null, user ? /*#__PURE__*/_react.default.createElement("p", {
|
|
70
|
+
className: _HeaderModule.default.profileName
|
|
71
|
+
}, user.name) : null, /*#__PURE__*/_react.default.createElement(_Collapsable.default, {
|
|
72
|
+
title: /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
className: "".concat(_HeaderModule.default.indicator, " ").concat(moreOptions ? _HeaderModule.default.withMoreOptions : "")
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(MoreOptions, {
|
|
75
|
+
open: showMoreOptions
|
|
76
|
+
})),
|
|
77
|
+
open: showMoreOptions,
|
|
78
|
+
onToggleOpen: setShowMoreOptions,
|
|
79
|
+
mode: "float",
|
|
80
|
+
contentClassName: _HeaderModule.default.headerOptions,
|
|
81
|
+
alignTo: _AnchoredTooltip.AnchoredTooltipAlignment.CENTER
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(Controls, _extends({}, props, {
|
|
83
|
+
mode: "mobile"
|
|
84
|
+
})), moreOptions ? moreOptions.map(function (opt) {
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
86
|
+
type: "link",
|
|
87
|
+
onClick: opt.onClick
|
|
88
|
+
}, opt.label);
|
|
89
|
+
}) : null));
|
|
75
90
|
}
|
|
76
|
-
|
|
91
|
+
function Controls(_ref) {
|
|
92
|
+
let options = _ref.options,
|
|
93
|
+
children = _ref.children,
|
|
94
|
+
mode = _ref.mode;
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, options.map(function (option) {
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
97
|
+
type: "link",
|
|
98
|
+
key: option.label,
|
|
99
|
+
onClick: option.onClick,
|
|
100
|
+
className: "".concat(_HeaderModule.default.option, " ").concat(mode === "desktop" ? _HeaderModule.default.desktopOnly : _HeaderModule.default.mobileOnly)
|
|
101
|
+
}, option.label);
|
|
102
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
103
|
+
className: _HeaderModule.default.sectionDivider
|
|
104
|
+
}), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
+
className: "".concat(_HeaderModule.default.children, " ").concat(mode === "desktop" ? _HeaderModule.default.desktopOnly : _HeaderModule.default.mobileOnly)
|
|
106
|
+
}, children));
|
|
107
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Header.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _Header = _interopRequireDefault(require("./Header"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = HeaderButton;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _HeaderCloseBtnModule = _interopRequireDefault(require("./HeaderCloseBtn.module.scss"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
10
|
/**
|
|
9
11
|
* A simple close button implemented with pure HTML and CSS
|
|
10
12
|
**/
|
|
11
|
-
function HeaderButton(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
function HeaderButton(_ref) {
|
|
14
|
+
let mode = _ref.mode,
|
|
15
|
+
hidden = _ref.hidden,
|
|
16
|
+
onClick = _ref.onClick;
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
|
+
className: "".concat(_HeaderCloseBtnModule.default.headerButton, " ").concat(_HeaderCloseBtnModule.default[mode], " ").concat(hidden ? _HeaderCloseBtnModule.default.pointOfNoReturn : ""),
|
|
19
|
+
onClick: onClick
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement("div", null));
|
|
21
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _HeaderCloseBtn.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _HeaderCloseBtn = _interopRequireDefault(require("./HeaderCloseBtn"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,131 +1,151 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
17
5
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
6
|
+
exports.default = exports.InfinityDataTestId = void 0;
|
|
7
|
+
exports.getItemsFactory = getItemsFactory;
|
|
8
|
+
exports.keys = keys;
|
|
9
|
+
exports.shouldIncrementPage = shouldIncrementPage;
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _InfinityScrollModule = _interopRequireDefault(require("./InfinityScroll.module.scss"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
25
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
26
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
28
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
29
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
32
31
|
function shouldIncrementPage(howMuchTheParentScrolled, prevSectionPosition, nextSectionPosition) {
|
|
33
|
-
|
|
34
|
-
return 1;
|
|
35
|
-
else if (howMuchTheParentScrolled === prevSectionPosition)
|
|
36
|
-
return -1;
|
|
37
|
-
else
|
|
38
|
-
return 0;
|
|
32
|
+
if (howMuchTheParentScrolled === nextSectionPosition) return 1;else if (howMuchTheParentScrolled === prevSectionPosition) return -1;else return 0;
|
|
39
33
|
}
|
|
40
|
-
exports.shouldIncrementPage = shouldIncrementPage;
|
|
41
34
|
function keys(currPage) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
return [currPage % 3, (currPage + 1) % 3, (currPage + 2) % 3].map(function (a) {
|
|
36
|
+
return "step_".concat(a);
|
|
37
|
+
}).reverse();
|
|
45
38
|
}
|
|
46
|
-
exports.keys = keys;
|
|
47
39
|
function getItemsFactory(pageSize, items, isCountTheSameOrLowerThanPage) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
return function getItems(page, offset) {
|
|
41
|
+
let _pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : pageSize;
|
|
42
|
+
let from = page * _pageSize + offset;
|
|
43
|
+
if (from < 0) from = items.length + from;
|
|
44
|
+
if (from > items.length) from = from - items.length;
|
|
45
|
+
const to = from + _pageSize;
|
|
46
|
+
const slicedItems = items.slice(from, to);
|
|
47
|
+
if (slicedItems.length < _pageSize && !isCountTheSameOrLowerThanPage) {
|
|
48
|
+
slicedItems.push.apply(slicedItems, _toConsumableArray(getItems(0, 0, _pageSize - slicedItems.length)));
|
|
49
|
+
}
|
|
50
|
+
return slicedItems.map(function (i, index) {
|
|
51
|
+
return _typeof(i) === "object" ? _objectSpread(_objectSpread({}, i), {}, {
|
|
52
|
+
key: index
|
|
53
|
+
}) : i;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
62
56
|
}
|
|
63
|
-
|
|
57
|
+
|
|
64
58
|
/**
|
|
65
59
|
* Manages a set of divs that allows the effect of inifinite scrolling between pages
|
|
66
60
|
**/
|
|
67
|
-
function InfinityScroll(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
function InfinityScroll(_ref, ref) {
|
|
62
|
+
let items = _ref.items,
|
|
63
|
+
pageSize = _ref.pageSize,
|
|
64
|
+
_ref$initialPage = _ref.initialPage,
|
|
65
|
+
initialPage = _ref$initialPage === void 0 ? 0 : _ref$initialPage,
|
|
66
|
+
pageClass = _ref.pageClass,
|
|
67
|
+
_ref$className = _ref.className,
|
|
68
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
|
69
|
+
const _useState = (0, _react.useState)({
|
|
70
|
+
page: initialPage,
|
|
71
|
+
offset: 0
|
|
72
|
+
}),
|
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
+
currPage = _useState2[0],
|
|
75
|
+
setCurrPage = _useState2[1];
|
|
76
|
+
const parentDiv = (0, _react.useMemo)(function () {
|
|
77
|
+
return ref || /*#__PURE__*/(0, _react.createRef)();
|
|
78
|
+
}, [ref]);
|
|
79
|
+
const prevDiv = (0, _react.useRef)(null);
|
|
80
|
+
const currDiv = (0, _react.useRef)(null);
|
|
81
|
+
const nextDiv = (0, _react.useRef)(null);
|
|
82
|
+
const isCountTheSameOrLowerThanPage = items.length <= pageSize;
|
|
83
|
+
const getItems = (0, _react.useMemo)(function () {
|
|
84
|
+
return getItemsFactory(pageSize, items, isCountTheSameOrLowerThanPage);
|
|
85
|
+
}, [pageSize, items, isCountTheSameOrLowerThanPage]);
|
|
86
|
+
(0, _react.useLayoutEffect)(function () {
|
|
87
|
+
if (isCountTheSameOrLowerThanPage || window.PRERENDER) return;
|
|
88
|
+
const viewportWidth = parentDiv.current.clientWidth;
|
|
89
|
+
const centerScroll = parentDiv.current.scrollWidth / 2;
|
|
90
|
+
parentDiv.current.scrollTo({
|
|
91
|
+
left: centerScroll - viewportWidth / 2
|
|
71
92
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
}, [isCountTheSameOrLowerThanPage, currPage.page, currPage.offset, items]);
|
|
94
|
+
const _keys = keys(currPage.page),
|
|
95
|
+
_keys2 = _slicedToArray(_keys, 3),
|
|
96
|
+
beforeKey = _keys2[0],
|
|
97
|
+
currKey = _keys2[1],
|
|
98
|
+
afterKey = _keys2[2];
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
+
ref: parentDiv,
|
|
101
|
+
className: "".concat(_InfinityScrollModule.default.container, " ").concat(className),
|
|
102
|
+
onScroll: !isCountTheSameOrLowerThanPage ? function () {
|
|
103
|
+
const pageToIncrement = shouldIncrementPage(Math.round(parentDiv.current.scrollLeft), prevDiv.current.offsetLeft, nextDiv.current.offsetLeft);
|
|
104
|
+
if (pageToIncrement) {
|
|
105
|
+
setCurrPage(function (prev) {
|
|
106
|
+
let nextPage = prev.page + pageToIncrement;
|
|
107
|
+
let offset = prev.offset;
|
|
108
|
+
if (nextPage < 0) {
|
|
109
|
+
nextPage = Math.round(items.length / pageSize) - 1;
|
|
110
|
+
const finalIndex = (nextPage + 1) * pageSize + offset;
|
|
111
|
+
const maxIndex = items.length;
|
|
112
|
+
const remainingItems = maxIndex + offset - finalIndex;
|
|
113
|
+
offset += remainingItems;
|
|
114
|
+
if (offset === -(items.length - 1)) offset = 1;
|
|
115
|
+
}
|
|
116
|
+
let nextIndex = nextPage * pageSize + offset;
|
|
117
|
+
if (nextIndex > items.length) {
|
|
118
|
+
offset = nextIndex - items.length;
|
|
119
|
+
nextPage = 0;
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
page: nextPage,
|
|
123
|
+
offset: offset
|
|
124
|
+
};
|
|
87
125
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (offset === -(items.length - 1))
|
|
104
|
-
offset = 1;
|
|
105
|
-
}
|
|
106
|
-
let nextIndex = nextPage * pageSize + offset;
|
|
107
|
-
if (nextIndex > items.length) {
|
|
108
|
-
offset = nextIndex - items.length;
|
|
109
|
-
nextPage = 0;
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
page: nextPage,
|
|
113
|
-
offset,
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
: undefined },
|
|
119
|
-
!isCountTheSameOrLowerThanPage && (react_1.default.createElement("div", { key: beforeKey, className: pageClass, "data-testid": InfinityDataTestId.PREV_PAGE, ref: prevDiv }, getItems(currPage.page - 1, currPage.offset))),
|
|
120
|
-
react_1.default.createElement("div", { key: currKey, className: pageClass, "data-testid": InfinityDataTestId.CURR_PAGE, ref: currDiv }, getItems(currPage.page, currPage.offset)),
|
|
121
|
-
!isCountTheSameOrLowerThanPage && (react_1.default.createElement("div", { key: afterKey, className: pageClass, "data-testid": InfinityDataTestId.NEXT_PAGE, ref: nextDiv }, getItems(currPage.page + 1, currPage.offset)))));
|
|
126
|
+
}
|
|
127
|
+
} : undefined
|
|
128
|
+
}, !isCountTheSameOrLowerThanPage && /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
+
key: beforeKey,
|
|
130
|
+
className: pageClass,
|
|
131
|
+
ref: prevDiv
|
|
132
|
+
}, getItems(currPage.page - 1, currPage.offset)), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
key: currKey,
|
|
134
|
+
className: pageClass,
|
|
135
|
+
ref: currDiv
|
|
136
|
+
}, getItems(currPage.page, currPage.offset)), !isCountTheSameOrLowerThanPage && /*#__PURE__*/_react.default.createElement("div", {
|
|
137
|
+
key: afterKey,
|
|
138
|
+
className: pageClass,
|
|
139
|
+
ref: nextDiv
|
|
140
|
+
}, getItems(currPage.page + 1, currPage.offset)));
|
|
122
141
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
142
|
+
var _default = /*#__PURE__*/(0, _react.forwardRef)(InfinityScroll);
|
|
143
|
+
exports.default = _default;
|
|
144
|
+
let InfinityDataTestId = /*#__PURE__*/function (InfinityDataTestId) {
|
|
145
|
+
InfinityDataTestId["PREV_PAGE"] = "infinity-prev";
|
|
146
|
+
InfinityDataTestId["CURR_PAGE"] = "infinity-curr";
|
|
147
|
+
InfinityDataTestId["NEXT_PAGE"] = "infinity-next";
|
|
148
|
+
InfinityDataTestId["ROOT"] = "infinity-parent";
|
|
149
|
+
return InfinityDataTestId;
|
|
150
|
+
}({});
|
|
151
|
+
exports.InfinityDataTestId = InfinityDataTestId;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _InfinityScroll.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _InfinityScroll = _interopRequireDefault(require("./InfinityScroll"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { ChangeEventHandler, DetailedHTMLProps } from "react";
|
|
1
|
+
import React, { ChangeEventHandler, DetailedHTMLProps, ReactElement } from "react";
|
|
2
2
|
export declare type InputProps = {
|
|
3
3
|
decoration?: React.ReactElement | null;
|
|
4
|
-
error?: string;
|
|
4
|
+
error?: string | ReactElement;
|
|
5
5
|
hideError?: "onfocus";
|
|
6
6
|
placeholder?: string;
|
|
7
|
-
disclaimer?: string;
|
|
7
|
+
disclaimer?: string | ReactElement;
|
|
8
8
|
multiline?: number;
|
|
9
9
|
border?: boolean;
|
|
10
10
|
icon?: {
|
|
@@ -12,6 +12,7 @@ export declare type InputProps = {
|
|
|
12
12
|
} & DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, any>;
|
|
13
13
|
Icon?: React.ReactElement;
|
|
14
14
|
onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
15
|
+
containerProps?: Omit<React.HTMLProps<HTMLDivElement>, "ref">;
|
|
15
16
|
} & Omit<React.HTMLProps<HTMLInputElement | HTMLTextAreaElement>, "ref" | "onChange">;
|
|
16
17
|
export declare enum InputTestIds {
|
|
17
18
|
DISCLAIMER = "disclaimer",
|
|
@@ -19,10 +20,10 @@ export declare enum InputTestIds {
|
|
|
19
20
|
}
|
|
20
21
|
declare const _default: React.ForwardRefExoticComponent<{
|
|
21
22
|
decoration?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined;
|
|
22
|
-
error?: string | undefined;
|
|
23
|
+
error?: string | React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
23
24
|
hideError?: "onfocus" | undefined;
|
|
24
25
|
placeholder?: string | undefined;
|
|
25
|
-
disclaimer?: string | undefined;
|
|
26
|
+
disclaimer?: string | React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
26
27
|
multiline?: number | undefined;
|
|
27
28
|
border?: boolean | undefined;
|
|
28
29
|
icon?: ({
|
|
@@ -30,5 +31,6 @@ declare const _default: React.ForwardRefExoticComponent<{
|
|
|
30
31
|
} & React.ClassAttributes<any> & React.ImgHTMLAttributes<HTMLImageElement>) | undefined;
|
|
31
32
|
Icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
32
33
|
onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
33
|
-
|
|
34
|
+
containerProps?: Omit<React.HTMLProps<HTMLDivElement>, "ref"> | undefined;
|
|
35
|
+
} & Omit<React.HTMLProps<HTMLInputElement | HTMLTextAreaElement>, "ref" | "onChange"> & React.RefAttributes<any>>;
|
|
34
36
|
export default _default;
|