@admin-layout/gluestack-ui-mobile 6.5.1-alpha.0

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.
Files changed (199) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/LICENSE +21 -0
  3. package/README.md +4 -0
  4. package/assets/logo.png +0 -0
  5. package/babel.config.js +26 -0
  6. package/jest-react-navigation-setup.js +14 -0
  7. package/jest.config.js +39 -0
  8. package/jest.env.js +2 -0
  9. package/lib/__tests__/prolayout-layout-feature.test.d.ts +1 -0
  10. package/lib/__tests__/prolayout-layout-feature.test.js +202 -0
  11. package/lib/__tests__/prolayout-layout-feature.test.js.map +1 -0
  12. package/lib/components/ApplicationErrorFillWrapper.d.ts +2 -0
  13. package/lib/components/ApplicationErrorFillWrapper.js +7 -0
  14. package/lib/components/ApplicationErrorFillWrapper.js.map +1 -0
  15. package/lib/components/ApplicationErrorHandler.d.ts +2 -0
  16. package/lib/components/ApplicationErrorHandler.js +24 -0
  17. package/lib/components/ApplicationErrorHandler.js.map +1 -0
  18. package/lib/components/ErrorBounday.d.ts +18 -0
  19. package/lib/components/ErrorBounday.js +22 -0
  20. package/lib/components/ErrorBounday.js.map +1 -0
  21. package/lib/components/Fallback.d.ts +6 -0
  22. package/lib/components/Fallback.js +53 -0
  23. package/lib/components/Fallback.js.map +1 -0
  24. package/lib/components/Layout/components/BasicLayout.d.ts +5 -0
  25. package/lib/components/Layout/components/BasicLayout.js +28 -0
  26. package/lib/components/Layout/components/BasicLayout.js.map +1 -0
  27. package/lib/components/Layout/components/BottomTabBar.d.ts +2 -0
  28. package/lib/components/Layout/components/BottomTabBar.js +90 -0
  29. package/lib/components/Layout/components/BottomTabBar.js.map +1 -0
  30. package/lib/components/Layout/components/Drawer.d.ts +2 -0
  31. package/lib/components/Layout/components/Drawer.js +253 -0
  32. package/lib/components/Layout/components/Drawer.js.map +1 -0
  33. package/lib/components/Layout/components/Header.d.ts +2 -0
  34. package/lib/components/Layout/components/Header.js +130 -0
  35. package/lib/components/Layout/components/Header.js.map +1 -0
  36. package/lib/components/Layout/components/Sample.d.ts +2 -0
  37. package/lib/components/Layout/components/Sample.js +7 -0
  38. package/lib/components/Layout/components/Sample.js.map +1 -0
  39. package/lib/components/Layout/components/SettingDrawer/LayoutButton.d.ts +3 -0
  40. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js +66 -0
  41. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js.map +1 -0
  42. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.d.ts +2 -0
  43. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.js +23 -0
  44. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.js.map +1 -0
  45. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.d.ts +3 -0
  46. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js +24 -0
  47. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js.map +1 -0
  48. package/lib/components/Layout/components/SettingDrawer/index.d.ts +1 -0
  49. package/lib/components/Layout/components/SettingDrawer/index.js +2 -0
  50. package/lib/components/Layout/components/SettingDrawer/index.js.map +1 -0
  51. package/lib/components/Layout/components/SideBar.d.ts +10 -0
  52. package/lib/components/Layout/components/SideBar.js +59 -0
  53. package/lib/components/Layout/components/SideBar.js.map +1 -0
  54. package/lib/components/Layout/components/defaultSettings.d.ts +4 -0
  55. package/lib/components/Layout/components/defaultSettings.js +16 -0
  56. package/lib/components/Layout/components/defaultSettings.js.map +1 -0
  57. package/lib/components/Layout/components/index.d.ts +4 -0
  58. package/lib/components/Layout/components/index.js +5 -0
  59. package/lib/components/Layout/components/index.js.map +1 -0
  60. package/lib/components/Layout/components/util.d.ts +1 -0
  61. package/lib/components/Layout/components/util.js +15 -0
  62. package/lib/components/Layout/components/util.js.map +1 -0
  63. package/lib/components/Layout/compute.d.ts +6 -0
  64. package/lib/components/Layout/compute.js +316 -0
  65. package/lib/components/Layout/compute.js.map +1 -0
  66. package/lib/components/Layout/compute.test.d.ts +6 -0
  67. package/lib/components/Layout/compute.test.js +120 -0
  68. package/lib/components/Layout/compute.test.js.map +1 -0
  69. package/lib/components/Layout/index.d.ts +4 -0
  70. package/lib/components/Layout/index.js +4 -0
  71. package/lib/components/Layout/index.js.map +1 -0
  72. package/lib/components/Layout/typings.d.ts +1 -0
  73. package/lib/components/Layout/typings.js +2 -0
  74. package/lib/components/Layout/typings.js.map +1 -0
  75. package/lib/components/NavigationComponent.d.ts +15 -0
  76. package/lib/components/NavigationComponent.js +120 -0
  77. package/lib/components/NavigationComponent.js.map +1 -0
  78. package/lib/components/PluginArea.d.ts +2 -0
  79. package/lib/components/PluginArea.js +8 -0
  80. package/lib/components/PluginArea.js.map +1 -0
  81. package/lib/components/ToastAlert.d.ts +12 -0
  82. package/lib/components/ToastAlert.js +17 -0
  83. package/lib/components/ToastAlert.js.map +1 -0
  84. package/lib/components/index.d.ts +9 -0
  85. package/lib/components/index.js +10 -0
  86. package/lib/components/index.js.map +1 -0
  87. package/lib/components/with-interactions-managed.d.ts +2 -0
  88. package/lib/components/with-interactions-managed.js +18 -0
  89. package/lib/components/with-interactions-managed.js.map +1 -0
  90. package/lib/config/config.d.ts +17 -0
  91. package/lib/config/config.js +18 -0
  92. package/lib/config/config.js.map +1 -0
  93. package/lib/config/index.d.ts +1 -0
  94. package/lib/config/index.js +2 -0
  95. package/lib/config/index.js.map +1 -0
  96. package/lib/constants/routes.d.ts +3 -0
  97. package/lib/constants/routes.js +5 -0
  98. package/lib/constants/routes.js.map +1 -0
  99. package/lib/containers/layout/BasicLayout.d.ts +7 -0
  100. package/lib/containers/layout/BasicLayout.js +36 -0
  101. package/lib/containers/layout/BasicLayout.js.map +1 -0
  102. package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +128 -0
  103. package/lib/containers/layout/DrawerBottomNavigationConfig.js +72 -0
  104. package/lib/containers/layout/DrawerBottomNavigationConfig.js.map +1 -0
  105. package/lib/containers/layout/DrawerConfig.d.ts +85 -0
  106. package/lib/containers/layout/DrawerConfig.js +48 -0
  107. package/lib/containers/layout/DrawerConfig.js.map +1 -0
  108. package/lib/containers/layout/Lifecycle.d.ts +13 -0
  109. package/lib/containers/layout/Lifecycle.js +18 -0
  110. package/lib/containers/layout/Lifecycle.js.map +1 -0
  111. package/lib/containers/layout/ProLayout.d.ts +5 -0
  112. package/lib/containers/layout/ProLayout.js +35 -0
  113. package/lib/containers/layout/ProLayout.js.map +1 -0
  114. package/lib/containers/layout/module.d.ts +5 -0
  115. package/lib/containers/layout/module.js +22 -0
  116. package/lib/containers/layout/module.js.map +1 -0
  117. package/lib/hooks/use-after-interactions.d.ts +6 -0
  118. package/lib/hooks/use-after-interactions.js +29 -0
  119. package/lib/hooks/use-after-interactions.js.map +1 -0
  120. package/lib/hooks/useIsReady.d.ts +2 -0
  121. package/lib/hooks/useIsReady.js +24 -0
  122. package/lib/hooks/useIsReady.js.map +1 -0
  123. package/lib/hooks/useLayoutSetting/index.d.ts +11 -0
  124. package/lib/hooks/useLayoutSetting/index.js +68 -0
  125. package/lib/hooks/useLayoutSetting/index.js.map +1 -0
  126. package/lib/index.d.ts +14 -0
  127. package/lib/index.js +26 -0
  128. package/lib/index.js.map +1 -0
  129. package/lib/interfaces/index.d.ts +1 -0
  130. package/lib/interfaces/index.js +2 -0
  131. package/lib/interfaces/index.js.map +1 -0
  132. package/lib/interfaces/settings.d.ts +4 -0
  133. package/lib/interfaces/settings.js +2 -0
  134. package/lib/interfaces/settings.js.map +1 -0
  135. package/lib/redux/settings.d.ts +80 -0
  136. package/lib/redux/settings.js +16 -0
  137. package/lib/redux/settings.js.map +1 -0
  138. package/lib/utils/ThemeColor.d.ts +8 -0
  139. package/lib/utils/ThemeColor.js +9 -0
  140. package/lib/utils/ThemeColor.js.map +1 -0
  141. package/lib/utils/routeConfigKeyReplace.d.ts +7 -0
  142. package/lib/utils/routeConfigKeyReplace.js +77 -0
  143. package/lib/utils/routeConfigKeyReplace.js.map +1 -0
  144. package/lib/utils/routeConfigKeyReplace.test.d.ts +1 -0
  145. package/lib/utils/routeConfigKeyReplace.test.js +102 -0
  146. package/lib/utils/routeConfigKeyReplace.test.js.map +1 -0
  147. package/package.json +40 -0
  148. package/src/__tests__/prolayout-layout-feature.test.tsx +207 -0
  149. package/src/components/ApplicationErrorFillWrapper.tsx +7 -0
  150. package/src/components/ApplicationErrorHandler.tsx +30 -0
  151. package/src/components/ErrorBounday.tsx +31 -0
  152. package/src/components/Fallback.tsx +65 -0
  153. package/src/components/Layout/README.md +11 -0
  154. package/src/components/Layout/components/BasicLayout.tsx +70 -0
  155. package/src/components/Layout/components/BottomTabBar.tsx +135 -0
  156. package/src/components/Layout/components/Drawer.tsx +412 -0
  157. package/src/components/Layout/components/Header.tsx +195 -0
  158. package/src/components/Layout/components/Sample.tsx +10 -0
  159. package/src/components/Layout/components/SettingDrawer/LayoutButton.tsx +102 -0
  160. package/src/components/Layout/components/SettingDrawer/SettingDrawer.tsx +60 -0
  161. package/src/components/Layout/components/SettingDrawer/ThemeColorButton.tsx +26 -0
  162. package/src/components/Layout/components/SettingDrawer/index.ts +1 -0
  163. package/src/components/Layout/components/SideBar.tsx +109 -0
  164. package/src/components/Layout/components/defaultSettings.ts +19 -0
  165. package/src/components/Layout/components/index.ts +4 -0
  166. package/src/components/Layout/components/util.ts +14 -0
  167. package/src/components/Layout/compute.test.tsx +129 -0
  168. package/src/components/Layout/compute.tsx +384 -0
  169. package/src/components/Layout/eslint.json +1 -0
  170. package/src/components/Layout/index.ts +5 -0
  171. package/src/components/Layout/typings.ts +1 -0
  172. package/src/components/NavigationComponent.tsx +154 -0
  173. package/src/components/PluginArea.tsx +11 -0
  174. package/src/components/ToastAlert.tsx +44 -0
  175. package/src/components/index.ts +9 -0
  176. package/src/components/with-interactions-managed.tsx +33 -0
  177. package/src/config/config.ts +17 -0
  178. package/src/config/index.ts +1 -0
  179. package/src/constants/routes.ts +3 -0
  180. package/src/containers/layout/BasicLayout.tsx +61 -0
  181. package/src/containers/layout/DrawerBottomNavigationConfig.tsx +85 -0
  182. package/src/containers/layout/DrawerConfig.tsx +59 -0
  183. package/src/containers/layout/Lifecycle.tsx +23 -0
  184. package/src/containers/layout/ProLayout.tsx +42 -0
  185. package/src/containers/layout/module.ts +24 -0
  186. package/src/hooks/use-after-interactions.ts +35 -0
  187. package/src/hooks/useIsReady.ts +31 -0
  188. package/src/hooks/useLayoutSetting/index.ts +99 -0
  189. package/src/index.ts +41 -0
  190. package/src/interfaces/index.ts +1 -0
  191. package/src/interfaces/settings.ts +5 -0
  192. package/src/redux/settings.ts +28 -0
  193. package/src/utils/ThemeColor.ts +9 -0
  194. package/src/utils/__snapshots__/routeConfigKeyReplace.test.ts.snap +117 -0
  195. package/src/utils/routeConfigKeyReplace.test.ts +114 -0
  196. package/src/utils/routeConfigKeyReplace.ts +74 -0
  197. package/tsconfig.json +37 -0
  198. package/types.d.ts +11 -0
  199. package/webpack.config.js +104 -0
