@vintedsamulionis/lovable-web-ui 70.3.4
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/README.md +5 -0
- package/dist/cjs/index.js +15555 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/styles/vinted/style.css +1 -0
- package/dist/cjs/styles/vintedgo/style.css +1 -0
- package/dist/esm/constants/html.js +10 -0
- package/dist/esm/constants/html.js.map +1 -0
- package/dist/esm/constants/keyboard.js +18 -0
- package/dist/esm/constants/keyboard.js.map +1 -0
- package/dist/esm/constants/portal.js +11 -0
- package/dist/esm/constants/portal.js.map +1 -0
- package/dist/esm/constants/spacing.js +74 -0
- package/dist/esm/constants/spacing.js.map +1 -0
- package/dist/esm/constants/ui.js +55 -0
- package/dist/esm/constants/ui.js.map +1 -0
- package/dist/esm/hooks/index.js +6 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/useDrag/index.js +4 -0
- package/dist/esm/hooks/useDrag/index.js.map +1 -0
- package/dist/esm/hooks/useDrag/type.js +2 -0
- package/dist/esm/hooks/useDrag/type.js.map +1 -0
- package/dist/esm/hooks/useDrag/useDrag.js +11 -0
- package/dist/esm/hooks/useDrag/useDrag.js.map +1 -0
- package/dist/esm/hooks/useDrag/useDragPosition.js +43 -0
- package/dist/esm/hooks/useDrag/useDragPosition.js.map +1 -0
- package/dist/esm/hooks/useDrag/useMouseDrag.js +25 -0
- package/dist/esm/hooks/useDrag/useMouseDrag.js.map +1 -0
- package/dist/esm/hooks/useDrag/useTouchDrag.js +28 -0
- package/dist/esm/hooks/useDrag/useTouchDrag.js.map +1 -0
- package/dist/esm/hooks/useEvent.js +30 -0
- package/dist/esm/hooks/useEvent.js.map +1 -0
- package/dist/esm/hooks/useFloating.js +3 -0
- package/dist/esm/hooks/useFloating.js.map +1 -0
- package/dist/esm/index.js +58 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/Accordion/Accordion.js +176 -0
- package/dist/esm/lib/Accordion/Accordion.js.map +1 -0
- package/dist/esm/lib/Accordion/index.js +2 -0
- package/dist/esm/lib/Accordion/index.js.map +1 -0
- package/dist/esm/lib/Animation/Animation.js +180 -0
- package/dist/esm/lib/Animation/Animation.js.map +1 -0
- package/dist/esm/lib/Animation/index.js +2 -0
- package/dist/esm/lib/Animation/index.js.map +1 -0
- package/dist/esm/lib/Badge/Badge.js +76 -0
- package/dist/esm/lib/Badge/Badge.js.map +1 -0
- package/dist/esm/lib/Badge/index.js +2 -0
- package/dist/esm/lib/Badge/index.js.map +1 -0
- package/dist/esm/lib/BottomSheet/BottomSheet.js +205 -0
- package/dist/esm/lib/BottomSheet/BottomSheet.js.map +1 -0
- package/dist/esm/lib/BottomSheet/Handle.js +6 -0
- package/dist/esm/lib/BottomSheet/Handle.js.map +1 -0
- package/dist/esm/lib/BottomSheet/index.js +2 -0
- package/dist/esm/lib/BottomSheet/index.js.map +1 -0
- package/dist/esm/lib/Box/Box.js +347 -0
- package/dist/esm/lib/Box/Box.js.map +1 -0
- package/dist/esm/lib/Box/index.js +2 -0
- package/dist/esm/lib/Box/index.js.map +1 -0
- package/dist/esm/lib/Bubble/Bubble.js +85 -0
- package/dist/esm/lib/Bubble/Bubble.js.map +1 -0
- package/dist/esm/lib/Bubble/index.js +2 -0
- package/dist/esm/lib/Bubble/index.js.map +1 -0
- package/dist/esm/lib/Button/Button.js +203 -0
- package/dist/esm/lib/Button/Button.js.map +1 -0
- package/dist/esm/lib/Button/index.js +2 -0
- package/dist/esm/lib/Button/index.js.map +1 -0
- package/dist/esm/lib/Card/Card.js +59 -0
- package/dist/esm/lib/Card/Card.js.map +1 -0
- package/dist/esm/lib/Card/index.js +2 -0
- package/dist/esm/lib/Card/index.js.map +1 -0
- package/dist/esm/lib/Carousel/Carousel.js +216 -0
- package/dist/esm/lib/Carousel/Carousel.js.map +1 -0
- package/dist/esm/lib/Carousel/CarouselArrow.js +88 -0
- package/dist/esm/lib/Carousel/CarouselArrow.js.map +1 -0
- package/dist/esm/lib/Carousel/CarouselNavigation.js +87 -0
- package/dist/esm/lib/Carousel/CarouselNavigation.js.map +1 -0
- package/dist/esm/lib/Carousel/index.js +2 -0
- package/dist/esm/lib/Carousel/index.js.map +1 -0
- package/dist/esm/lib/Carousel/utils.js +13 -0
- package/dist/esm/lib/Carousel/utils.js.map +1 -0
- package/dist/esm/lib/Cell/Cell.js +199 -0
- package/dist/esm/lib/Cell/Cell.js.map +1 -0
- package/dist/esm/lib/Cell/index.js +2 -0
- package/dist/esm/lib/Cell/index.js.map +1 -0
- package/dist/esm/lib/Checkbox/Checkbox.js +97 -0
- package/dist/esm/lib/Checkbox/Checkbox.js.map +1 -0
- package/dist/esm/lib/Checkbox/index.js +2 -0
- package/dist/esm/lib/Checkbox/index.js.map +1 -0
- package/dist/esm/lib/Chip/Chip.js +125 -0
- package/dist/esm/lib/Chip/Chip.js.map +1 -0
- package/dist/esm/lib/Chip/index.js +2 -0
- package/dist/esm/lib/Chip/index.js.map +1 -0
- package/dist/esm/lib/Container/Container.js +304 -0
- package/dist/esm/lib/Container/Container.js.map +1 -0
- package/dist/esm/lib/Container/index.js +2 -0
- package/dist/esm/lib/Container/index.js.map +1 -0
- package/dist/esm/lib/Dialog/Dialog.js +220 -0
- package/dist/esm/lib/Dialog/Dialog.js.map +1 -0
- package/dist/esm/lib/Dialog/index.js +2 -0
- package/dist/esm/lib/Dialog/index.js.map +1 -0
- package/dist/esm/lib/Divider/Divider.js +51 -0
- package/dist/esm/lib/Divider/Divider.js.map +1 -0
- package/dist/esm/lib/Divider/index.js +2 -0
- package/dist/esm/lib/Divider/index.js.map +1 -0
- package/dist/esm/lib/DoubleImage/DoubleImage.js +56 -0
- package/dist/esm/lib/DoubleImage/DoubleImage.js.map +1 -0
- package/dist/esm/lib/DoubleImage/index.js +2 -0
- package/dist/esm/lib/DoubleImage/index.js.map +1 -0
- package/dist/esm/lib/EmptyState/EmptyState.js +73 -0
- package/dist/esm/lib/EmptyState/EmptyState.js.map +1 -0
- package/dist/esm/lib/EmptyState/index.js +2 -0
- package/dist/esm/lib/EmptyState/index.js.map +1 -0
- package/dist/esm/lib/Icon/Icon.js +163 -0
- package/dist/esm/lib/Icon/Icon.js.map +1 -0
- package/dist/esm/lib/Icon/index.js +2 -0
- package/dist/esm/lib/Icon/index.js.map +1 -0
- package/dist/esm/lib/Image/Image.js +243 -0
- package/dist/esm/lib/Image/Image.js.map +1 -0
- package/dist/esm/lib/Image/index.js +2 -0
- package/dist/esm/lib/Image/index.js.map +1 -0
- package/dist/esm/lib/InfoBanner/InfoBanner.js +230 -0
- package/dist/esm/lib/InfoBanner/InfoBanner.js.map +1 -0
- package/dist/esm/lib/InfoBanner/assets/DefaultIcon.js +20 -0
- package/dist/esm/lib/InfoBanner/assets/DefaultIcon.js.map +1 -0
- package/dist/esm/lib/InfoBanner/index.js +2 -0
- package/dist/esm/lib/InfoBanner/index.js.map +1 -0
- package/dist/esm/lib/Input/InputSelect/InputSelect.js +116 -0
- package/dist/esm/lib/Input/InputSelect/InputSelect.js.map +1 -0
- package/dist/esm/lib/Input/InputSelect/index.js +2 -0
- package/dist/esm/lib/Input/InputSelect/index.js.map +1 -0
- package/dist/esm/lib/Input/InputText/InputText.js +156 -0
- package/dist/esm/lib/Input/InputText/InputText.js.map +1 -0
- package/dist/esm/lib/Input/InputText/index.js +2 -0
- package/dist/esm/lib/Input/InputText/index.js.map +1 -0
- package/dist/esm/lib/Input/InputTextarea/InputTextarea.js +147 -0
- package/dist/esm/lib/Input/InputTextarea/InputTextarea.js.map +1 -0
- package/dist/esm/lib/Input/InputTextarea/index.js +2 -0
- package/dist/esm/lib/Input/InputTextarea/index.js.map +1 -0
- package/dist/esm/lib/Input/index.js +4 -0
- package/dist/esm/lib/Input/index.js.map +1 -0
- package/dist/esm/lib/InputBar/InputBar.js +196 -0
- package/dist/esm/lib/InputBar/InputBar.js.map +1 -0
- package/dist/esm/lib/InputBar/index.js +2 -0
- package/dist/esm/lib/InputBar/index.js.map +1 -0
- package/dist/esm/lib/Label/Label.js +68 -0
- package/dist/esm/lib/Label/Label.js.map +1 -0
- package/dist/esm/lib/Label/index.js +2 -0
- package/dist/esm/lib/Label/index.js.map +1 -0
- package/dist/esm/lib/List/Item/Item.js +26 -0
- package/dist/esm/lib/List/Item/Item.js.map +1 -0
- package/dist/esm/lib/List/Item/index.js +2 -0
- package/dist/esm/lib/List/Item/index.js.map +1 -0
- package/dist/esm/lib/List/List.js +391 -0
- package/dist/esm/lib/List/List.js.map +1 -0
- package/dist/esm/lib/List/index.js +2 -0
- package/dist/esm/lib/List/index.js.map +1 -0
- package/dist/esm/lib/Loader/Loader.js +132 -0
- package/dist/esm/lib/Loader/Loader.js.map +1 -0
- package/dist/esm/lib/Loader/index.js +2 -0
- package/dist/esm/lib/Loader/index.js.map +1 -0
- package/dist/esm/lib/Navigation/Navigation.js +54 -0
- package/dist/esm/lib/Navigation/Navigation.js.map +1 -0
- package/dist/esm/lib/Navigation/index.js +2 -0
- package/dist/esm/lib/Navigation/index.js.map +1 -0
- package/dist/esm/lib/Note/Note.js +67 -0
- package/dist/esm/lib/Note/Note.js.map +1 -0
- package/dist/esm/lib/Note/index.js +2 -0
- package/dist/esm/lib/Note/index.js.map +1 -0
- package/dist/esm/lib/Notification/Notification.js +148 -0
- package/dist/esm/lib/Notification/Notification.js.map +1 -0
- package/dist/esm/lib/Notification/index.js +2 -0
- package/dist/esm/lib/Notification/index.js.map +1 -0
- package/dist/esm/lib/Pagination/Pagination.js +276 -0
- package/dist/esm/lib/Pagination/Pagination.js.map +1 -0
- package/dist/esm/lib/Pagination/index.js +2 -0
- package/dist/esm/lib/Pagination/index.js.map +1 -0
- package/dist/esm/lib/Pressable/Pressable.js +119 -0
- package/dist/esm/lib/Pressable/Pressable.js.map +1 -0
- package/dist/esm/lib/Pressable/index.js +2 -0
- package/dist/esm/lib/Pressable/index.js.map +1 -0
- package/dist/esm/lib/Pressable/utils/borderRadius.js +16 -0
- package/dist/esm/lib/Pressable/utils/borderRadius.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/ProgressIndicator.js +92 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/ProgressIndicator.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/hooks/useId.js +26 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/hooks/useId.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/hooks/useProgressIndicator.js +106 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/hooks/useProgressIndicator.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/index.js +2 -0
- package/dist/esm/lib/ProgressIndicator/ProgressIndicator/index.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemHorizontal/ProgressItemHorizontal.js +106 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemHorizontal/ProgressItemHorizontal.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemHorizontal/index.js +2 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemHorizontal/index.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemVertical/ProgressItemVertical.js +177 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemVertical/ProgressItemVertical.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemVertical/index.js +2 -0
- package/dist/esm/lib/ProgressIndicator/ProgressItemVertical/index.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/shared/types.js +2 -0
- package/dist/esm/lib/ProgressIndicator/shared/types.js.map +1 -0
- package/dist/esm/lib/ProgressIndicator/shared/utils.js +379 -0
- package/dist/esm/lib/ProgressIndicator/shared/utils.js.map +1 -0
- package/dist/esm/lib/PromoBanner/PromoBanner.js +190 -0
- package/dist/esm/lib/PromoBanner/PromoBanner.js.map +1 -0
- package/dist/esm/lib/PromoBanner/index.js +2 -0
- package/dist/esm/lib/PromoBanner/index.js.map +1 -0
- package/dist/esm/lib/Radio/Radio.js +92 -0
- package/dist/esm/lib/Radio/Radio.js.map +1 -0
- package/dist/esm/lib/Radio/index.js +2 -0
- package/dist/esm/lib/Radio/index.js.map +1 -0
- package/dist/esm/lib/RangeGraph/RangeGraph.js +68 -0
- package/dist/esm/lib/RangeGraph/RangeGraph.js.map +1 -0
- package/dist/esm/lib/RangeGraph/index.js +2 -0
- package/dist/esm/lib/RangeGraph/index.js.map +1 -0
- package/dist/esm/lib/Rating/Rating.js +288 -0
- package/dist/esm/lib/Rating/Rating.js.map +1 -0
- package/dist/esm/lib/Rating/index.js +2 -0
- package/dist/esm/lib/Rating/index.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/SelectionGroup/SelectionGroup.js +171 -0
- package/dist/esm/lib/SelectionGroup/SelectionGroup/SelectionGroup.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/SelectionGroup/index.js +2 -0
- package/dist/esm/lib/SelectionGroup/SelectionGroup/index.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/SelectionItem/SelectionItem.js +188 -0
- package/dist/esm/lib/SelectionGroup/SelectionItem/SelectionItem.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/SelectionItem/index.js +2 -0
- package/dist/esm/lib/SelectionGroup/SelectionItem/index.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/assets/Scelected.js +19 -0
- package/dist/esm/lib/SelectionGroup/assets/Scelected.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/hooks/useIsElementVisible.js +21 -0
- package/dist/esm/lib/SelectionGroup/hooks/useIsElementVisible.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/hooks/useScrollToItem.js +25 -0
- package/dist/esm/lib/SelectionGroup/hooks/useScrollToItem.js.map +1 -0
- package/dist/esm/lib/SelectionGroup/hooks/useScrollToPreSelectedItem.js +50 -0
- package/dist/esm/lib/SelectionGroup/hooks/useScrollToPreSelectedItem.js.map +1 -0
- package/dist/esm/lib/Spacer/Spacer.js +114 -0
- package/dist/esm/lib/Spacer/Spacer.js.map +1 -0
- package/dist/esm/lib/Spacer/index.js +2 -0
- package/dist/esm/lib/Spacer/index.js.map +1 -0
- package/dist/esm/lib/Stack/Stack.js +352 -0
- package/dist/esm/lib/Stack/Stack.js.map +1 -0
- package/dist/esm/lib/Stack/StackItem/StackItem.js +27 -0
- package/dist/esm/lib/Stack/StackItem/StackItem.js.map +1 -0
- package/dist/esm/lib/Stack/StackItem/index.js +2 -0
- package/dist/esm/lib/Stack/StackItem/index.js.map +1 -0
- package/dist/esm/lib/Stack/index.js +3 -0
- package/dist/esm/lib/Stack/index.js.map +1 -0
- package/dist/esm/lib/Tabs/Tab.js +7 -0
- package/dist/esm/lib/Tabs/Tab.js.map +1 -0
- package/dist/esm/lib/Tabs/Tabs.js +77 -0
- package/dist/esm/lib/Tabs/Tabs.js.map +1 -0
- package/dist/esm/lib/Tabs/index.js +2 -0
- package/dist/esm/lib/Tabs/index.js.map +1 -0
- package/dist/esm/lib/Tabs/types.js +2 -0
- package/dist/esm/lib/Tabs/types.js.map +1 -0
- package/dist/esm/lib/Text/Text.js +153 -0
- package/dist/esm/lib/Text/Text.js.map +1 -0
- package/dist/esm/lib/Text/index.js +2 -0
- package/dist/esm/lib/Text/index.js.map +1 -0
- package/dist/esm/lib/ThemeProvider/ThemeContext.js +26 -0
- package/dist/esm/lib/ThemeProvider/ThemeContext.js.map +1 -0
- package/dist/esm/lib/ThemeProvider/ThemeProvider.js +30 -0
- package/dist/esm/lib/ThemeProvider/ThemeProvider.js.map +1 -0
- package/dist/esm/lib/ThemeProvider/index.js +3 -0
- package/dist/esm/lib/ThemeProvider/index.js.map +1 -0
- package/dist/esm/lib/Toggle/Toggle.js +72 -0
- package/dist/esm/lib/Toggle/Toggle.js.map +1 -0
- package/dist/esm/lib/Toggle/index.js +2 -0
- package/dist/esm/lib/Toggle/index.js.map +1 -0
- package/dist/esm/lib/Tooltip/Tooltip.js +190 -0
- package/dist/esm/lib/Tooltip/Tooltip.js.map +1 -0
- package/dist/esm/lib/Tooltip/index.js +2 -0
- package/dist/esm/lib/Tooltip/index.js.map +1 -0
- package/dist/esm/lib/Validation/Validation.js +49 -0
- package/dist/esm/lib/Validation/Validation.js.map +1 -0
- package/dist/esm/lib/Validation/index.js +2 -0
- package/dist/esm/lib/Validation/index.js.map +1 -0
- package/dist/esm/lib/index.js +58 -0
- package/dist/esm/lib/index.js.map +1 -0
- package/dist/esm/lib/types.js +102 -0
- package/dist/esm/lib/types.js.map +1 -0
- package/dist/esm/shared/Carousel-5f36fb0d.js +23 -0
- package/dist/esm/shared/Carousel-5f36fb0d.js.map +1 -0
- package/dist/esm/shared/Carousel-9459b4d8.js +23 -0
- package/dist/esm/shared/Carousel-9459b4d8.js.map +1 -0
- package/dist/esm/shared/ExclamationCircleFilled24-59f7ec60.js +48 -0
- package/dist/esm/shared/ExclamationCircleFilled24-59f7ec60.js.map +1 -0
- package/dist/esm/shared/ExclamationCircleFilled24-b013307f.js +48 -0
- package/dist/esm/shared/ExclamationCircleFilled24-b013307f.js.map +1 -0
- package/dist/esm/shared/Handle-3ff506f0.js +40 -0
- package/dist/esm/shared/Handle-3ff506f0.js.map +1 -0
- package/dist/esm/shared/Handle-f047c8a4.js +40 -0
- package/dist/esm/shared/Handle-f047c8a4.js.map +1 -0
- package/dist/esm/shared/Input-20355c28.js +19 -0
- package/dist/esm/shared/Input-20355c28.js.map +1 -0
- package/dist/esm/shared/Input-dc4a8673.js +19 -0
- package/dist/esm/shared/Input-dc4a8673.js.map +1 -0
- package/dist/esm/shared/Tab-bb35b788.js +78 -0
- package/dist/esm/shared/Tab-bb35b788.js.map +1 -0
- package/dist/esm/shared/Tab-c1d76f7d.js +78 -0
- package/dist/esm/shared/Tab-c1d76f7d.js.map +1 -0
- package/dist/esm/shared/X12-01310840.js +27 -0
- package/dist/esm/shared/X12-01310840.js.map +1 -0
- package/dist/esm/shared/X12-cb28ac62.js +27 -0
- package/dist/esm/shared/X12-cb28ac62.js.map +1 -0
- package/dist/esm/shared/X24-34ae2df2.js +27 -0
- package/dist/esm/shared/X24-34ae2df2.js.map +1 -0
- package/dist/esm/shared/X24-392e2ca1.js +27 -0
- package/dist/esm/shared/X24-392e2ca1.js.map +1 -0
- package/dist/esm/shared/bind-1a05f4e7.js +85 -0
- package/dist/esm/shared/bind-1a05f4e7.js.map +1 -0
- package/dist/esm/shared/bind-c3e87011.js +85 -0
- package/dist/esm/shared/bind-c3e87011.js.map +1 -0
- package/dist/esm/shared/index-6433f80a.js +85 -0
- package/dist/esm/shared/index-6433f80a.js.map +1 -0
- package/dist/esm/shared/index-8d1baf3a.js +85 -0
- package/dist/esm/shared/index-8d1baf3a.js.map +1 -0
- package/dist/esm/shared/index-955ebb7e.js +3057 -0
- package/dist/esm/shared/index-955ebb7e.js.map +1 -0
- package/dist/esm/shared/index-d4674a06.js +3057 -0
- package/dist/esm/shared/index-d4674a06.js.map +1 -0
- package/dist/esm/shared/react-textarea-autosize.esm-6562b342.js +261 -0
- package/dist/esm/shared/react-textarea-autosize.esm-6562b342.js.map +1 -0
- package/dist/esm/shared/react-textarea-autosize.esm-b159a949.js +261 -0
- package/dist/esm/shared/react-textarea-autosize.esm-b159a949.js.map +1 -0
- package/dist/esm/shared/useFloating-360df820.js +2525 -0
- package/dist/esm/shared/useFloating-360df820.js.map +1 -0
- package/dist/esm/shared/useFloating-6cb942ff.js +2525 -0
- package/dist/esm/shared/useFloating-6cb942ff.js.map +1 -0
- package/dist/esm/styles/vinted/style.css +1 -0
- package/dist/esm/styles/vintedgo/style.css +1 -0
- package/dist/esm/types/declarations/css-modules.d.js +2 -0
- package/dist/esm/types/declarations/css-modules.d.js.map +1 -0
- package/dist/esm/types/declarations/mdx.d.js +2 -0
- package/dist/esm/types/declarations/mdx.d.js.map +1 -0
- package/dist/esm/types/declarations/rollup-plugin-peer-deps-external.d.js +2 -0
- package/dist/esm/types/declarations/rollup-plugin-peer-deps-external.d.js.map +1 -0
- package/dist/esm/utils/a11y/onA11yKeyDown.js +22 -0
- package/dist/esm/utils/a11y/onA11yKeyDown.js.map +1 -0
- package/dist/esm/utils/formatString.js +535 -0
- package/dist/esm/utils/formatString.js.map +1 -0
- package/dist/esm/utils/getDisplayName.js +29 -0
- package/dist/esm/utils/getDisplayName.js.map +1 -0
- package/dist/esm/utils/html.js +23 -0
- package/dist/esm/utils/html.js.map +1 -0
- package/dist/esm/utils/interpolateWithHtml.js +349 -0
- package/dist/esm/utils/interpolateWithHtml.js.map +1 -0
- package/dist/esm/utils/isNumeric.js +6 -0
- package/dist/esm/utils/isNumeric.js.map +1 -0
- package/dist/esm/utils/mutableRefs.js +40 -0
- package/dist/esm/utils/mutableRefs.js.map +1 -0
- package/dist/esm/utils/noop.js +6 -0
- package/dist/esm/utils/noop.js.map +1 -0
- package/dist/esm/utils/padding.js +51 -0
- package/dist/esm/utils/padding.js.map +1 -0
- package/dist/esm/utils/randomId.js +6 -0
- package/dist/esm/utils/randomId.js.map +1 -0
- package/dist/esm/utils/sizing.js +21 -0
- package/dist/esm/utils/sizing.js.map +1 -0
- package/dist/esm/utils/test.js +13 -0
- package/dist/esm/utils/test.js.map +1 -0
- package/dist/esm/utils/testId.js +10 -0
- package/dist/esm/utils/testId.js.map +1 -0
- package/dist/esm/utils/warning.js +14 -0
- package/dist/esm/utils/warning.js.map +1 -0
- package/dist/styles/vinted/style.css +1 -0
- package/dist/styles/vintedgo/style.css +1 -0
- package/dist/types/constants/html.d.ts +7 -0
- package/dist/types/constants/html.d.ts.map +1 -0
- package/dist/types/constants/keyboard.d.ts +15 -0
- package/dist/types/constants/keyboard.d.ts.map +1 -0
- package/dist/types/constants/portal.d.ts +8 -0
- package/dist/types/constants/portal.d.ts.map +1 -0
- package/dist/types/constants/spacing.d.ts +67 -0
- package/dist/types/constants/spacing.d.ts.map +1 -0
- package/dist/types/constants/ui.d.ts +82 -0
- package/dist/types/constants/ui.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useDrag/index.d.ts +4 -0
- package/dist/types/hooks/useDrag/index.d.ts.map +1 -0
- package/dist/types/hooks/useDrag/type.d.ts +6 -0
- package/dist/types/hooks/useDrag/type.d.ts.map +1 -0
- package/dist/types/hooks/useDrag/useDrag.d.ts +5 -0
- package/dist/types/hooks/useDrag/useDrag.d.ts.map +1 -0
- package/dist/types/hooks/useDrag/useDragPosition.d.ts +9 -0
- package/dist/types/hooks/useDrag/useDragPosition.d.ts.map +1 -0
- package/dist/types/hooks/useDrag/useMouseDrag.d.ts +5 -0
- package/dist/types/hooks/useDrag/useMouseDrag.d.ts.map +1 -0
- package/dist/types/hooks/useDrag/useTouchDrag.d.ts +5 -0
- package/dist/types/hooks/useDrag/useTouchDrag.d.ts.map +1 -0
- package/dist/types/hooks/useEvent.d.ts +5 -0
- package/dist/types/hooks/useEvent.d.ts.map +1 -0
- package/dist/types/hooks/useFloating.d.ts +32 -0
- package/dist/types/hooks/useFloating.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/Accordion/Accordion.d.ts +66 -0
- package/dist/types/lib/Accordion/Accordion.d.ts.map +1 -0
- package/dist/types/lib/Accordion/index.d.ts +3 -0
- package/dist/types/lib/Accordion/index.d.ts.map +1 -0
- package/dist/types/lib/Animation/Animation.d.ts +60 -0
- package/dist/types/lib/Animation/Animation.d.ts.map +1 -0
- package/dist/types/lib/Animation/index.d.ts +3 -0
- package/dist/types/lib/Animation/index.d.ts.map +1 -0
- package/dist/types/lib/Badge/Badge.d.ts +53 -0
- package/dist/types/lib/Badge/Badge.d.ts.map +1 -0
- package/dist/types/lib/Badge/index.d.ts +3 -0
- package/dist/types/lib/Badge/index.d.ts.map +1 -0
- package/dist/types/lib/BottomSheet/BottomSheet.d.ts +47 -0
- package/dist/types/lib/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/dist/types/lib/BottomSheet/Handle.d.ts +7 -0
- package/dist/types/lib/BottomSheet/Handle.d.ts.map +1 -0
- package/dist/types/lib/BottomSheet/index.d.ts +3 -0
- package/dist/types/lib/BottomSheet/index.d.ts.map +1 -0
- package/dist/types/lib/Box/Box.d.ts +32 -0
- package/dist/types/lib/Box/Box.d.ts.map +1 -0
- package/dist/types/lib/Box/index.d.ts +2 -0
- package/dist/types/lib/Box/index.d.ts.map +1 -0
- package/dist/types/lib/Bubble/Bubble.d.ts +50 -0
- package/dist/types/lib/Bubble/Bubble.d.ts.map +1 -0
- package/dist/types/lib/Bubble/index.d.ts +3 -0
- package/dist/types/lib/Bubble/index.d.ts.map +1 -0
- package/dist/types/lib/Button/Button.d.ts +114 -0
- package/dist/types/lib/Button/Button.d.ts.map +1 -0
- package/dist/types/lib/Button/index.d.ts +3 -0
- package/dist/types/lib/Button/index.d.ts.map +1 -0
- package/dist/types/lib/Card/Card.d.ts +32 -0
- package/dist/types/lib/Card/Card.d.ts.map +1 -0
- package/dist/types/lib/Card/index.d.ts +3 -0
- package/dist/types/lib/Card/index.d.ts.map +1 -0
- package/dist/types/lib/Carousel/Carousel.d.ts +57 -0
- package/dist/types/lib/Carousel/Carousel.d.ts.map +1 -0
- package/dist/types/lib/Carousel/CarouselArrow.d.ts +23 -0
- package/dist/types/lib/Carousel/CarouselArrow.d.ts.map +1 -0
- package/dist/types/lib/Carousel/CarouselNavigation.d.ts +25 -0
- package/dist/types/lib/Carousel/CarouselNavigation.d.ts.map +1 -0
- package/dist/types/lib/Carousel/index.d.ts +5 -0
- package/dist/types/lib/Carousel/index.d.ts.map +1 -0
- package/dist/types/lib/Carousel/utils.d.ts +3 -0
- package/dist/types/lib/Carousel/utils.d.ts.map +1 -0
- package/dist/types/lib/Cell/Cell.d.ts +98 -0
- package/dist/types/lib/Cell/Cell.d.ts.map +1 -0
- package/dist/types/lib/Cell/index.d.ts +3 -0
- package/dist/types/lib/Cell/index.d.ts.map +1 -0
- package/dist/types/lib/Checkbox/Checkbox.d.ts +38 -0
- package/dist/types/lib/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/types/lib/Checkbox/index.d.ts +3 -0
- package/dist/types/lib/Checkbox/index.d.ts.map +1 -0
- package/dist/types/lib/Chip/Chip.d.ts +48 -0
- package/dist/types/lib/Chip/Chip.d.ts.map +1 -0
- package/dist/types/lib/Chip/index.d.ts +3 -0
- package/dist/types/lib/Chip/index.d.ts.map +1 -0
- package/dist/types/lib/Container/Container.d.ts +43 -0
- package/dist/types/lib/Container/Container.d.ts.map +1 -0
- package/dist/types/lib/Container/index.d.ts +3 -0
- package/dist/types/lib/Container/index.d.ts.map +1 -0
- package/dist/types/lib/Dialog/Dialog.d.ts +74 -0
- package/dist/types/lib/Dialog/Dialog.d.ts.map +1 -0
- package/dist/types/lib/Dialog/index.d.ts +3 -0
- package/dist/types/lib/Dialog/index.d.ts.map +1 -0
- package/dist/types/lib/Divider/Divider.d.ts +32 -0
- package/dist/types/lib/Divider/Divider.d.ts.map +1 -0
- package/dist/types/lib/Divider/index.d.ts +3 -0
- package/dist/types/lib/Divider/index.d.ts.map +1 -0
- package/dist/types/lib/DoubleImage/DoubleImage.d.ts +43 -0
- package/dist/types/lib/DoubleImage/DoubleImage.d.ts.map +1 -0
- package/dist/types/lib/DoubleImage/index.d.ts +3 -0
- package/dist/types/lib/DoubleImage/index.d.ts.map +1 -0
- package/dist/types/lib/EmptyState/EmptyState.d.ts +31 -0
- package/dist/types/lib/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/types/lib/EmptyState/index.d.ts +3 -0
- package/dist/types/lib/EmptyState/index.d.ts.map +1 -0
- package/dist/types/lib/Icon/Icon.d.ts +47 -0
- package/dist/types/lib/Icon/Icon.d.ts.map +1 -0
- package/dist/types/lib/Icon/index.d.ts +3 -0
- package/dist/types/lib/Icon/index.d.ts.map +1 -0
- package/dist/types/lib/Image/Image.d.ts +101 -0
- package/dist/types/lib/Image/Image.d.ts.map +1 -0
- package/dist/types/lib/Image/index.d.ts +3 -0
- package/dist/types/lib/Image/index.d.ts.map +1 -0
- package/dist/types/lib/InfoBanner/InfoBanner.d.ts +61 -0
- package/dist/types/lib/InfoBanner/InfoBanner.d.ts.map +1 -0
- package/dist/types/lib/InfoBanner/assets/DefaultIcon.d.ts +3 -0
- package/dist/types/lib/InfoBanner/assets/DefaultIcon.d.ts.map +1 -0
- package/dist/types/lib/InfoBanner/index.d.ts +3 -0
- package/dist/types/lib/InfoBanner/index.d.ts.map +1 -0
- package/dist/types/lib/Input/InputSelect/InputSelect.d.ts +63 -0
- package/dist/types/lib/Input/InputSelect/InputSelect.d.ts.map +1 -0
- package/dist/types/lib/Input/InputSelect/index.d.ts +3 -0
- package/dist/types/lib/Input/InputSelect/index.d.ts.map +1 -0
- package/dist/types/lib/Input/InputText/InputText.d.ts +95 -0
- package/dist/types/lib/Input/InputText/InputText.d.ts.map +1 -0
- package/dist/types/lib/Input/InputText/index.d.ts +3 -0
- package/dist/types/lib/Input/InputText/index.d.ts.map +1 -0
- package/dist/types/lib/Input/InputTextarea/InputTextarea.d.ts +72 -0
- package/dist/types/lib/Input/InputTextarea/InputTextarea.d.ts.map +1 -0
- package/dist/types/lib/Input/InputTextarea/index.d.ts +3 -0
- package/dist/types/lib/Input/InputTextarea/index.d.ts.map +1 -0
- package/dist/types/lib/Input/index.d.ts +7 -0
- package/dist/types/lib/Input/index.d.ts.map +1 -0
- package/dist/types/lib/InputBar/InputBar.d.ts +62 -0
- package/dist/types/lib/InputBar/InputBar.d.ts.map +1 -0
- package/dist/types/lib/InputBar/index.d.ts +3 -0
- package/dist/types/lib/InputBar/index.d.ts.map +1 -0
- package/dist/types/lib/Label/Label.d.ts +37 -0
- package/dist/types/lib/Label/Label.d.ts.map +1 -0
- package/dist/types/lib/Label/index.d.ts +3 -0
- package/dist/types/lib/Label/index.d.ts.map +1 -0
- package/dist/types/lib/List/Item/Item.d.ts +12 -0
- package/dist/types/lib/List/Item/Item.d.ts.map +1 -0
- package/dist/types/lib/List/Item/index.d.ts +3 -0
- package/dist/types/lib/List/Item/index.d.ts.map +1 -0
- package/dist/types/lib/List/List.d.ts +54 -0
- package/dist/types/lib/List/List.d.ts.map +1 -0
- package/dist/types/lib/List/index.d.ts +3 -0
- package/dist/types/lib/List/index.d.ts.map +1 -0
- package/dist/types/lib/Loader/Loader.d.ts +46 -0
- package/dist/types/lib/Loader/Loader.d.ts.map +1 -0
- package/dist/types/lib/Loader/index.d.ts +3 -0
- package/dist/types/lib/Loader/index.d.ts.map +1 -0
- package/dist/types/lib/Navigation/Navigation.d.ts +19 -0
- package/dist/types/lib/Navigation/Navigation.d.ts.map +1 -0
- package/dist/types/lib/Navigation/index.d.ts +3 -0
- package/dist/types/lib/Navigation/index.d.ts.map +1 -0
- package/dist/types/lib/Note/Note.d.ts +38 -0
- package/dist/types/lib/Note/Note.d.ts.map +1 -0
- package/dist/types/lib/Note/index.d.ts +3 -0
- package/dist/types/lib/Note/index.d.ts.map +1 -0
- package/dist/types/lib/Notification/Notification.d.ts +39 -0
- package/dist/types/lib/Notification/Notification.d.ts.map +1 -0
- package/dist/types/lib/Notification/index.d.ts +3 -0
- package/dist/types/lib/Notification/index.d.ts.map +1 -0
- package/dist/types/lib/Pagination/Pagination.d.ts +60 -0
- package/dist/types/lib/Pagination/Pagination.d.ts.map +1 -0
- package/dist/types/lib/Pagination/index.d.ts +3 -0
- package/dist/types/lib/Pagination/index.d.ts.map +1 -0
- package/dist/types/lib/Pressable/Pressable.d.ts +40 -0
- package/dist/types/lib/Pressable/Pressable.d.ts.map +1 -0
- package/dist/types/lib/Pressable/index.d.ts +2 -0
- package/dist/types/lib/Pressable/index.d.ts.map +1 -0
- package/dist/types/lib/Pressable/utils/borderRadius.d.ts +6 -0
- package/dist/types/lib/Pressable/utils/borderRadius.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/ProgressIndicator.d.ts +18 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/ProgressIndicator.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/hooks/useId.d.ts +11 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/hooks/useId.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/hooks/useProgressIndicator.d.ts +45 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/hooks/useProgressIndicator.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/index.d.ts +2 -0
- package/dist/types/lib/ProgressIndicator/ProgressIndicator/index.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemHorizontal/ProgressItemHorizontal.d.ts +13 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemHorizontal/ProgressItemHorizontal.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemHorizontal/index.d.ts +3 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemHorizontal/index.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemVertical/ProgressItemVertical.d.ts +25 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemVertical/ProgressItemVertical.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemVertical/index.d.ts +3 -0
- package/dist/types/lib/ProgressIndicator/ProgressItemVertical/index.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/shared/types.d.ts +16 -0
- package/dist/types/lib/ProgressIndicator/shared/types.d.ts.map +1 -0
- package/dist/types/lib/ProgressIndicator/shared/utils.d.ts +31 -0
- package/dist/types/lib/ProgressIndicator/shared/utils.d.ts.map +1 -0
- package/dist/types/lib/PromoBanner/PromoBanner.d.ts +54 -0
- package/dist/types/lib/PromoBanner/PromoBanner.d.ts.map +1 -0
- package/dist/types/lib/PromoBanner/index.d.ts +3 -0
- package/dist/types/lib/PromoBanner/index.d.ts.map +1 -0
- package/dist/types/lib/Radio/Radio.d.ts +47 -0
- package/dist/types/lib/Radio/Radio.d.ts.map +1 -0
- package/dist/types/lib/Radio/index.d.ts +3 -0
- package/dist/types/lib/Radio/index.d.ts.map +1 -0
- package/dist/types/lib/RangeGraph/RangeGraph.d.ts +25 -0
- package/dist/types/lib/RangeGraph/RangeGraph.d.ts.map +1 -0
- package/dist/types/lib/RangeGraph/index.d.ts +3 -0
- package/dist/types/lib/RangeGraph/index.d.ts.map +1 -0
- package/dist/types/lib/Rating/Rating.d.ts +54 -0
- package/dist/types/lib/Rating/Rating.d.ts.map +1 -0
- package/dist/types/lib/Rating/index.d.ts +3 -0
- package/dist/types/lib/Rating/index.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/SelectionGroup/SelectionGroup.d.ts +57 -0
- package/dist/types/lib/SelectionGroup/SelectionGroup/SelectionGroup.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/SelectionGroup/index.d.ts +3 -0
- package/dist/types/lib/SelectionGroup/SelectionGroup/index.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/SelectionItem/SelectionItem.d.ts +52 -0
- package/dist/types/lib/SelectionGroup/SelectionItem/SelectionItem.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/SelectionItem/index.d.ts +3 -0
- package/dist/types/lib/SelectionGroup/SelectionItem/index.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/assets/Scelected.d.ts +3 -0
- package/dist/types/lib/SelectionGroup/assets/Scelected.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/hooks/useIsElementVisible.d.ts +2 -0
- package/dist/types/lib/SelectionGroup/hooks/useIsElementVisible.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/hooks/useScrollToItem.d.ts +4 -0
- package/dist/types/lib/SelectionGroup/hooks/useScrollToItem.d.ts.map +1 -0
- package/dist/types/lib/SelectionGroup/hooks/useScrollToPreSelectedItem.d.ts +7 -0
- package/dist/types/lib/SelectionGroup/hooks/useScrollToPreSelectedItem.d.ts.map +1 -0
- package/dist/types/lib/Spacer/Spacer.d.ts +62 -0
- package/dist/types/lib/Spacer/Spacer.d.ts.map +1 -0
- package/dist/types/lib/Spacer/index.d.ts +3 -0
- package/dist/types/lib/Spacer/index.d.ts.map +1 -0
- package/dist/types/lib/Stack/Stack.d.ts +28 -0
- package/dist/types/lib/Stack/Stack.d.ts.map +1 -0
- package/dist/types/lib/Stack/StackItem/StackItem.d.ts +12 -0
- package/dist/types/lib/Stack/StackItem/StackItem.d.ts.map +1 -0
- package/dist/types/lib/Stack/StackItem/index.d.ts +3 -0
- package/dist/types/lib/Stack/StackItem/index.d.ts.map +1 -0
- package/dist/types/lib/Stack/index.d.ts +5 -0
- package/dist/types/lib/Stack/index.d.ts.map +1 -0
- package/dist/types/lib/Tabs/Tab.d.ts +16 -0
- package/dist/types/lib/Tabs/Tab.d.ts.map +1 -0
- package/dist/types/lib/Tabs/Tabs.d.ts +48 -0
- package/dist/types/lib/Tabs/Tabs.d.ts.map +1 -0
- package/dist/types/lib/Tabs/index.d.ts +4 -0
- package/dist/types/lib/Tabs/index.d.ts.map +1 -0
- package/dist/types/lib/Tabs/types.d.ts +10 -0
- package/dist/types/lib/Tabs/types.d.ts.map +1 -0
- package/dist/types/lib/Text/Text.d.ts +92 -0
- package/dist/types/lib/Text/Text.d.ts.map +1 -0
- package/dist/types/lib/Text/index.d.ts +3 -0
- package/dist/types/lib/Text/index.d.ts.map +1 -0
- package/dist/types/lib/ThemeProvider/ThemeContext.d.ts +16 -0
- package/dist/types/lib/ThemeProvider/ThemeContext.d.ts.map +1 -0
- package/dist/types/lib/ThemeProvider/ThemeProvider.d.ts +9 -0
- package/dist/types/lib/ThemeProvider/ThemeProvider.d.ts.map +1 -0
- package/dist/types/lib/ThemeProvider/index.d.ts +5 -0
- package/dist/types/lib/ThemeProvider/index.d.ts.map +1 -0
- package/dist/types/lib/Toggle/Toggle.d.ts +38 -0
- package/dist/types/lib/Toggle/Toggle.d.ts.map +1 -0
- package/dist/types/lib/Toggle/index.d.ts +3 -0
- package/dist/types/lib/Toggle/index.d.ts.map +1 -0
- package/dist/types/lib/Tooltip/Tooltip.d.ts +75 -0
- package/dist/types/lib/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/types/lib/Tooltip/index.d.ts +3 -0
- package/dist/types/lib/Tooltip/index.d.ts.map +1 -0
- package/dist/types/lib/Validation/Validation.d.ts +27 -0
- package/dist/types/lib/Validation/Validation.d.ts.map +1 -0
- package/dist/types/lib/Validation/index.d.ts +3 -0
- package/dist/types/lib/Validation/index.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +91 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/types.d.ts +98 -0
- package/dist/types/lib/types.d.ts.map +1 -0
- package/dist/types/utils/a11y/onA11yKeyDown.d.ts +8 -0
- package/dist/types/utils/a11y/onA11yKeyDown.d.ts.map +1 -0
- package/dist/types/utils/formatString.d.ts +3 -0
- package/dist/types/utils/formatString.d.ts.map +1 -0
- package/dist/types/utils/getDisplayName.d.ts +5 -0
- package/dist/types/utils/getDisplayName.d.ts.map +1 -0
- package/dist/types/utils/html.d.ts +16 -0
- package/dist/types/utils/html.d.ts.map +1 -0
- package/dist/types/utils/interpolateWithHtml.d.ts +5 -0
- package/dist/types/utils/interpolateWithHtml.d.ts.map +1 -0
- package/dist/types/utils/isNumeric.d.ts +2 -0
- package/dist/types/utils/isNumeric.d.ts.map +1 -0
- package/dist/types/utils/mutableRefs.d.ts +20 -0
- package/dist/types/utils/mutableRefs.d.ts.map +1 -0
- package/dist/types/utils/noop.d.ts +2 -0
- package/dist/types/utils/noop.d.ts.map +1 -0
- package/dist/types/utils/padding.d.ts +14 -0
- package/dist/types/utils/padding.d.ts.map +1 -0
- package/dist/types/utils/randomId.d.ts +2 -0
- package/dist/types/utils/randomId.d.ts.map +1 -0
- package/dist/types/utils/sizing.d.ts +9 -0
- package/dist/types/utils/sizing.d.ts.map +1 -0
- package/dist/types/utils/test.d.ts +3 -0
- package/dist/types/utils/test.d.ts.map +1 -0
- package/dist/types/utils/testId.d.ts +2 -0
- package/dist/types/utils/testId.d.ts.map +1 -0
- package/dist/types/utils/warning.d.ts +3 -0
- package/dist/types/utils/warning.d.ts.map +1 -0
- package/package.json +172 -0
|
@@ -0,0 +1,3057 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import ReactDOM__default from 'react-dom';
|
|
3
|
+
|
|
4
|
+
function getDefaultExportFromCjs (x) {
|
|
5
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function getAugmentedNamespace(n) {
|
|
9
|
+
if (n.__esModule) return n;
|
|
10
|
+
var f = n.default;
|
|
11
|
+
if (typeof f == "function") {
|
|
12
|
+
var a = function a () {
|
|
13
|
+
if (this instanceof a) {
|
|
14
|
+
var args = [null];
|
|
15
|
+
args.push.apply(args, arguments);
|
|
16
|
+
var Ctor = Function.bind.apply(f, args);
|
|
17
|
+
return new Ctor();
|
|
18
|
+
}
|
|
19
|
+
return f.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
a.prototype = f.prototype;
|
|
22
|
+
} else a = {};
|
|
23
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
24
|
+
Object.keys(n).forEach(function (k) {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
26
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return n[k];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return a;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var libExports = {};
|
|
37
|
+
var lib = {
|
|
38
|
+
get exports(){ return libExports; },
|
|
39
|
+
set exports(v){ libExports = v; },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var Modal$1 = {};
|
|
43
|
+
|
|
44
|
+
var propTypesExports = {};
|
|
45
|
+
var propTypes = {
|
|
46
|
+
get exports(){ return propTypesExports; },
|
|
47
|
+
set exports(v){ propTypesExports = v; },
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var reactIsExports = {};
|
|
51
|
+
var reactIs = {
|
|
52
|
+
get exports(){ return reactIsExports; },
|
|
53
|
+
set exports(v){ reactIsExports = v; },
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var reactIs_production_min = {};
|
|
57
|
+
|
|
58
|
+
/** @license React v16.13.1
|
|
59
|
+
* react-is.production.min.js
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
var hasRequiredReactIs_production_min;
|
|
68
|
+
|
|
69
|
+
function requireReactIs_production_min () {
|
|
70
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
71
|
+
hasRequiredReactIs_production_min = 1;
|
|
72
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
73
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
74
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
75
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
76
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
77
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
78
|
+
return reactIs_production_min;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var reactIs_development = {};
|
|
82
|
+
|
|
83
|
+
/** @license React v16.13.1
|
|
84
|
+
* react-is.development.js
|
|
85
|
+
*
|
|
86
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the MIT license found in the
|
|
89
|
+
* LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
var hasRequiredReactIs_development;
|
|
93
|
+
|
|
94
|
+
function requireReactIs_development () {
|
|
95
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
96
|
+
hasRequiredReactIs_development = 1;
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if (process.env.NODE_ENV !== "production") {
|
|
101
|
+
(function() {
|
|
102
|
+
|
|
103
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
104
|
+
// nor polyfill, then a plain number is used for performance.
|
|
105
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
106
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
107
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
108
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
109
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
110
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
111
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
112
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
113
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
114
|
+
|
|
115
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
116
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
117
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
118
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
119
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
120
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
121
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
122
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
123
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
124
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
125
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
126
|
+
|
|
127
|
+
function isValidElementType(type) {
|
|
128
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
129
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function typeOf(object) {
|
|
133
|
+
if (typeof object === 'object' && object !== null) {
|
|
134
|
+
var $$typeof = object.$$typeof;
|
|
135
|
+
|
|
136
|
+
switch ($$typeof) {
|
|
137
|
+
case REACT_ELEMENT_TYPE:
|
|
138
|
+
var type = object.type;
|
|
139
|
+
|
|
140
|
+
switch (type) {
|
|
141
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
142
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
143
|
+
case REACT_FRAGMENT_TYPE:
|
|
144
|
+
case REACT_PROFILER_TYPE:
|
|
145
|
+
case REACT_STRICT_MODE_TYPE:
|
|
146
|
+
case REACT_SUSPENSE_TYPE:
|
|
147
|
+
return type;
|
|
148
|
+
|
|
149
|
+
default:
|
|
150
|
+
var $$typeofType = type && type.$$typeof;
|
|
151
|
+
|
|
152
|
+
switch ($$typeofType) {
|
|
153
|
+
case REACT_CONTEXT_TYPE:
|
|
154
|
+
case REACT_FORWARD_REF_TYPE:
|
|
155
|
+
case REACT_LAZY_TYPE:
|
|
156
|
+
case REACT_MEMO_TYPE:
|
|
157
|
+
case REACT_PROVIDER_TYPE:
|
|
158
|
+
return $$typeofType;
|
|
159
|
+
|
|
160
|
+
default:
|
|
161
|
+
return $$typeof;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
case REACT_PORTAL_TYPE:
|
|
167
|
+
return $$typeof;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return undefined;
|
|
172
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
173
|
+
|
|
174
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
175
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
176
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
177
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
178
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
179
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
180
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
181
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
182
|
+
var Memo = REACT_MEMO_TYPE;
|
|
183
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
184
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
185
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
186
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
187
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
188
|
+
|
|
189
|
+
function isAsyncMode(object) {
|
|
190
|
+
{
|
|
191
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
192
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
193
|
+
|
|
194
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
199
|
+
}
|
|
200
|
+
function isConcurrentMode(object) {
|
|
201
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
202
|
+
}
|
|
203
|
+
function isContextConsumer(object) {
|
|
204
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
205
|
+
}
|
|
206
|
+
function isContextProvider(object) {
|
|
207
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
208
|
+
}
|
|
209
|
+
function isElement(object) {
|
|
210
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
211
|
+
}
|
|
212
|
+
function isForwardRef(object) {
|
|
213
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
214
|
+
}
|
|
215
|
+
function isFragment(object) {
|
|
216
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
217
|
+
}
|
|
218
|
+
function isLazy(object) {
|
|
219
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
220
|
+
}
|
|
221
|
+
function isMemo(object) {
|
|
222
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
223
|
+
}
|
|
224
|
+
function isPortal(object) {
|
|
225
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
226
|
+
}
|
|
227
|
+
function isProfiler(object) {
|
|
228
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
229
|
+
}
|
|
230
|
+
function isStrictMode(object) {
|
|
231
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
232
|
+
}
|
|
233
|
+
function isSuspense(object) {
|
|
234
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
238
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
239
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
240
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
241
|
+
reactIs_development.Element = Element;
|
|
242
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
243
|
+
reactIs_development.Fragment = Fragment;
|
|
244
|
+
reactIs_development.Lazy = Lazy;
|
|
245
|
+
reactIs_development.Memo = Memo;
|
|
246
|
+
reactIs_development.Portal = Portal;
|
|
247
|
+
reactIs_development.Profiler = Profiler;
|
|
248
|
+
reactIs_development.StrictMode = StrictMode;
|
|
249
|
+
reactIs_development.Suspense = Suspense;
|
|
250
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
251
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
252
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
253
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
254
|
+
reactIs_development.isElement = isElement;
|
|
255
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
256
|
+
reactIs_development.isFragment = isFragment;
|
|
257
|
+
reactIs_development.isLazy = isLazy;
|
|
258
|
+
reactIs_development.isMemo = isMemo;
|
|
259
|
+
reactIs_development.isPortal = isPortal;
|
|
260
|
+
reactIs_development.isProfiler = isProfiler;
|
|
261
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
262
|
+
reactIs_development.isSuspense = isSuspense;
|
|
263
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
264
|
+
reactIs_development.typeOf = typeOf;
|
|
265
|
+
})();
|
|
266
|
+
}
|
|
267
|
+
return reactIs_development;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
var hasRequiredReactIs;
|
|
271
|
+
|
|
272
|
+
function requireReactIs () {
|
|
273
|
+
if (hasRequiredReactIs) return reactIsExports;
|
|
274
|
+
hasRequiredReactIs = 1;
|
|
275
|
+
(function (module) {
|
|
276
|
+
|
|
277
|
+
if (process.env.NODE_ENV === 'production') {
|
|
278
|
+
module.exports = requireReactIs_production_min();
|
|
279
|
+
} else {
|
|
280
|
+
module.exports = requireReactIs_development();
|
|
281
|
+
}
|
|
282
|
+
} (reactIs));
|
|
283
|
+
return reactIsExports;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/*
|
|
287
|
+
object-assign
|
|
288
|
+
(c) Sindre Sorhus
|
|
289
|
+
@license MIT
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
var objectAssign;
|
|
293
|
+
var hasRequiredObjectAssign;
|
|
294
|
+
|
|
295
|
+
function requireObjectAssign () {
|
|
296
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
297
|
+
hasRequiredObjectAssign = 1;
|
|
298
|
+
/* eslint-disable no-unused-vars */
|
|
299
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
300
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
301
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
302
|
+
|
|
303
|
+
function toObject(val) {
|
|
304
|
+
if (val === null || val === undefined) {
|
|
305
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return Object(val);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function shouldUseNative() {
|
|
312
|
+
try {
|
|
313
|
+
if (!Object.assign) {
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
318
|
+
|
|
319
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
320
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
321
|
+
test1[5] = 'de';
|
|
322
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
327
|
+
var test2 = {};
|
|
328
|
+
for (var i = 0; i < 10; i++) {
|
|
329
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
330
|
+
}
|
|
331
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
332
|
+
return test2[n];
|
|
333
|
+
});
|
|
334
|
+
if (order2.join('') !== '0123456789') {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
339
|
+
var test3 = {};
|
|
340
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
341
|
+
test3[letter] = letter;
|
|
342
|
+
});
|
|
343
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
344
|
+
'abcdefghijklmnopqrst') {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return true;
|
|
349
|
+
} catch (err) {
|
|
350
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
356
|
+
var from;
|
|
357
|
+
var to = toObject(target);
|
|
358
|
+
var symbols;
|
|
359
|
+
|
|
360
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
361
|
+
from = Object(arguments[s]);
|
|
362
|
+
|
|
363
|
+
for (var key in from) {
|
|
364
|
+
if (hasOwnProperty.call(from, key)) {
|
|
365
|
+
to[key] = from[key];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (getOwnPropertySymbols) {
|
|
370
|
+
symbols = getOwnPropertySymbols(from);
|
|
371
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
372
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
373
|
+
to[symbols[i]] = from[symbols[i]];
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return to;
|
|
380
|
+
};
|
|
381
|
+
return objectAssign;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
386
|
+
*
|
|
387
|
+
* This source code is licensed under the MIT license found in the
|
|
388
|
+
* LICENSE file in the root directory of this source tree.
|
|
389
|
+
*/
|
|
390
|
+
|
|
391
|
+
var ReactPropTypesSecret_1;
|
|
392
|
+
var hasRequiredReactPropTypesSecret;
|
|
393
|
+
|
|
394
|
+
function requireReactPropTypesSecret () {
|
|
395
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
396
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
397
|
+
|
|
398
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
399
|
+
|
|
400
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
401
|
+
return ReactPropTypesSecret_1;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
var has;
|
|
405
|
+
var hasRequiredHas;
|
|
406
|
+
|
|
407
|
+
function requireHas () {
|
|
408
|
+
if (hasRequiredHas) return has;
|
|
409
|
+
hasRequiredHas = 1;
|
|
410
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
411
|
+
return has;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
416
|
+
*
|
|
417
|
+
* This source code is licensed under the MIT license found in the
|
|
418
|
+
* LICENSE file in the root directory of this source tree.
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
var checkPropTypes_1;
|
|
422
|
+
var hasRequiredCheckPropTypes;
|
|
423
|
+
|
|
424
|
+
function requireCheckPropTypes () {
|
|
425
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
426
|
+
hasRequiredCheckPropTypes = 1;
|
|
427
|
+
|
|
428
|
+
var printWarning = function() {};
|
|
429
|
+
|
|
430
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
431
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
432
|
+
var loggedTypeFailures = {};
|
|
433
|
+
var has = requireHas();
|
|
434
|
+
|
|
435
|
+
printWarning = function(text) {
|
|
436
|
+
var message = 'Warning: ' + text;
|
|
437
|
+
if (typeof console !== 'undefined') {
|
|
438
|
+
console.error(message);
|
|
439
|
+
}
|
|
440
|
+
try {
|
|
441
|
+
// --- Welcome to debugging React ---
|
|
442
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
443
|
+
// to find the callsite that caused this warning to fire.
|
|
444
|
+
throw new Error(message);
|
|
445
|
+
} catch (x) { /**/ }
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Assert that the values match with the type specs.
|
|
451
|
+
* Error messages are memorized and will only be shown once.
|
|
452
|
+
*
|
|
453
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
454
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
455
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
456
|
+
* @param {string} componentName Name of the component for error messages.
|
|
457
|
+
* @param {?Function} getStack Returns the component stack.
|
|
458
|
+
* @private
|
|
459
|
+
*/
|
|
460
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
461
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
462
|
+
for (var typeSpecName in typeSpecs) {
|
|
463
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
464
|
+
var error;
|
|
465
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
466
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
467
|
+
// After these have been cleaned up, we'll let them throw.
|
|
468
|
+
try {
|
|
469
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
470
|
+
// behavior as without this statement except with a better message.
|
|
471
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
472
|
+
var err = Error(
|
|
473
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
474
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
475
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
476
|
+
);
|
|
477
|
+
err.name = 'Invariant Violation';
|
|
478
|
+
throw err;
|
|
479
|
+
}
|
|
480
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
481
|
+
} catch (ex) {
|
|
482
|
+
error = ex;
|
|
483
|
+
}
|
|
484
|
+
if (error && !(error instanceof Error)) {
|
|
485
|
+
printWarning(
|
|
486
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
487
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
488
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
489
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
490
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
491
|
+
'shape all require an argument).'
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
495
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
496
|
+
// same error.
|
|
497
|
+
loggedTypeFailures[error.message] = true;
|
|
498
|
+
|
|
499
|
+
var stack = getStack ? getStack() : '';
|
|
500
|
+
|
|
501
|
+
printWarning(
|
|
502
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Resets warning cache when testing.
|
|
512
|
+
*
|
|
513
|
+
* @private
|
|
514
|
+
*/
|
|
515
|
+
checkPropTypes.resetWarningCache = function() {
|
|
516
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
517
|
+
loggedTypeFailures = {};
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
checkPropTypes_1 = checkPropTypes;
|
|
522
|
+
return checkPropTypes_1;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
527
|
+
*
|
|
528
|
+
* This source code is licensed under the MIT license found in the
|
|
529
|
+
* LICENSE file in the root directory of this source tree.
|
|
530
|
+
*/
|
|
531
|
+
|
|
532
|
+
var factoryWithTypeCheckers;
|
|
533
|
+
var hasRequiredFactoryWithTypeCheckers;
|
|
534
|
+
|
|
535
|
+
function requireFactoryWithTypeCheckers () {
|
|
536
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
537
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
538
|
+
|
|
539
|
+
var ReactIs = requireReactIs();
|
|
540
|
+
var assign = requireObjectAssign();
|
|
541
|
+
|
|
542
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
543
|
+
var has = requireHas();
|
|
544
|
+
var checkPropTypes = requireCheckPropTypes();
|
|
545
|
+
|
|
546
|
+
var printWarning = function() {};
|
|
547
|
+
|
|
548
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
549
|
+
printWarning = function(text) {
|
|
550
|
+
var message = 'Warning: ' + text;
|
|
551
|
+
if (typeof console !== 'undefined') {
|
|
552
|
+
console.error(message);
|
|
553
|
+
}
|
|
554
|
+
try {
|
|
555
|
+
// --- Welcome to debugging React ---
|
|
556
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
557
|
+
// to find the callsite that caused this warning to fire.
|
|
558
|
+
throw new Error(message);
|
|
559
|
+
} catch (x) {}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
function emptyFunctionThatReturnsNull() {
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
568
|
+
/* global Symbol */
|
|
569
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
570
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Returns the iterator method function contained on the iterable object.
|
|
574
|
+
*
|
|
575
|
+
* Be sure to invoke the function with the iterable as context:
|
|
576
|
+
*
|
|
577
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
578
|
+
* if (iteratorFn) {
|
|
579
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
580
|
+
* ...
|
|
581
|
+
* }
|
|
582
|
+
*
|
|
583
|
+
* @param {?object} maybeIterable
|
|
584
|
+
* @return {?function}
|
|
585
|
+
*/
|
|
586
|
+
function getIteratorFn(maybeIterable) {
|
|
587
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
588
|
+
if (typeof iteratorFn === 'function') {
|
|
589
|
+
return iteratorFn;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
595
|
+
* supplied to React components. Example usage:
|
|
596
|
+
*
|
|
597
|
+
* var Props = require('ReactPropTypes');
|
|
598
|
+
* var MyArticle = React.createClass({
|
|
599
|
+
* propTypes: {
|
|
600
|
+
* // An optional string prop named "description".
|
|
601
|
+
* description: Props.string,
|
|
602
|
+
*
|
|
603
|
+
* // A required enum prop named "category".
|
|
604
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
605
|
+
*
|
|
606
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
607
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
608
|
+
* },
|
|
609
|
+
* render: function() { ... }
|
|
610
|
+
* });
|
|
611
|
+
*
|
|
612
|
+
* A more formal specification of how these methods are used:
|
|
613
|
+
*
|
|
614
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
615
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
616
|
+
*
|
|
617
|
+
* Each and every declaration produces a function with the same signature. This
|
|
618
|
+
* allows the creation of custom validation functions. For example:
|
|
619
|
+
*
|
|
620
|
+
* var MyLink = React.createClass({
|
|
621
|
+
* propTypes: {
|
|
622
|
+
* // An optional string or URI prop named "href".
|
|
623
|
+
* href: function(props, propName, componentName) {
|
|
624
|
+
* var propValue = props[propName];
|
|
625
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
626
|
+
* !(propValue instanceof URI)) {
|
|
627
|
+
* return new Error(
|
|
628
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
629
|
+
* componentName
|
|
630
|
+
* );
|
|
631
|
+
* }
|
|
632
|
+
* }
|
|
633
|
+
* },
|
|
634
|
+
* render: function() {...}
|
|
635
|
+
* });
|
|
636
|
+
*
|
|
637
|
+
* @internal
|
|
638
|
+
*/
|
|
639
|
+
|
|
640
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
641
|
+
|
|
642
|
+
// Important!
|
|
643
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
644
|
+
var ReactPropTypes = {
|
|
645
|
+
array: createPrimitiveTypeChecker('array'),
|
|
646
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
647
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
648
|
+
func: createPrimitiveTypeChecker('function'),
|
|
649
|
+
number: createPrimitiveTypeChecker('number'),
|
|
650
|
+
object: createPrimitiveTypeChecker('object'),
|
|
651
|
+
string: createPrimitiveTypeChecker('string'),
|
|
652
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
653
|
+
|
|
654
|
+
any: createAnyTypeChecker(),
|
|
655
|
+
arrayOf: createArrayOfTypeChecker,
|
|
656
|
+
element: createElementTypeChecker(),
|
|
657
|
+
elementType: createElementTypeTypeChecker(),
|
|
658
|
+
instanceOf: createInstanceTypeChecker,
|
|
659
|
+
node: createNodeChecker(),
|
|
660
|
+
objectOf: createObjectOfTypeChecker,
|
|
661
|
+
oneOf: createEnumTypeChecker,
|
|
662
|
+
oneOfType: createUnionTypeChecker,
|
|
663
|
+
shape: createShapeTypeChecker,
|
|
664
|
+
exact: createStrictShapeTypeChecker,
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
669
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
670
|
+
*/
|
|
671
|
+
/*eslint-disable no-self-compare*/
|
|
672
|
+
function is(x, y) {
|
|
673
|
+
// SameValue algorithm
|
|
674
|
+
if (x === y) {
|
|
675
|
+
// Steps 1-5, 7-10
|
|
676
|
+
// Steps 6.b-6.e: +0 != -0
|
|
677
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
678
|
+
} else {
|
|
679
|
+
// Step 6.a: NaN == NaN
|
|
680
|
+
return x !== x && y !== y;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
/*eslint-enable no-self-compare*/
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
687
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
688
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
689
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
690
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
691
|
+
*/
|
|
692
|
+
function PropTypeError(message, data) {
|
|
693
|
+
this.message = message;
|
|
694
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
695
|
+
this.stack = '';
|
|
696
|
+
}
|
|
697
|
+
// Make `instanceof Error` still work for returned errors.
|
|
698
|
+
PropTypeError.prototype = Error.prototype;
|
|
699
|
+
|
|
700
|
+
function createChainableTypeChecker(validate) {
|
|
701
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
702
|
+
var manualPropTypeCallCache = {};
|
|
703
|
+
var manualPropTypeWarningCount = 0;
|
|
704
|
+
}
|
|
705
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
706
|
+
componentName = componentName || ANONYMOUS;
|
|
707
|
+
propFullName = propFullName || propName;
|
|
708
|
+
|
|
709
|
+
if (secret !== ReactPropTypesSecret) {
|
|
710
|
+
if (throwOnDirectAccess) {
|
|
711
|
+
// New behavior only for users of `prop-types` package
|
|
712
|
+
var err = new Error(
|
|
713
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
714
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
715
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
716
|
+
);
|
|
717
|
+
err.name = 'Invariant Violation';
|
|
718
|
+
throw err;
|
|
719
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
720
|
+
// Old behavior for people using React.PropTypes
|
|
721
|
+
var cacheKey = componentName + ':' + propName;
|
|
722
|
+
if (
|
|
723
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
724
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
725
|
+
manualPropTypeWarningCount < 3
|
|
726
|
+
) {
|
|
727
|
+
printWarning(
|
|
728
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
729
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
730
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
731
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
732
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
733
|
+
);
|
|
734
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
735
|
+
manualPropTypeWarningCount++;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
if (props[propName] == null) {
|
|
740
|
+
if (isRequired) {
|
|
741
|
+
if (props[propName] === null) {
|
|
742
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
743
|
+
}
|
|
744
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
745
|
+
}
|
|
746
|
+
return null;
|
|
747
|
+
} else {
|
|
748
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
753
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
754
|
+
|
|
755
|
+
return chainedCheckType;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
759
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
760
|
+
var propValue = props[propName];
|
|
761
|
+
var propType = getPropType(propValue);
|
|
762
|
+
if (propType !== expectedType) {
|
|
763
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
764
|
+
// check, but we can offer a more precise error message here rather than
|
|
765
|
+
// 'of type `object`'.
|
|
766
|
+
var preciseType = getPreciseType(propValue);
|
|
767
|
+
|
|
768
|
+
return new PropTypeError(
|
|
769
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
770
|
+
{expectedType: expectedType}
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
return createChainableTypeChecker(validate);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
function createAnyTypeChecker() {
|
|
779
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
783
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
784
|
+
if (typeof typeChecker !== 'function') {
|
|
785
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
786
|
+
}
|
|
787
|
+
var propValue = props[propName];
|
|
788
|
+
if (!Array.isArray(propValue)) {
|
|
789
|
+
var propType = getPropType(propValue);
|
|
790
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
791
|
+
}
|
|
792
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
793
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
794
|
+
if (error instanceof Error) {
|
|
795
|
+
return error;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
return createChainableTypeChecker(validate);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
function createElementTypeChecker() {
|
|
804
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
805
|
+
var propValue = props[propName];
|
|
806
|
+
if (!isValidElement(propValue)) {
|
|
807
|
+
var propType = getPropType(propValue);
|
|
808
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
809
|
+
}
|
|
810
|
+
return null;
|
|
811
|
+
}
|
|
812
|
+
return createChainableTypeChecker(validate);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function createElementTypeTypeChecker() {
|
|
816
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
817
|
+
var propValue = props[propName];
|
|
818
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
819
|
+
var propType = getPropType(propValue);
|
|
820
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
821
|
+
}
|
|
822
|
+
return null;
|
|
823
|
+
}
|
|
824
|
+
return createChainableTypeChecker(validate);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
828
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
829
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
830
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
831
|
+
var actualClassName = getClassName(props[propName]);
|
|
832
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
833
|
+
}
|
|
834
|
+
return null;
|
|
835
|
+
}
|
|
836
|
+
return createChainableTypeChecker(validate);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
function createEnumTypeChecker(expectedValues) {
|
|
840
|
+
if (!Array.isArray(expectedValues)) {
|
|
841
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
842
|
+
if (arguments.length > 1) {
|
|
843
|
+
printWarning(
|
|
844
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
845
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
846
|
+
);
|
|
847
|
+
} else {
|
|
848
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return emptyFunctionThatReturnsNull;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
855
|
+
var propValue = props[propName];
|
|
856
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
857
|
+
if (is(propValue, expectedValues[i])) {
|
|
858
|
+
return null;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
863
|
+
var type = getPreciseType(value);
|
|
864
|
+
if (type === 'symbol') {
|
|
865
|
+
return String(value);
|
|
866
|
+
}
|
|
867
|
+
return value;
|
|
868
|
+
});
|
|
869
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
870
|
+
}
|
|
871
|
+
return createChainableTypeChecker(validate);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
875
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
876
|
+
if (typeof typeChecker !== 'function') {
|
|
877
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
878
|
+
}
|
|
879
|
+
var propValue = props[propName];
|
|
880
|
+
var propType = getPropType(propValue);
|
|
881
|
+
if (propType !== 'object') {
|
|
882
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
883
|
+
}
|
|
884
|
+
for (var key in propValue) {
|
|
885
|
+
if (has(propValue, key)) {
|
|
886
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
887
|
+
if (error instanceof Error) {
|
|
888
|
+
return error;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return null;
|
|
893
|
+
}
|
|
894
|
+
return createChainableTypeChecker(validate);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
898
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
899
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
900
|
+
return emptyFunctionThatReturnsNull;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
904
|
+
var checker = arrayOfTypeCheckers[i];
|
|
905
|
+
if (typeof checker !== 'function') {
|
|
906
|
+
printWarning(
|
|
907
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
908
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
909
|
+
);
|
|
910
|
+
return emptyFunctionThatReturnsNull;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
915
|
+
var expectedTypes = [];
|
|
916
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
917
|
+
var checker = arrayOfTypeCheckers[i];
|
|
918
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
919
|
+
if (checkerResult == null) {
|
|
920
|
+
return null;
|
|
921
|
+
}
|
|
922
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
923
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
927
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
928
|
+
}
|
|
929
|
+
return createChainableTypeChecker(validate);
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
function createNodeChecker() {
|
|
933
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
934
|
+
if (!isNode(props[propName])) {
|
|
935
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
936
|
+
}
|
|
937
|
+
return null;
|
|
938
|
+
}
|
|
939
|
+
return createChainableTypeChecker(validate);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
943
|
+
return new PropTypeError(
|
|
944
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
945
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
950
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
951
|
+
var propValue = props[propName];
|
|
952
|
+
var propType = getPropType(propValue);
|
|
953
|
+
if (propType !== 'object') {
|
|
954
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
955
|
+
}
|
|
956
|
+
for (var key in shapeTypes) {
|
|
957
|
+
var checker = shapeTypes[key];
|
|
958
|
+
if (typeof checker !== 'function') {
|
|
959
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
960
|
+
}
|
|
961
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
962
|
+
if (error) {
|
|
963
|
+
return error;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return null;
|
|
967
|
+
}
|
|
968
|
+
return createChainableTypeChecker(validate);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
972
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
973
|
+
var propValue = props[propName];
|
|
974
|
+
var propType = getPropType(propValue);
|
|
975
|
+
if (propType !== 'object') {
|
|
976
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
977
|
+
}
|
|
978
|
+
// We need to check all keys in case some are required but missing from props.
|
|
979
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
980
|
+
for (var key in allKeys) {
|
|
981
|
+
var checker = shapeTypes[key];
|
|
982
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
983
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
984
|
+
}
|
|
985
|
+
if (!checker) {
|
|
986
|
+
return new PropTypeError(
|
|
987
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
988
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
989
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
993
|
+
if (error) {
|
|
994
|
+
return error;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return null;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
return createChainableTypeChecker(validate);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
function isNode(propValue) {
|
|
1004
|
+
switch (typeof propValue) {
|
|
1005
|
+
case 'number':
|
|
1006
|
+
case 'string':
|
|
1007
|
+
case 'undefined':
|
|
1008
|
+
return true;
|
|
1009
|
+
case 'boolean':
|
|
1010
|
+
return !propValue;
|
|
1011
|
+
case 'object':
|
|
1012
|
+
if (Array.isArray(propValue)) {
|
|
1013
|
+
return propValue.every(isNode);
|
|
1014
|
+
}
|
|
1015
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
1016
|
+
return true;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
1020
|
+
if (iteratorFn) {
|
|
1021
|
+
var iterator = iteratorFn.call(propValue);
|
|
1022
|
+
var step;
|
|
1023
|
+
if (iteratorFn !== propValue.entries) {
|
|
1024
|
+
while (!(step = iterator.next()).done) {
|
|
1025
|
+
if (!isNode(step.value)) {
|
|
1026
|
+
return false;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
} else {
|
|
1030
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1031
|
+
while (!(step = iterator.next()).done) {
|
|
1032
|
+
var entry = step.value;
|
|
1033
|
+
if (entry) {
|
|
1034
|
+
if (!isNode(entry[1])) {
|
|
1035
|
+
return false;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
} else {
|
|
1041
|
+
return false;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
return true;
|
|
1045
|
+
default:
|
|
1046
|
+
return false;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
function isSymbol(propType, propValue) {
|
|
1051
|
+
// Native Symbol.
|
|
1052
|
+
if (propType === 'symbol') {
|
|
1053
|
+
return true;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
// falsy value can't be a Symbol
|
|
1057
|
+
if (!propValue) {
|
|
1058
|
+
return false;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1062
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1063
|
+
return true;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1067
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1068
|
+
return true;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
return false;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1075
|
+
function getPropType(propValue) {
|
|
1076
|
+
var propType = typeof propValue;
|
|
1077
|
+
if (Array.isArray(propValue)) {
|
|
1078
|
+
return 'array';
|
|
1079
|
+
}
|
|
1080
|
+
if (propValue instanceof RegExp) {
|
|
1081
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1082
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1083
|
+
// passes PropTypes.object.
|
|
1084
|
+
return 'object';
|
|
1085
|
+
}
|
|
1086
|
+
if (isSymbol(propType, propValue)) {
|
|
1087
|
+
return 'symbol';
|
|
1088
|
+
}
|
|
1089
|
+
return propType;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1093
|
+
// See `createPrimitiveTypeChecker`.
|
|
1094
|
+
function getPreciseType(propValue) {
|
|
1095
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1096
|
+
return '' + propValue;
|
|
1097
|
+
}
|
|
1098
|
+
var propType = getPropType(propValue);
|
|
1099
|
+
if (propType === 'object') {
|
|
1100
|
+
if (propValue instanceof Date) {
|
|
1101
|
+
return 'date';
|
|
1102
|
+
} else if (propValue instanceof RegExp) {
|
|
1103
|
+
return 'regexp';
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
return propType;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1110
|
+
// For example, "undefined" or "of type array"
|
|
1111
|
+
function getPostfixForTypeWarning(value) {
|
|
1112
|
+
var type = getPreciseType(value);
|
|
1113
|
+
switch (type) {
|
|
1114
|
+
case 'array':
|
|
1115
|
+
case 'object':
|
|
1116
|
+
return 'an ' + type;
|
|
1117
|
+
case 'boolean':
|
|
1118
|
+
case 'date':
|
|
1119
|
+
case 'regexp':
|
|
1120
|
+
return 'a ' + type;
|
|
1121
|
+
default:
|
|
1122
|
+
return type;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// Returns class name of the object, if any.
|
|
1127
|
+
function getClassName(propValue) {
|
|
1128
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1129
|
+
return ANONYMOUS;
|
|
1130
|
+
}
|
|
1131
|
+
return propValue.constructor.name;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1135
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1136
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1137
|
+
|
|
1138
|
+
return ReactPropTypes;
|
|
1139
|
+
};
|
|
1140
|
+
return factoryWithTypeCheckers;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1145
|
+
*
|
|
1146
|
+
* This source code is licensed under the MIT license found in the
|
|
1147
|
+
* LICENSE file in the root directory of this source tree.
|
|
1148
|
+
*/
|
|
1149
|
+
|
|
1150
|
+
var factoryWithThrowingShims;
|
|
1151
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
1152
|
+
|
|
1153
|
+
function requireFactoryWithThrowingShims () {
|
|
1154
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1155
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
1156
|
+
|
|
1157
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
1158
|
+
|
|
1159
|
+
function emptyFunction() {}
|
|
1160
|
+
function emptyFunctionWithReset() {}
|
|
1161
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1162
|
+
|
|
1163
|
+
factoryWithThrowingShims = function() {
|
|
1164
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1165
|
+
if (secret === ReactPropTypesSecret) {
|
|
1166
|
+
// It is still safe when called from React.
|
|
1167
|
+
return;
|
|
1168
|
+
}
|
|
1169
|
+
var err = new Error(
|
|
1170
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1171
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1172
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1173
|
+
);
|
|
1174
|
+
err.name = 'Invariant Violation';
|
|
1175
|
+
throw err;
|
|
1176
|
+
} shim.isRequired = shim;
|
|
1177
|
+
function getShim() {
|
|
1178
|
+
return shim;
|
|
1179
|
+
} // Important!
|
|
1180
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1181
|
+
var ReactPropTypes = {
|
|
1182
|
+
array: shim,
|
|
1183
|
+
bigint: shim,
|
|
1184
|
+
bool: shim,
|
|
1185
|
+
func: shim,
|
|
1186
|
+
number: shim,
|
|
1187
|
+
object: shim,
|
|
1188
|
+
string: shim,
|
|
1189
|
+
symbol: shim,
|
|
1190
|
+
|
|
1191
|
+
any: shim,
|
|
1192
|
+
arrayOf: getShim,
|
|
1193
|
+
element: shim,
|
|
1194
|
+
elementType: shim,
|
|
1195
|
+
instanceOf: getShim,
|
|
1196
|
+
node: shim,
|
|
1197
|
+
objectOf: getShim,
|
|
1198
|
+
oneOf: getShim,
|
|
1199
|
+
oneOfType: getShim,
|
|
1200
|
+
shape: getShim,
|
|
1201
|
+
exact: getShim,
|
|
1202
|
+
|
|
1203
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
1204
|
+
resetWarningCache: emptyFunction
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1207
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1208
|
+
|
|
1209
|
+
return ReactPropTypes;
|
|
1210
|
+
};
|
|
1211
|
+
return factoryWithThrowingShims;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1216
|
+
*
|
|
1217
|
+
* This source code is licensed under the MIT license found in the
|
|
1218
|
+
* LICENSE file in the root directory of this source tree.
|
|
1219
|
+
*/
|
|
1220
|
+
|
|
1221
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1222
|
+
var ReactIs = requireReactIs();
|
|
1223
|
+
|
|
1224
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1225
|
+
// http://fb.me/prop-types-in-prod
|
|
1226
|
+
var throwOnDirectAccess = true;
|
|
1227
|
+
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1228
|
+
} else {
|
|
1229
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1230
|
+
// http://fb.me/prop-types-in-prod
|
|
1231
|
+
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
var ModalPortalExports = {};
|
|
1235
|
+
var ModalPortal = {
|
|
1236
|
+
get exports(){ return ModalPortalExports; },
|
|
1237
|
+
set exports(v){ ModalPortalExports = v; },
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
var focusManager = {};
|
|
1241
|
+
|
|
1242
|
+
var tabbableExports = {};
|
|
1243
|
+
var tabbable = {
|
|
1244
|
+
get exports(){ return tabbableExports; },
|
|
1245
|
+
set exports(v){ tabbableExports = v; },
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
(function (module, exports) {
|
|
1249
|
+
|
|
1250
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1251
|
+
value: true
|
|
1252
|
+
});
|
|
1253
|
+
exports.default = findTabbableDescendants;
|
|
1254
|
+
/*!
|
|
1255
|
+
* Adapted from jQuery UI core
|
|
1256
|
+
*
|
|
1257
|
+
* http://jqueryui.com
|
|
1258
|
+
*
|
|
1259
|
+
* Copyright 2014 jQuery Foundation and other contributors
|
|
1260
|
+
* Released under the MIT license.
|
|
1261
|
+
* http://jquery.org/license
|
|
1262
|
+
*
|
|
1263
|
+
* http://api.jqueryui.com/category/ui-core/
|
|
1264
|
+
*/
|
|
1265
|
+
|
|
1266
|
+
var DISPLAY_NONE = "none";
|
|
1267
|
+
var DISPLAY_CONTENTS = "contents";
|
|
1268
|
+
|
|
1269
|
+
// match the whole word to prevent fuzzy searching
|
|
1270
|
+
var tabbableNode = /^(input|select|textarea|button|object|iframe)$/;
|
|
1271
|
+
|
|
1272
|
+
function isNotOverflowing(element, style) {
|
|
1273
|
+
return style.getPropertyValue("overflow") !== "visible" ||
|
|
1274
|
+
// if 'overflow: visible' set, check if there is actually any overflow
|
|
1275
|
+
element.scrollWidth <= 0 && element.scrollHeight <= 0;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
function hidesContents(element) {
|
|
1279
|
+
var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
|
|
1280
|
+
|
|
1281
|
+
// If the node is empty, this is good enough
|
|
1282
|
+
if (zeroSize && !element.innerHTML) return true;
|
|
1283
|
+
|
|
1284
|
+
try {
|
|
1285
|
+
// Otherwise we need to check some styles
|
|
1286
|
+
var style = window.getComputedStyle(element);
|
|
1287
|
+
var displayValue = style.getPropertyValue("display");
|
|
1288
|
+
return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
|
|
1289
|
+
} catch (exception) {
|
|
1290
|
+
// eslint-disable-next-line no-console
|
|
1291
|
+
console.warn("Failed to inspect element style");
|
|
1292
|
+
return false;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
function visible(element) {
|
|
1297
|
+
var parentElement = element;
|
|
1298
|
+
var rootNode = element.getRootNode && element.getRootNode();
|
|
1299
|
+
while (parentElement) {
|
|
1300
|
+
if (parentElement === document.body) break;
|
|
1301
|
+
|
|
1302
|
+
// if we are not hidden yet, skip to checking outside the Web Component
|
|
1303
|
+
if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;
|
|
1304
|
+
|
|
1305
|
+
if (hidesContents(parentElement)) return false;
|
|
1306
|
+
parentElement = parentElement.parentNode;
|
|
1307
|
+
}
|
|
1308
|
+
return true;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
function focusable(element, isTabIndexNotNaN) {
|
|
1312
|
+
var nodeName = element.nodeName.toLowerCase();
|
|
1313
|
+
var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
|
|
1314
|
+
return res && visible(element);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
function tabbable(element) {
|
|
1318
|
+
var tabIndex = element.getAttribute("tabindex");
|
|
1319
|
+
if (tabIndex === null) tabIndex = undefined;
|
|
1320
|
+
var isTabIndexNaN = isNaN(tabIndex);
|
|
1321
|
+
return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function findTabbableDescendants(element) {
|
|
1325
|
+
var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
|
|
1326
|
+
return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
|
|
1327
|
+
}, []);
|
|
1328
|
+
return descendants.filter(tabbable);
|
|
1329
|
+
}
|
|
1330
|
+
module.exports = exports["default"];
|
|
1331
|
+
} (tabbable, tabbableExports));
|
|
1332
|
+
|
|
1333
|
+
Object.defineProperty(focusManager, "__esModule", {
|
|
1334
|
+
value: true
|
|
1335
|
+
});
|
|
1336
|
+
focusManager.resetState = resetState$4;
|
|
1337
|
+
focusManager.log = log$4;
|
|
1338
|
+
focusManager.handleBlur = handleBlur;
|
|
1339
|
+
focusManager.handleFocus = handleFocus;
|
|
1340
|
+
focusManager.markForFocusLater = markForFocusLater;
|
|
1341
|
+
focusManager.returnFocus = returnFocus;
|
|
1342
|
+
focusManager.popWithoutFocus = popWithoutFocus;
|
|
1343
|
+
focusManager.setupScopedFocus = setupScopedFocus;
|
|
1344
|
+
focusManager.teardownScopedFocus = teardownScopedFocus;
|
|
1345
|
+
|
|
1346
|
+
var _tabbable = tabbableExports;
|
|
1347
|
+
|
|
1348
|
+
var _tabbable2 = _interopRequireDefault$4(_tabbable);
|
|
1349
|
+
|
|
1350
|
+
function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1351
|
+
|
|
1352
|
+
var focusLaterElements = [];
|
|
1353
|
+
var modalElement = null;
|
|
1354
|
+
var needToFocus = false;
|
|
1355
|
+
|
|
1356
|
+
/* eslint-disable no-console */
|
|
1357
|
+
/* istanbul ignore next */
|
|
1358
|
+
function resetState$4() {
|
|
1359
|
+
focusLaterElements = [];
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
/* istanbul ignore next */
|
|
1363
|
+
function log$4() {
|
|
1364
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1365
|
+
console.log("focusManager ----------");
|
|
1366
|
+
focusLaterElements.forEach(function (f) {
|
|
1367
|
+
var check = f || {};
|
|
1368
|
+
console.log(check.nodeName, check.className, check.id);
|
|
1369
|
+
});
|
|
1370
|
+
console.log("end focusManager ----------");
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
/* eslint-enable no-console */
|
|
1374
|
+
|
|
1375
|
+
function handleBlur() {
|
|
1376
|
+
needToFocus = true;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
function handleFocus() {
|
|
1380
|
+
if (needToFocus) {
|
|
1381
|
+
needToFocus = false;
|
|
1382
|
+
if (!modalElement) {
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
// need to see how jQuery shims document.on('focusin') so we don't need the
|
|
1386
|
+
// setTimeout, firefox doesn't support focusin, if it did, we could focus
|
|
1387
|
+
// the element outside of a setTimeout. Side-effect of this implementation
|
|
1388
|
+
// is that the document.body gets focus, and then we focus our element right
|
|
1389
|
+
// after, seems fine.
|
|
1390
|
+
setTimeout(function () {
|
|
1391
|
+
if (modalElement.contains(document.activeElement)) {
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;
|
|
1395
|
+
el.focus();
|
|
1396
|
+
}, 0);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
function markForFocusLater() {
|
|
1401
|
+
focusLaterElements.push(document.activeElement);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/* eslint-disable no-console */
|
|
1405
|
+
function returnFocus() {
|
|
1406
|
+
var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1407
|
+
|
|
1408
|
+
var toFocus = null;
|
|
1409
|
+
try {
|
|
1410
|
+
if (focusLaterElements.length !== 0) {
|
|
1411
|
+
toFocus = focusLaterElements.pop();
|
|
1412
|
+
toFocus.focus({ preventScroll: preventScroll });
|
|
1413
|
+
}
|
|
1414
|
+
return;
|
|
1415
|
+
} catch (e) {
|
|
1416
|
+
console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" "));
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
/* eslint-enable no-console */
|
|
1420
|
+
|
|
1421
|
+
function popWithoutFocus() {
|
|
1422
|
+
focusLaterElements.length > 0 && focusLaterElements.pop();
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
function setupScopedFocus(element) {
|
|
1426
|
+
modalElement = element;
|
|
1427
|
+
|
|
1428
|
+
if (window.addEventListener) {
|
|
1429
|
+
window.addEventListener("blur", handleBlur, false);
|
|
1430
|
+
document.addEventListener("focus", handleFocus, true);
|
|
1431
|
+
} else {
|
|
1432
|
+
window.attachEvent("onBlur", handleBlur);
|
|
1433
|
+
document.attachEvent("onFocus", handleFocus);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
function teardownScopedFocus() {
|
|
1438
|
+
modalElement = null;
|
|
1439
|
+
|
|
1440
|
+
if (window.addEventListener) {
|
|
1441
|
+
window.removeEventListener("blur", handleBlur);
|
|
1442
|
+
document.removeEventListener("focus", handleFocus);
|
|
1443
|
+
} else {
|
|
1444
|
+
window.detachEvent("onBlur", handleBlur);
|
|
1445
|
+
document.detachEvent("onFocus", handleFocus);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
var scopeTabExports = {};
|
|
1450
|
+
var scopeTab = {
|
|
1451
|
+
get exports(){ return scopeTabExports; },
|
|
1452
|
+
set exports(v){ scopeTabExports = v; },
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
(function (module, exports) {
|
|
1456
|
+
|
|
1457
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1458
|
+
value: true
|
|
1459
|
+
});
|
|
1460
|
+
exports.default = scopeTab;
|
|
1461
|
+
|
|
1462
|
+
var _tabbable = tabbableExports;
|
|
1463
|
+
|
|
1464
|
+
var _tabbable2 = _interopRequireDefault(_tabbable);
|
|
1465
|
+
|
|
1466
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1467
|
+
|
|
1468
|
+
function getActiveElement() {
|
|
1469
|
+
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
1470
|
+
|
|
1471
|
+
return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
function scopeTab(node, event) {
|
|
1475
|
+
var tabbable = (0, _tabbable2.default)(node);
|
|
1476
|
+
|
|
1477
|
+
if (!tabbable.length) {
|
|
1478
|
+
// Do nothing, since there are no elements that can receive focus.
|
|
1479
|
+
event.preventDefault();
|
|
1480
|
+
return;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
var target = void 0;
|
|
1484
|
+
|
|
1485
|
+
var shiftKey = event.shiftKey;
|
|
1486
|
+
var head = tabbable[0];
|
|
1487
|
+
var tail = tabbable[tabbable.length - 1];
|
|
1488
|
+
var activeElement = getActiveElement();
|
|
1489
|
+
|
|
1490
|
+
// proceed with default browser behavior on tab.
|
|
1491
|
+
// Focus on last element on shift + tab.
|
|
1492
|
+
if (node === activeElement) {
|
|
1493
|
+
if (!shiftKey) return;
|
|
1494
|
+
target = tail;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
if (tail === activeElement && !shiftKey) {
|
|
1498
|
+
target = head;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (head === activeElement && shiftKey) {
|
|
1502
|
+
target = tail;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
if (target) {
|
|
1506
|
+
event.preventDefault();
|
|
1507
|
+
target.focus();
|
|
1508
|
+
return;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// Safari radio issue.
|
|
1512
|
+
//
|
|
1513
|
+
// Safari does not move the focus to the radio button,
|
|
1514
|
+
// so we need to force it to really walk through all elements.
|
|
1515
|
+
//
|
|
1516
|
+
// This is very error prone, since we are trying to guess
|
|
1517
|
+
// if it is a safari browser from the first occurence between
|
|
1518
|
+
// chrome or safari.
|
|
1519
|
+
//
|
|
1520
|
+
// The chrome user agent contains the first ocurrence
|
|
1521
|
+
// as the 'chrome/version' and later the 'safari/version'.
|
|
1522
|
+
var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);
|
|
1523
|
+
var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
|
|
1524
|
+
|
|
1525
|
+
// If we are not in safari desktop, let the browser control
|
|
1526
|
+
// the focus
|
|
1527
|
+
if (!isSafariDesktop) return;
|
|
1528
|
+
|
|
1529
|
+
var x = tabbable.indexOf(activeElement);
|
|
1530
|
+
|
|
1531
|
+
if (x > -1) {
|
|
1532
|
+
x += shiftKey ? -1 : 1;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
target = tabbable[x];
|
|
1536
|
+
|
|
1537
|
+
// If the tabbable element does not exist,
|
|
1538
|
+
// focus head/tail based on shiftKey
|
|
1539
|
+
if (typeof target === "undefined") {
|
|
1540
|
+
event.preventDefault();
|
|
1541
|
+
target = shiftKey ? tail : head;
|
|
1542
|
+
target.focus();
|
|
1543
|
+
return;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
event.preventDefault();
|
|
1547
|
+
|
|
1548
|
+
target.focus();
|
|
1549
|
+
}
|
|
1550
|
+
module.exports = exports["default"];
|
|
1551
|
+
} (scopeTab, scopeTabExports));
|
|
1552
|
+
|
|
1553
|
+
var ariaAppHider$1 = {};
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
1557
|
+
*
|
|
1558
|
+
* This source code is licensed under the MIT license found in the
|
|
1559
|
+
* LICENSE file in the root directory of this source tree.
|
|
1560
|
+
*/
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
1564
|
+
* This can be used to log issues in development environments in critical
|
|
1565
|
+
* paths. Removing the logging code for production environments will keep the
|
|
1566
|
+
* same logic and follow the same code paths.
|
|
1567
|
+
*/
|
|
1568
|
+
|
|
1569
|
+
var __DEV__ = process.env.NODE_ENV !== 'production';
|
|
1570
|
+
|
|
1571
|
+
var warning = function() {};
|
|
1572
|
+
|
|
1573
|
+
if (__DEV__) {
|
|
1574
|
+
var printWarning = function printWarning(format, args) {
|
|
1575
|
+
var len = arguments.length;
|
|
1576
|
+
args = new Array(len > 1 ? len - 1 : 0);
|
|
1577
|
+
for (var key = 1; key < len; key++) {
|
|
1578
|
+
args[key - 1] = arguments[key];
|
|
1579
|
+
}
|
|
1580
|
+
var argIndex = 0;
|
|
1581
|
+
var message = 'Warning: ' +
|
|
1582
|
+
format.replace(/%s/g, function() {
|
|
1583
|
+
return args[argIndex++];
|
|
1584
|
+
});
|
|
1585
|
+
if (typeof console !== 'undefined') {
|
|
1586
|
+
console.error(message);
|
|
1587
|
+
}
|
|
1588
|
+
try {
|
|
1589
|
+
// --- Welcome to debugging React ---
|
|
1590
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
1591
|
+
// to find the callsite that caused this warning to fire.
|
|
1592
|
+
throw new Error(message);
|
|
1593
|
+
} catch (x) {}
|
|
1594
|
+
};
|
|
1595
|
+
|
|
1596
|
+
warning = function(condition, format, args) {
|
|
1597
|
+
var len = arguments.length;
|
|
1598
|
+
args = new Array(len > 2 ? len - 2 : 0);
|
|
1599
|
+
for (var key = 2; key < len; key++) {
|
|
1600
|
+
args[key - 2] = arguments[key];
|
|
1601
|
+
}
|
|
1602
|
+
if (format === undefined) {
|
|
1603
|
+
throw new Error(
|
|
1604
|
+
'`warning(condition, format, ...args)` requires a warning ' +
|
|
1605
|
+
'message argument'
|
|
1606
|
+
);
|
|
1607
|
+
}
|
|
1608
|
+
if (!condition) {
|
|
1609
|
+
printWarning.apply(null, [format].concat(args));
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
var warning_1 = warning;
|
|
1615
|
+
|
|
1616
|
+
var safeHTMLElement = {};
|
|
1617
|
+
|
|
1618
|
+
var exenvExports = {};
|
|
1619
|
+
var exenv = {
|
|
1620
|
+
get exports(){ return exenvExports; },
|
|
1621
|
+
set exports(v){ exenvExports = v; },
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
/*!
|
|
1625
|
+
Copyright (c) 2015 Jed Watson.
|
|
1626
|
+
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
1627
|
+
All rights reserved.
|
|
1628
|
+
*/
|
|
1629
|
+
|
|
1630
|
+
(function (module) {
|
|
1631
|
+
/* global define */
|
|
1632
|
+
|
|
1633
|
+
(function () {
|
|
1634
|
+
|
|
1635
|
+
var canUseDOM = !!(
|
|
1636
|
+
typeof window !== 'undefined' &&
|
|
1637
|
+
window.document &&
|
|
1638
|
+
window.document.createElement
|
|
1639
|
+
);
|
|
1640
|
+
|
|
1641
|
+
var ExecutionEnvironment = {
|
|
1642
|
+
|
|
1643
|
+
canUseDOM: canUseDOM,
|
|
1644
|
+
|
|
1645
|
+
canUseWorkers: typeof Worker !== 'undefined',
|
|
1646
|
+
|
|
1647
|
+
canUseEventListeners:
|
|
1648
|
+
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
1649
|
+
|
|
1650
|
+
canUseViewport: canUseDOM && !!window.screen
|
|
1651
|
+
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
if (module.exports) {
|
|
1655
|
+
module.exports = ExecutionEnvironment;
|
|
1656
|
+
} else {
|
|
1657
|
+
window.ExecutionEnvironment = ExecutionEnvironment;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
}());
|
|
1661
|
+
} (exenv));
|
|
1662
|
+
|
|
1663
|
+
Object.defineProperty(safeHTMLElement, "__esModule", {
|
|
1664
|
+
value: true
|
|
1665
|
+
});
|
|
1666
|
+
safeHTMLElement.canUseDOM = safeHTMLElement.SafeNodeList = safeHTMLElement.SafeHTMLCollection = undefined;
|
|
1667
|
+
|
|
1668
|
+
var _exenv = exenvExports;
|
|
1669
|
+
|
|
1670
|
+
var _exenv2 = _interopRequireDefault$3(_exenv);
|
|
1671
|
+
|
|
1672
|
+
function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1673
|
+
|
|
1674
|
+
var EE = _exenv2.default;
|
|
1675
|
+
|
|
1676
|
+
var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
|
|
1677
|
+
|
|
1678
|
+
safeHTMLElement.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
|
|
1679
|
+
|
|
1680
|
+
safeHTMLElement.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
|
|
1681
|
+
|
|
1682
|
+
safeHTMLElement.canUseDOM = EE.canUseDOM;
|
|
1683
|
+
|
|
1684
|
+
safeHTMLElement.default = SafeHTMLElement;
|
|
1685
|
+
|
|
1686
|
+
Object.defineProperty(ariaAppHider$1, "__esModule", {
|
|
1687
|
+
value: true
|
|
1688
|
+
});
|
|
1689
|
+
ariaAppHider$1.resetState = resetState$3;
|
|
1690
|
+
ariaAppHider$1.log = log$3;
|
|
1691
|
+
ariaAppHider$1.assertNodeList = assertNodeList;
|
|
1692
|
+
ariaAppHider$1.setElement = setElement;
|
|
1693
|
+
ariaAppHider$1.validateElement = validateElement;
|
|
1694
|
+
ariaAppHider$1.hide = hide;
|
|
1695
|
+
ariaAppHider$1.show = show;
|
|
1696
|
+
ariaAppHider$1.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
|
|
1697
|
+
|
|
1698
|
+
var _warning = warning_1;
|
|
1699
|
+
|
|
1700
|
+
var _warning2 = _interopRequireDefault$2(_warning);
|
|
1701
|
+
|
|
1702
|
+
var _safeHTMLElement$1 = safeHTMLElement;
|
|
1703
|
+
|
|
1704
|
+
function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1705
|
+
|
|
1706
|
+
var globalElement = null;
|
|
1707
|
+
|
|
1708
|
+
/* eslint-disable no-console */
|
|
1709
|
+
/* istanbul ignore next */
|
|
1710
|
+
function resetState$3() {
|
|
1711
|
+
if (globalElement) {
|
|
1712
|
+
if (globalElement.removeAttribute) {
|
|
1713
|
+
globalElement.removeAttribute("aria-hidden");
|
|
1714
|
+
} else if (globalElement.length != null) {
|
|
1715
|
+
globalElement.forEach(function (element) {
|
|
1716
|
+
return element.removeAttribute("aria-hidden");
|
|
1717
|
+
});
|
|
1718
|
+
} else {
|
|
1719
|
+
document.querySelectorAll(globalElement).forEach(function (element) {
|
|
1720
|
+
return element.removeAttribute("aria-hidden");
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
globalElement = null;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
/* istanbul ignore next */
|
|
1728
|
+
function log$3() {
|
|
1729
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1730
|
+
var check = globalElement || {};
|
|
1731
|
+
console.log("ariaAppHider ----------");
|
|
1732
|
+
console.log(check.nodeName, check.className, check.id);
|
|
1733
|
+
console.log("end ariaAppHider ----------");
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
/* eslint-enable no-console */
|
|
1737
|
+
|
|
1738
|
+
function assertNodeList(nodeList, selector) {
|
|
1739
|
+
if (!nodeList || !nodeList.length) {
|
|
1740
|
+
throw new Error("react-modal: No elements were found for selector " + selector + ".");
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
function setElement(element) {
|
|
1745
|
+
var useElement = element;
|
|
1746
|
+
if (typeof useElement === "string" && _safeHTMLElement$1.canUseDOM) {
|
|
1747
|
+
var el = document.querySelectorAll(useElement);
|
|
1748
|
+
assertNodeList(el, useElement);
|
|
1749
|
+
useElement = el;
|
|
1750
|
+
}
|
|
1751
|
+
globalElement = useElement || globalElement;
|
|
1752
|
+
return globalElement;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
function validateElement(appElement) {
|
|
1756
|
+
var el = appElement || globalElement;
|
|
1757
|
+
if (el) {
|
|
1758
|
+
return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
|
|
1759
|
+
} else {
|
|
1760
|
+
(0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
|
|
1761
|
+
|
|
1762
|
+
return [];
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
function hide(appElement) {
|
|
1767
|
+
var _iteratorNormalCompletion = true;
|
|
1768
|
+
var _didIteratorError = false;
|
|
1769
|
+
var _iteratorError = undefined;
|
|
1770
|
+
|
|
1771
|
+
try {
|
|
1772
|
+
for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1773
|
+
var el = _step.value;
|
|
1774
|
+
|
|
1775
|
+
el.setAttribute("aria-hidden", "true");
|
|
1776
|
+
}
|
|
1777
|
+
} catch (err) {
|
|
1778
|
+
_didIteratorError = true;
|
|
1779
|
+
_iteratorError = err;
|
|
1780
|
+
} finally {
|
|
1781
|
+
try {
|
|
1782
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
1783
|
+
_iterator.return();
|
|
1784
|
+
}
|
|
1785
|
+
} finally {
|
|
1786
|
+
if (_didIteratorError) {
|
|
1787
|
+
throw _iteratorError;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
function show(appElement) {
|
|
1794
|
+
var _iteratorNormalCompletion2 = true;
|
|
1795
|
+
var _didIteratorError2 = false;
|
|
1796
|
+
var _iteratorError2 = undefined;
|
|
1797
|
+
|
|
1798
|
+
try {
|
|
1799
|
+
for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
1800
|
+
var el = _step2.value;
|
|
1801
|
+
|
|
1802
|
+
el.removeAttribute("aria-hidden");
|
|
1803
|
+
}
|
|
1804
|
+
} catch (err) {
|
|
1805
|
+
_didIteratorError2 = true;
|
|
1806
|
+
_iteratorError2 = err;
|
|
1807
|
+
} finally {
|
|
1808
|
+
try {
|
|
1809
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
1810
|
+
_iterator2.return();
|
|
1811
|
+
}
|
|
1812
|
+
} finally {
|
|
1813
|
+
if (_didIteratorError2) {
|
|
1814
|
+
throw _iteratorError2;
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
function documentNotReadyOrSSRTesting() {
|
|
1821
|
+
globalElement = null;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
var classList = {};
|
|
1825
|
+
|
|
1826
|
+
Object.defineProperty(classList, "__esModule", {
|
|
1827
|
+
value: true
|
|
1828
|
+
});
|
|
1829
|
+
classList.resetState = resetState$2;
|
|
1830
|
+
classList.log = log$2;
|
|
1831
|
+
var htmlClassList = {};
|
|
1832
|
+
var docBodyClassList = {};
|
|
1833
|
+
|
|
1834
|
+
/* eslint-disable no-console */
|
|
1835
|
+
/* istanbul ignore next */
|
|
1836
|
+
function removeClass(at, cls) {
|
|
1837
|
+
at.classList.remove(cls);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/* istanbul ignore next */
|
|
1841
|
+
function resetState$2() {
|
|
1842
|
+
var htmlElement = document.getElementsByTagName("html")[0];
|
|
1843
|
+
for (var cls in htmlClassList) {
|
|
1844
|
+
removeClass(htmlElement, htmlClassList[cls]);
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
var body = document.body;
|
|
1848
|
+
for (var _cls in docBodyClassList) {
|
|
1849
|
+
removeClass(body, docBodyClassList[_cls]);
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
htmlClassList = {};
|
|
1853
|
+
docBodyClassList = {};
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
/* istanbul ignore next */
|
|
1857
|
+
function log$2() {
|
|
1858
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1859
|
+
var classes = document.getElementsByTagName("html")[0].className;
|
|
1860
|
+
var buffer = "Show tracked classes:\n\n";
|
|
1861
|
+
|
|
1862
|
+
buffer += "<html /> (" + classes + "):\n ";
|
|
1863
|
+
for (var x in htmlClassList) {
|
|
1864
|
+
buffer += " " + x + " " + htmlClassList[x] + "\n ";
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
classes = document.body.className;
|
|
1868
|
+
|
|
1869
|
+
buffer += "\n\ndoc.body (" + classes + "):\n ";
|
|
1870
|
+
for (var _x in docBodyClassList) {
|
|
1871
|
+
buffer += " " + _x + " " + docBodyClassList[_x] + "\n ";
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
buffer += "\n";
|
|
1875
|
+
|
|
1876
|
+
console.log(buffer);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
/* eslint-enable no-console */
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Track the number of reference of a class.
|
|
1883
|
+
* @param {object} poll The poll to receive the reference.
|
|
1884
|
+
* @param {string} className The class name.
|
|
1885
|
+
* @return {string}
|
|
1886
|
+
*/
|
|
1887
|
+
var incrementReference = function incrementReference(poll, className) {
|
|
1888
|
+
if (!poll[className]) {
|
|
1889
|
+
poll[className] = 0;
|
|
1890
|
+
}
|
|
1891
|
+
poll[className] += 1;
|
|
1892
|
+
return className;
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* Drop the reference of a class.
|
|
1897
|
+
* @param {object} poll The poll to receive the reference.
|
|
1898
|
+
* @param {string} className The class name.
|
|
1899
|
+
* @return {string}
|
|
1900
|
+
*/
|
|
1901
|
+
var decrementReference = function decrementReference(poll, className) {
|
|
1902
|
+
if (poll[className]) {
|
|
1903
|
+
poll[className] -= 1;
|
|
1904
|
+
}
|
|
1905
|
+
return className;
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Track a class and add to the given class list.
|
|
1910
|
+
* @param {Object} classListRef A class list of an element.
|
|
1911
|
+
* @param {Object} poll The poll to be used.
|
|
1912
|
+
* @param {Array} classes The list of classes to be tracked.
|
|
1913
|
+
*/
|
|
1914
|
+
var trackClass = function trackClass(classListRef, poll, classes) {
|
|
1915
|
+
classes.forEach(function (className) {
|
|
1916
|
+
incrementReference(poll, className);
|
|
1917
|
+
classListRef.add(className);
|
|
1918
|
+
});
|
|
1919
|
+
};
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* Untrack a class and remove from the given class list if the reference
|
|
1923
|
+
* reaches 0.
|
|
1924
|
+
* @param {Object} classListRef A class list of an element.
|
|
1925
|
+
* @param {Object} poll The poll to be used.
|
|
1926
|
+
* @param {Array} classes The list of classes to be untracked.
|
|
1927
|
+
*/
|
|
1928
|
+
var untrackClass = function untrackClass(classListRef, poll, classes) {
|
|
1929
|
+
classes.forEach(function (className) {
|
|
1930
|
+
decrementReference(poll, className);
|
|
1931
|
+
poll[className] === 0 && classListRef.remove(className);
|
|
1932
|
+
});
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* Public inferface to add classes to the document.body.
|
|
1937
|
+
* @param {string} bodyClass The class string to be added.
|
|
1938
|
+
* It may contain more then one class
|
|
1939
|
+
* with ' ' as separator.
|
|
1940
|
+
*/
|
|
1941
|
+
classList.add = function add(element, classString) {
|
|
1942
|
+
return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1945
|
+
/**
|
|
1946
|
+
* Public inferface to remove classes from the document.body.
|
|
1947
|
+
* @param {string} bodyClass The class string to be added.
|
|
1948
|
+
* It may contain more then one class
|
|
1949
|
+
* with ' ' as separator.
|
|
1950
|
+
*/
|
|
1951
|
+
classList.remove = function remove(element, classString) {
|
|
1952
|
+
return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
1953
|
+
};
|
|
1954
|
+
|
|
1955
|
+
var portalOpenInstances$1 = {};
|
|
1956
|
+
|
|
1957
|
+
Object.defineProperty(portalOpenInstances$1, "__esModule", {
|
|
1958
|
+
value: true
|
|
1959
|
+
});
|
|
1960
|
+
portalOpenInstances$1.log = log$1;
|
|
1961
|
+
portalOpenInstances$1.resetState = resetState$1;
|
|
1962
|
+
|
|
1963
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1964
|
+
|
|
1965
|
+
// Tracks portals that are open and emits events to subscribers
|
|
1966
|
+
|
|
1967
|
+
var PortalOpenInstances = function PortalOpenInstances() {
|
|
1968
|
+
var _this = this;
|
|
1969
|
+
|
|
1970
|
+
_classCallCheck$1(this, PortalOpenInstances);
|
|
1971
|
+
|
|
1972
|
+
this.register = function (openInstance) {
|
|
1973
|
+
if (_this.openInstances.indexOf(openInstance) !== -1) {
|
|
1974
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1975
|
+
// eslint-disable-next-line no-console
|
|
1976
|
+
console.warn("React-Modal: Cannot register modal instance that's already open");
|
|
1977
|
+
}
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
_this.openInstances.push(openInstance);
|
|
1981
|
+
_this.emit("register");
|
|
1982
|
+
};
|
|
1983
|
+
|
|
1984
|
+
this.deregister = function (openInstance) {
|
|
1985
|
+
var index = _this.openInstances.indexOf(openInstance);
|
|
1986
|
+
if (index === -1) {
|
|
1987
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1988
|
+
// eslint-disable-next-line no-console
|
|
1989
|
+
console.warn("React-Modal: Unable to deregister " + openInstance + " as " + "it was never registered");
|
|
1990
|
+
}
|
|
1991
|
+
return;
|
|
1992
|
+
}
|
|
1993
|
+
_this.openInstances.splice(index, 1);
|
|
1994
|
+
_this.emit("deregister");
|
|
1995
|
+
};
|
|
1996
|
+
|
|
1997
|
+
this.subscribe = function (callback) {
|
|
1998
|
+
_this.subscribers.push(callback);
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
this.emit = function (eventType) {
|
|
2002
|
+
_this.subscribers.forEach(function (subscriber) {
|
|
2003
|
+
return subscriber(eventType,
|
|
2004
|
+
// shallow copy to avoid accidental mutation
|
|
2005
|
+
_this.openInstances.slice());
|
|
2006
|
+
});
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
this.openInstances = [];
|
|
2010
|
+
this.subscribers = [];
|
|
2011
|
+
};
|
|
2012
|
+
|
|
2013
|
+
var portalOpenInstances = new PortalOpenInstances();
|
|
2014
|
+
|
|
2015
|
+
/* eslint-disable no-console */
|
|
2016
|
+
/* istanbul ignore next */
|
|
2017
|
+
function log$1() {
|
|
2018
|
+
console.log("portalOpenInstances ----------");
|
|
2019
|
+
console.log(portalOpenInstances.openInstances.length);
|
|
2020
|
+
portalOpenInstances.openInstances.forEach(function (p) {
|
|
2021
|
+
return console.log(p);
|
|
2022
|
+
});
|
|
2023
|
+
console.log("end portalOpenInstances ----------");
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
/* istanbul ignore next */
|
|
2027
|
+
function resetState$1() {
|
|
2028
|
+
portalOpenInstances = new PortalOpenInstances();
|
|
2029
|
+
}
|
|
2030
|
+
/* eslint-enable no-console */
|
|
2031
|
+
|
|
2032
|
+
portalOpenInstances$1.default = portalOpenInstances;
|
|
2033
|
+
|
|
2034
|
+
var bodyTrap$1 = {};
|
|
2035
|
+
|
|
2036
|
+
Object.defineProperty(bodyTrap$1, "__esModule", {
|
|
2037
|
+
value: true
|
|
2038
|
+
});
|
|
2039
|
+
bodyTrap$1.resetState = resetState;
|
|
2040
|
+
bodyTrap$1.log = log;
|
|
2041
|
+
|
|
2042
|
+
var _portalOpenInstances = portalOpenInstances$1;
|
|
2043
|
+
|
|
2044
|
+
var _portalOpenInstances2 = _interopRequireDefault$1(_portalOpenInstances);
|
|
2045
|
+
|
|
2046
|
+
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2047
|
+
|
|
2048
|
+
// Body focus trap see Issue #742
|
|
2049
|
+
|
|
2050
|
+
var before = void 0,
|
|
2051
|
+
after = void 0,
|
|
2052
|
+
instances = [];
|
|
2053
|
+
|
|
2054
|
+
/* eslint-disable no-console */
|
|
2055
|
+
/* istanbul ignore next */
|
|
2056
|
+
function resetState() {
|
|
2057
|
+
var _arr = [before, after];
|
|
2058
|
+
|
|
2059
|
+
for (var _i = 0; _i < _arr.length; _i++) {
|
|
2060
|
+
var item = _arr[_i];
|
|
2061
|
+
if (!item) continue;
|
|
2062
|
+
item.parentNode && item.parentNode.removeChild(item);
|
|
2063
|
+
}
|
|
2064
|
+
before = after = null;
|
|
2065
|
+
instances = [];
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
/* istanbul ignore next */
|
|
2069
|
+
function log() {
|
|
2070
|
+
console.log("bodyTrap ----------");
|
|
2071
|
+
console.log(instances.length);
|
|
2072
|
+
var _arr2 = [before, after];
|
|
2073
|
+
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
|
2074
|
+
var item = _arr2[_i2];
|
|
2075
|
+
var check = item || {};
|
|
2076
|
+
console.log(check.nodeName, check.className, check.id);
|
|
2077
|
+
}
|
|
2078
|
+
console.log("edn bodyTrap ----------");
|
|
2079
|
+
}
|
|
2080
|
+
/* eslint-enable no-console */
|
|
2081
|
+
|
|
2082
|
+
function focusContent() {
|
|
2083
|
+
if (instances.length === 0) {
|
|
2084
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2085
|
+
// eslint-disable-next-line no-console
|
|
2086
|
+
console.warn("React-Modal: Open instances > 0 expected");
|
|
2087
|
+
}
|
|
2088
|
+
return;
|
|
2089
|
+
}
|
|
2090
|
+
instances[instances.length - 1].focusContent();
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
function bodyTrap(eventType, openInstances) {
|
|
2094
|
+
if (!before && !after) {
|
|
2095
|
+
before = document.createElement("div");
|
|
2096
|
+
before.setAttribute("data-react-modal-body-trap", "");
|
|
2097
|
+
before.style.position = "absolute";
|
|
2098
|
+
before.style.opacity = "0";
|
|
2099
|
+
before.setAttribute("tabindex", "0");
|
|
2100
|
+
before.addEventListener("focus", focusContent);
|
|
2101
|
+
after = before.cloneNode();
|
|
2102
|
+
after.addEventListener("focus", focusContent);
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
instances = openInstances;
|
|
2106
|
+
|
|
2107
|
+
if (instances.length > 0) {
|
|
2108
|
+
// Add focus trap
|
|
2109
|
+
if (document.body.firstChild !== before) {
|
|
2110
|
+
document.body.insertBefore(before, document.body.firstChild);
|
|
2111
|
+
}
|
|
2112
|
+
if (document.body.lastChild !== after) {
|
|
2113
|
+
document.body.appendChild(after);
|
|
2114
|
+
}
|
|
2115
|
+
} else {
|
|
2116
|
+
// Remove focus trap
|
|
2117
|
+
if (before.parentElement) {
|
|
2118
|
+
before.parentElement.removeChild(before);
|
|
2119
|
+
}
|
|
2120
|
+
if (after.parentElement) {
|
|
2121
|
+
after.parentElement.removeChild(after);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
_portalOpenInstances2.default.subscribe(bodyTrap);
|
|
2127
|
+
|
|
2128
|
+
(function (module, exports) {
|
|
2129
|
+
|
|
2130
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2131
|
+
value: true
|
|
2132
|
+
});
|
|
2133
|
+
|
|
2134
|
+
var _extends = Object.assign || 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; };
|
|
2135
|
+
|
|
2136
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2137
|
+
|
|
2138
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
2139
|
+
|
|
2140
|
+
var _react = React__default;
|
|
2141
|
+
|
|
2142
|
+
var _propTypes = propTypesExports;
|
|
2143
|
+
|
|
2144
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
2145
|
+
|
|
2146
|
+
var _focusManager = focusManager;
|
|
2147
|
+
|
|
2148
|
+
var focusManager$1 = _interopRequireWildcard(_focusManager);
|
|
2149
|
+
|
|
2150
|
+
var _scopeTab = scopeTabExports;
|
|
2151
|
+
|
|
2152
|
+
var _scopeTab2 = _interopRequireDefault(_scopeTab);
|
|
2153
|
+
|
|
2154
|
+
var _ariaAppHider = ariaAppHider$1;
|
|
2155
|
+
|
|
2156
|
+
var ariaAppHider = _interopRequireWildcard(_ariaAppHider);
|
|
2157
|
+
|
|
2158
|
+
var _classList = classList;
|
|
2159
|
+
|
|
2160
|
+
var classList$1 = _interopRequireWildcard(_classList);
|
|
2161
|
+
|
|
2162
|
+
var _safeHTMLElement = safeHTMLElement;
|
|
2163
|
+
|
|
2164
|
+
var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
|
|
2165
|
+
|
|
2166
|
+
var _portalOpenInstances = portalOpenInstances$1;
|
|
2167
|
+
|
|
2168
|
+
var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
|
|
2172
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
2173
|
+
|
|
2174
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2175
|
+
|
|
2176
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2177
|
+
|
|
2178
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
2179
|
+
|
|
2180
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
2181
|
+
|
|
2182
|
+
// so that our CSS is statically analyzable
|
|
2183
|
+
var CLASS_NAMES = {
|
|
2184
|
+
overlay: "ReactModal__Overlay",
|
|
2185
|
+
content: "ReactModal__Content"
|
|
2186
|
+
};
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* We need to support the deprecated `KeyboardEvent.keyCode` in addition to
|
|
2190
|
+
* `KeyboardEvent.code` for apps that still support IE11. Can be removed when
|
|
2191
|
+
* `react-modal` only supports React >18 (which dropped IE support).
|
|
2192
|
+
*/
|
|
2193
|
+
var isTabKey = function isTabKey(event) {
|
|
2194
|
+
return event.code === "Tab" || event.keyCode === 9;
|
|
2195
|
+
};
|
|
2196
|
+
var isEscKey = function isEscKey(event) {
|
|
2197
|
+
return event.code === "Escape" || event.keyCode === 27;
|
|
2198
|
+
};
|
|
2199
|
+
|
|
2200
|
+
var ariaHiddenInstances = 0;
|
|
2201
|
+
|
|
2202
|
+
var ModalPortal = function (_Component) {
|
|
2203
|
+
_inherits(ModalPortal, _Component);
|
|
2204
|
+
|
|
2205
|
+
function ModalPortal(props) {
|
|
2206
|
+
_classCallCheck(this, ModalPortal);
|
|
2207
|
+
|
|
2208
|
+
var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));
|
|
2209
|
+
|
|
2210
|
+
_this.setOverlayRef = function (overlay) {
|
|
2211
|
+
_this.overlay = overlay;
|
|
2212
|
+
_this.props.overlayRef && _this.props.overlayRef(overlay);
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
_this.setContentRef = function (content) {
|
|
2216
|
+
_this.content = content;
|
|
2217
|
+
_this.props.contentRef && _this.props.contentRef(content);
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
_this.afterClose = function () {
|
|
2221
|
+
var _this$props = _this.props,
|
|
2222
|
+
appElement = _this$props.appElement,
|
|
2223
|
+
ariaHideApp = _this$props.ariaHideApp,
|
|
2224
|
+
htmlOpenClassName = _this$props.htmlOpenClassName,
|
|
2225
|
+
bodyOpenClassName = _this$props.bodyOpenClassName,
|
|
2226
|
+
parentSelector = _this$props.parentSelector;
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
2230
|
+
|
|
2231
|
+
// Remove classes.
|
|
2232
|
+
bodyOpenClassName && classList$1.remove(parentDocument.body, bodyOpenClassName);
|
|
2233
|
+
|
|
2234
|
+
htmlOpenClassName && classList$1.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
2235
|
+
|
|
2236
|
+
// Reset aria-hidden attribute if all modals have been removed
|
|
2237
|
+
if (ariaHideApp && ariaHiddenInstances > 0) {
|
|
2238
|
+
ariaHiddenInstances -= 1;
|
|
2239
|
+
|
|
2240
|
+
if (ariaHiddenInstances === 0) {
|
|
2241
|
+
ariaAppHider.show(appElement);
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
if (_this.props.shouldFocusAfterRender) {
|
|
2246
|
+
if (_this.props.shouldReturnFocusAfterClose) {
|
|
2247
|
+
focusManager$1.returnFocus(_this.props.preventScroll);
|
|
2248
|
+
focusManager$1.teardownScopedFocus();
|
|
2249
|
+
} else {
|
|
2250
|
+
focusManager$1.popWithoutFocus();
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
if (_this.props.onAfterClose) {
|
|
2255
|
+
_this.props.onAfterClose();
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
_portalOpenInstances2.default.deregister(_this);
|
|
2259
|
+
};
|
|
2260
|
+
|
|
2261
|
+
_this.open = function () {
|
|
2262
|
+
_this.beforeOpen();
|
|
2263
|
+
if (_this.state.afterOpen && _this.state.beforeClose) {
|
|
2264
|
+
clearTimeout(_this.closeTimer);
|
|
2265
|
+
_this.setState({ beforeClose: false });
|
|
2266
|
+
} else {
|
|
2267
|
+
if (_this.props.shouldFocusAfterRender) {
|
|
2268
|
+
focusManager$1.setupScopedFocus(_this.node);
|
|
2269
|
+
focusManager$1.markForFocusLater();
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
_this.setState({ isOpen: true }, function () {
|
|
2273
|
+
_this.openAnimationFrame = requestAnimationFrame(function () {
|
|
2274
|
+
_this.setState({ afterOpen: true });
|
|
2275
|
+
|
|
2276
|
+
if (_this.props.isOpen && _this.props.onAfterOpen) {
|
|
2277
|
+
_this.props.onAfterOpen({
|
|
2278
|
+
overlayEl: _this.overlay,
|
|
2279
|
+
contentEl: _this.content
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
});
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
};
|
|
2286
|
+
|
|
2287
|
+
_this.close = function () {
|
|
2288
|
+
if (_this.props.closeTimeoutMS > 0) {
|
|
2289
|
+
_this.closeWithTimeout();
|
|
2290
|
+
} else {
|
|
2291
|
+
_this.closeWithoutTimeout();
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
|
|
2295
|
+
_this.focusContent = function () {
|
|
2296
|
+
return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
_this.closeWithTimeout = function () {
|
|
2300
|
+
var closesAt = Date.now() + _this.props.closeTimeoutMS;
|
|
2301
|
+
_this.setState({ beforeClose: true, closesAt: closesAt }, function () {
|
|
2302
|
+
_this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());
|
|
2303
|
+
});
|
|
2304
|
+
};
|
|
2305
|
+
|
|
2306
|
+
_this.closeWithoutTimeout = function () {
|
|
2307
|
+
_this.setState({
|
|
2308
|
+
beforeClose: false,
|
|
2309
|
+
isOpen: false,
|
|
2310
|
+
afterOpen: false,
|
|
2311
|
+
closesAt: null
|
|
2312
|
+
}, _this.afterClose);
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2315
|
+
_this.handleKeyDown = function (event) {
|
|
2316
|
+
if (isTabKey(event)) {
|
|
2317
|
+
(0, _scopeTab2.default)(_this.content, event);
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
|
|
2321
|
+
event.stopPropagation();
|
|
2322
|
+
_this.requestClose(event);
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2325
|
+
|
|
2326
|
+
_this.handleOverlayOnClick = function (event) {
|
|
2327
|
+
if (_this.shouldClose === null) {
|
|
2328
|
+
_this.shouldClose = true;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {
|
|
2332
|
+
if (_this.ownerHandlesClose()) {
|
|
2333
|
+
_this.requestClose(event);
|
|
2334
|
+
} else {
|
|
2335
|
+
_this.focusContent();
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
_this.shouldClose = null;
|
|
2339
|
+
};
|
|
2340
|
+
|
|
2341
|
+
_this.handleContentOnMouseUp = function () {
|
|
2342
|
+
_this.shouldClose = false;
|
|
2343
|
+
};
|
|
2344
|
+
|
|
2345
|
+
_this.handleOverlayOnMouseDown = function (event) {
|
|
2346
|
+
if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {
|
|
2347
|
+
event.preventDefault();
|
|
2348
|
+
}
|
|
2349
|
+
};
|
|
2350
|
+
|
|
2351
|
+
_this.handleContentOnClick = function () {
|
|
2352
|
+
_this.shouldClose = false;
|
|
2353
|
+
};
|
|
2354
|
+
|
|
2355
|
+
_this.handleContentOnMouseDown = function () {
|
|
2356
|
+
_this.shouldClose = false;
|
|
2357
|
+
};
|
|
2358
|
+
|
|
2359
|
+
_this.requestClose = function (event) {
|
|
2360
|
+
return _this.ownerHandlesClose() && _this.props.onRequestClose(event);
|
|
2361
|
+
};
|
|
2362
|
+
|
|
2363
|
+
_this.ownerHandlesClose = function () {
|
|
2364
|
+
return _this.props.onRequestClose;
|
|
2365
|
+
};
|
|
2366
|
+
|
|
2367
|
+
_this.shouldBeClosed = function () {
|
|
2368
|
+
return !_this.state.isOpen && !_this.state.beforeClose;
|
|
2369
|
+
};
|
|
2370
|
+
|
|
2371
|
+
_this.contentHasFocus = function () {
|
|
2372
|
+
return document.activeElement === _this.content || _this.content.contains(document.activeElement);
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2375
|
+
_this.buildClassName = function (which, additional) {
|
|
2376
|
+
var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : {
|
|
2377
|
+
base: CLASS_NAMES[which],
|
|
2378
|
+
afterOpen: CLASS_NAMES[which] + "--after-open",
|
|
2379
|
+
beforeClose: CLASS_NAMES[which] + "--before-close"
|
|
2380
|
+
};
|
|
2381
|
+
var className = classNames.base;
|
|
2382
|
+
if (_this.state.afterOpen) {
|
|
2383
|
+
className = className + " " + classNames.afterOpen;
|
|
2384
|
+
}
|
|
2385
|
+
if (_this.state.beforeClose) {
|
|
2386
|
+
className = className + " " + classNames.beforeClose;
|
|
2387
|
+
}
|
|
2388
|
+
return typeof additional === "string" && additional ? className + " " + additional : className;
|
|
2389
|
+
};
|
|
2390
|
+
|
|
2391
|
+
_this.attributesFromObject = function (prefix, items) {
|
|
2392
|
+
return Object.keys(items).reduce(function (acc, name) {
|
|
2393
|
+
acc[prefix + "-" + name] = items[name];
|
|
2394
|
+
return acc;
|
|
2395
|
+
}, {});
|
|
2396
|
+
};
|
|
2397
|
+
|
|
2398
|
+
_this.state = {
|
|
2399
|
+
afterOpen: false,
|
|
2400
|
+
beforeClose: false
|
|
2401
|
+
};
|
|
2402
|
+
|
|
2403
|
+
_this.shouldClose = null;
|
|
2404
|
+
_this.moveFromContentToOverlay = null;
|
|
2405
|
+
return _this;
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
_createClass(ModalPortal, [{
|
|
2409
|
+
key: "componentDidMount",
|
|
2410
|
+
value: function componentDidMount() {
|
|
2411
|
+
if (this.props.isOpen) {
|
|
2412
|
+
this.open();
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
}, {
|
|
2416
|
+
key: "componentDidUpdate",
|
|
2417
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
2418
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2419
|
+
if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {
|
|
2420
|
+
// eslint-disable-next-line no-console
|
|
2421
|
+
console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
|
|
2422
|
+
}
|
|
2423
|
+
if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {
|
|
2424
|
+
// eslint-disable-next-line no-console
|
|
2425
|
+
console.warn('React-Modal: "htmlOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
if (this.props.isOpen && !prevProps.isOpen) {
|
|
2430
|
+
this.open();
|
|
2431
|
+
} else if (!this.props.isOpen && prevProps.isOpen) {
|
|
2432
|
+
this.close();
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
// Focus only needs to be set once when the modal is being opened
|
|
2436
|
+
if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {
|
|
2437
|
+
this.focusContent();
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
}, {
|
|
2441
|
+
key: "componentWillUnmount",
|
|
2442
|
+
value: function componentWillUnmount() {
|
|
2443
|
+
if (this.state.isOpen) {
|
|
2444
|
+
this.afterClose();
|
|
2445
|
+
}
|
|
2446
|
+
clearTimeout(this.closeTimer);
|
|
2447
|
+
cancelAnimationFrame(this.openAnimationFrame);
|
|
2448
|
+
}
|
|
2449
|
+
}, {
|
|
2450
|
+
key: "beforeOpen",
|
|
2451
|
+
value: function beforeOpen() {
|
|
2452
|
+
var _props = this.props,
|
|
2453
|
+
appElement = _props.appElement,
|
|
2454
|
+
ariaHideApp = _props.ariaHideApp,
|
|
2455
|
+
htmlOpenClassName = _props.htmlOpenClassName,
|
|
2456
|
+
bodyOpenClassName = _props.bodyOpenClassName,
|
|
2457
|
+
parentSelector = _props.parentSelector;
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
2461
|
+
|
|
2462
|
+
// Add classes.
|
|
2463
|
+
bodyOpenClassName && classList$1.add(parentDocument.body, bodyOpenClassName);
|
|
2464
|
+
|
|
2465
|
+
htmlOpenClassName && classList$1.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
2466
|
+
|
|
2467
|
+
if (ariaHideApp) {
|
|
2468
|
+
ariaHiddenInstances += 1;
|
|
2469
|
+
ariaAppHider.hide(appElement);
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
_portalOpenInstances2.default.register(this);
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
// Don't steal focus from inner elements
|
|
2476
|
+
|
|
2477
|
+
}, {
|
|
2478
|
+
key: "render",
|
|
2479
|
+
value: function render() {
|
|
2480
|
+
var _props2 = this.props,
|
|
2481
|
+
id = _props2.id,
|
|
2482
|
+
className = _props2.className,
|
|
2483
|
+
overlayClassName = _props2.overlayClassName,
|
|
2484
|
+
defaultStyles = _props2.defaultStyles,
|
|
2485
|
+
children = _props2.children;
|
|
2486
|
+
|
|
2487
|
+
var contentStyles = className ? {} : defaultStyles.content;
|
|
2488
|
+
var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
|
|
2489
|
+
|
|
2490
|
+
if (this.shouldBeClosed()) {
|
|
2491
|
+
return null;
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
var overlayProps = {
|
|
2495
|
+
ref: this.setOverlayRef,
|
|
2496
|
+
className: this.buildClassName("overlay", overlayClassName),
|
|
2497
|
+
style: _extends({}, overlayStyles, this.props.style.overlay),
|
|
2498
|
+
onClick: this.handleOverlayOnClick,
|
|
2499
|
+
onMouseDown: this.handleOverlayOnMouseDown
|
|
2500
|
+
};
|
|
2501
|
+
|
|
2502
|
+
var contentProps = _extends({
|
|
2503
|
+
id: id,
|
|
2504
|
+
ref: this.setContentRef,
|
|
2505
|
+
style: _extends({}, contentStyles, this.props.style.content),
|
|
2506
|
+
className: this.buildClassName("content", className),
|
|
2507
|
+
tabIndex: "-1",
|
|
2508
|
+
onKeyDown: this.handleKeyDown,
|
|
2509
|
+
onMouseDown: this.handleContentOnMouseDown,
|
|
2510
|
+
onMouseUp: this.handleContentOnMouseUp,
|
|
2511
|
+
onClick: this.handleContentOnClick,
|
|
2512
|
+
role: this.props.role,
|
|
2513
|
+
"aria-label": this.props.contentLabel
|
|
2514
|
+
}, this.attributesFromObject("aria", _extends({ modal: true }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
2515
|
+
"data-testid": this.props.testId
|
|
2516
|
+
});
|
|
2517
|
+
|
|
2518
|
+
var contentElement = this.props.contentElement(contentProps, children);
|
|
2519
|
+
return this.props.overlayElement(overlayProps, contentElement);
|
|
2520
|
+
}
|
|
2521
|
+
}]);
|
|
2522
|
+
|
|
2523
|
+
return ModalPortal;
|
|
2524
|
+
}(_react.Component);
|
|
2525
|
+
|
|
2526
|
+
ModalPortal.defaultProps = {
|
|
2527
|
+
style: {
|
|
2528
|
+
overlay: {},
|
|
2529
|
+
content: {}
|
|
2530
|
+
},
|
|
2531
|
+
defaultStyles: {}
|
|
2532
|
+
};
|
|
2533
|
+
ModalPortal.propTypes = {
|
|
2534
|
+
isOpen: _propTypes2.default.bool.isRequired,
|
|
2535
|
+
defaultStyles: _propTypes2.default.shape({
|
|
2536
|
+
content: _propTypes2.default.object,
|
|
2537
|
+
overlay: _propTypes2.default.object
|
|
2538
|
+
}),
|
|
2539
|
+
style: _propTypes2.default.shape({
|
|
2540
|
+
content: _propTypes2.default.object,
|
|
2541
|
+
overlay: _propTypes2.default.object
|
|
2542
|
+
}),
|
|
2543
|
+
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
2544
|
+
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
2545
|
+
parentSelector: _propTypes2.default.func,
|
|
2546
|
+
bodyOpenClassName: _propTypes2.default.string,
|
|
2547
|
+
htmlOpenClassName: _propTypes2.default.string,
|
|
2548
|
+
ariaHideApp: _propTypes2.default.bool,
|
|
2549
|
+
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
2550
|
+
onAfterOpen: _propTypes2.default.func,
|
|
2551
|
+
onAfterClose: _propTypes2.default.func,
|
|
2552
|
+
onRequestClose: _propTypes2.default.func,
|
|
2553
|
+
closeTimeoutMS: _propTypes2.default.number,
|
|
2554
|
+
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
2555
|
+
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
2556
|
+
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
2557
|
+
preventScroll: _propTypes2.default.bool,
|
|
2558
|
+
role: _propTypes2.default.string,
|
|
2559
|
+
contentLabel: _propTypes2.default.string,
|
|
2560
|
+
aria: _propTypes2.default.object,
|
|
2561
|
+
data: _propTypes2.default.object,
|
|
2562
|
+
children: _propTypes2.default.node,
|
|
2563
|
+
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
2564
|
+
overlayRef: _propTypes2.default.func,
|
|
2565
|
+
contentRef: _propTypes2.default.func,
|
|
2566
|
+
id: _propTypes2.default.string,
|
|
2567
|
+
overlayElement: _propTypes2.default.func,
|
|
2568
|
+
contentElement: _propTypes2.default.func,
|
|
2569
|
+
testId: _propTypes2.default.string
|
|
2570
|
+
};
|
|
2571
|
+
exports.default = ModalPortal;
|
|
2572
|
+
module.exports = exports["default"];
|
|
2573
|
+
} (ModalPortal, ModalPortalExports));
|
|
2574
|
+
|
|
2575
|
+
/**
|
|
2576
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2577
|
+
*
|
|
2578
|
+
* This source code is licensed under the MIT license found in the
|
|
2579
|
+
* LICENSE file in the root directory of this source tree.
|
|
2580
|
+
*/
|
|
2581
|
+
|
|
2582
|
+
function componentWillMount() {
|
|
2583
|
+
// Call this.constructor.gDSFP to support sub-classes.
|
|
2584
|
+
var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
|
2585
|
+
if (state !== null && state !== undefined) {
|
|
2586
|
+
this.setState(state);
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
function componentWillReceiveProps(nextProps) {
|
|
2591
|
+
// Call this.constructor.gDSFP to support sub-classes.
|
|
2592
|
+
// Use the setState() updater to ensure state isn't stale in certain edge cases.
|
|
2593
|
+
function updater(prevState) {
|
|
2594
|
+
var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
|
2595
|
+
return state !== null && state !== undefined ? state : null;
|
|
2596
|
+
}
|
|
2597
|
+
// Binding "this" is important for shallow renderer support.
|
|
2598
|
+
this.setState(updater.bind(this));
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
function componentWillUpdate(nextProps, nextState) {
|
|
2602
|
+
try {
|
|
2603
|
+
var prevProps = this.props;
|
|
2604
|
+
var prevState = this.state;
|
|
2605
|
+
this.props = nextProps;
|
|
2606
|
+
this.state = nextState;
|
|
2607
|
+
this.__reactInternalSnapshotFlag = true;
|
|
2608
|
+
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
|
|
2609
|
+
prevProps,
|
|
2610
|
+
prevState
|
|
2611
|
+
);
|
|
2612
|
+
} finally {
|
|
2613
|
+
this.props = prevProps;
|
|
2614
|
+
this.state = prevState;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
// React may warn about cWM/cWRP/cWU methods being deprecated.
|
|
2619
|
+
// Add a flag to suppress these warnings for this special case.
|
|
2620
|
+
componentWillMount.__suppressDeprecationWarning = true;
|
|
2621
|
+
componentWillReceiveProps.__suppressDeprecationWarning = true;
|
|
2622
|
+
componentWillUpdate.__suppressDeprecationWarning = true;
|
|
2623
|
+
|
|
2624
|
+
function polyfill(Component) {
|
|
2625
|
+
var prototype = Component.prototype;
|
|
2626
|
+
|
|
2627
|
+
if (!prototype || !prototype.isReactComponent) {
|
|
2628
|
+
throw new Error('Can only polyfill class components');
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
if (
|
|
2632
|
+
typeof Component.getDerivedStateFromProps !== 'function' &&
|
|
2633
|
+
typeof prototype.getSnapshotBeforeUpdate !== 'function'
|
|
2634
|
+
) {
|
|
2635
|
+
return Component;
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
// If new component APIs are defined, "unsafe" lifecycles won't be called.
|
|
2639
|
+
// Error if any of these lifecycles are present,
|
|
2640
|
+
// Because they would work differently between older and newer (16.3+) versions of React.
|
|
2641
|
+
var foundWillMountName = null;
|
|
2642
|
+
var foundWillReceivePropsName = null;
|
|
2643
|
+
var foundWillUpdateName = null;
|
|
2644
|
+
if (typeof prototype.componentWillMount === 'function') {
|
|
2645
|
+
foundWillMountName = 'componentWillMount';
|
|
2646
|
+
} else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
|
2647
|
+
foundWillMountName = 'UNSAFE_componentWillMount';
|
|
2648
|
+
}
|
|
2649
|
+
if (typeof prototype.componentWillReceiveProps === 'function') {
|
|
2650
|
+
foundWillReceivePropsName = 'componentWillReceiveProps';
|
|
2651
|
+
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
|
2652
|
+
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
|
2653
|
+
}
|
|
2654
|
+
if (typeof prototype.componentWillUpdate === 'function') {
|
|
2655
|
+
foundWillUpdateName = 'componentWillUpdate';
|
|
2656
|
+
} else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
|
2657
|
+
foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
|
2658
|
+
}
|
|
2659
|
+
if (
|
|
2660
|
+
foundWillMountName !== null ||
|
|
2661
|
+
foundWillReceivePropsName !== null ||
|
|
2662
|
+
foundWillUpdateName !== null
|
|
2663
|
+
) {
|
|
2664
|
+
var componentName = Component.displayName || Component.name;
|
|
2665
|
+
var newApiName =
|
|
2666
|
+
typeof Component.getDerivedStateFromProps === 'function'
|
|
2667
|
+
? 'getDerivedStateFromProps()'
|
|
2668
|
+
: 'getSnapshotBeforeUpdate()';
|
|
2669
|
+
|
|
2670
|
+
throw Error(
|
|
2671
|
+
'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
|
|
2672
|
+
componentName +
|
|
2673
|
+
' uses ' +
|
|
2674
|
+
newApiName +
|
|
2675
|
+
' but also contains the following legacy lifecycles:' +
|
|
2676
|
+
(foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
|
|
2677
|
+
(foundWillReceivePropsName !== null
|
|
2678
|
+
? '\n ' + foundWillReceivePropsName
|
|
2679
|
+
: '') +
|
|
2680
|
+
(foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
|
|
2681
|
+
'\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
|
|
2682
|
+
'https://fb.me/react-async-component-lifecycle-hooks'
|
|
2683
|
+
);
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2686
|
+
// React <= 16.2 does not support static getDerivedStateFromProps.
|
|
2687
|
+
// As a workaround, use cWM and cWRP to invoke the new static lifecycle.
|
|
2688
|
+
// Newer versions of React will ignore these lifecycles if gDSFP exists.
|
|
2689
|
+
if (typeof Component.getDerivedStateFromProps === 'function') {
|
|
2690
|
+
prototype.componentWillMount = componentWillMount;
|
|
2691
|
+
prototype.componentWillReceiveProps = componentWillReceiveProps;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
// React <= 16.2 does not support getSnapshotBeforeUpdate.
|
|
2695
|
+
// As a workaround, use cWU to invoke the new lifecycle.
|
|
2696
|
+
// Newer versions of React will ignore that lifecycle if gSBU exists.
|
|
2697
|
+
if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
|
2698
|
+
if (typeof prototype.componentDidUpdate !== 'function') {
|
|
2699
|
+
throw new Error(
|
|
2700
|
+
'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
|
|
2701
|
+
);
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
prototype.componentWillUpdate = componentWillUpdate;
|
|
2705
|
+
|
|
2706
|
+
var componentDidUpdate = prototype.componentDidUpdate;
|
|
2707
|
+
|
|
2708
|
+
prototype.componentDidUpdate = function componentDidUpdatePolyfill(
|
|
2709
|
+
prevProps,
|
|
2710
|
+
prevState,
|
|
2711
|
+
maybeSnapshot
|
|
2712
|
+
) {
|
|
2713
|
+
// 16.3+ will not execute our will-update method;
|
|
2714
|
+
// It will pass a snapshot value to did-update though.
|
|
2715
|
+
// Older versions will require our polyfilled will-update value.
|
|
2716
|
+
// We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
|
|
2717
|
+
// Because for <= 15.x versions this might be a "prevContext" object.
|
|
2718
|
+
// We also can't just check "__reactInternalSnapshot",
|
|
2719
|
+
// Because get-snapshot might return a falsy value.
|
|
2720
|
+
// So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
|
|
2721
|
+
var snapshot = this.__reactInternalSnapshotFlag
|
|
2722
|
+
? this.__reactInternalSnapshot
|
|
2723
|
+
: maybeSnapshot;
|
|
2724
|
+
|
|
2725
|
+
componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
|
2726
|
+
};
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
return Component;
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
var reactLifecyclesCompat_es = /*#__PURE__*/Object.freeze({
|
|
2733
|
+
__proto__: null,
|
|
2734
|
+
polyfill: polyfill
|
|
2735
|
+
});
|
|
2736
|
+
|
|
2737
|
+
var require$$6 = /*@__PURE__*/getAugmentedNamespace(reactLifecyclesCompat_es);
|
|
2738
|
+
|
|
2739
|
+
Object.defineProperty(Modal$1, "__esModule", {
|
|
2740
|
+
value: true
|
|
2741
|
+
});
|
|
2742
|
+
Modal$1.bodyOpenClassName = Modal$1.portalClassName = undefined;
|
|
2743
|
+
|
|
2744
|
+
var _extends = Object.assign || 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; };
|
|
2745
|
+
|
|
2746
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
2747
|
+
|
|
2748
|
+
var _react = React__default;
|
|
2749
|
+
|
|
2750
|
+
var _react2 = _interopRequireDefault(_react);
|
|
2751
|
+
|
|
2752
|
+
var _reactDom = ReactDOM__default;
|
|
2753
|
+
|
|
2754
|
+
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
2755
|
+
|
|
2756
|
+
var _propTypes = propTypesExports;
|
|
2757
|
+
|
|
2758
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
2759
|
+
|
|
2760
|
+
var _ModalPortal = ModalPortalExports;
|
|
2761
|
+
|
|
2762
|
+
var _ModalPortal2 = _interopRequireDefault(_ModalPortal);
|
|
2763
|
+
|
|
2764
|
+
var _ariaAppHider = ariaAppHider$1;
|
|
2765
|
+
|
|
2766
|
+
var ariaAppHider = _interopRequireWildcard(_ariaAppHider);
|
|
2767
|
+
|
|
2768
|
+
var _safeHTMLElement = safeHTMLElement;
|
|
2769
|
+
|
|
2770
|
+
var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
|
|
2771
|
+
|
|
2772
|
+
var _reactLifecyclesCompat = require$$6;
|
|
2773
|
+
|
|
2774
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
2775
|
+
|
|
2776
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2777
|
+
|
|
2778
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2779
|
+
|
|
2780
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
2781
|
+
|
|
2782
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
2783
|
+
|
|
2784
|
+
var portalClassName = Modal$1.portalClassName = "ReactModalPortal";
|
|
2785
|
+
var bodyOpenClassName = Modal$1.bodyOpenClassName = "ReactModal__Body--open";
|
|
2786
|
+
|
|
2787
|
+
var isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
|
|
2788
|
+
|
|
2789
|
+
var createHTMLElement = function createHTMLElement(name) {
|
|
2790
|
+
return document.createElement(name);
|
|
2791
|
+
};
|
|
2792
|
+
|
|
2793
|
+
var getCreatePortal = function getCreatePortal() {
|
|
2794
|
+
return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
|
|
2795
|
+
};
|
|
2796
|
+
|
|
2797
|
+
function getParentElement(parentSelector) {
|
|
2798
|
+
return parentSelector();
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
var Modal = function (_Component) {
|
|
2802
|
+
_inherits(Modal, _Component);
|
|
2803
|
+
|
|
2804
|
+
function Modal() {
|
|
2805
|
+
var _ref;
|
|
2806
|
+
|
|
2807
|
+
var _temp, _this, _ret;
|
|
2808
|
+
|
|
2809
|
+
_classCallCheck(this, Modal);
|
|
2810
|
+
|
|
2811
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
2812
|
+
args[_key] = arguments[_key];
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
|
|
2816
|
+
!isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
|
|
2817
|
+
var parent = getParentElement(_this.props.parentSelector);
|
|
2818
|
+
if (parent && parent.contains(_this.node)) {
|
|
2819
|
+
parent.removeChild(_this.node);
|
|
2820
|
+
} else {
|
|
2821
|
+
// eslint-disable-next-line no-console
|
|
2822
|
+
console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks.");
|
|
2823
|
+
}
|
|
2824
|
+
}, _this.portalRef = function (ref) {
|
|
2825
|
+
_this.portal = ref;
|
|
2826
|
+
}, _this.renderPortal = function (props) {
|
|
2827
|
+
var createPortal = getCreatePortal();
|
|
2828
|
+
var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);
|
|
2829
|
+
_this.portalRef(portal);
|
|
2830
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
_createClass(Modal, [{
|
|
2834
|
+
key: "componentDidMount",
|
|
2835
|
+
value: function componentDidMount() {
|
|
2836
|
+
if (!_safeHTMLElement.canUseDOM) return;
|
|
2837
|
+
|
|
2838
|
+
if (!isReact16) {
|
|
2839
|
+
this.node = createHTMLElement("div");
|
|
2840
|
+
}
|
|
2841
|
+
this.node.className = this.props.portalClassName;
|
|
2842
|
+
|
|
2843
|
+
var parent = getParentElement(this.props.parentSelector);
|
|
2844
|
+
parent.appendChild(this.node);
|
|
2845
|
+
|
|
2846
|
+
!isReact16 && this.renderPortal(this.props);
|
|
2847
|
+
}
|
|
2848
|
+
}, {
|
|
2849
|
+
key: "getSnapshotBeforeUpdate",
|
|
2850
|
+
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
2851
|
+
var prevParent = getParentElement(prevProps.parentSelector);
|
|
2852
|
+
var nextParent = getParentElement(this.props.parentSelector);
|
|
2853
|
+
return { prevParent: prevParent, nextParent: nextParent };
|
|
2854
|
+
}
|
|
2855
|
+
}, {
|
|
2856
|
+
key: "componentDidUpdate",
|
|
2857
|
+
value: function componentDidUpdate(prevProps, _, snapshot) {
|
|
2858
|
+
if (!_safeHTMLElement.canUseDOM) return;
|
|
2859
|
+
var _props = this.props,
|
|
2860
|
+
isOpen = _props.isOpen,
|
|
2861
|
+
portalClassName = _props.portalClassName;
|
|
2862
|
+
|
|
2863
|
+
|
|
2864
|
+
if (prevProps.portalClassName !== portalClassName) {
|
|
2865
|
+
this.node.className = portalClassName;
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
var prevParent = snapshot.prevParent,
|
|
2869
|
+
nextParent = snapshot.nextParent;
|
|
2870
|
+
|
|
2871
|
+
if (nextParent !== prevParent) {
|
|
2872
|
+
prevParent.removeChild(this.node);
|
|
2873
|
+
nextParent.appendChild(this.node);
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
// Stop unnecessary renders if modal is remaining closed
|
|
2877
|
+
if (!prevProps.isOpen && !isOpen) return;
|
|
2878
|
+
|
|
2879
|
+
!isReact16 && this.renderPortal(this.props);
|
|
2880
|
+
}
|
|
2881
|
+
}, {
|
|
2882
|
+
key: "componentWillUnmount",
|
|
2883
|
+
value: function componentWillUnmount() {
|
|
2884
|
+
if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;
|
|
2885
|
+
|
|
2886
|
+
var state = this.portal.state;
|
|
2887
|
+
var now = Date.now();
|
|
2888
|
+
var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);
|
|
2889
|
+
|
|
2890
|
+
if (closesAt) {
|
|
2891
|
+
if (!state.beforeClose) {
|
|
2892
|
+
this.portal.closeWithTimeout();
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
setTimeout(this.removePortal, closesAt - now);
|
|
2896
|
+
} else {
|
|
2897
|
+
this.removePortal();
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
}, {
|
|
2901
|
+
key: "render",
|
|
2902
|
+
value: function render() {
|
|
2903
|
+
if (!_safeHTMLElement.canUseDOM || !isReact16) {
|
|
2904
|
+
return null;
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
if (!this.node && isReact16) {
|
|
2908
|
+
this.node = createHTMLElement("div");
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
var createPortal = getCreatePortal();
|
|
2912
|
+
return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({
|
|
2913
|
+
ref: this.portalRef,
|
|
2914
|
+
defaultStyles: Modal.defaultStyles
|
|
2915
|
+
}, this.props)), this.node);
|
|
2916
|
+
}
|
|
2917
|
+
}], [{
|
|
2918
|
+
key: "setAppElement",
|
|
2919
|
+
value: function setAppElement(element) {
|
|
2920
|
+
ariaAppHider.setElement(element);
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
2924
|
+
|
|
2925
|
+
/* eslint-enable react/no-unused-prop-types */
|
|
2926
|
+
|
|
2927
|
+
}]);
|
|
2928
|
+
|
|
2929
|
+
return Modal;
|
|
2930
|
+
}(_react.Component);
|
|
2931
|
+
|
|
2932
|
+
Modal.propTypes = {
|
|
2933
|
+
isOpen: _propTypes2.default.bool.isRequired,
|
|
2934
|
+
style: _propTypes2.default.shape({
|
|
2935
|
+
content: _propTypes2.default.object,
|
|
2936
|
+
overlay: _propTypes2.default.object
|
|
2937
|
+
}),
|
|
2938
|
+
portalClassName: _propTypes2.default.string,
|
|
2939
|
+
bodyOpenClassName: _propTypes2.default.string,
|
|
2940
|
+
htmlOpenClassName: _propTypes2.default.string,
|
|
2941
|
+
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
2942
|
+
base: _propTypes2.default.string.isRequired,
|
|
2943
|
+
afterOpen: _propTypes2.default.string.isRequired,
|
|
2944
|
+
beforeClose: _propTypes2.default.string.isRequired
|
|
2945
|
+
})]),
|
|
2946
|
+
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
2947
|
+
base: _propTypes2.default.string.isRequired,
|
|
2948
|
+
afterOpen: _propTypes2.default.string.isRequired,
|
|
2949
|
+
beforeClose: _propTypes2.default.string.isRequired
|
|
2950
|
+
})]),
|
|
2951
|
+
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
2952
|
+
onAfterOpen: _propTypes2.default.func,
|
|
2953
|
+
onRequestClose: _propTypes2.default.func,
|
|
2954
|
+
closeTimeoutMS: _propTypes2.default.number,
|
|
2955
|
+
ariaHideApp: _propTypes2.default.bool,
|
|
2956
|
+
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
2957
|
+
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
2958
|
+
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
2959
|
+
preventScroll: _propTypes2.default.bool,
|
|
2960
|
+
parentSelector: _propTypes2.default.func,
|
|
2961
|
+
aria: _propTypes2.default.object,
|
|
2962
|
+
data: _propTypes2.default.object,
|
|
2963
|
+
role: _propTypes2.default.string,
|
|
2964
|
+
contentLabel: _propTypes2.default.string,
|
|
2965
|
+
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
2966
|
+
overlayRef: _propTypes2.default.func,
|
|
2967
|
+
contentRef: _propTypes2.default.func,
|
|
2968
|
+
id: _propTypes2.default.string,
|
|
2969
|
+
overlayElement: _propTypes2.default.func,
|
|
2970
|
+
contentElement: _propTypes2.default.func
|
|
2971
|
+
};
|
|
2972
|
+
Modal.defaultProps = {
|
|
2973
|
+
isOpen: false,
|
|
2974
|
+
portalClassName: portalClassName,
|
|
2975
|
+
bodyOpenClassName: bodyOpenClassName,
|
|
2976
|
+
role: "dialog",
|
|
2977
|
+
ariaHideApp: true,
|
|
2978
|
+
closeTimeoutMS: 0,
|
|
2979
|
+
shouldFocusAfterRender: true,
|
|
2980
|
+
shouldCloseOnEsc: true,
|
|
2981
|
+
shouldCloseOnOverlayClick: true,
|
|
2982
|
+
shouldReturnFocusAfterClose: true,
|
|
2983
|
+
preventScroll: false,
|
|
2984
|
+
parentSelector: function parentSelector() {
|
|
2985
|
+
return document.body;
|
|
2986
|
+
},
|
|
2987
|
+
overlayElement: function overlayElement(props, contentEl) {
|
|
2988
|
+
return _react2.default.createElement(
|
|
2989
|
+
"div",
|
|
2990
|
+
props,
|
|
2991
|
+
contentEl
|
|
2992
|
+
);
|
|
2993
|
+
},
|
|
2994
|
+
contentElement: function contentElement(props, children) {
|
|
2995
|
+
return _react2.default.createElement(
|
|
2996
|
+
"div",
|
|
2997
|
+
props,
|
|
2998
|
+
children
|
|
2999
|
+
);
|
|
3000
|
+
}
|
|
3001
|
+
};
|
|
3002
|
+
Modal.defaultStyles = {
|
|
3003
|
+
overlay: {
|
|
3004
|
+
position: "fixed",
|
|
3005
|
+
top: 0,
|
|
3006
|
+
left: 0,
|
|
3007
|
+
right: 0,
|
|
3008
|
+
bottom: 0,
|
|
3009
|
+
backgroundColor: "rgba(255, 255, 255, 0.75)"
|
|
3010
|
+
},
|
|
3011
|
+
content: {
|
|
3012
|
+
position: "absolute",
|
|
3013
|
+
top: "40px",
|
|
3014
|
+
left: "40px",
|
|
3015
|
+
right: "40px",
|
|
3016
|
+
bottom: "40px",
|
|
3017
|
+
border: "1px solid #ccc",
|
|
3018
|
+
background: "#fff",
|
|
3019
|
+
overflow: "auto",
|
|
3020
|
+
WebkitOverflowScrolling: "touch",
|
|
3021
|
+
borderRadius: "4px",
|
|
3022
|
+
outline: "none",
|
|
3023
|
+
padding: "20px"
|
|
3024
|
+
}
|
|
3025
|
+
};
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
(0, _reactLifecyclesCompat.polyfill)(Modal);
|
|
3029
|
+
|
|
3030
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3031
|
+
Modal.setCreateHTMLElement = function (fn) {
|
|
3032
|
+
return createHTMLElement = fn;
|
|
3033
|
+
};
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
Modal$1.default = Modal;
|
|
3037
|
+
|
|
3038
|
+
(function (module, exports) {
|
|
3039
|
+
|
|
3040
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3041
|
+
value: true
|
|
3042
|
+
});
|
|
3043
|
+
|
|
3044
|
+
var _Modal = Modal$1;
|
|
3045
|
+
|
|
3046
|
+
var _Modal2 = _interopRequireDefault(_Modal);
|
|
3047
|
+
|
|
3048
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3049
|
+
|
|
3050
|
+
exports.default = _Modal2.default;
|
|
3051
|
+
module.exports = exports["default"];
|
|
3052
|
+
} (lib, libExports));
|
|
3053
|
+
|
|
3054
|
+
var ReactModal = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
3055
|
+
|
|
3056
|
+
export { ReactModal as R };
|
|
3057
|
+
//# sourceMappingURL=index-d4674a06.js.map
|