@onepercentio/one-ui 0.1.7 → 0.2.2
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/dist/__test__/analytics.d.ts +3 -3
- package/dist/__test__/analytics.js +18 -18
- package/dist/__test__/firestore.d.ts +2 -1
- package/dist/__test__/firestore.js +25 -19
- package/dist/__test__/firestore.js.map +1 -1
- package/dist/__test__/utils.d.ts +17 -17
- package/dist/__test__/utils.js +187 -182
- package/dist/__test__/utils.js.map +1 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.d.ts +8 -8
- package/dist/components/AdaptiveButton/AdaptiveButton.js +84 -84
- package/dist/components/AdaptiveButton/AdaptiveButton.js.map +1 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.d.ts +18 -18
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.js +81 -81
- package/dist/components/AdaptiveButton/index.d.ts +1 -1
- package/dist/components/AdaptiveButton/index.js +8 -8
- package/dist/components/AdaptiveDialog/AdaptiveDialog.d.ts +9 -9
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +59 -89
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +1 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.d.ts +19 -19
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.js +93 -93
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.d.ts +1 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.js +14 -14
- package/dist/components/AdaptiveDialog/index.d.ts +1 -1
- package/dist/components/AdaptiveDialog/index.js +8 -8
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.d.ts +10 -7
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +69 -64
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +1 -1
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +4 -2
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.d.ts +18 -15
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.js +20 -20
- package/dist/components/AdaptiveSidebar/index.d.ts +1 -1
- package/dist/components/AdaptiveSidebar/index.js +8 -8
- package/dist/components/AnchoredTooltip/AnchoredTooltip.d.ts +13 -13
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js +173 -171
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js.map +1 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.d.ts +16 -16
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.js +85 -85
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.d.ts +1 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.js +19 -19
- package/dist/components/AnchoredTooltip/index.d.ts +1 -1
- package/dist/components/AnchoredTooltip/index.js +8 -8
- package/dist/components/AsyncWrapper/AsyncWrapper.d.ts +10 -10
- package/dist/components/AsyncWrapper/AsyncWrapper.js +24 -24
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.d.ts +18 -18
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.js +33 -33
- package/dist/components/AsyncWrapper/AsyncWrapper.test.d.ts +1 -1
- package/dist/components/AsyncWrapper/AsyncWrapper.test.js +18 -18
- package/dist/components/AsyncWrapper/index.d.ts +1 -1
- package/dist/components/AsyncWrapper/index.js +8 -8
- package/dist/components/Avatar/Avatar.d.ts +8 -8
- package/dist/components/Avatar/Avatar.js +44 -44
- package/dist/components/Avatar/Avatar.stories.d.ts +14 -14
- package/dist/components/Avatar/Avatar.stories.js +18 -18
- package/dist/components/Avatar/Avatar.test.d.ts +1 -1
- package/dist/components/Avatar/Avatar.test.js +35 -35
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Avatar/index.js +8 -8
- package/dist/components/Button/Button.d.ts +7 -7
- package/dist/components/Button/Button.js +49 -49
- package/dist/components/Button/Button.stories.d.ts +13 -13
- package/dist/components/Button/Button.stories.js +33 -33
- package/dist/components/Button/Button.test.d.ts +1 -1
- package/dist/components/Button/Button.test.js +14 -14
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +8 -8
- package/dist/components/Card/Card.d.ts +7 -7
- package/dist/components/Card/Card.js +14 -14
- package/dist/components/Card/Card.stories.d.ts +15 -15
- package/dist/components/Card/Card.stories.js +15 -15
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.js +8 -8
- package/dist/components/CheckBox/CheckBox.d.ts +11 -11
- package/dist/components/CheckBox/CheckBox.js +31 -31
- package/dist/components/CheckBox/CheckBox.stories.d.ts +20 -20
- package/dist/components/CheckBox/CheckBox.stories.js +29 -29
- package/dist/components/CheckBox/index.d.ts +1 -1
- package/dist/components/CheckBox/index.js +8 -8
- package/dist/components/Collapsable/Collapsable.d.ts +33 -33
- package/dist/components/Collapsable/Collapsable.js +128 -128
- package/dist/components/Collapsable/Collapsable.stories.d.ts +39 -39
- package/dist/components/Collapsable/Collapsable.stories.js +27 -27
- package/dist/components/Collapsable/index.d.ts +1 -1
- package/dist/components/Collapsable/index.js +8 -8
- package/dist/components/Countdown/Countdown.d.ts +13 -13
- package/dist/components/Countdown/Countdown.js +79 -79
- package/dist/components/Countdown/Countdown.stories.d.ts +14 -14
- package/dist/components/Countdown/Countdown.stories.js +31 -31
- package/dist/components/Countdown/index.d.ts +1 -1
- package/dist/components/Countdown/index.js +8 -8
- package/dist/components/Divider/Divider.d.ts +6 -6
- package/dist/components/Divider/Divider.js +15 -15
- package/dist/components/Divider/Divider.stories.d.ts +7 -7
- package/dist/components/Divider/Divider.stories.js +14 -14
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Divider/index.js +8 -8
- package/dist/components/EmailInput/EmailInput.d.ts +23 -23
- package/dist/components/EmailInput/EmailInput.js +51 -51
- package/dist/components/EmailInput/EmailInput.stories.d.ts +26 -26
- package/dist/components/EmailInput/EmailInput.stories.js +14 -14
- package/dist/components/EmailInput/EmailInput.test.d.ts +1 -1
- package/dist/components/EmailInput/EmailInput.test.js +76 -76
- package/dist/components/EmailInput/index.d.ts +1 -1
- package/dist/components/EmailInput/index.js +9 -9
- package/dist/components/FadeIn/FadeIn.d.ts +10 -10
- package/dist/components/FadeIn/FadeIn.js +63 -63
- package/dist/components/FadeIn/FadeIn.stories.d.ts +24 -24
- package/dist/components/FadeIn/FadeIn.stories.js +15 -15
- package/dist/components/FadeIn/FadeIn.test.d.ts +1 -1
- package/dist/components/FadeIn/FadeIn.test.js +21 -21
- package/dist/components/FadeIn/index.d.ts +1 -1
- package/dist/components/FadeIn/index.js +8 -8
- package/dist/components/FileInput/FileInput.d.ts +13 -13
- package/dist/components/FileInput/FileInput.js +74 -74
- package/dist/components/FileInput/FileInput.stories.d.ts +19 -19
- package/dist/components/FileInput/FileInput.stories.js +58 -58
- package/dist/components/FileInput/index.d.ts +1 -1
- package/dist/components/FileInput/index.js +8 -8
- package/dist/components/FlowController/FlowController.d.ts +23 -23
- package/dist/components/FlowController/FlowController.js +33 -33
- package/dist/components/FlowController/FlowController.stories.d.ts +43 -43
- package/dist/components/FlowController/FlowController.stories.js +100 -100
- package/dist/components/FlowController/FlowController.test.d.ts +1 -1
- package/dist/components/FlowController/FlowController.test.js +165 -165
- package/dist/components/FlowController/index.d.ts +1 -1
- package/dist/components/FlowController/index.js +8 -8
- package/dist/components/Form/Form.d.ts +40 -40
- package/dist/components/Form/Form.js +91 -91
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/Form/index.js +8 -8
- package/dist/components/Freeze/Freeze.d.ts +5 -5
- package/dist/components/Freeze/Freeze.js +12 -12
- package/dist/components/Freeze/Freeze.stories.d.ts +7 -7
- package/dist/components/Freeze/Freeze.stories.js +55 -55
- package/dist/components/Freeze/Freeze.test.d.ts +1 -1
- package/dist/components/Freeze/Freeze.test.js +14 -14
- package/dist/components/Freeze/index.d.ts +1 -1
- package/dist/components/Freeze/index.js +8 -8
- package/dist/components/HSForms/HSForms.d.ts +5 -5
- package/dist/components/HSForms/HSForms.js +46 -46
- package/dist/components/HSForms/index.d.ts +1 -1
- package/dist/components/HSForms/index.js +8 -8
- package/dist/components/Header/Header.d.ts +25 -25
- package/dist/components/Header/Header.js +74 -74
- package/dist/components/Header/Header.stories.d.ts +28 -28
- package/dist/components/Header/Header.stories.js +40 -40
- package/dist/components/Header/Header.test.d.ts +1 -1
- package/dist/components/Header/Header.test.js +99 -99
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Header/index.js +8 -8
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.d.ts +8 -8
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +16 -16
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.d.ts +14 -14
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.js +15 -15
- package/dist/components/HeaderCloseBtn/index.d.ts +1 -1
- package/dist/components/HeaderCloseBtn/index.js +8 -8
- package/dist/components/InfinityScroll/InfinityScroll.d.ts +11 -11
- package/dist/components/InfinityScroll/InfinityScroll.js +111 -111
- package/dist/components/InfinityScroll/InfinityScroll.stories.d.ts +23 -23
- package/dist/components/InfinityScroll/InfinityScroll.stories.js +53 -53
- package/dist/components/InfinityScroll/InfinityScroll.test.d.ts +1 -1
- package/dist/components/InfinityScroll/InfinityScroll.test.js +188 -188
- package/dist/components/InfinityScroll/index.d.ts +1 -1
- package/dist/components/InfinityScroll/index.js +8 -8
- package/dist/components/Input/Input.d.ts +30 -30
- package/dist/components/Input/Input.js +93 -93
- package/dist/components/Input/Input.stories.d.ts +22 -22
- package/dist/components/Input/Input.stories.js +20 -20
- package/dist/components/Input/Input.test.d.ts +1 -1
- package/dist/components/Input/Input.test.js +57 -57
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +8 -8
- package/dist/components/InstantCounter/InstantCounter.d.ts +13 -13
- package/dist/components/InstantCounter/InstantCounter.js +58 -58
- package/dist/components/InstantCounter/InstantCounter.stories.d.ts +28 -28
- package/dist/components/InstantCounter/InstantCounter.stories.js +15 -15
- package/dist/components/InstantCounter/InstantCounter.test.d.ts +1 -1
- package/dist/components/InstantCounter/InstantCounter.test.js +49 -49
- package/dist/components/InstantCounter/index.d.ts +1 -1
- package/dist/components/InstantCounter/index.js +8 -8
- package/dist/components/LinkToId/LinkToId.d.ts +10 -10
- package/dist/components/LinkToId/LinkToId.js +32 -32
- package/dist/components/LinkToId/LinkToId.test.d.ts +1 -1
- package/dist/components/LinkToId/LinkToId.test.js +11 -11
- package/dist/components/LinkToId/index.d.ts +1 -1
- package/dist/components/LinkToId/index.js +9 -9
- package/dist/components/Loader/Loader.d.ts +6 -6
- package/dist/components/Loader/Loader.js +17 -17
- package/dist/components/Loader/Loader.stories.d.ts +12 -12
- package/dist/components/Loader/Loader.stories.js +15 -15
- package/dist/components/Loader/index.d.ts +1 -1
- package/dist/components/Loader/index.js +8 -8
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.d.ts +6 -6
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +41 -41
- package/dist/components/LoaderDotsIndicator/index.d.ts +1 -1
- package/dist/components/LoaderDotsIndicator/index.js +8 -8
- package/dist/components/MainGrid/MainGrid.d.ts +10 -10
- package/dist/components/MainGrid/MainGrid.js +55 -55
- package/dist/components/MainGrid/MainGrid.stories.d.ts +14 -14
- package/dist/components/MainGrid/MainGrid.stories.js +69 -69
- package/dist/components/MainGrid/MainGrid.test.d.ts +1 -1
- package/dist/components/MainGrid/MainGrid.test.js +17 -17
- package/dist/components/MainGrid/index.d.ts +1 -1
- package/dist/components/MainGrid/index.js +8 -8
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.d.ts +8 -8
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +29 -29
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +23 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.d.ts +14 -14
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.js +15 -15
- package/dist/components/MutableHamburgerButton/index.d.ts +1 -1
- package/dist/components/MutableHamburgerButton/index.js +8 -8
- package/dist/components/Notification/Notification.d.ts +7 -7
- package/dist/components/Notification/Notification.js +15 -15
- package/dist/components/Notification/Notification.stories.d.ts +15 -15
- package/dist/components/Notification/Notification.stories.js +18 -18
- package/dist/components/Notification/index.d.ts +1 -1
- package/dist/components/Notification/index.js +8 -8
- package/dist/components/Parallax/Parallax.d.ts +15 -15
- package/dist/components/Parallax/Parallax.js +174 -174
- package/dist/components/Parallax/Parallax.stories.d.ts +32 -32
- package/dist/components/Parallax/Parallax.stories.js +22 -22
- package/dist/components/Parallax/Parallax.test.d.ts +1 -1
- package/dist/components/Parallax/Parallax.test.js +21 -21
- package/dist/components/Parallax/index.d.ts +1 -1
- package/dist/components/Parallax/index.js +8 -8
- package/dist/components/Parallax/math/helpers.d.ts +58 -58
- package/dist/components/Parallax/math/helpers.js +228 -228
- package/dist/components/PasswordInput/PasswordInput.d.ts +40 -40
- package/dist/components/PasswordInput/PasswordInput.js +105 -105
- package/dist/components/PasswordInput/PasswordInput.test.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.test.js +156 -156
- package/dist/components/PasswordInput/index.d.ts +1 -1
- package/dist/components/PasswordInput/index.js +8 -8
- package/dist/components/PixelatedScan/PixelatedScan.d.ts +8 -8
- package/dist/components/PixelatedScan/PixelatedScan.js +104 -104
- package/dist/components/PixelatedScan/PixelatedScan.stories.d.ts +15 -15
- package/dist/components/PixelatedScan/PixelatedScan.stories.js +39 -39
- package/dist/components/PixelatedScan/index.d.ts +1 -1
- package/dist/components/PixelatedScan/index.js +8 -8
- package/dist/components/ProgressTexts/ProgressTexts.d.ts +22 -22
- package/dist/components/ProgressTexts/ProgressTexts.js +37 -37
- package/dist/components/ProgressTexts/ProgressTexts.stories.d.ts +24 -24
- package/dist/components/ProgressTexts/ProgressTexts.stories.js +89 -89
- package/dist/components/ProgressTexts/ProgressTexts.test.d.ts +1 -1
- package/dist/components/ProgressTexts/ProgressTexts.test.js +51 -51
- package/dist/components/ProgressTexts/index.d.ts +1 -1
- package/dist/components/ProgressTexts/index.js +8 -8
- package/dist/components/SectionContainer/SectionContainer.d.ts +11 -11
- package/dist/components/SectionContainer/SectionContainer.js +45 -45
- package/dist/components/SectionContainer/index.d.ts +1 -1
- package/dist/components/SectionContainer/index.js +8 -8
- package/dist/components/Select/Select.d.ts +22 -22
- package/dist/components/Select/Select.js +75 -75
- package/dist/components/Select/Select.stories.d.ts +52 -52
- package/dist/components/Select/Select.stories.js +33 -33
- package/dist/components/Select/Select.test.d.ts +1 -1
- package/dist/components/Select/Select.test.js +11 -11
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.js +8 -8
- package/dist/components/Spacing/Spacing.d.ts +6 -6
- package/dist/components/Spacing/Spacing.js +14 -14
- package/dist/components/Spacing/Spacing.stories.d.ts +7 -7
- package/dist/components/Spacing/Spacing.stories.js +34 -34
- package/dist/components/Spacing/index.d.ts +1 -1
- package/dist/components/Spacing/index.js +8 -8
- package/dist/components/Table/Table.d.ts +19 -19
- package/dist/components/Table/Table.js +87 -87
- package/dist/components/Table/Table.stories.d.ts +15 -15
- package/dist/components/Table/Table.stories.js +87 -87
- package/dist/components/Table/Table.test.d.ts +1 -1
- package/dist/components/Table/Table.test.js +34 -34
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/index.js +8 -8
- package/dist/components/Tabs/Tabs.d.ts +11 -11
- package/dist/components/Tabs/Tabs.js +48 -48
- package/dist/components/Tabs/Tabs.test.d.ts +1 -1
- package/dist/components/Tabs/Tabs.test.js +38 -38
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/index.js +8 -8
- package/dist/components/Text/Text.d.ts +8 -8
- package/dist/components/Text/Text.js +51 -51
- package/dist/components/Text/Text.stories.d.ts +12 -12
- package/dist/components/Text/Text.stories.js +19 -19
- package/dist/components/Text/Text.test.d.ts +1 -1
- package/dist/components/Text/Text.test.js +11 -11
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/index.js +8 -8
- package/dist/components/Transition/Transition.d.ts +44 -44
- package/dist/components/Transition/Transition.js +226 -226
- package/dist/components/Transition/Transition.stories.d.ts +10 -10
- package/dist/components/Transition/Transition.stories.js +28 -28
- package/dist/components/Transition/Transition.test.d.ts +1 -1
- package/dist/components/Transition/Transition.test.js +54 -54
- package/dist/components/Transition/index.d.ts +1 -1
- package/dist/components/Transition/index.js +9 -9
- package/dist/components/UncontrolledTransition/UncontrolledTransition.d.ts +12 -12
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js +95 -95
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.d.ts +30 -30
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js +183 -183
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.d.ts +1 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.js +134 -134
- package/dist/components/UncontrolledTransition/index.d.ts +1 -1
- package/dist/components/UncontrolledTransition/index.js +8 -8
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.d.ts +52 -35
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +121 -89
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +1 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.d.ts +70 -47
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js +64 -55
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js.map +1 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.d.ts +1 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.js +136 -136
- package/dist/components/WalletConnectionWrapper/index.d.ts +1 -1
- package/dist/components/WalletConnectionWrapper/index.js +9 -8
- package/dist/components/WalletConnectionWrapper/index.js.map +1 -1
- package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.d.ts +40 -0
- package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.js +130 -0
- package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.stories.d.ts +59 -0
- package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.stories.js +62 -0
- package/dist/components/WalletConnectionWrapper/v2/WalletConnectionWrapper.stories.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/v2/index.d.ts +1 -0
- package/dist/components/WalletConnectionWrapper/v2/index.js +9 -0
- package/dist/components/WalletConnectionWrapper/v2/index.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/v2/rLoginConfig.d.ts +6 -0
- package/dist/components/WalletConnectionWrapper/v2/rLoginConfig.js +52 -0
- package/dist/components/WalletConnectionWrapper/v2/rLoginConfig.js.map +1 -0
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.d.ts +7 -0
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +71 -0
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js.map +1 -0
- package/dist/components/utilitary/ScrollAndFocusLock/index.d.ts +1 -0
- package/dist/components/utilitary/ScrollAndFocusLock/index.js +9 -0
- package/dist/components/utilitary/ScrollAndFocusLock/index.js.map +1 -0
- package/dist/context/OneUIProvider.d.ts +67 -64
- package/dist/context/OneUIProvider.js +63 -63
- package/dist/context/OneUIProvider.js.map +1 -1
- package/dist/context/OneUIProvider.test.d.ts +1 -1
- package/dist/context/OneUIProvider.test.js +44 -44
- package/dist/context/__mocks__/OneUIProvider.d.ts +67 -64
- package/dist/context/__mocks__/OneUIProvider.js +12 -12
- package/dist/hooks/shims/ObjectWatchShim.d.ts +0 -0
- package/dist/hooks/shims/ObjectWatchShim.js +48 -0
- package/dist/hooks/shims/ObjectWatchShim.js.map +1 -0
- package/dist/hooks/useAsyncControl.d.ts +9 -9
- package/dist/hooks/useAsyncControl.js +39 -39
- package/dist/hooks/useIntersection.d.ts +4 -4
- package/dist/hooks/useIntersection.js +29 -29
- package/dist/hooks/useObserve.d.ts +2 -0
- package/dist/hooks/useObserve.js +14 -0
- package/dist/hooks/useObserve.js.map +1 -0
- package/dist/hooks/usePagination.d.ts +19 -19
- package/dist/hooks/usePagination.js +64 -64
- package/dist/hooks/usePooledOperation.d.ts +15 -15
- package/dist/hooks/usePooledOperation.js +63 -63
- package/dist/hooks/usePooling.d.ts +16 -16
- package/dist/hooks/usePooling.js +46 -46
- package/dist/hooks/usePooling.test.d.ts +1 -1
- package/dist/hooks/usePooling.test.js +103 -103
- package/dist/hooks/useScrollLock.d.ts +0 -0
- package/dist/hooks/useScrollLock.js +2 -0
- package/dist/hooks/useScrollLock.js.map +1 -0
- package/dist/hooks/useShortIntl.d.ts +14 -14
- package/dist/hooks/useShortIntl.js +34 -34
- package/dist/models/GenericContract.d.ts +66 -66
- package/dist/models/GenericContract.js +13 -13
- package/dist/storybookUtils/index.d.ts +5 -5
- package/dist/storybookUtils/index.js +26 -26
- package/package.json +7 -4
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useOneUIContext = exports.ProtectVariableAccess = void 0;
|
|
7
|
-
const lodash_1 = require("lodash");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const react_2 = require("react");
|
|
10
|
-
const Context = (0, react_2.createContext)(null);
|
|
11
|
-
function OneUIProvider({ children, config, }) {
|
|
12
|
-
return react_1.default.createElement(Context.Provider, { value: config }, children);
|
|
13
|
-
}
|
|
14
|
-
exports.default = OneUIProvider;
|
|
15
|
-
const debouncedError = (0, lodash_1.debounce)((message) => {
|
|
16
|
-
const event = new Event("error");
|
|
17
|
-
event.error = new Error(message);
|
|
18
|
-
window.dispatchEvent(event);
|
|
19
|
-
}, 100);
|
|
20
|
-
const IGNORED_KEYS = ["className"];
|
|
21
|
-
function ProtectVariableAccess(obj, basePath = []) {
|
|
22
|
-
const proxyInstance = new Proxy(() => obj || {}, {
|
|
23
|
-
apply: (target) => {
|
|
24
|
-
return String(target());
|
|
25
|
-
},
|
|
26
|
-
get: (ctx, variable) => {
|
|
27
|
-
const value = ctx()[variable];
|
|
28
|
-
if (variable === Symbol.toPrimitive)
|
|
29
|
-
return () => value;
|
|
30
|
-
if (value === undefined) {
|
|
31
|
-
const path = [...basePath, variable.toString()];
|
|
32
|
-
if (/[^A-Z]/.test(String(variable).charAt(0))) {
|
|
33
|
-
switch (basePath.join(".")) {
|
|
34
|
-
case "component.text.className":
|
|
35
|
-
return undefined;
|
|
36
|
-
case "component.text":
|
|
37
|
-
case "component.input":
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
if (!IGNORED_KEYS.includes(path[path.length - 1]))
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useOneUIContext = exports.ProtectVariableAccess = void 0;
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
const Context = (0, react_2.createContext)(null);
|
|
11
|
+
function OneUIProvider({ children, config, }) {
|
|
12
|
+
return react_1.default.createElement(Context.Provider, { value: config }, children);
|
|
13
|
+
}
|
|
14
|
+
exports.default = OneUIProvider;
|
|
15
|
+
const debouncedError = (0, lodash_1.debounce)((message) => {
|
|
16
|
+
const event = new Event("error");
|
|
17
|
+
event.error = new Error(message);
|
|
18
|
+
window.dispatchEvent(event);
|
|
19
|
+
}, 100);
|
|
20
|
+
const IGNORED_KEYS = ["className"];
|
|
21
|
+
function ProtectVariableAccess(obj, basePath = []) {
|
|
22
|
+
const proxyInstance = new Proxy(() => obj || {}, {
|
|
23
|
+
apply: (target) => {
|
|
24
|
+
return String(target());
|
|
25
|
+
},
|
|
26
|
+
get: (ctx, variable) => {
|
|
27
|
+
const value = ctx()[variable];
|
|
28
|
+
if (variable === Symbol.toPrimitive)
|
|
29
|
+
return () => value;
|
|
30
|
+
if (value === undefined) {
|
|
31
|
+
const path = [...basePath, variable.toString()];
|
|
32
|
+
if (/[^A-Z]/.test(String(variable).charAt(0))) {
|
|
33
|
+
switch (basePath.join(".")) {
|
|
34
|
+
case "component.text.className":
|
|
35
|
+
return undefined;
|
|
36
|
+
case "component.text":
|
|
37
|
+
case "component.input":
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
if (!IGNORED_KEYS.includes(path[path.length - 1]))
|
|
41
41
|
debouncedError(`A component is using the UI config ${path.join(".")}.
|
|
42
42
|
|
|
43
43
|
Please define it using:
|
|
@@ -45,27 +45,27 @@ import OneUIProvider from "@onepercent/one-ui/dist/context/OneUIProvider";
|
|
|
45
45
|
...
|
|
46
46
|
<OneUIProvider config={THE_MISSING_CONFIG}>
|
|
47
47
|
...
|
|
48
|
-
</OneUIProvider>`);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
debouncedError.cancel();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if ((typeof value === "object" && !Array.isArray(value)) ||
|
|
55
|
-
(value === undefined && /[^A-Z]/.test(String(variable).charAt(0))))
|
|
56
|
-
return ProtectVariableAccess(value, [...basePath, variable.toString()]);
|
|
57
|
-
return value;
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
return proxyInstance;
|
|
61
|
-
}
|
|
62
|
-
exports.ProtectVariableAccess = ProtectVariableAccess;
|
|
63
|
-
function useOneUIContext() {
|
|
64
|
-
const context = (0, react_2.useContext)(Context);
|
|
65
|
-
if (process.env.NODE_ENV === "development") {
|
|
66
|
-
return ProtectVariableAccess(context);
|
|
67
|
-
}
|
|
68
|
-
return context;
|
|
69
|
-
}
|
|
70
|
-
exports.useOneUIContext = useOneUIContext;
|
|
48
|
+
</OneUIProvider>`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
debouncedError.cancel();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if ((typeof value === "object" && !Array.isArray(value)) ||
|
|
55
|
+
(value === undefined && /[^A-Z]/.test(String(variable).charAt(0))))
|
|
56
|
+
return ProtectVariableAccess(value, [...basePath, variable.toString()]);
|
|
57
|
+
return value;
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
return proxyInstance;
|
|
61
|
+
}
|
|
62
|
+
exports.ProtectVariableAccess = ProtectVariableAccess;
|
|
63
|
+
function useOneUIContext() {
|
|
64
|
+
const context = (0, react_2.useContext)(Context);
|
|
65
|
+
if (process.env.NODE_ENV === "development") {
|
|
66
|
+
return ProtectVariableAccess(context);
|
|
67
|
+
}
|
|
68
|
+
return context;
|
|
69
|
+
}
|
|
70
|
+
exports.useOneUIContext = useOneUIContext;
|
|
71
71
|
//# sourceMappingURL=OneUIProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneUIProvider.js","sourceRoot":"","sources":["../../src/context/OneUIProvider.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAkC;AAClC,kDAA0B;AAC1B,iCAAqE;
|
|
1
|
+
{"version":3,"file":"OneUIProvider.js","sourceRoot":"","sources":["../../src/context/OneUIProvider.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAkC;AAClC,kDAA0B;AAC1B,iCAAqE;AA0DrE,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAqB,IAAW,CAAC,CAAC;AAE/D,SAAwB,aAAa,CAAC,EACpC,QAAQ,EACR,MAAM,GAC4C;IAClD,OAAO,8BAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,IAAG,QAAQ,CAAoB,CAAC;AACxE,CAAC;AALD,gCAKC;AAED,MAAM,cAAc,GAAG,IAAA,iBAAQ,EAAC,CAAC,OAAe,EAAE,EAAE;IAClD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC,KAAa,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC,EAAE,GAAG,CAAC,CAAC;AAER,MAAM,YAAY,GAAG,CAAC,WAAW,CAAC,CAAC;AAEnC,SAAgB,qBAAqB,CAAC,GAAS,EAAE,WAAqB,EAAE;IACtE,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE;QAC/C,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE;YAChB,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1B,CAAC;QACD,GAAG,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,QAAwC,CAAC,CAAC;YAC9D,IAAI,QAAQ,KAAK,MAAM,CAAC,WAAW;gBAAE,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;YACxD,IAAI,KAAK,KAAK,SAAS,EAAE;gBACvB,MAAM,IAAI,GAAG,CAAC,GAAG,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAChD,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;oBAC7C,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;wBAC1B,KAAK,0BAA0B;4BAC7B,OAAO,SAAS,CAAC;wBACnB,KAAK,gBAAgB,CAAC;wBACtB,KAAK,iBAAiB;4BACpB,OAAO,EAAE,CAAC;qBACb;oBACD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;wBAC/C,cAAc,CACZ,sCAAsC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;;;;;;;mBAO/C,CACN,CAAC;iBACL;qBAAM;oBACL,cAAc,CAAC,MAAM,EAAE,CAAC;iBACzB;aACF;YACD,IACE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACpD,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAElE,OAAO,qBAAqB,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACvB,CAAC;AA1CD,sDA0CC;AAED,SAAgB,eAAe;IAC7B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,OAAO,qBAAqB,CAAC,OAAO,CAAiB,CAAC;KACvD;IAED,OAAO,OAAuB,CAAC;AACjC,CAAC;AARD,0CAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const OneUIProvider_1 = require("./OneUIProvider");
|
|
4
|
-
const loggingSpy = jest.spyOn(console, "error");
|
|
5
|
-
loggingSpy.mockImplementation(() => { });
|
|
6
|
-
describe("The proxy that protects variable access", () => {
|
|
7
|
-
it("Should work when there is no object (the provider is not added yet)", () => {
|
|
8
|
-
(0, OneUIProvider_1.ProtectVariableAccess)();
|
|
9
|
-
});
|
|
10
|
-
it("Should work when there is a concatenation", () => {
|
|
11
|
-
const val = (0, OneUIProvider_1.ProtectVariableAccess)(() => { });
|
|
12
|
-
expect("" + val).toBeDefined();
|
|
13
|
-
});
|
|
14
|
-
it("Should work when there is an or", () => {
|
|
15
|
-
const val = (0, OneUIProvider_1.ProtectVariableAccess)(() => { });
|
|
16
|
-
expect(val || "expectedResult").toEqual("expectedResult");
|
|
17
|
-
});
|
|
18
|
-
it("Should log expected value", () => {
|
|
19
|
-
const a = (0, OneUIProvider_1.ProtectVariableAccess)({ some: { prop: "string" } });
|
|
20
|
-
// expect("Result: " + a).toEqual("Result: [object Object]");
|
|
21
|
-
expect("Result: " + a.some.prop).toEqual("Result: string");
|
|
22
|
-
});
|
|
23
|
-
it("Should display the path to the file when it doesn't exists", () => {
|
|
24
|
-
const protectedObject = (0, OneUIProvider_1.ProtectVariableAccess)({});
|
|
25
|
-
protectedObject.undefinedProperty;
|
|
26
|
-
expect(loggingSpy).toHaveBeenCalledWith(expect.stringContaining("undefinedProperty"));
|
|
27
|
-
jest.clearAllMocks();
|
|
28
|
-
const protectedObjectWithSecondLevelDependency = (0, OneUIProvider_1.ProtectVariableAccess)({
|
|
29
|
-
undefinedProperty: {},
|
|
30
|
-
});
|
|
31
|
-
protectedObjectWithSecondLevelDependency.undefinedProperty
|
|
32
|
-
.thisShouldNotCrash;
|
|
33
|
-
expect(loggingSpy).toHaveBeenCalledWith(expect.stringContaining("undefinedProperty.thisShouldNotCrash"));
|
|
34
|
-
jest.clearAllMocks();
|
|
35
|
-
const protectedObjectWithThirddLevelDependency = (0, OneUIProvider_1.ProtectVariableAccess)({
|
|
36
|
-
undefinedProperty: {
|
|
37
|
-
thisShouldNotCrash: {},
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
protectedObjectWithThirddLevelDependency.undefinedProperty
|
|
41
|
-
.thisShouldNotCrash.andThisShouldFollowAllThePath;
|
|
42
|
-
expect(loggingSpy).toHaveBeenCalledWith(expect.stringContaining("undefinedProperty.thisShouldNotCrash.andThisShouldFollowAllThePath"));
|
|
43
|
-
});
|
|
44
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const OneUIProvider_1 = require("./OneUIProvider");
|
|
4
|
+
const loggingSpy = jest.spyOn(console, "error");
|
|
5
|
+
loggingSpy.mockImplementation(() => { });
|
|
6
|
+
describe("The proxy that protects variable access", () => {
|
|
7
|
+
it("Should work when there is no object (the provider is not added yet)", () => {
|
|
8
|
+
(0, OneUIProvider_1.ProtectVariableAccess)();
|
|
9
|
+
});
|
|
10
|
+
it("Should work when there is a concatenation", () => {
|
|
11
|
+
const val = (0, OneUIProvider_1.ProtectVariableAccess)(() => { });
|
|
12
|
+
expect("" + val).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
it("Should work when there is an or", () => {
|
|
15
|
+
const val = (0, OneUIProvider_1.ProtectVariableAccess)(() => { });
|
|
16
|
+
expect(val || "expectedResult").toEqual("expectedResult");
|
|
17
|
+
});
|
|
18
|
+
it("Should log expected value", () => {
|
|
19
|
+
const a = (0, OneUIProvider_1.ProtectVariableAccess)({ some: { prop: "string" } });
|
|
20
|
+
// expect("Result: " + a).toEqual("Result: [object Object]");
|
|
21
|
+
expect("Result: " + a.some.prop).toEqual("Result: string");
|
|
22
|
+
});
|
|
23
|
+
it("Should display the path to the file when it doesn't exists", () => {
|
|
24
|
+
const protectedObject = (0, OneUIProvider_1.ProtectVariableAccess)({});
|
|
25
|
+
protectedObject.undefinedProperty;
|
|
26
|
+
expect(loggingSpy).toHaveBeenCalledWith(expect.stringContaining("undefinedProperty"));
|
|
27
|
+
jest.clearAllMocks();
|
|
28
|
+
const protectedObjectWithSecondLevelDependency = (0, OneUIProvider_1.ProtectVariableAccess)({
|
|
29
|
+
undefinedProperty: {},
|
|
30
|
+
});
|
|
31
|
+
protectedObjectWithSecondLevelDependency.undefinedProperty
|
|
32
|
+
.thisShouldNotCrash;
|
|
33
|
+
expect(loggingSpy).toHaveBeenCalledWith(expect.stringContaining("undefinedProperty.thisShouldNotCrash"));
|
|
34
|
+
jest.clearAllMocks();
|
|
35
|
+
const protectedObjectWithThirddLevelDependency = (0, OneUIProvider_1.ProtectVariableAccess)({
|
|
36
|
+
undefinedProperty: {
|
|
37
|
+
thisShouldNotCrash: {},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
protectedObjectWithThirddLevelDependency.undefinedProperty
|
|
41
|
+
.thisShouldNotCrash.andThisShouldFollowAllThePath;
|
|
42
|
+
expect(loggingSpy).toHaveBeenCalledWith(expect.stringContaining("undefinedProperty.thisShouldNotCrash.andThisShouldFollowAllThePath"));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
45
|
//# sourceMappingURL=OneUIProvider.test.js.map
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
export declare function useOneUIContext(): {
|
|
3
|
-
component?: {
|
|
4
|
-
text?: {
|
|
5
|
-
className?: {
|
|
6
|
-
link?: string | undefined;
|
|
7
|
-
caption?: string | undefined;
|
|
8
|
-
title?: string | undefined;
|
|
9
|
-
content?: string | undefined;
|
|
10
|
-
description?: string | undefined;
|
|
11
|
-
error?: string | undefined;
|
|
12
|
-
highlightTitle?: string | undefined;
|
|
13
|
-
highlight?: string | undefined;
|
|
14
|
-
subtitle?: string | undefined;
|
|
15
|
-
boldTitle?: string | undefined;
|
|
16
|
-
boldTitleBig?: string | undefined;
|
|
17
|
-
} | undefined;
|
|
18
|
-
} | undefined;
|
|
19
|
-
input?: {
|
|
20
|
-
className?: string | undefined;
|
|
21
|
-
border?: boolean | undefined;
|
|
22
|
-
} | undefined;
|
|
23
|
-
fileInput?: {
|
|
24
|
-
Icon?: (() => JSX.Element) | undefined;
|
|
25
|
-
} | undefined;
|
|
26
|
-
passwordInput?: {
|
|
27
|
-
iconSrc?: {
|
|
28
|
-
passwordHidden?: string | undefined;
|
|
29
|
-
passwordVisible?: string | undefined;
|
|
30
|
-
} | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
asyncWrapper?: {
|
|
33
|
-
LoadingComponent?: {} | undefined;
|
|
34
|
-
messages?: {
|
|
35
|
-
error?: {
|
|
36
|
-
title?: string | undefined;
|
|
37
|
-
retryBtn?: string | undefined;
|
|
38
|
-
} | undefined;
|
|
39
|
-
} | undefined;
|
|
40
|
-
} | undefined;
|
|
41
|
-
select?: {
|
|
42
|
-
StateIndicator?: ((props: {
|
|
43
|
-
open: boolean;
|
|
44
|
-
}) => JSX.Element) | undefined;
|
|
45
|
-
} | undefined;
|
|
46
|
-
header?: {
|
|
47
|
-
LogoImage?: (() => JSX.Element) | undefined;
|
|
48
|
-
MoreOptions?: (({ open }: {
|
|
49
|
-
open: boolean;
|
|
50
|
-
}) => JSX.Element) | undefined;
|
|
51
|
-
} | undefined;
|
|
52
|
-
table?: {
|
|
53
|
-
controls?: {
|
|
54
|
-
PrevPage?: (({ disabled }: {
|
|
55
|
-
disabled: boolean;
|
|
56
|
-
}) => JSX.Element) | undefined;
|
|
57
|
-
NextPage?: (({ disabled }: {
|
|
58
|
-
disabled: boolean;
|
|
59
|
-
}) => JSX.Element) | undefined;
|
|
60
|
-
} | undefined;
|
|
61
|
-
} | undefined;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
export declare function useOneUIContext(): {
|
|
3
|
+
component?: {
|
|
4
|
+
text?: {
|
|
5
|
+
className?: {
|
|
6
|
+
link?: string | undefined;
|
|
7
|
+
caption?: string | undefined;
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
content?: string | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
error?: string | undefined;
|
|
12
|
+
highlightTitle?: string | undefined;
|
|
13
|
+
highlight?: string | undefined;
|
|
14
|
+
subtitle?: string | undefined;
|
|
15
|
+
boldTitle?: string | undefined;
|
|
16
|
+
boldTitleBig?: string | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
input?: {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
border?: boolean | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
fileInput?: {
|
|
24
|
+
Icon?: (() => JSX.Element) | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
passwordInput?: {
|
|
27
|
+
iconSrc?: {
|
|
28
|
+
passwordHidden?: string | undefined;
|
|
29
|
+
passwordVisible?: string | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
asyncWrapper?: {
|
|
33
|
+
LoadingComponent?: {} | undefined;
|
|
34
|
+
messages?: {
|
|
35
|
+
error?: {
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
retryBtn?: string | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
select?: {
|
|
42
|
+
StateIndicator?: ((props: {
|
|
43
|
+
open: boolean;
|
|
44
|
+
}) => JSX.Element) | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
header?: {
|
|
47
|
+
LogoImage?: (() => JSX.Element) | undefined;
|
|
48
|
+
MoreOptions?: (({ open }: {
|
|
49
|
+
open: boolean;
|
|
50
|
+
}) => JSX.Element) | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
table?: {
|
|
53
|
+
controls?: {
|
|
54
|
+
PrevPage?: (({ disabled }: {
|
|
55
|
+
disabled: boolean;
|
|
56
|
+
}) => JSX.Element) | undefined;
|
|
57
|
+
NextPage?: (({ disabled }: {
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
}) => JSX.Element) | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
tooltip?: {
|
|
63
|
+
className?: string | undefined;
|
|
64
|
+
} | undefined;
|
|
65
|
+
} | undefined;
|
|
66
|
+
};
|
|
67
|
+
export declare function setupMock(ctx: ComponentProps<typeof import("../OneUIProvider")["default"]>["config"]): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupMock = exports.useOneUIContext = void 0;
|
|
4
|
-
let MockedProvider;
|
|
5
|
-
function useOneUIContext() {
|
|
6
|
-
return MockedProvider;
|
|
7
|
-
}
|
|
8
|
-
exports.useOneUIContext = useOneUIContext;
|
|
9
|
-
function setupMock(ctx) {
|
|
10
|
-
MockedProvider = ctx;
|
|
11
|
-
}
|
|
12
|
-
exports.setupMock = setupMock;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupMock = exports.useOneUIContext = void 0;
|
|
4
|
+
let MockedProvider;
|
|
5
|
+
function useOneUIContext() {
|
|
6
|
+
return MockedProvider;
|
|
7
|
+
}
|
|
8
|
+
exports.useOneUIContext = useOneUIContext;
|
|
9
|
+
function setupMock(ctx) {
|
|
10
|
+
MockedProvider = ctx;
|
|
11
|
+
}
|
|
12
|
+
exports.setupMock = setupMock;
|
|
13
13
|
//# sourceMappingURL=OneUIProvider.js.map
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// object.watch
|
|
4
|
+
if (!Object.prototype.watch)
|
|
5
|
+
Object.prototype.watch = function (propsToWatchFor, handler) {
|
|
6
|
+
propsToWatchFor.forEach((prop) => {
|
|
7
|
+
var oldval = this[prop], newval = oldval, getter = function () {
|
|
8
|
+
return newval;
|
|
9
|
+
}, setter = function (val) {
|
|
10
|
+
if (this._watchTimer)
|
|
11
|
+
clearTimeout(this._watchTimer);
|
|
12
|
+
this._watchTimer = setTimeout(() => {
|
|
13
|
+
handler.call();
|
|
14
|
+
clearTimeout(this._watchTimer);
|
|
15
|
+
delete this._watchTimer;
|
|
16
|
+
}, 0);
|
|
17
|
+
oldval = newval;
|
|
18
|
+
newval = val;
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
if (delete this[prop]) {
|
|
22
|
+
// can't watch constants
|
|
23
|
+
if (Object.defineProperty)
|
|
24
|
+
// ECMAScript 5
|
|
25
|
+
Object.defineProperty(this, prop, {
|
|
26
|
+
get: getter,
|
|
27
|
+
set: setter,
|
|
28
|
+
});
|
|
29
|
+
else if (Object.prototype.__defineGetter__ &&
|
|
30
|
+
Object.prototype.__defineSetter__) {
|
|
31
|
+
// legacy
|
|
32
|
+
Object.prototype.__defineGetter__.call(this, prop, getter);
|
|
33
|
+
Object.prototype.__defineSetter__.call(this, prop, setter);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
function _unwatch(prop) {
|
|
38
|
+
var val = this[prop];
|
|
39
|
+
delete this[prop]; // remove accessors
|
|
40
|
+
this[prop] = val;
|
|
41
|
+
}
|
|
42
|
+
this.unwatch = function () {
|
|
43
|
+
propsToWatchFor.forEach((prop) => {
|
|
44
|
+
_unwatch(prop);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=ObjectWatchShim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectWatchShim.js","sourceRoot":"","sources":["../../../src/hooks/shims/ObjectWatchShim.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,eAAe;AACf,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK;IACzB,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,eAAe,EAAE,OAAO;QACzD,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC/B,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,EACrB,MAAM,GAAG,MAAM,EACf,MAAM,GAAG;gBACP,OAAO,MAAM,CAAC;YAChB,CAAC,EACD,MAAM,GAAG,UAAU,GAAG;gBACpB,IAAI,IAAI,CAAC,WAAW;oBAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACrD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE;oBACjC,OAAO,CAAC,IAAI,EAAE,CAAC;oBACf,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBAC/B,OAAO,IAAI,CAAC,WAAW,CAAC;gBAC1B,CAAC,EAAE,CAAC,CAAC,CAAC;gBACN,MAAM,GAAG,MAAM,CAAC;gBAChB,MAAM,GAAG,GAAG,CAAC;gBACb,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;YACJ,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE;gBACrB,wBAAwB;gBACxB,IAAI,MAAM,CAAC,cAAc;oBACvB,eAAe;oBACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE;wBAChC,GAAG,EAAE,MAAM;wBACX,GAAG,EAAE,MAAM;qBACZ,CAAC,CAAC;qBACA,IACH,MAAM,CAAC,SAAS,CAAC,gBAAgB;oBACjC,MAAM,CAAC,SAAS,CAAC,gBAAgB,EACjC;oBACA,SAAS;oBACT,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;oBAC3D,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;iBAC5D;aACF;QACH,CAAC,CAAC,CAAC;QACH,SAAS,QAAQ,CAAC,IAAI;YACpB,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB;YACtC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QACnB,CAAC;QACD,IAAI,CAAC,OAAO,GAAG;YACb,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC/B,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CommonErrorCodes } from "../types";
|
|
3
|
-
export default function useAsyncControl<E extends CommonErrorCodes>(): {
|
|
4
|
-
process: (asyncFn: () => Promise<any>) => Promise<void>;
|
|
5
|
-
loading: boolean;
|
|
6
|
-
error: E | undefined;
|
|
7
|
-
setError: import("react").Dispatch<import("react").SetStateAction<E | undefined>>;
|
|
8
|
-
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
9
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonErrorCodes } from "../types";
|
|
3
|
+
export default function useAsyncControl<E extends CommonErrorCodes>(): {
|
|
4
|
+
process: (asyncFn: () => Promise<any>) => Promise<void>;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: E | undefined;
|
|
7
|
+
setError: import("react").Dispatch<import("react").SetStateAction<E | undefined>>;
|
|
8
|
+
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
9
|
+
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const react_1 = require("react");
|
|
13
|
-
function useAsyncControl() {
|
|
14
|
-
const [error, setError] = (0, react_1.useState)();
|
|
15
|
-
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
16
|
-
const _process = (asyncFn) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
try {
|
|
18
|
-
setLoading(true);
|
|
19
|
-
setError(undefined);
|
|
20
|
-
yield asyncFn();
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
if (process.env.NODE_ENV === "development")
|
|
24
|
-
console.error(e);
|
|
25
|
-
setError("UNEXPECTED_ERROR");
|
|
26
|
-
}
|
|
27
|
-
finally {
|
|
28
|
-
setLoading(false);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return {
|
|
32
|
-
process: _process,
|
|
33
|
-
loading,
|
|
34
|
-
error,
|
|
35
|
-
setError,
|
|
36
|
-
setLoading,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
exports.default = useAsyncControl;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
function useAsyncControl() {
|
|
14
|
+
const [error, setError] = (0, react_1.useState)();
|
|
15
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
16
|
+
const _process = (asyncFn) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
try {
|
|
18
|
+
setLoading(true);
|
|
19
|
+
setError(undefined);
|
|
20
|
+
yield asyncFn();
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
if (process.env.NODE_ENV === "development")
|
|
24
|
+
console.error(e);
|
|
25
|
+
setError("UNEXPECTED_ERROR");
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
setLoading(false);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
process: _process,
|
|
33
|
+
loading,
|
|
34
|
+
error,
|
|
35
|
+
setError,
|
|
36
|
+
setLoading,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.default = useAsyncControl;
|
|
40
40
|
//# sourceMappingURL=useAsyncControl.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function useIntersection(): {
|
|
2
|
-
observe: (e: HTMLOrSVGElement, cb: () => void) => void;
|
|
3
|
-
unobserve: (e: HTMLOrSVGElement) => void;
|
|
4
|
-
};
|
|
1
|
+
export default function useIntersection(): {
|
|
2
|
+
observe: (e: HTMLOrSVGElement, cb: () => void) => void;
|
|
3
|
+
unobserve: (e: HTMLOrSVGElement) => void;
|
|
4
|
+
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_1 = require("react");
|
|
4
|
-
function useIntersection() {
|
|
5
|
-
const { current: targetMap } = (0, react_1.useRef)([]);
|
|
6
|
-
const { current: observer } = (0, react_1.useRef)(("IntersectionObserver" in window) ? new IntersectionObserver((els) => {
|
|
7
|
-
els.forEach((e, i) => {
|
|
8
|
-
const result = targetMap.find((el) => el[0] === e.target);
|
|
9
|
-
if (result && e.isIntersecting) {
|
|
10
|
-
result[1]();
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}) : null);
|
|
14
|
-
return (0, react_1.useMemo)(() => {
|
|
15
|
-
return {
|
|
16
|
-
observe: (e, cb) => {
|
|
17
|
-
targetMap.push([e, cb]);
|
|
18
|
-
if (observer)
|
|
19
|
-
observer.observe(e);
|
|
20
|
-
},
|
|
21
|
-
unobserve: (e) => {
|
|
22
|
-
if (observer)
|
|
23
|
-
observer.unobserve(e);
|
|
24
|
-
targetMap.splice(targetMap.findIndex((el) => el[0] === e), 1);
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}, []);
|
|
28
|
-
}
|
|
29
|
-
exports.default = useIntersection;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
function useIntersection() {
|
|
5
|
+
const { current: targetMap } = (0, react_1.useRef)([]);
|
|
6
|
+
const { current: observer } = (0, react_1.useRef)(("IntersectionObserver" in window) ? new IntersectionObserver((els) => {
|
|
7
|
+
els.forEach((e, i) => {
|
|
8
|
+
const result = targetMap.find((el) => el[0] === e.target);
|
|
9
|
+
if (result && e.isIntersecting) {
|
|
10
|
+
result[1]();
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}) : null);
|
|
14
|
+
return (0, react_1.useMemo)(() => {
|
|
15
|
+
return {
|
|
16
|
+
observe: (e, cb) => {
|
|
17
|
+
targetMap.push([e, cb]);
|
|
18
|
+
if (observer)
|
|
19
|
+
observer.observe(e);
|
|
20
|
+
},
|
|
21
|
+
unobserve: (e) => {
|
|
22
|
+
if (observer)
|
|
23
|
+
observer.unobserve(e);
|
|
24
|
+
targetMap.splice(targetMap.findIndex((el) => el[0] === e), 1);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
}
|
|
29
|
+
exports.default = useIntersection;
|
|
30
30
|
//# sourceMappingURL=useIntersection.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
require("./shims/ObjectWatchShim.js");
|
|
5
|
+
function useObserve(object, keysToObserve) {
|
|
6
|
+
const [_, ss] = (0, react_1.useState)(0);
|
|
7
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
8
|
+
return object.watch(keysToObserve, () => {
|
|
9
|
+
ss((p) => p + 1);
|
|
10
|
+
});
|
|
11
|
+
}, [object]);
|
|
12
|
+
}
|
|
13
|
+
exports.default = useObserve;
|
|
14
|
+
//# sourceMappingURL=useObserve.js.map
|