@@ -0,0 +1,66 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import { Box, Pressable, HStack, VStack, Text } from '@gluestack-ui/themed';
14
+ const LayoutButton = ({ color, onSettingChange, settings, bottom, mode, bottomOnly, bottomDrawer }) => {
15
+ return (React.createElement(Pressable, { backgroundColor: '#f0f2f5', width: 50, height: 50, borderRadius: '$sm', mr: '$4', onPress: () => {
16
+ if (mode === 'style') {
17
+ let { navTheme } = settings, rest = __rest(settings, ["navTheme"]);
18
+ if (color === 'white') {
19
+ navTheme = 'light';
20
+ const newSettings = Object.assign(Object.assign({}, rest), { navTheme });
21
+ onSettingChange(newSettings);
22
+ }
23
+ else {
24
+ navTheme = 'dark';
25
+ const newSettings = Object.assign(Object.assign({}, rest), { navTheme });
26
+ onSettingChange(newSettings);
27
+ }
28
+ }
29
+ else {
30
+ let { layout } = settings, rest = __rest(settings, ["layout"]);
31
+ if (bottom) {
32
+ layout = 'mixSide';
33
+ const newSettings = Object.assign(Object.assign({}, rest), { layout });
34
+ onSettingChange(newSettings);
35
+ }
36
+ else if (bottomOnly) {
37
+ layout = 'bottom';
38
+ const newSettings = Object.assign(Object.assign({}, rest), { layout });
39
+ onSettingChange(newSettings);
40
+ }
41
+ else if (bottomDrawer) {
42
+ layout = 'bottomDrawer';
43
+ const newSettings = Object.assign(Object.assign({}, rest), { layout });
44
+ onSettingChange(newSettings);
45
+ }
46
+ else {
47
+ layout = 'side';
48
+ const newSettings = Object.assign(Object.assign({}, rest), { layout });
49
+ onSettingChange(newSettings);
50
+ }
51
+ }
52
+ } },
53
+ React.createElement(HStack, null,
54
+ React.createElement(Box, { backgroundColor: color, height: bottomOnly ? '$0' : 50, width: '28%', borderTopLeftRadius: '$sm', borderBottomLeftRadius: '$sm' }),
55
+ React.createElement(VStack, { justifyContent: 'space-between' },
56
+ React.createElement(Box, { height: 15, width: 36, backgroundColor: '$white', borderTopRightRadius: '$sm' }),
57
+ bottom ? (React.createElement(Box, { height: 15, width: 36, backgroundColor: '$black', borderBottomRightRadius: '$sm' })) : null,
58
+ bottomOnly ? (React.createElement(React.Fragment, null,
59
+ React.createElement(Box, { height: 15, width: '$0', backgroundColor: '$white', borderTopRightRadius: '$sm' }),
60
+ React.createElement(Box, { height: 15, width: 49, backgroundColor: '$black' }))) : null,
61
+ bottomDrawer ? (React.createElement(React.Fragment, null,
62
+ React.createElement(Box, { height: 15, width: 36, backgroundColor: '$black', borderBottomRightRadius: '$sm' }),
63
+ React.createElement(Text, null))) : null))));
64
+ };
65
+ export default LayoutButton;
66
+ //# sourceMappingURL=LayoutButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutButton.js","sourceRoot":"","sources":["../../../../../src/components/Layout/components/SettingDrawer/LayoutButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5E,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAO,EAAE,EAAE;IACvG,OAAO,CACH,oBAAC,SAAS,IACN,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,YAAY,EAAE,KAAK,EACnB,EAAE,EAAE,IAAI,EACR,OAAO,EAAE,GAAG,EAAE;YACV,IAAI,IAAI,KAAK,OAAO,EAAE;gBAClB,IAAI,EAAE,QAAQ,KAAc,QAAQ,EAAjB,IAAI,UAAK,QAAQ,EAAhC,YAAqB,CAAW,CAAC;gBACrC,IAAI,KAAK,KAAK,OAAO,EAAE;oBACnB,QAAQ,GAAG,OAAO,CAAC;oBACnB,MAAM,WAAW,mCACV,IAAI,KACP,QAAQ,GACX,CAAC;oBACF,eAAe,CAAC,WAAW,CAAC,CAAC;iBAChC;qBAAM;oBACH,QAAQ,GAAG,MAAM,CAAC;oBAClB,MAAM,WAAW,mCACV,IAAI,KACP,QAAQ,GACX,CAAC;oBACF,eAAe,CAAC,WAAW,CAAC,CAAC;iBAChC;aACJ;iBAAM;gBACH,IAAI,EAAE,MAAM,KAAc,QAAQ,EAAjB,IAAI,UAAK,QAAQ,EAA9B,UAAmB,CAAW,CAAC;gBACnC,IAAI,MAAM,EAAE;oBACR,MAAM,GAAG,SAAS,CAAC;oBACnB,MAAM,WAAW,mCACV,IAAI,KACP,MA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AAE,KAAK,GAAI;oBACxF,oBAAC,GAAG,IAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,QAAQ,GAAI,CAC1D,CACN,CAAC,CAAC,CAAC,IAAI;gBAEP,YAAY,CAAC,CAAC,CAAC,CACZ;oBACI,oBAAC,GAAG,IACA,MAAM,EAAE,EAAE,EACV,KAAK,EAAE,EAAE,EACT,eAAe,EAAE,QAAQ,EACzB,uBAAuB,EAAE,KAAK,GAChC;oBACF,oBAAC,IAAI,OAAQ,CACd,CACN,CAAC,CAAC,CAAC,IAAI,CACH,CACJ,CACD,CACf,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SettingDrawer: ({ onSettingChange }: any) => React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { Box, Text, HStack } from '@gluestack-ui/themed';
3
+ import { useSelector } from 'react-redux';
4
+ import LayoutButton from './LayoutButton';
5
+ import ThemeColorButton from './ThemeColorButton';
6
+ import { THEMECOLOR } from '../../../../utils/ThemeColor';
7
+ export const SettingDrawer = ({ onSettingChange }) => {
8
+ const settings = useSelector((state) => state.settings);
9
+ return (React.createElement(Box, { position: 'absolute', flex: 1, flexGrow: 1, p: "$5", right: "$0", bg: '$white', top: "$4" },
10
+ React.createElement(Text, { color: '#000080', style: { fontWeight: '900' } }, "Page style setting"),
11
+ React.createElement(HStack, { space: "md", mt: "$3" },
12
+ React.createElement(LayoutButton, { mode: "style", settings: settings, onSettingChange: onSettingChange, color: 'white' }),
13
+ React.createElement(LayoutButton, { mode: "style", settings: settings, onSettingChange: onSettingChange, color: 'black' })),
14
+ React.createElement(Text, { color: '#000080', style: { fontWeight: '900' }, mt: "$2" }, "Theme Color"),
15
+ React.createElement(HStack, { space: "md", mt: "$3", flexWrap: 'wrap' }, THEMECOLOR.map((color, index) => (React.createElement(ThemeColorButton, { key: index, color: color, settings: settings, onSettingChange: onSettingChange })))),
16
+ React.createElement(Text, { color: '#000080', style: { fontWeight: '900' }, mt: "$2" }, "Navigation Mode"),
17
+ React.createElement(HStack, { space: "md", mt: "$3" },
18
+ React.createElement(LayoutButton, { mode: "layout", settings: settings, onSettingChange: onSettingChange, color: 'black' }),
19
+ React.createElement(LayoutButton, { mode: "layout", bottom: true, settings: settings, onSettingChange: onSettingChange, color: 'black' }),
20
+ React.createElement(LayoutButton, { mode: "layout", bottomOnly: true, settings: settings, onSettingChange: onSettingChange, color: 'black' })),
21
+ React.createElement(HStack, { space: "md", mt: "$3" })));
22
+ };
23
+ //# sourceMappingURL=SettingDrawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingDrawer.js","sourceRoot":"","sources":["../../../../../src/components/Layout/components/SettingDrawer/SettingDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,eAAe,EAAO,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG,WAAW,CAAM,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAQ,CAAC;IACpE,OAAO,CACH,oBAAC,GAAG,IAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI;QAC3F,oBAAC,IAAI,IAAC,KAA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AClB,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,OAAO,GAChB;YAEF,oBAAC,YAAY,IACT,IAAI,EAAC,QAAQ,EACb,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,OAAO,GAChB,CACG;QACT,oBAAC,MAAM,IAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAQpB,CACP,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ThemeColorButton: ({ color, onSettingChange, settings }: any) => React.JSX.Element;
3
+ export default ThemeColorButton;
@@ -0,0 +1,24 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import { Pressable, Box } from '@gluestack-ui/themed';
14
+ const ThemeColorButton = ({ color, onSettingChange, settings }) => {
15
+ return (React.createElement(Pressable, { backgroundColor: color, height: '$4', width: '$4', borderRadius: '$sm', onPress: () => {
16
+ let { primaryColor } = settings, rest = __rest(settings, ["primaryColor"]);
17
+ primaryColor = color;
18
+ const newSettings = Object.assign(Object.assign({}, rest), { primaryColor });
19
+ onSettingChange(newSettings);
20
+ } },
21
+ React.createElement(Box, null)));
22
+ };
23
+ export default ThemeColorButton;
24
+ //# sourceMappingURL=ThemeColorButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeColorButton.js","sourceRoot":"","sources":["../../../../../src/components/Layout/components/SettingDrawer/ThemeColorButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAO,EAAE,EAAE;IACnE,OAAO,CACH,oBAAC,SAAS,IACN,eAAe,EAAE,KAAK,EACtB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,IAAI,EACX,YAAY,EAAE,KAAK,EACnB,OAAO,EAAE,GAAG,EAAE;YACV,IAAI,EAAE,YAAY,KAAc,QAAQ,EAAjB,IAAI,UAAK,QAAQ,EAApC,gBAAyB,CAAW,CAAC;YACzC,YAAY,GAAG,KAAK,CAAC;YACrB,MAAM,WAAW,mCACV,IAAI,KACP,YAAY,GACf,CAAC;YACF,eAAe,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;QAED,oBAAC,GAAG,OAAG,CACC,CACf,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './SettingDrawer';
@@ -0,0 +1,2 @@
1
+ export * from './SettingDrawer';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/Layout/components/SettingDrawer/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { MenuDataItem } from '../typings';
3
+ export interface SideBarProps {
4
+ menuData: MenuDataItem[];
5
+ matchUrl: string;
6
+ navTheme: string;
7
+ drawerRef: any;
8
+ }
9
+ declare const SideBar: React.FC<SideBarProps>;
10
+ export default SideBar;
@@ -0,0 +1,59 @@
1
+ import React, { useState } from 'react';
2
+ import { HStack, Text, Box, Divider, FlatList } from '@gluestack-ui/themed';
3
+ import { StyleSheet, TouchableOpacity } from 'react-native';
4
+ import { Ionicons } from '@expo/vector-icons';
5
+ import { Link } from 'react-router-native';
6
+ import { useHistory } from 'react-router-native';
7
+ import { COLOR } from '../../../utils/ThemeColor';
8
+ const SideBar = ({ menuData, matchUrl, navTheme, drawerRef }) => {
9
+ const [icon, setIcon] = useState('chevron-down-outline');
10
+ const [isToggle, setToggle] = useState(false);
11
+ const history = useHistory();
12
+ const toggle = () => {
13
+ if (isToggle) {
14
+ setIcon('chevron-down-outline');
15
+ setToggle(false);
16
+ }
17
+ else {
18
+ setIcon('chevron-up-outline');
19
+ setToggle(true);
20
+ }
21
+ };
22
+ const isMenuExist = menuData.length > 0;
23
+ const openMenuItem = (menu) => {
24
+ history.push({ pathname: menu.path, state: menu.name });
25
+ drawerRef.current.closeDrawer();
26
+ };
27
+ return (React.createElement(Box, { flex: 1, style: { backgroundColor: navTheme === 'dark' ? COLOR.GREYISH_BLACK : COLOR.WHITE } }, !!isMenuExist && (React.createElement(FlatList, { data: menuData, renderItem: ({ item }) => {
28
+ const keys = item === null || item === void 0 ? void 0 : item.key.split('.');
29
+ const arrowIcon = icon || 'chevron-down-outline';
30
+ return (item === null || item === void 0 ? void 0 : item.routes) ? (React.createElement(Box, { p: "$3" },
31
+ React.createElement(TouchableOpacity, { onPress: () => toggle() },
32
+ React.createElement(HStack, null,
33
+ React.createElement(Ionicons, { color: isToggle ? '#fff' : '#a1a1a1', name: "document-outline" }),
34
+ React.createElement(Text, { style: { color: isToggle ? '#fff' : '#a1a1a1' } }, item.name),
35
+ React.createElement(Ionicons, { name: arrowIcon }))),
36
+ isToggle
37
+ ? item.routes.map((subMenu) => (React.createElement(Box, { key: subMenu.key },
38
+ React.createElement(Link, { to: subMenu.path, underlayColor: "#f0f4f7" },
39
+ React.createElement(Text, { style: { color: '#a1a1a1' } }, subMenu.name)))))
40
+ : null)) : (keys[0] != 'Main' && keys[0] == 'sidebar' && (React.createElement(Box, { key: item.key, p: "$3" },
41
+ React.createElement(TouchableOpacity, { style: { marginBottom: 10 }, onPress: () => openMenuItem(item) },
42
+ React.createElement(HStack, null,
43
+ React.createElement(Ionicons, { size: 20, color: navTheme === 'dark' ? COLOR.LIGHT_GREY : COLOR.BLACK, name: item.icon }),
44
+ React.createElement(Text, { style: {
45
+ color: navTheme === 'dark' ? COLOR.LIGHT_GREY : COLOR.BLACK,
46
+ marginLeft: 10,
47
+ } }, item.name))),
48
+ React.createElement(Divider, null))));
49
+ } }))));
50
+ };
51
+ const styles = StyleSheet.create({
52
+ header: {
53
+ marginLeft: 20,
54
+ marginTop: 10,
55
+ marginBottom: 10,
56
+ },
57
+ });
58
+ export default SideBar;
59
+ //# sourceMappingURL=SideBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideBar.js","sourceRoot":"","sources":["../../../../src/components/Layout/components/SideBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAQ,IAAI,EAAE,GAAG,EAAa,OAAO,EAAU,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AASlD,MAAM,OAAO,GAA2B,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IACpF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACzD,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,OAAO,GAA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,KAAK,EAC3D,IAAI,EAAE,IAAI,CAAC,IAAI,GACjB;wBACF,oBAAC,IAAI,IACD,KAAK,EAAE;gCACH,KAAK,EAAE,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;gCAC3D,UAAU,EAAE,EAAE;6BACjB,IAEA,IAAI,CAAC,IAAI,CACP,CACF,CACM;gBACnB,oBAAC,OAAO,OAAG,CACT,CACT,CACJ,CAAC;QACN,CAAC,GACH,CACL,CACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC7B,MAAM,EAAE;QACJ,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,EAAE;KACnB;CACJ,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { RenderSetting, ContentWidth, PureSettings, ProSettings } from '@admin-layout/client';
2
+ export { ContentWidth, PureSettings, RenderSetting, ProSettings };
3
+ declare const defaultSettings: ProSettings;
4
+ export default defaultSettings;
@@ -0,0 +1,16 @@
1
+ const defaultSettings = {
2
+ navTheme: 'dark',
3
+ layout: 'side',
4
+ contentWidth: 'Fluid',
5
+ fixedHeader: false,
6
+ fixSiderbar: false,
7
+ menu: {
8
+ locale: false,
9
+ },
10
+ headerHeight: 48,
11
+ title: 'CDMBase LLC',
12
+ iconfontUrl: '',
13
+ primaryColor: '#1890ff',
14
+ };
15
+ export default defaultSettings;
16
+ //# sourceMappingURL=defaultSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultSettings.js","sourceRoot":"","sources":["../../../../src/components/Layout/components/defaultSettings.ts"],"names":[],"mappings":"AAIA,MAAM,eAAe,GAAgB;IACjC,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,KAAK;IAClB,IAAI,EAAE;QACF,MAAM,EAAE,KAAK;KAChB;IACD,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,SAAS;CAC1B,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './Drawer';
2
+ export * from './BottomTabBar';
3
+ export * from './Header';
4
+ export * from './Sample';
@@ -0,0 +1,5 @@
1
+ export * from './Drawer';
2
+ export * from './BottomTabBar';
3
+ export * from './Header';
4
+ export * from './Sample';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Layout/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const generateMenuPath: (path: any, params: any) => string;
@@ -0,0 +1,15 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import { generatePath } from 'react-router';
3
+ export const generateMenuPath = (path, params) => {
4
+ try {
5
+ const generatedPath = generatePath(path, params);
6
+ return generatedPath;
7
+ }
8
+ catch (err) {
9
+ console.log('--fillParams.path', path);
10
+ console.log('--fillParams.params', params);
11
+ console.log('generatePath is errored due to missing orgId');
12
+ }
13
+ return null;
14
+ };
15
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/components/Layout/components/util.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;IAC7C,IAAI;QACA,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACjD,OAAO,aAAa,CAAC;KACxB;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;KAC/D;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Feature } from '@common-stack/client-react';
2
+ export declare const appDrawerFeature: (props: any) => Feature;
3
+ export declare const appDrawerBottomTabFeature: (props: any) => Feature;
4
+ export declare const appBottomTabFeature: (props: any) => Feature;
5
+ export declare const appHostBottomTabFeature: (props: any) => Feature;
6
+ export declare const appBottomTabDrawerFeature: Feature;
@@ -0,0 +1,316 @@
1
+ import React from 'react';
2
+ import { Feature } from '@common-stack/client-react';
3
+ import { createDrawerNavigator } from '@react-navigation/drawer';
4
+ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
5
+ import { Drawer, BottomTabBar, Header } from './components';
6
+ import { AntDesign } from '@expo/vector-icons';
7
+ import { navigationRef } from '@common-stack/client-react';
8
+ const layoutSettingConfig = process.APP_ENV && process.APP_ENV.LAYOUT_SETTINGS ? JSON.parse(process.APP_ENV.LAYOUT_SETTINGS) : null;
9
+ const headerSettings = layoutSettingConfig
10
+ ? {
11
+ showToggle: layoutSettingConfig.hasOwnProperty('topLeftToggle')
12
+ ? layoutSettingConfig.topLeftToggle
13
+ ? true
14
+ : false
15
+ : true,
16
+ rightSettingToggle: layoutSettingConfig.hasOwnProperty('topRightSettingToggle')
17
+ ? layoutSettingConfig.topRightSettingToggle
18
+ ? true
19
+ : false
20
+ : true,
21
+ }
22
+ : { showToggle: true, rightSettingToggle: true };
23
+ const drawerConfig = (props) => {
24
+ var _a;
25
+ let drawerProps = (_a = props === null || props === void 0 ? void 0 : props.drawerConfig) !== null && _a !== void 0 ? _a : null;
26
+ return {
27
+ ['//main_drawer']: {
28
+ exact: false,
29
+ container: createDrawerNavigator(),
30
+ name: 'Layout',
31
+ props: {
32
+ initialRouteName: 'MainStack.Layout.Home',
33
+ drawerContent: (props) => {
34
+ var _a, _b, _c;
35
+ let currentRoute = navigationRef.isReady() ? navigationRef === null || navigationRef === void 0 ? void 0 : navigationRef.getCurrentRoute() : null;
36
+ let currentOptions = ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _a === void 0 ? void 0 : _a.options)
37
+ ? JSON.parse((_b = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _b === void 0 ? void 0 : _b.options)
38
+ : null;
39
+ let drawerOptions = Object.assign(Object.assign({}, currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.drawerOption), drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.drawerOption);
40
+ return React.createElement((_c = drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.drawerContent) !== null && _c !== void 0 ? _c : Drawer, Object.assign({}, props, Object.assign({ title: 'ClockBook', titleColor: 'black', logout: true, redirect: 'MainStack.Login' }, drawerOptions)));
41
+ },
42
+ screenOptions: (options) => {
43
+ var _a, _b, _c, _d, _e, _f;
44
+ let currentRoute = navigationRef.isReady() ? navigationRef === null || navigationRef === void 0 ? void 0 : navigationRef.getCurrentRoute() : null;
45
+ let currentOptions = ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _a === void 0 ? void 0 : _a.options)
46
+ ? JSON.parse((_b = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _b === void 0 ? void 0 : _b.options)
47
+ : null;
48
+ return {
49
+ headerShown: true,
50
+ header: (props) => (React.createElement(Header, Object.assign({ showToggle: headerSettings && headerSettings.showToggle ? headerSettings.showToggle : false, right: headerSettings && headerSettings.rightSettingToggle
51
+ ? headerSettings.rightSettingToggle
52
+ : false }, props))),
53
+ drawerIcon: 'grid',
54
+ drawerStyle: (_d = (_c = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.drawerStyle) !== null && _c !== void 0 ? _c : drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.drawerStyle) !== null && _d !== void 0 ? _d : {},
55
+ gestureEnabled: (_e = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.gestureEnabled) !== null && _e !== void 0 ? _e : true,
56
+ swipeEnabled: (_f = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.swipeEnabled) !== null && _f !== void 0 ? _f : true,
57
+ };
58
+ },
59
+ },
60
+ },
61
+ };
62
+ };
63
+ const bottomTabConfig = (props) => {
64
+ var _a;
65
+ let tabBarProps = (_a = props === null || props === void 0 ? void 0 : props.tabBarConfig) !== null && _a !== void 0 ? _a : null;
66
+ return {
67
+ ['//bottom_tab']: {
68
+ exact: false,
69
+ container: createBottomTabNavigator(),
70
+ name: 'Layout',
71
+ props: {
72
+ initialRouteName: 'MainStack.Layout.Home',
73
+ //tabBar: (props: any) => <BottomTabBar {...props} />,
74
+ tabBar: (props) => {
75
+ var _a;
76
+ return React.createElement((_a = tabBarProps === null || tabBarProps === void 0 ? void 0 : tabBarProps.bottomTabBar) !== null && _a !== void 0 ? _a : BottomTabBar, Object.assign({}, props));
77
+ },
78
+ screenOptions: ({ route }) => {
79
+ return {
80
+ headerShown: false,
81
+ title: 'Home',
82
+ headerTitle: 'Home',
83
+ tabBarActiveTintColor: '#4c87f9',
84
+ tabBarInactiveTintColor: 'black',
85
+ tabBarIcon: ({ color }) => React.createElement(AntDesign, { name: 'search1', color: color, size: 24 }),
86
+ };
87
+ },
88
+ },
89
+ },
90
+ };
91
+ };
92
+ const hostBottomTabConfig = (props) => {
93
+ var _a;
94
+ let tabBarProps = (_a = props === null || props === void 0 ? void 0 : props.tabBarConfig) !== null && _a !== void 0 ? _a : null;
95
+ return {
96
+ ['//host_tab']: {
97
+ container: createBottomTabNavigator(),
98
+ exact: false,
99
+ name: 'Layout',
100
+ props: {
101
+ initialRouteName: 'MainStack.Layout.Home',
102
+ //tabBar: (props: any) => <BottomTabBar {...props} />,
103
+ tabBar: (props) => {
104
+ var _a;
105
+ return React.createElement((_a = tabBarProps === null || tabBarProps === void 0 ? void 0 : tabBarProps.bottomTabBar) !== null && _a !== void 0 ? _a : BottomTabBar, Object.assign({}, props));
106
+ },
107
+ screenOptions: (props) => {
108
+ return {
109
+ headerShown: false,
110
+ title: 'Home',
111
+ headerTitle: 'Home',
112
+ tabBarActiveTintColor: '#4c87f9',
113
+ tabBarInactiveTintColor: 'black',
114
+ tabBarIcon: ({ color }) => React.createElement(AntDesign, { name: 'search1', color: color, size: 24 }),
115
+ };
116
+ },
117
+ },
118
+ },
119
+ };
120
+ };
121
+ const drawerBottomTabConfig = (props) => {
122
+ var _a, _b;
123
+ let drawerProps = (_a = props === null || props === void 0 ? void 0 : props.drawerConfig) !== null && _a !== void 0 ? _a : null;
124
+ let tabBarProps = (_b = props === null || props === void 0 ? void 0 : props.tabBarConfig) !== null && _b !== void 0 ? _b : null;
125
+ return {
126
+ ['//main_drawer']: {
127
+ exact: false,
128
+ container: createDrawerNavigator(),
129
+ name: 'Layout',
130
+ props: {
131
+ initialRouteName: 'MainStack.Layout.MainBottomTab',
132
+ drawerContent: (props) => {
133
+ var _a, _b, _c;
134
+ let currentRoute = navigationRef.isReady() ? navigationRef === null || navigationRef === void 0 ? void 0 : navigationRef.getCurrentRoute() : null;
135
+ let currentOptions = ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _a === void 0 ? void 0 : _a.options)
136
+ ? JSON.parse((_b = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _b === void 0 ? void 0 : _b.options)
137
+ : null;
138
+ let drawerOptions = Object.assign(Object.assign({}, currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.drawerOption), drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.drawerOption);
139
+ return React.createElement((_c = drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.drawerContent) !== null && _c !== void 0 ? _c : Drawer, Object.assign({}, props, Object.assign({ title: 'ClockBook', titleColor: 'black', logout: true, redirect: 'MainStack.Login' }, drawerOptions)));
140
+ },
141
+ screenOptions: (options) => {
142
+ var _a, _b, _c, _d, _e, _f;
143
+ let currentRoute = navigationRef.isReady() ? navigationRef === null || navigationRef === void 0 ? void 0 : navigationRef.getCurrentRoute() : null;
144
+ let currentOptions = ((_a = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _a === void 0 ? void 0 : _a.options)
145
+ ? JSON.parse((_b = currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.params) === null || _b === void 0 ? void 0 : _b.options)
146
+ : null;
147
+ return {
148
+ headerShown: false,
149
+ drawerIcon: 'grid',
150
+ drawerStyle: (_d = (_c = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.drawerStyle) !== null && _c !== void 0 ? _c : drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.drawerStyle) !== null && _d !== void 0 ? _d : {},
151
+ gestureEnabled: (_e = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.gestureEnabled) !== null && _e !== void 0 ? _e : true,
152
+ swipeEnabled: (_f = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.swipeEnabled) !== null && _f !== void 0 ? _f : true,
153
+ };
154
+ },
155
+ },
156
+ },
157
+ ['//main_drawer/bottom_tab']: {
158
+ container: createBottomTabNavigator(),
159
+ exact: false,
160
+ name: 'MainBottomTab',
161
+ props: {
162
+ initialRouteName: 'MainStack.MainDrawer.MainBottomTab.Home',
163
+ //tabBar: (props: any) => <BottomTabBar {...props} />,
164
+ tabBar: (props) => {
165
+ var _a;
166
+ return React.createElement((_a = tabBarProps === null || tabBarProps === void 0 ? void 0 : tabBarProps.bottomTabBar) !== null && _a !== void 0 ? _a : BottomTabBar, Object.assign({}, props));
167
+ },
168
+ screenOptions: ({ route }) => {
169
+ return {
170
+ headerShown: true,
171
+ header: (props) => (React.createElement(Header, Object.assign({ showToggle: headerSettings && headerSettings.showToggle ? headerSettings.showToggle : false, right: headerSettings && headerSettings.rightSettingToggle
172
+ ? headerSettings.rightSettingToggle
173
+ : false }, props))),
174
+ title: 'Home',
175
+ headerTitle: 'Home',
176
+ tabBarActiveTintColor: '#ff5a60',
177
+ tabBarInactiveTintColor: 'black',
178
+ };
179
+ },
180
+ },
181
+ },
182
+ };
183
+ };
184
+ const bottomTabDrawerConfig = (props) => {
185
+ var _a, _b;
186
+ let drawerProps = (_a = props === null || props === void 0 ? void 0 : props.drawerConfig) !== null && _a !== void 0 ? _a : null;
187
+ let tabBarProps = (_b = props === null || props === void 0 ? void 0 : props.tabBarConfig) !== null && _b !== void 0 ? _b : null;
188
+ return {
189
+ ['//bottom_tab']: {
190
+ container: createBottomTabNavigator(),
191
+ exact: false,
192
+ name: 'Layout',
193
+ props: {
194
+ initialRouteName: 'MainStack.Layout.Home',
195
+ // tabBar: (props: any) => <BottomTabBar {...props} />,
196
+ tabBar: (props) => {
197
+ var _a;
198
+ return React.createElement((_a = tabBarProps === null || tabBarProps === void 0 ? void 0 : tabBarProps.bottomTabBar) !== null && _a !== void 0 ? _a : BottomTabBar, Object.assign({}, props));
199
+ },
200
+ screenOptions: ({ route }) => {
201
+ return {
202
+ headerShown: true,
203
+ header: (props) => (React.createElement(Header, Object.assign({ showToggle: headerSettings && headerSettings.showToggle ? headerSettings.showToggle : false, right: headerSettings && headerSettings.rightSettingToggle
204
+ ? headerSettings.rightSettingToggle
205
+ : false }, props))),
206
+ title: 'Home',
207
+ headerTitle: 'Home',
208
+ tabBarActiveTintColor: '#ff5a60',
209
+ tabBarInactiveTintColor: 'black',
210
+ };
211
+ },
212
+ // screenOptions: ({ route }: any) => {
213
+ // return {
214
+ // headerShown: false,
215
+ // //header: (props: any) => <Header showToggle={true} right={true} {...props} />,
216
+ // title: 'Home',
217
+ // headerTitle: 'Home',
218
+ // tabBarActiveTintColor: '#ff5a60',
219
+ // tabBarInactiveTintColor: 'black',
220
+ // };
221
+ // },
222
+ },
223
+ },
224
+ // ['//bottom_tab/main_drawer']: {
225
+ // exact: false,
226
+ // container: createDrawerNavigator(),
227
+ // name: 'MainDrawer',
228
+ // props: {
229
+ // initialRouteName: 'MainStack.MainBottomTab.MainDrawer.Home',
230
+ // drawerContent: (props: any) => (
231
+ // <Drawer
232
+ // {...props}
233
+ // title={'ClockBook'}
234
+ // titleColor={'black'}
235
+ // logout={true}
236
+ // redirect={'MainStack.Login'}
237
+ // />
238
+ // ),
239
+ // screenOptions:(options:any) =>{
240
+ // return{
241
+ // headerShown: true,
242
+ // header: (props: any) => <Header showToggle={true} right={true} {...props} />,
243
+ // drawerIcon: 'grid',
244
+ // }
245
+ // }
246
+ // },
247
+ // },
248
+ };
249
+ };
250
+ // const bottomTabDrawerConfig = {
251
+ // ['//bottom_tab']: {
252
+ // container: createBottomTabNavigator(),
253
+ // exact: false,
254
+ // name: 'Layout',
255
+ // props: {
256
+ // initialRouteName: 'MainStack.Layout.Home',
257
+ // tabBar: (props: any) => <BottomTabBar {...props} />,
258
+ // screenOptions: ({ route }: any) => {
259
+ // return {
260
+ // headerShown: false,
261
+ // //header: (props: any) => <Header showToggle={true} right={true} {...props} />,
262
+ // title: 'Home',
263
+ // headerTitle: 'Home',
264
+ // tabBarActiveTintColor: '#ff5a60',
265
+ // tabBarInactiveTintColor: 'black',
266
+ // };
267
+ // },
268
+ // },
269
+ // },
270
+ // // ['//bottom_tab/main_drawer']: {
271
+ // // exact: false,
272
+ // // container: createDrawerNavigator(),
273
+ // // name: 'MainDrawer',
274
+ // // props: {
275
+ // // initialRouteName: 'MainStack.MainBottomTab.MainDrawer.Home',
276
+ // // drawerContent: (props: any) => (
277
+ // // <Drawer
278
+ // // {...props}
279
+ // // title={'ClockBook'}
280
+ // // titleColor={'black'}
281
+ // // logout={true}
282
+ // // redirect={'MainStack.Login'}
283
+ // // />
284
+ // // ),
285
+ // // screenOptions:(options:any) =>{
286
+ // // return{
287
+ // // headerShown: true,
288
+ // // header: (props: any) => <Header showToggle={true} right={true} {...props} />,
289
+ // // drawerIcon: 'grid',
290
+ // // }
291
+ // // }
292
+ // // },
293
+ // // },
294
+ // };
295
+ // export const appDrawerFeature = new Feature({
296
+ // routeConfig: drawerConfig as any,
297
+ // });
298
+ // export const appDrawerBottomTabFeature = new Feature({
299
+ // routeConfig: drawerBottomTabConfig as any,
300
+ // });
301
+ export const appDrawerFeature = (props) => new Feature({
302
+ routeConfig: drawerConfig(props),
303
+ });
304
+ export const appDrawerBottomTabFeature = (props) => new Feature({
305
+ routeConfig: drawerBottomTabConfig(props),
306
+ });
307
+ export const appBottomTabFeature = (props) => new Feature({
308
+ routeConfig: bottomTabConfig(props),
309
+ });
310
+ export const appHostBottomTabFeature = (props) => new Feature({
311
+ routeConfig: hostBottomTabConfig(props),
312
+ });
313
+ export const appBottomTabDrawerFeature = new Feature({
314
+ routeConfig: bottomTabDrawerConfig,
315
+ });
316
+ //# sourceMappingURL=compute.js.map