bootstrap-rn 0.4.5 → 0.4.7
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/lib/module/Context.js.map +1 -1
- package/lib/module/Provider.js +3 -7
- package/lib/module/Provider.js.map +1 -1
- package/lib/module/components/Body.js +10 -5
- package/lib/module/components/Body.js.map +1 -1
- package/lib/module/components/buttons/Button.js +10 -8
- package/lib/module/components/buttons/Button.js.map +1 -1
- package/lib/module/components/close/CloseButton.js +7 -3
- package/lib/module/components/close/CloseButton.js.map +1 -1
- package/lib/module/components/collapse/useCollapse.js +2 -3
- package/lib/module/components/collapse/useCollapse.js.map +1 -1
- package/lib/module/components/dropdown/Dropdown.js +1 -2
- package/lib/module/components/dropdown/Dropdown.js.map +1 -1
- package/lib/module/components/dropdown/DropdownContext.js.map +1 -1
- package/lib/module/components/dropdown/DropdownMenu.js +33 -59
- package/lib/module/components/dropdown/DropdownMenu.js.map +1 -1
- package/lib/module/components/dropdown/useDismissDropdown.js +5 -4
- package/lib/module/components/dropdown/useDismissDropdown.js.map +1 -1
- package/lib/module/components/dropdown/useDropdown.js +35 -11
- package/lib/module/components/dropdown/useDropdown.js.map +1 -1
- package/lib/module/components/dropdown/useToggleDropdown.js +4 -6
- package/lib/module/components/dropdown/useToggleDropdown.js.map +1 -1
- package/lib/module/components/forms/FormCheckInput.js +1 -1
- package/lib/module/components/forms/Input.js +1 -1
- package/lib/module/components/forms/internals/PickerNative.js +1 -1
- package/lib/module/components/forms/internals/PickerNative.js.map +1 -1
- package/lib/module/components/helpers/BackdropHandler.js +6 -92
- package/lib/module/components/helpers/BackdropHandler.js.map +1 -1
- package/lib/module/components/helpers/BackdropHandler.web.js +8 -0
- package/lib/module/components/helpers/BackdropHandler.web.js.map +1 -0
- package/lib/module/components/helpers/Dialog.js +29 -0
- package/lib/module/components/helpers/Dialog.js.map +1 -0
- package/lib/module/components/helpers/Dialog.web.js +117 -0
- package/lib/module/components/helpers/Dialog.web.js.map +1 -0
- package/lib/module/components/helpers/Portal.js +5 -0
- package/lib/module/components/helpers/Portal.js.map +1 -0
- package/lib/module/components/helpers/Portal.web.js +16 -0
- package/lib/module/components/helpers/Portal.web.js.map +1 -0
- package/lib/module/components/helpers/PortalHost.js +5 -0
- package/lib/module/components/helpers/PortalHost.js.map +1 -0
- package/lib/module/components/helpers/PortalHost.web.js +15 -0
- package/lib/module/components/helpers/PortalHost.web.js.map +1 -0
- package/lib/module/components/modal/Modal.js +58 -47
- package/lib/module/components/modal/Modal.js.map +1 -1
- package/lib/module/components/modal/ModalContext.js.map +1 -1
- package/lib/module/components/modal/ModalTitle.js +6 -0
- package/lib/module/components/modal/ModalTitle.js.map +1 -1
- package/lib/module/components/modal/useModal.js +4 -13
- package/lib/module/components/modal/useModal.js.map +1 -1
- package/lib/module/components/nav/useTabbable.js +2 -3
- package/lib/module/components/nav/useTabbable.js.map +1 -1
- package/lib/module/components/navbar/NavbarToggler.js +1 -1
- package/lib/module/components/navbar/useNavbar.js +2 -3
- package/lib/module/components/navbar/useNavbar.js.map +1 -1
- package/lib/module/components/offcanvas/Offcanvas.js +84 -83
- package/lib/module/components/offcanvas/Offcanvas.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasContext.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasTitle.js +6 -0
- package/lib/module/components/offcanvas/OffcanvasTitle.js.map +1 -1
- package/lib/module/components/offcanvas/useOffcanvas.js +6 -14
- package/lib/module/components/offcanvas/useOffcanvas.js.map +1 -1
- package/lib/module/components/pagination/PaginationItem.js +39 -39
- package/lib/module/components/popover/Popover.js +6 -8
- package/lib/module/components/popover/Popover.js.map +1 -1
- package/lib/module/components/popover/PopoverArrow.js +18 -9
- package/lib/module/components/popover/PopoverArrow.js.map +1 -1
- package/lib/module/components/popover/PopoverContext.js.map +1 -1
- package/lib/module/components/popover/injectPopover.js +48 -45
- package/lib/module/components/popover/injectPopover.js.map +1 -1
- package/lib/module/components/tooltip/Tooltip.js +7 -23
- package/lib/module/components/tooltip/Tooltip.js.map +1 -1
- package/lib/module/components/tooltip/TooltipArrow.js +22 -12
- package/lib/module/components/tooltip/TooltipArrow.js.map +1 -1
- package/lib/module/components/tooltip/TooltipContext.js.map +1 -1
- package/lib/module/components/tooltip/injectTooltip.js +46 -42
- package/lib/module/components/tooltip/injectTooltip.js.map +1 -1
- package/lib/module/hooks/useBackgroundNative.js.map +1 -1
- package/lib/module/hooks/useFocusRing.js +13 -0
- package/lib/module/hooks/useFocusRing.js.map +1 -0
- package/lib/module/hooks/useFocusRing.web.js +5 -0
- package/lib/module/hooks/useFocusRing.web.js.map +1 -0
- package/lib/module/hooks/useInteractionState.js +11 -11
- package/lib/module/hooks/useInteractionState.js.map +1 -1
- package/lib/module/hooks/useOverlay.js +121 -0
- package/lib/module/hooks/useOverlay.js.map +1 -0
- package/lib/module/hooks/useOverlay.web.js +113 -0
- package/lib/module/hooks/useOverlay.web.js.map +1 -0
- package/lib/module/hooks/useScrollbarEffects.js +7 -60
- package/lib/module/hooks/useScrollbarEffects.js.map +1 -1
- package/lib/module/hooks/useScrollbarEffects.web.js +59 -0
- package/lib/module/hooks/useScrollbarEffects.web.js.map +1 -0
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/style/StyleSheet.js +1 -3
- package/lib/module/style/StyleSheet.js.map +1 -1
- package/lib/module/theme/variables.js +9 -9
- package/lib/module/utils.js +0 -11
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/Context.d.ts +0 -1
- package/lib/typescript/Context.d.ts.map +1 -1
- package/lib/typescript/Provider.d.ts.map +1 -1
- package/lib/typescript/components/Body.d.ts +2 -2
- package/lib/typescript/components/Body.d.ts.map +1 -1
- package/lib/typescript/components/Link.d.ts +1 -1
- package/lib/typescript/components/Link.d.ts.map +1 -1
- package/lib/typescript/components/Pressable.d.ts +1 -1
- package/lib/typescript/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/components/TextInput.d.ts +3 -3
- package/lib/typescript/components/TextInput.d.ts.map +1 -1
- package/lib/typescript/components/buttons/Button.d.ts +1 -1
- package/lib/typescript/components/buttons/Button.d.ts.map +1 -1
- package/lib/typescript/components/close/CloseButton.d.ts +1 -1
- package/lib/typescript/components/close/CloseButton.d.ts.map +1 -1
- package/lib/typescript/components/collapse/useCollapse.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/Dropdown.d.ts +0 -1
- package/lib/typescript/components/dropdown/Dropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownContext.d.ts +14 -3
- package/lib/typescript/components/dropdown/DropdownContext.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownMenu.d.ts +0 -1
- package/lib/typescript/components/dropdown/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useDismissDropdown.d.ts +1 -1
- package/lib/typescript/components/dropdown/useDismissDropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useDropdown.d.ts +38 -4
- package/lib/typescript/components/dropdown/useDropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useToggleDropdown.d.ts +4 -3
- package/lib/typescript/components/dropdown/useToggleDropdown.d.ts.map +1 -1
- package/lib/typescript/components/forms/Picker.d.ts +1 -1
- package/lib/typescript/components/forms/internals/PickerNative.d.ts +1 -1
- package/lib/typescript/components/forms/internals/PickerNative.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/PickerWeb.d.ts +1 -1
- package/lib/typescript/components/forms/internals/PickerWeb.d.ts.map +1 -1
- package/lib/typescript/components/helpers/BackdropHandler.d.ts +2 -11
- package/lib/typescript/components/helpers/BackdropHandler.d.ts.map +1 -1
- package/lib/typescript/components/helpers/BackdropHandler.web.d.ts +3 -0
- package/lib/typescript/components/helpers/BackdropHandler.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Dialog.d.ts +15 -0
- package/lib/typescript/components/helpers/Dialog.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Dialog.web.d.ts +15 -0
- package/lib/typescript/components/helpers/Dialog.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Portal.d.ts +8 -0
- package/lib/typescript/components/helpers/Portal.d.ts.map +1 -0
- package/lib/typescript/components/helpers/Portal.web.d.ts +8 -0
- package/lib/typescript/components/helpers/Portal.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/PortalHost.d.ts +6 -0
- package/lib/typescript/components/helpers/PortalHost.d.ts.map +1 -0
- package/lib/typescript/components/helpers/PortalHost.web.d.ts +7 -0
- package/lib/typescript/components/helpers/PortalHost.web.d.ts.map +1 -0
- package/lib/typescript/components/list-group/ListGroup.d.ts +1 -1
- package/lib/typescript/components/list-group/ListGroupItemAction.d.ts +1 -1
- package/lib/typescript/components/list-group/ListGroupItemAction.d.ts.map +1 -1
- package/lib/typescript/components/modal/Modal.d.ts +1 -1
- package/lib/typescript/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalContext.d.ts +1 -0
- package/lib/typescript/components/modal/ModalContext.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalTitle.d.ts.map +1 -1
- package/lib/typescript/components/modal/useModal.d.ts +2 -1
- package/lib/typescript/components/modal/useModal.d.ts.map +1 -1
- package/lib/typescript/components/nav/Nav.d.ts +1 -1
- package/lib/typescript/components/nav/NavLink.d.ts +1 -1
- package/lib/typescript/components/nav/NavLink.d.ts.map +1 -1
- package/lib/typescript/components/nav/useTabbable.d.ts.map +1 -1
- package/lib/typescript/components/navbar/Navbar.d.ts +2 -2
- package/lib/typescript/components/navbar/NavbarBrand.d.ts +1 -1
- package/lib/typescript/components/navbar/NavbarBrand.d.ts.map +1 -1
- package/lib/typescript/components/navbar/NavbarToggler.d.ts +1 -1
- package/lib/typescript/components/navbar/NavbarToggler.d.ts.map +1 -1
- package/lib/typescript/components/navbar/useNavbar.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts +1 -4
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasContext.d.ts +3 -1
- package/lib/typescript/components/offcanvas/OffcanvasContext.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasTitle.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/useOffcanvas.d.ts +3 -1
- package/lib/typescript/components/offcanvas/useOffcanvas.d.ts.map +1 -1
- package/lib/typescript/components/popover/Popover.d.ts +3 -4
- package/lib/typescript/components/popover/Popover.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverArrow.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverContext.d.ts +3 -4
- package/lib/typescript/components/popover/PopoverContext.d.ts.map +1 -1
- package/lib/typescript/components/popover/injectPopover.d.ts +5 -7
- package/lib/typescript/components/popover/injectPopover.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/Tooltip.d.ts +3 -4
- package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipArrow.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipContext.d.ts +3 -4
- package/lib/typescript/components/tooltip/TooltipContext.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/injectTooltip.d.ts +5 -7
- package/lib/typescript/components/tooltip/injectTooltip.d.ts.map +1 -1
- package/lib/typescript/hooks/useBackgroundNative.d.ts.map +1 -1
- package/lib/typescript/hooks/useFocusRing.d.ts +3 -0
- package/lib/typescript/hooks/useFocusRing.d.ts.map +1 -0
- package/lib/typescript/hooks/useFocusRing.web.d.ts +3 -0
- package/lib/typescript/hooks/useFocusRing.web.d.ts.map +1 -0
- package/lib/typescript/hooks/useInteractionState.d.ts +7 -7
- package/lib/typescript/hooks/useInteractionState.d.ts.map +1 -1
- package/lib/typescript/hooks/useOverlay.d.ts +64 -0
- package/lib/typescript/hooks/useOverlay.d.ts.map +1 -0
- package/lib/typescript/hooks/useOverlay.web.d.ts +37 -0
- package/lib/typescript/hooks/useOverlay.web.d.ts.map +1 -0
- package/lib/typescript/hooks/useScrollbarEffects.d.ts.map +1 -1
- package/lib/typescript/hooks/useScrollbarEffects.web.d.ts +7 -0
- package/lib/typescript/hooks/useScrollbarEffects.web.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/style/StyleSheet.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +12 -6
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils.d.ts +2 -3
- package/lib/typescript/utils.d.ts.map +1 -1
- package/package.json +92 -87
- package/src/Context.ts +37 -38
- package/src/Provider.tsx +61 -66
- package/src/components/Body.tsx +22 -22
- package/src/components/TextInput.tsx +66 -66
- package/src/components/buttons/Button.tsx +381 -379
- package/src/components/close/CloseButton.tsx +142 -138
- package/src/components/collapse/useCollapse.ts +25 -26
- package/src/components/dropdown/Dropdown.tsx +77 -80
- package/src/components/dropdown/DropdownContext.ts +14 -3
- package/src/components/dropdown/DropdownMenu.tsx +243 -284
- package/src/components/dropdown/useDismissDropdown.ts +30 -29
- package/src/components/dropdown/useDropdown.ts +55 -38
- package/src/components/dropdown/useToggleDropdown.ts +31 -32
- package/src/components/forms/FormCheckInput.tsx +268 -268
- package/src/components/forms/Input.tsx +220 -220
- package/src/components/forms/internals/PickerNative.tsx +9 -10
- package/src/components/helpers/BackdropHandler.tsx +5 -119
- package/src/components/helpers/BackdropHandler.web.tsx +6 -0
- package/src/components/helpers/Dialog.tsx +49 -0
- package/src/components/helpers/Dialog.web.tsx +145 -0
- package/src/components/helpers/Portal.tsx +10 -0
- package/src/components/helpers/Portal.web.tsx +22 -0
- package/src/components/helpers/PortalHost.tsx +7 -0
- package/src/components/helpers/PortalHost.web.tsx +14 -0
- package/src/components/modal/Modal.tsx +60 -46
- package/src/components/modal/ModalContext.ts +12 -11
- package/src/components/modal/ModalTitle.tsx +41 -31
- package/src/components/modal/useModal.ts +13 -25
- package/src/components/nav/useTabbable.ts +31 -32
- package/src/components/navbar/NavbarToggler.tsx +130 -130
- package/src/components/navbar/useNavbar.ts +30 -31
- package/src/components/offcanvas/Offcanvas.tsx +92 -95
- package/src/components/offcanvas/OffcanvasContext.ts +13 -11
- package/src/components/offcanvas/OffcanvasTitle.tsx +43 -33
- package/src/components/offcanvas/useOffcanvas.ts +12 -20
- package/src/components/pagination/PaginationItem.tsx +139 -139
- package/src/components/popover/Popover.tsx +87 -90
- package/src/components/popover/PopoverArrow.tsx +22 -6
- package/src/components/popover/PopoverContext.ts +13 -18
- package/src/components/popover/injectPopover.tsx +63 -55
- package/src/components/tooltip/Tooltip.tsx +79 -98
- package/src/components/tooltip/TooltipArrow.tsx +26 -8
- package/src/components/tooltip/TooltipContext.ts +13 -18
- package/src/components/tooltip/injectTooltip.tsx +62 -53
- package/src/hooks/useAction.ts +78 -78
- package/src/hooks/useBackgroundNative.tsx +6 -4
- package/src/hooks/useFocusRing.ts +13 -0
- package/src/hooks/useFocusRing.web.ts +3 -0
- package/src/hooks/useInteractionState.ts +75 -81
- package/src/hooks/useOverlay.ts +197 -0
- package/src/hooks/useOverlay.web.ts +190 -0
- package/src/hooks/useScrollbarEffects.ts +5 -83
- package/src/hooks/useScrollbarEffects.web.ts +83 -0
- package/src/index.ts +5 -5
- package/src/style/StyleSheet.ts +2 -5
- package/src/theme/variables.ts +1420 -1420
- package/src/types.ts +14 -14
- package/src/utils.ts +4 -22
- package/lib/module/components/SafeAreaView.js +0 -44
- package/lib/module/components/SafeAreaView.js.map +0 -1
- package/lib/module/components/helpers/Overlay.js +0 -50
- package/lib/module/components/helpers/Overlay.js.map +0 -1
- package/lib/module/hooks/useIdentifier.js +0 -14
- package/lib/module/hooks/useIdentifier.js.map +0 -1
- package/lib/module/hooks/useTrigger.js +0 -97
- package/lib/module/hooks/useTrigger.js.map +0 -1
- package/lib/typescript/components/SafeAreaView.d.ts +0 -13
- package/lib/typescript/components/SafeAreaView.d.ts.map +0 -1
- package/lib/typescript/components/helpers/Overlay.d.ts +0 -28
- package/lib/typescript/components/helpers/Overlay.d.ts.map +0 -1
- package/lib/typescript/hooks/useIdentifier.d.ts +0 -2
- package/lib/typescript/hooks/useIdentifier.d.ts.map +0 -1
- package/lib/typescript/hooks/useTrigger.d.ts +0 -33
- package/lib/typescript/hooks/useTrigger.d.ts.map +0 -1
- package/src/components/SafeAreaView.tsx +0 -71
- package/src/components/helpers/Overlay.tsx +0 -81
- package/src/hooks/useIdentifier.ts +0 -15
- package/src/hooks/useTrigger.ts +0 -141
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useForcedContext","DropdownContext","useToggleDropdown","props","context","
|
|
1
|
+
{"version":3,"names":["useForcedContext","DropdownContext","concatRefs","useToggleDropdown","props","context","ref","caret","restProps","trigger","getProps","id","identifier","visible","active","undefined","direction"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/dropdown/useToggleDropdown.ts"],"mappings":";;AACA,OAAOA,gBAAgB,MAAM,iCAA8B;AAC3D,OAAOC,eAAe,MAAM,sBAAmB;AAC/C,SAASC,UAAU,QAAQ,gBAAa;AAUxC,eAAe,SAASC,iBAAiBA,CACvCC,KAAiC,EACjC;EACA,MAAMC,OAAO,GAAGL,gBAAgB,CAACC,eAAe,CAAC;EAEjD,MAAM;IAAEK,GAAG;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAE1C,OAAO;IACL,GAAGI,SAAS;IACZ,GAAGH,OAAO,CAACI,OAAO,CAACC,QAAQ,CAACF,SAAS,CAAC;IACtCG,EAAE,EAAEN,OAAO,CAACO,UAAU;IACtBN,GAAG,EAAEJ,UAAU,CAACI,GAAG,EAAED,OAAO,CAACI,OAAO,CAACH,GAAG,CAAC;IACzC,eAAe,EAAE,IAAI;IACrB,eAAe,EAAED,OAAO,CAACQ,OAAO;IAChCC,MAAM,EAAET,OAAO,CAACQ,OAAO;IACvBN,KAAK,EAAEA,KAAK,KAAKQ,SAAS,GAAG;MAAEC,SAAS,EAAEX,OAAO,CAACW;IAAU,CAAC,GAAGT;EAClE,CAAC;AACH","ignoreList":[]}
|
|
@@ -55,7 +55,7 @@ const styles = StyleSheet.create({
|
|
|
55
55
|
&:focus {
|
|
56
56
|
border-color: $form-check-input-focus-border;
|
|
57
57
|
@include platform(web) {
|
|
58
|
-
outline-
|
|
58
|
+
outline-style: none; // outline: 0;
|
|
59
59
|
box-shadow: $form-check-input-focus-box-shadow;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -56,7 +56,7 @@ const styles = StyleSheet.create({
|
|
|
56
56
|
background-color: $input-focus-bg;
|
|
57
57
|
border-color: $input-focus-border-color;
|
|
58
58
|
@include platform(web) {
|
|
59
|
-
outline-
|
|
59
|
+
outline-style: none; // outline: 0;
|
|
60
60
|
// @if $enable-shadows {
|
|
61
61
|
// @include box-shadow($input-box-shadow, $input-focus-box-shadow);
|
|
62
62
|
// } @else {
|
|
@@ -52,7 +52,7 @@ function DefaultMenuComponent({
|
|
|
52
52
|
return /*#__PURE__*/_jsx(Offcanvas, {
|
|
53
53
|
placement: "bottom",
|
|
54
54
|
visible: true,
|
|
55
|
-
|
|
55
|
+
onClose: handleClose,
|
|
56
56
|
children: /*#__PURE__*/_jsx(Offcanvas.Body, {
|
|
57
57
|
contentContainerStyle: styles.menu,
|
|
58
58
|
children: /*#__PURE__*/_jsx(PickerNativeContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","useMemo","StyleSheet","StyleUtils","css","Pressable","Text","Offcanvas","useBackground","PickerNativeContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","styles","create","menu","textStyleKeys","extractTextStyles","style","flattenedStyle","flatten","textStyles","Object","entries","forEach","key","value","includes","getText","children","selectedValue","items","Children","map","child","label","props","selectedItem","find","item","DefaultMenuComponent","onValueChange","handleValueChange","onClose","handleClose","contextValue","placement","visible","
|
|
1
|
+
{"version":3,"names":["React","useState","useMemo","StyleSheet","StyleUtils","css","Pressable","Text","Offcanvas","useBackground","PickerNativeContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","styles","create","menu","textStyleKeys","extractTextStyles","style","flattenedStyle","flatten","textStyles","Object","entries","forEach","key","value","includes","getText","children","selectedValue","items","Children","map","child","label","props","selectedItem","find","item","DefaultMenuComponent","onValueChange","handleValueChange","onClose","handleClose","contextValue","placement","visible","Body","contentContainerStyle","Provider","PickerNative","forwardRef","ref","onFocus","onBlur","placeholder","placeholderTextColor","disabled","MenuComponent","elementProps","background","setVisible","textStyle","showPlaceholder","undefined","nextValue","handleFocus","event","handleBlur","role","onPress","element","numberOfLines","color"],"sourceRoot":"..\\..\\..\\..\\..\\src","sources":["components/forms/internals/PickerNative.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,SAIEC,UAAU,IAAIC,UAAU,QACnB,cAAc;AACrB,OAAOD,UAAU,MAAM,8BAA2B;AAClD,OAAOE,GAAG,MAAM,uBAAoB;AACpC,OAAOC,SAAS,MAAwB,oBAAiB;AACzD,OAAOC,IAAI,MAAM,eAAY;AAC7B,OAAOC,SAAS,MAAM,8BAA2B;AACjD,OAAOC,aAAa,MAAM,iCAA8B;AACxD,OAAOC,mBAAmB,MAAM,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAQxD,MAAMC,MAAM,GAAGd,UAAU,CAACe,MAAM,CAAC;EAC/BC,IAAI,EAAEd,GAAG;AACX;AACA;AACA,CAAC,CAAC;;AAEF;AACA,MAAMe,aAAa,GAAG,CACpB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,YAAY,EACZ,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,e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AAgB,IAAK;IACvCb,MAAM,CAACa,KAAK,CAAC;EACf,CAAC;EAED,oBACE1D,KAAA,CAAAE,SAAA;IAAAiB,QAAA,gBACEnB,KAAA,CAACR,SAAS;MAAA,GACJ0D,YAAY;MAChBP,GAAG,EAAEA,GAAI;MACTiB,IAAI,EAAC,UAAU;MACfC,OAAO,EAAEA,CAAA,KAAM;QACbT,UAAU,CAAC,IAAI,CAAC;MAClB,CAAE;MACFR,OAAO,EAAGc,KAAiB,IAAK;QAC9BD,WAAW,CAACC,KAAK,CAAC;MACpB,CAAE;MACFb,MAAM,EAAGa,KAAgB,IAAK;QAC5BC,UAAU,CAACD,KAAK,CAAC;MACnB,CAAE;MACFV,QAAQ,EAAEA,QAAS;MACnBxC,KAAK,EAAE2C,UAAU,CAAC3C,KAAM;MAAAW,QAAA,GAEvBgC,UAAU,CAACW,OAAO,eACnBhE,IAAA,CAACL,IAAI;QACHsE,aAAa,EAAE,CAAE;QACjBvD,KAAK,EAAE,CACL6C,SAAS,EACTC,eAAe,IAAI;UAAEU,KAAK,EAAEjB;QAAqB,CAAC,CAClD;QAAA5B,QAAA,EAEDmC,eAAe,GACZR,WAAW,iBAAIhD,IAAA,CAACL,IAAI;UAAA0B,QAAA,EAAC;QAAM,CAAM,CAAC,GAClCD,OAAO,CAAC;UAAEC,QAAQ;UAAEC;QAAc,CAAC;MAAC,CACpC,CAAC;IAAA,CACE,CAAC,EACXiB,OAAO,iBACNvC,IAAA,CAACmD,aAAa;MACZ7B,aAAa,EAAEA,aAAc;MAC7BW,aAAa,EAAEC,iBAAkB;MACjCC,OAAO,EAAEC,WAAY;MAAAf,QAAA,EAEpBA;IAAQ,CACI,CAChB;EAAA,CACD,CAAC;AAEP,CACF,CAAC;AAED,eAAesB,YAAY","ignoreList":[]}
|
|
@@ -1,106 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React
|
|
4
|
-
import {
|
|
5
|
-
import StyleSheet from "../../style/StyleSheet.js";
|
|
6
|
-
import css from "../../style/css.js";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
7
5
|
import Pressable from "../Pressable.js";
|
|
8
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const styles = StyleSheet.create({
|
|
10
|
-
handler: css`
|
|
11
|
-
top: 0;
|
|
12
|
-
bottom: 0;
|
|
13
|
-
left: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
position: absolute;
|
|
16
|
-
flex-grow: 1;
|
|
17
|
-
`
|
|
18
|
-
});
|
|
19
|
-
const initialState = {
|
|
20
|
-
waitingForMouseUp: false,
|
|
21
|
-
ignoreBackdropClick: false
|
|
22
|
-
};
|
|
23
7
|
function BackdropHandler(props) {
|
|
24
8
|
const {
|
|
25
|
-
toggleRef,
|
|
26
|
-
dialogRef,
|
|
27
9
|
onClose: handleClose,
|
|
28
|
-
backdrop = true
|
|
29
|
-
autoClose = 'outside'
|
|
10
|
+
backdrop = true
|
|
30
11
|
} = props;
|
|
31
|
-
if (Platform.OS === 'web') {
|
|
32
|
-
const state = useMemo(() => initialState, []);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
const toggle = toggleRef ?
|
|
35
|
-
// @ts-expect-error web only method for converting to HTMLElement
|
|
36
|
-
toggleRef.current : undefined;
|
|
37
|
-
// @ts-expect-error web only method for converting to HTMLElement
|
|
38
|
-
const dialog = dialogRef.current;
|
|
39
|
-
const handleDialogMouseDown = () => {
|
|
40
|
-
state.waitingForMouseUp = true;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// Workaround for chrome, because chrome does not fire onMouseDown event
|
|
44
|
-
// for dialog when clicking on the <select> menu.
|
|
45
|
-
const handleDialogMouseUp = () => {
|
|
46
|
-
state.ignoreBackdropClick = true;
|
|
47
|
-
};
|
|
48
|
-
const handleDocumentClick = ({
|
|
49
|
-
target
|
|
50
|
-
}) => {
|
|
51
|
-
const isDialogClick = state.ignoreBackdropClick || dialog && dialog.contains(target);
|
|
52
|
-
if (backdrop === 'static' || autoClose === false) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Click outside -> return if autoClose is inside.
|
|
57
|
-
if (!isDialogClick && autoClose === 'inside') {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Click inside / on dialog -> return if autoClose is outside.
|
|
62
|
-
if (isDialogClick) {
|
|
63
|
-
state.ignoreBackdropClick = false;
|
|
64
|
-
if (autoClose === 'outside') {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Click on toggle -> return always.
|
|
70
|
-
if (toggle && (target === toggle || toggle.contains(target))) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
handleClose?.();
|
|
74
|
-
};
|
|
75
|
-
const handleDocumentMouseUp = () => {
|
|
76
|
-
if (state.waitingForMouseUp) {
|
|
77
|
-
state.ignoreBackdropClick = true;
|
|
78
|
-
}
|
|
79
|
-
state.waitingForMouseUp = false;
|
|
80
|
-
};
|
|
81
|
-
if (dialog) {
|
|
82
|
-
dialog.addEventListener('mousedown', handleDialogMouseDown);
|
|
83
|
-
dialog.addEventListener('mouseup', handleDialogMouseUp);
|
|
84
|
-
}
|
|
85
|
-
// See https://github.com/necolas/react-native-web/issues/2115
|
|
86
|
-
document.addEventListener('click', handleDocumentClick, true);
|
|
87
|
-
document.addEventListener('mouseup', handleDocumentMouseUp, true);
|
|
88
|
-
return () => {
|
|
89
|
-
if (dialog) {
|
|
90
|
-
dialog.removeEventListener('mousedown', handleDialogMouseDown);
|
|
91
|
-
dialog.removeEventListener('mouseup', handleDialogMouseUp);
|
|
92
|
-
}
|
|
93
|
-
document.removeEventListener('click', handleDocumentClick, true);
|
|
94
|
-
document.removeEventListener('mouseup', handleDocumentMouseUp, true);
|
|
95
|
-
};
|
|
96
|
-
}, [backdrop, autoClose]);
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
12
|
if (backdrop !== true) {
|
|
100
13
|
return null;
|
|
101
14
|
}
|
|
102
15
|
return /*#__PURE__*/_jsx(Pressable, {
|
|
103
|
-
style:
|
|
16
|
+
style: [StyleSheet.absoluteFill, {
|
|
17
|
+
flexGrow: 1
|
|
18
|
+
}],
|
|
104
19
|
onPress: () => {
|
|
105
20
|
handleClose?.();
|
|
106
21
|
},
|
|
@@ -108,6 +23,5 @@ function BackdropHandler(props) {
|
|
|
108
23
|
importantForAccessibility: "no"
|
|
109
24
|
});
|
|
110
25
|
}
|
|
111
|
-
BackdropHandler.displayName = 'BackdropHandler';
|
|
112
26
|
export default BackdropHandler;
|
|
113
27
|
//# sourceMappingURL=BackdropHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Pressable","jsx","_jsx","BackdropHandler","props","onClose","handleClose","backdrop","style","absoluteFill","flexGrow","onPress","accessible","importantForAccessibility"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/BackdropHandler.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,SAAS,MAAM,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOrC,SAASC,eAAeA,CAACC,KAA2B,EAAE;EACpD,MAAM;IAAEC,OAAO,EAAEC,WAAW;IAAEC,QAAQ,GAAG;EAAK,CAAC,GAAGH,KAAK;EAEvD,IAAIG,QAAQ,KAAK,IAAI,EAAE;IACrB,OAAO,IAAI;EACb;EAEA,oBACEL,IAAA,CAACF,SAAS;IACRQ,KAAK,EAAE,CAACT,UAAU,CAACU,YAAY,EAAE;MAAEC,QAAQ,EAAE;IAAE,CAAC,CAAE;IAClDC,OAAO,EAAEA,CAAA,KAAM;MACbL,WAAW,GAAG,CAAC;IACjB,CAAE;IACFM,UAAU,EAAE,KAAM;IAClBC,yBAAyB,EAAC;EAAI,CAC/B,CAAC;AAEN;AAEA,eAAeV,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BackdropHandler"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/BackdropHandler.web.tsx"],"mappings":";;AAAA;AACA,SAASA,eAAeA,CAAA,EAAG;EACzB,OAAO,IAAI;AACb;AAEA,eAAeA,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import { BackHandler } from 'react-native';
|
|
5
|
+
import { Portal } from '@rn-primitives/portal';
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Dialog({
|
|
8
|
+
children,
|
|
9
|
+
id,
|
|
10
|
+
backdrop,
|
|
11
|
+
backdropElement,
|
|
12
|
+
onClose: handleClose
|
|
13
|
+
}) {
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
16
|
+
handleClose?.();
|
|
17
|
+
return true;
|
|
18
|
+
});
|
|
19
|
+
return () => {
|
|
20
|
+
backHandler.remove();
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
return /*#__PURE__*/_jsxs(Portal, {
|
|
24
|
+
name: id,
|
|
25
|
+
children: [backdrop && backdropElement, children]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export default Dialog;
|
|
29
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","BackHandler","Portal","jsxs","_jsxs","Dialog","children","id","backdrop","backdropElement","onClose","handleClose","backHandler","addEventListener","remove","name"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/Dialog.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,WAAW,QAAQ,cAAc;AAC1C,SAASC,MAAM,QAAQ,uBAAuB;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAiB/C,SAASC,MAAMA,CAAC;EACdC,QAAQ;EACRC,EAAE;EACFC,QAAQ;EACRC,eAAe;EACfC,OAAO,EAAEC;AACE,CAAC,EAAE;EACdX,SAAS,CAAC,MAAM;IACd,MAAMY,WAAW,GAAGX,WAAW,CAACY,gBAAgB,CAC9C,mBAAmB,EACnB,MAAM;MACJF,WAAW,GAAG,CAAC;MACf,OAAO,IAAI;IACb,CACF,CAAC;IAED,OAAO,MAAM;MACXC,WAAW,CAACE,MAAM,CAAC,CAAC;IACtB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEV,KAAA,CAACF,MAAM;IAACa,IAAI,EAAER,EAAG;IAAAD,QAAA,GACdE,QAAQ,IAAIC,eAAe,EAC3BH,QAAQ;EAAA,CACH,CAAC;AAEb;AAEA,eAAeD,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
4
|
+
import { FocusScope } from '@react-aria/focus';
|
|
5
|
+
import Portal from './Portal';
|
|
6
|
+
import Context from "../../Context.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Dialog({
|
|
9
|
+
children,
|
|
10
|
+
id,
|
|
11
|
+
dialogRef,
|
|
12
|
+
backgroundRef,
|
|
13
|
+
onClose: handleClose,
|
|
14
|
+
backdrop,
|
|
15
|
+
backdropElement,
|
|
16
|
+
scroll = false
|
|
17
|
+
}) {
|
|
18
|
+
const context = useContext(Context);
|
|
19
|
+
|
|
20
|
+
// Handle scrollbars
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!context || scroll) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
context.scrollbars.hide();
|
|
26
|
+
return () => {
|
|
27
|
+
context.scrollbars.show();
|
|
28
|
+
};
|
|
29
|
+
}, [context, scroll]);
|
|
30
|
+
|
|
31
|
+
// Handle ESC key press
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const dialog = dialogRef.current;
|
|
34
|
+
if (!dialog) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Auto-focus dialog element
|
|
39
|
+
dialog.focus();
|
|
40
|
+
const handleKeyDown = event => {
|
|
41
|
+
if (event.key === 'Escape') {
|
|
42
|
+
handleClose?.();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
dialog.addEventListener('keydown', handleKeyDown);
|
|
46
|
+
return () => {
|
|
47
|
+
dialog.removeEventListener('keydown', handleKeyDown);
|
|
48
|
+
};
|
|
49
|
+
}, [handleClose]);
|
|
50
|
+
|
|
51
|
+
// Handle outside click
|
|
52
|
+
const state = useRef({
|
|
53
|
+
waitingForMouseUp: false,
|
|
54
|
+
handleClick: null
|
|
55
|
+
});
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const ref = backgroundRef.current;
|
|
58
|
+
|
|
59
|
+
// @ts-expect-error getScrollableNode exists on web only
|
|
60
|
+
const isScrollView = typeof ref?.getScrollableNode === 'function';
|
|
61
|
+
|
|
62
|
+
// If the ref refers to a scroll view, we need the first child, otherwise the ref itself.
|
|
63
|
+
const background = isScrollView ? ref?.firstElementChild : ref;
|
|
64
|
+
if (!background) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const handleMouseDown = event => {
|
|
68
|
+
// It might be that a click starts inside the window and ends outside the window, so that
|
|
69
|
+
// only the on mouse down event is dispatched and we need to remove the click listener
|
|
70
|
+
// before the next click event is dispatched.
|
|
71
|
+
if (state.current.waitingForMouseUp && state.current.handleClick) {
|
|
72
|
+
background.removeEventListener('click', state.current.handleClick);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// A bad trick to segregate clicks that may start inside dialog but end outside, and avoid
|
|
76
|
+
// listen to scrollbar clicks.
|
|
77
|
+
const handleClick = event2 => {
|
|
78
|
+
if (background !== event.target || background !== event2.target) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (backdrop === 'static') {
|
|
82
|
+
// TODO: triggerBackdropTransition()
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (backdrop) {
|
|
86
|
+
handleClose?.();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
state.current = {
|
|
90
|
+
waitingForMouseUp: true,
|
|
91
|
+
handleClick
|
|
92
|
+
};
|
|
93
|
+
background.addEventListener('click', handleClick, {
|
|
94
|
+
once: true
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const handleMouseUp = () => {
|
|
98
|
+
state.current.waitingForMouseUp = false;
|
|
99
|
+
};
|
|
100
|
+
background.addEventListener('mousedown', handleMouseDown);
|
|
101
|
+
background.addEventListener('mouseup', handleMouseUp);
|
|
102
|
+
return () => {
|
|
103
|
+
background.removeEventListener('mousedown', handleMouseDown);
|
|
104
|
+
background.removeEventListener('mouseup', handleMouseUp);
|
|
105
|
+
};
|
|
106
|
+
}, [backdrop, handleClose]);
|
|
107
|
+
return /*#__PURE__*/_jsxs(Portal, {
|
|
108
|
+
name: id,
|
|
109
|
+
children: [backdrop && backdropElement, /*#__PURE__*/_jsx(FocusScope, {
|
|
110
|
+
contain: true,
|
|
111
|
+
restoreFocus: true,
|
|
112
|
+
children: children
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export default Dialog;
|
|
117
|
+
//# sourceMappingURL=Dialog.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useContext","useEffect","useRef","FocusScope","Portal","Context","jsx","_jsx","jsxs","_jsxs","Dialog","children","id","dialogRef","backgroundRef","onClose","handleClose","backdrop","backdropElement","scroll","context","undefined","scrollbars","hide","show","dialog","current","focus","handleKeyDown","event","key","addEventListener","removeEventListener","state","waitingForMouseUp","handleClick","ref","isScrollView","getScrollableNode","background","firstElementChild","handleMouseDown","event2","target","once","handleMouseUp","name","contain","restoreFocus"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/Dialog.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC5D,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,OAAOC,MAAM,MAAM,UAAU;AAE7B,OAAOC,OAAO,MAAM,kBAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAapC,SAASC,MAAMA,CAAC;EACdC,QAAQ;EACRC,EAAE;EACFC,SAAS;EACTC,aAAa;EACbC,OAAO,EAAEC,WAAW;EACpBC,QAAQ;EACRC,eAAe;EACfC,MAAM,GAAG;AACE,CAAC,EAAE;EACd,MAAMC,OAAO,GAAGpB,UAAU,CAACK,OAAO,CAAC;;EAEnC;EACAJ,SAAS,CAAC,MAAM;IACd,IAAI,CAACmB,OAAO,IAAID,MAAM,EAAE;MACtB,OAAOE,SAAS;IAClB;IAEAD,OAAO,CAACE,UAAU,CAACC,IAAI,CAAC,CAAC;IAEzB,OAAO,MAAM;MACXH,OAAO,CAACE,UAAU,CAACE,IAAI,CAAC,CAAC;IAC3B,CAAC;EACH,CAAC,EAAE,CAACJ,OAAO,EAAED,MAAM,CAAC,CAAC;;EAErB;EACAlB,SAAS,CAAC,MAAM;IACd,MAAMwB,MAAM,GAAGZ,SAAS,CAACa,OAAgC;IAEzD,IAAI,CAACD,MAAM,EAAE;MACX,OAAOJ,SAAS;IAClB;;IAEA;IACAI,MAAM,CAACE,KAAK,CAAC,CAAC;IAEd,MAAMC,aAAa,GAAIC,KAAoB,IAAK;MAC9C,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;QAC1Bd,WAAW,GAAG,CAAC;MACjB;IACF,CAAC;IAEDS,MAAM,CAACM,g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EAAE;MAAK,CAAC,CAAC;IACnE,CAAC;IAED,MAAMC,aAAa,GAAGA,CAAA,KAAM;MAC1BZ,KAAK,CAACP,OAAO,CAACQ,iBAAiB,GAAG,KAAK;IACzC,CAAC;IAEDK,UAAU,CAACR,gBAAgB,CAAC,WAAW,EAAEU,eAAe,CAAC;IACzDF,UAAU,CAACR,gBAAgB,CAAC,SAAS,EAAEc,aAAa,CAAC;IAErD,OAAO,MAAM;MACXN,UAAU,CAACP,mBAAmB,CAAC,WAAW,EAAES,eAAe,CAAC;MAC5DF,UAAU,CAACP,mBAAmB,CAAC,SAAS,EAAEa,aAAa,CAAC;IAC1D,CAAC;EACH,CAAC,EAAE,CAAC5B,QAAQ,EAAED,WAAW,CAAC,CAAC;EAE3B,oBACEP,KAAA,CAACL,MAAM;IAAC0C,IAAI,EAAElC,EAAG;IAAAD,QAAA,GACdM,QAAQ,IAAIC,eAAe,eAC5BX,IAAA,CAACJ,UAAU;MAAC4C,OAAO;MAACC,YAAY;MAAArC,QAAA,EAC7BA;IAAQ,CACC,CAAC;EAAA,CACP,CAAC;AAEb;AAEA,eAAeD,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Portal"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/Portal.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAS9C,eAAeA,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
const DEFAULT_PORTAL_HOST = 'INTERNAL_PRIMITIVE_DEFAULT_HOST_NAME';
|
|
5
|
+
function Portal({
|
|
6
|
+
hostName = DEFAULT_PORTAL_HOST,
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
const element = document.getElementById(hostName);
|
|
10
|
+
if (!element) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/createPortal(children, element);
|
|
14
|
+
}
|
|
15
|
+
export default Portal;
|
|
16
|
+
//# sourceMappingURL=Portal.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPortal","DEFAULT_PORTAL_HOST","Portal","hostName","children","element","document","getElementById"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/Portal.web.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,WAAW;AASxC,MAAMC,mBAAmB,GAAG,sCAAsC;AAElE,SAASC,MAAMA,CAAC;EAAEC,QAAQ,GAAGF,mBAAmB;EAAEG;AAAsB,CAAC,EAAE;EACzE,MAAMC,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAACJ,QAAQ,CAAC;EAEjD,IAAI,CAACE,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EAEA,oBAAOL,YAAY,CAACI,QAAQ,EAAEC,OAAO,CAAC;AACxC;AAEA,eAAeH,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PortalHost"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/PortalHost.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,uBAAuB;AAMlD,eAAeA,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const DEFAULT_PORTAL_HOST = 'INTERNAL_PRIMITIVE_DEFAULT_HOST_NAME';
|
|
7
|
+
function PortalHost({
|
|
8
|
+
name = DEFAULT_PORTAL_HOST
|
|
9
|
+
}) {
|
|
10
|
+
return /*#__PURE__*/_jsx(View, {
|
|
11
|
+
id: name
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export default PortalHost;
|
|
15
|
+
//# sourceMappingURL=PortalHost.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","jsx","_jsx","DEFAULT_PORTAL_HOST","PortalHost","name","id"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/helpers/PortalHost.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMpC,MAAMC,mBAAmB,GAAG,sCAAsC;AAElE,SAASC,UAAUA,CAAC;EAAEC,IAAI,GAAGF;AAAqC,CAAC,EAAE;EACnE,oBAAOD,IAAA,CAACF,IAAI;IAACM,EAAE,EAAED;EAAK,CAAE,CAAC;AAC3B;AAEA,eAAeD,UAAU","ignoreList":[]}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useRef } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { OverlayProvider } from '@react-native-aria/overlays';
|
|
4
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
5
|
import StyleSheet from "../../style/StyleSheet.js";
|
|
7
|
-
import { getStyles } from "../../utils.js";
|
|
6
|
+
import { concatRefs, getStyles } from "../../utils.js";
|
|
8
7
|
import css from "../../style/css.js";
|
|
9
8
|
import ScrollView from "../ScrollView.js";
|
|
10
9
|
import View from "../View.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
10
|
+
import Dialog from '../helpers/Dialog';
|
|
11
|
+
import BackdropHandler from '../helpers/BackdropHandler';
|
|
13
12
|
import useModal from "./useModal.js";
|
|
14
13
|
import ModalContext from "./ModalContext.js";
|
|
15
14
|
import ModalHeader from "./ModalHeader.js";
|
|
@@ -19,19 +18,24 @@ import ModalFooter from "./ModalFooter.js";
|
|
|
19
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
const styles = StyleSheet.create({
|
|
21
20
|
'.modal': css`
|
|
22
|
-
position: absolute; //
|
|
21
|
+
position: absolute; // added for bootstrap-rn
|
|
22
|
+
@include platform(web) {
|
|
23
|
+
position: fixed;
|
|
24
|
+
}
|
|
23
25
|
top: 0;
|
|
24
26
|
left: 0;
|
|
25
|
-
|
|
27
|
+
bottom: 0; // added for bootstrap-rn
|
|
28
|
+
right: 0; // added for bootstrap-rn
|
|
29
|
+
// z-index: $zindex-modal;
|
|
26
30
|
// display: none;
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 100%;
|
|
31
|
+
// width: 100%;
|
|
32
|
+
// height: 100%;
|
|
29
33
|
// overflow-x: hidden;
|
|
30
34
|
// overflow-y: auto;
|
|
31
35
|
// Prevent Chrome on Windows from adding a focus outline. For details, see
|
|
32
36
|
// https://github.com/twbs/bootstrap/pull/10951.
|
|
33
37
|
@include platform(web) {
|
|
34
|
-
outline-
|
|
38
|
+
outline-style: none; // outline: 0;
|
|
35
39
|
}
|
|
36
40
|
// We deliberately don't use "-webkit-overflow-scrolling: touch;" due to a
|
|
37
41
|
// gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
|
|
@@ -76,7 +80,9 @@ const styles = StyleSheet.create({
|
|
|
76
80
|
border-radius: $modal-content-border-radius;
|
|
77
81
|
// @include box-shadow($modal-content-box-shadow-xs);
|
|
78
82
|
// Remove focus outline from opened modal
|
|
79
|
-
|
|
83
|
+
@include platform(web) {
|
|
84
|
+
outline-style: none; // outline: 0;
|
|
85
|
+
}
|
|
80
86
|
|
|
81
87
|
@include media-breakpoint-up(sm) {
|
|
82
88
|
// @include box-shadow($modal-content-box-shadow-sm-up);
|
|
@@ -86,12 +92,17 @@ const styles = StyleSheet.create({
|
|
|
86
92
|
color: $modal-content-color;
|
|
87
93
|
`,
|
|
88
94
|
'.modal-backdrop': css`
|
|
89
|
-
position: absolute;
|
|
95
|
+
position: absolute; // added for bootstrap-rn
|
|
96
|
+
@include platform(web) {
|
|
97
|
+
position: fixed;
|
|
98
|
+
}
|
|
90
99
|
top: 0;
|
|
91
100
|
left: 0;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
bottom: 0; // added for bootstrap-rn
|
|
102
|
+
right: 0; // added for bootstrap-rn
|
|
103
|
+
// z-index: $zindex-modal-backdrop;
|
|
104
|
+
// width: 100vw;
|
|
105
|
+
// height: 100vh;
|
|
95
106
|
background-color: $modal-backdrop-bg;
|
|
96
107
|
opacity: $modal-backdrop-opacity;
|
|
97
108
|
`,
|
|
@@ -122,7 +133,7 @@ const Modal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
122
133
|
backdrop = true,
|
|
123
134
|
scrollable = false,
|
|
124
135
|
centered = false,
|
|
125
|
-
|
|
136
|
+
onClose: handleClose,
|
|
126
137
|
style,
|
|
127
138
|
contentContainerStyle,
|
|
128
139
|
dialogStyle,
|
|
@@ -132,8 +143,9 @@ const Modal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
132
143
|
contentTextStyle,
|
|
133
144
|
...elementProps
|
|
134
145
|
} = props;
|
|
135
|
-
const
|
|
136
|
-
const
|
|
146
|
+
const modalRef = useRef(null);
|
|
147
|
+
const insets = useSafeAreaInsets();
|
|
148
|
+
const modal = useModal(scrollable);
|
|
137
149
|
const backdropClasses = getStyles(styles, ['.modal-backdrop']);
|
|
138
150
|
const classes = getStyles(styles, ['.modal']);
|
|
139
151
|
const dialogClasses = getStyles(styles, ['.modal-dialog', size === 'sm' && '.modal-sm', size === 'lg' && '.modal-lg', size === 'xl' && '.modal-xl', scrollable && '.modal-dialog-scrollable', centered && '.modal-dialog-centered']);
|
|
@@ -145,48 +157,47 @@ const Modal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
145
157
|
const centeredStyle = centered && {
|
|
146
158
|
justifyContent: 'center'
|
|
147
159
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
160
|
+
if (!visible) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/_jsx(Dialog, {
|
|
164
|
+
id: modal.identifier,
|
|
165
|
+
dialogRef: modalRef,
|
|
166
|
+
backgroundRef: modalRef,
|
|
167
|
+
onClose: handleClose,
|
|
168
|
+
backdrop: backdrop,
|
|
169
|
+
backdropElement: /*#__PURE__*/_jsx(View, {
|
|
155
170
|
style: backdropClasses
|
|
156
|
-
}),
|
|
171
|
+
}),
|
|
172
|
+
children: /*#__PURE__*/_jsxs(FlexView, {
|
|
157
173
|
...elementProps,
|
|
158
174
|
// @ts-expect-error Type of ref depends on component.
|
|
159
|
-
ref: ref,
|
|
160
|
-
|
|
175
|
+
ref: concatRefs(ref, modalRef),
|
|
176
|
+
role: "dialog",
|
|
177
|
+
"aria-modal": true,
|
|
178
|
+
"aria-labelledby": `${modal.identifier}-title`,
|
|
179
|
+
tabIndex: -1,
|
|
180
|
+
style: [classes, insets, scrollable && centeredStyle, style],
|
|
161
181
|
textStyle: textStyle,
|
|
162
182
|
contentContainerStyle: scrollable ? undefined : [{
|
|
163
183
|
flexGrow: 1
|
|
164
184
|
}, centeredStyle, contentContainerStyle],
|
|
165
185
|
children: [/*#__PURE__*/_jsx(BackdropHandler, {
|
|
166
|
-
|
|
167
|
-
onClose: handleToggle,
|
|
186
|
+
onClose: handleClose,
|
|
168
187
|
backdrop: backdrop
|
|
169
|
-
}), /*#__PURE__*/_jsx(
|
|
170
|
-
style:
|
|
171
|
-
|
|
172
|
-
},
|
|
188
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
189
|
+
style: [dialogClasses, dialogStyle],
|
|
190
|
+
textStyle: dialogTextStyle,
|
|
173
191
|
children: /*#__PURE__*/_jsx(View, {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
textStyle: [contentTextClasses, contentTextStyle],
|
|
180
|
-
children: /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
181
|
-
value: modal,
|
|
182
|
-
children: /*#__PURE__*/_jsx(OverlayProvider, {
|
|
183
|
-
children: children
|
|
184
|
-
})
|
|
185
|
-
})
|
|
192
|
+
style: [contentClasses, contentStyle],
|
|
193
|
+
textStyle: [contentTextClasses, contentTextStyle],
|
|
194
|
+
children: /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
195
|
+
value: modal,
|
|
196
|
+
children: children
|
|
186
197
|
})
|
|
187
198
|
})
|
|
188
199
|
})]
|
|
189
|
-
})
|
|
200
|
+
})
|
|
190
201
|
});
|
|
191
202
|
});
|
|
192
203
|
Modal.displayName = 'Modal';
|