@j2inn/fin5-ui-utils 5.2.2-beta.9 → 6.0.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 (231) hide show
  1. package/README.md +5 -5
  2. package/dist/fantomProps/createFin5Props/index.d.ts +12 -12
  3. package/dist/fantomProps/createFin5Props/index.js +146 -146
  4. package/dist/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  5. package/dist/fantomProps/createFin5Props/runCreateFin5Props.js +16 -16
  6. package/dist/fantomProps/fantomPropsToObject.d.ts +8 -8
  7. package/dist/fantomProps/fantomPropsToObject.js +183 -183
  8. package/dist/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  9. package/dist/fantomProps/generateJsonFromFantomPropsFile.js +41 -41
  10. package/dist/fantomProps/localePropsToJson.d.ts +1 -1
  11. package/dist/fantomProps/localePropsToJson.js +50 -50
  12. package/dist/fantomProps/readFantomPropsFile.d.ts +5 -5
  13. package/dist/fantomProps/readFantomPropsFile.js +61 -61
  14. package/dist/fin5Top/fin5FileUpload.d.ts +24 -24
  15. package/dist/fin5Top/fin5FileUpload.js +51 -51
  16. package/dist/fin5Top/fin5Top.d.ts +124 -124
  17. package/dist/fin5Top/fin5Top.js +58 -58
  18. package/dist/fin5Top/finEdge2Cloud.d.ts +6 -6
  19. package/dist/fin5Top/finEdge2Cloud.js +15 -15
  20. package/dist/fin5Top/getFin5BinUrl.d.ts +2 -2
  21. package/dist/fin5Top/getFin5BinUrl.js +9 -9
  22. package/dist/fin5Top/openFin5Alarm.d.ts +22 -22
  23. package/dist/fin5Top/openFin5Alarm.js +23 -23
  24. package/dist/fin5Top/openFin5Historian.d.ts +3 -3
  25. package/dist/fin5Top/openFin5Historian.js +19 -19
  26. package/dist/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  27. package/dist/fin5Top/useFin5AppURLHashParameter.js +133 -133
  28. package/dist/index.d.ts +31 -36
  29. package/dist/index.js +65 -70
  30. package/dist/index.js.map +1 -1
  31. package/dist/jobs/jobUtils.d.ts +14 -14
  32. package/dist/jobs/jobUtils.js +15 -15
  33. package/dist/react/app/Fin5AppContainer.d.ts +36 -36
  34. package/dist/react/app/Fin5AppContainer.js +102 -102
  35. package/dist/react/app/Fin5AppRootStore.d.ts +38 -39
  36. package/dist/react/app/Fin5AppRootStore.js +68 -69
  37. package/dist/react/app/Fin5AppRootStore.js.map +1 -1
  38. package/dist/react/components/ErrorBoundary.d.ts +57 -57
  39. package/dist/react/components/ErrorBoundary.js +150 -150
  40. package/dist/react/components/ErrorDisplayer.d.ts +19 -19
  41. package/dist/react/components/ErrorDisplayer.js +36 -36
  42. package/dist/react/components/Loader.d.ts +9 -9
  43. package/dist/react/components/Loader.js +17 -17
  44. package/dist/react/components/LoadingSpinner.d.ts +2 -2
  45. package/dist/react/components/LoadingSpinner.js +27 -27
  46. package/dist/react/components/RecordImage.d.ts +20 -20
  47. package/dist/react/components/RecordImage.js +51 -51
  48. package/dist/react/components/charts/QRCode.d.ts +25 -25
  49. package/dist/react/components/charts/QRCode.js +81 -82
  50. package/dist/react/components/charts/QRCode.js.map +1 -1
  51. package/dist/react/components/charts/pie/PieChart.d.ts +93 -94
  52. package/dist/react/components/charts/pie/PieChart.js +202 -204
  53. package/dist/react/components/charts/pie/PieChart.js.map +1 -1
  54. package/dist/react/components/charts/pie/SimplePieChart.d.ts +20 -21
  55. package/dist/react/components/charts/pie/SimplePieChart.js +55 -55
  56. package/dist/react/components/charts/pie/SimplePieChart.js.map +1 -1
  57. package/dist/react/components/graphics/GraphicViewer.d.ts +10 -10
  58. package/dist/react/components/graphics/GraphicViewer.js +29 -29
  59. package/dist/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  60. package/dist/react/components/graphics/GraphicsTabViewer.js +90 -90
  61. package/dist/react/components/navigation/BasicLayout.d.ts +41 -41
  62. package/dist/react/components/navigation/BasicLayout.js +155 -155
  63. package/dist/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  64. package/dist/react/components/navigation/HeaderSiderLayout.js +110 -110
  65. package/dist/react/components/navigation/MenuPage.d.ts +37 -37
  66. package/dist/react/components/navigation/MenuPage.js +36 -36
  67. package/dist/react/components/navigation/MenuTrigger.d.ts +9 -9
  68. package/dist/react/components/navigation/MenuTrigger.js +33 -33
  69. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  70. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js +25 -25
  71. package/dist/react/components/navigation/ReactRouterLayout.d.ts +46 -46
  72. package/dist/react/components/navigation/ReactRouterLayout.js +132 -132
  73. package/dist/react/components/navigation/customRouting/Router.d.ts +12 -12
  74. package/dist/react/components/navigation/customRouting/Router.js +45 -45
  75. package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  76. package/dist/react/components/navigation/customRouting/RouterLayout.js +61 -61
  77. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +27 -27
  78. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js +95 -95
  79. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +16 -16
  80. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +88 -88
  81. package/dist/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  82. package/dist/react/components/resolvable/configurationForm/getSectionDefault.js +99 -99
  83. package/dist/react/hooks/useFin5BinUrl.d.ts +6 -6
  84. package/dist/react/hooks/useFin5BinUrl.js +15 -15
  85. package/dist/react/hooks/useFin5ColorScheme.d.ts +2 -2
  86. package/dist/react/hooks/useFin5ColorScheme.js +42 -42
  87. package/dist_es/fantomProps/createFin5Props/index.d.ts +12 -12
  88. package/dist_es/fantomProps/createFin5Props/index.js +140 -140
  89. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  90. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js +11 -11
  91. package/dist_es/fantomProps/fantomPropsToObject.d.ts +8 -8
  92. package/dist_es/fantomProps/fantomPropsToObject.js +178 -178
  93. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  94. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.js +12 -12
  95. package/dist_es/fantomProps/localePropsToJson.d.ts +1 -1
  96. package/dist_es/fantomProps/localePropsToJson.js +21 -21
  97. package/dist_es/fantomProps/readFantomPropsFile.d.ts +5 -5
  98. package/dist_es/fantomProps/readFantomPropsFile.js +35 -35
  99. package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -24
  100. package/dist_es/fin5Top/fin5FileUpload.js +47 -47
  101. package/dist_es/fin5Top/fin5Top.d.ts +124 -124
  102. package/dist_es/fin5Top/fin5Top.js +54 -54
  103. package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -6
  104. package/dist_es/fin5Top/finEdge2Cloud.js +11 -11
  105. package/dist_es/fin5Top/getFin5BinUrl.d.ts +2 -2
  106. package/dist_es/fin5Top/getFin5BinUrl.js +5 -5
  107. package/dist_es/fin5Top/openFin5Alarm.d.ts +22 -22
  108. package/dist_es/fin5Top/openFin5Alarm.js +19 -19
  109. package/dist_es/fin5Top/openFin5Historian.d.ts +3 -3
  110. package/dist_es/fin5Top/openFin5Historian.js +15 -15
  111. package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  112. package/dist_es/fin5Top/useFin5AppURLHashParameter.js +124 -124
  113. package/dist_es/index.d.ts +31 -36
  114. package/dist_es/index.js +49 -54
  115. package/dist_es/index.js.map +1 -1
  116. package/dist_es/jobs/jobUtils.d.ts +14 -14
  117. package/dist_es/jobs/jobUtils.js +9 -9
  118. package/dist_es/react/app/Fin5AppContainer.d.ts +36 -36
  119. package/dist_es/react/app/Fin5AppContainer.js +73 -73
  120. package/dist_es/react/app/Fin5AppRootStore.d.ts +38 -39
  121. package/dist_es/react/app/Fin5AppRootStore.js +64 -65
  122. package/dist_es/react/app/Fin5AppRootStore.js.map +1 -1
  123. package/dist_es/react/components/ErrorBoundary.d.ts +57 -57
  124. package/dist_es/react/components/ErrorBoundary.js +123 -123
  125. package/dist_es/react/components/ErrorDisplayer.d.ts +19 -19
  126. package/dist_es/react/components/ErrorDisplayer.js +28 -28
  127. package/dist_es/react/components/Loader.d.ts +9 -9
  128. package/dist_es/react/components/Loader.js +12 -12
  129. package/dist_es/react/components/LoadingSpinner.d.ts +2 -2
  130. package/dist_es/react/components/LoadingSpinner.js +20 -20
  131. package/dist_es/react/components/RecordImage.d.ts +20 -20
  132. package/dist_es/react/components/RecordImage.js +24 -24
  133. package/dist_es/react/components/charts/QRCode.d.ts +25 -25
  134. package/dist_es/react/components/charts/QRCode.js +53 -52
  135. package/dist_es/react/components/charts/QRCode.js.map +1 -1
  136. package/dist_es/react/components/charts/pie/PieChart.d.ts +93 -94
  137. package/dist_es/react/components/charts/pie/PieChart.js +175 -177
  138. package/dist_es/react/components/charts/pie/PieChart.js.map +1 -1
  139. package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +20 -21
  140. package/dist_es/react/components/charts/pie/SimplePieChart.js +25 -25
  141. package/dist_es/react/components/charts/pie/SimplePieChart.js.map +1 -1
  142. package/dist_es/react/components/graphics/GraphicViewer.d.ts +10 -10
  143. package/dist_es/react/components/graphics/GraphicViewer.js +22 -22
  144. package/dist_es/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  145. package/dist_es/react/components/graphics/GraphicsTabViewer.js +60 -60
  146. package/dist_es/react/components/navigation/BasicLayout.d.ts +41 -41
  147. package/dist_es/react/components/navigation/BasicLayout.js +124 -124
  148. package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  149. package/dist_es/react/components/navigation/HeaderSiderLayout.js +80 -80
  150. package/dist_es/react/components/navigation/MenuPage.d.ts +37 -37
  151. package/dist_es/react/components/navigation/MenuPage.js +30 -30
  152. package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -9
  153. package/dist_es/react/components/navigation/MenuTrigger.js +28 -28
  154. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  155. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +18 -18
  156. package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +46 -46
  157. package/dist_es/react/components/navigation/ReactRouterLayout.js +99 -99
  158. package/dist_es/react/components/navigation/customRouting/Router.d.ts +12 -12
  159. package/dist_es/react/components/navigation/customRouting/Router.js +18 -18
  160. package/dist_es/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  161. package/dist_es/react/components/navigation/customRouting/RouterLayout.js +34 -34
  162. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +27 -27
  163. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js +64 -64
  164. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +16 -16
  165. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +58 -58
  166. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  167. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js +94 -94
  168. package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -6
  169. package/dist_es/react/hooks/useFin5BinUrl.js +11 -11
  170. package/dist_es/react/hooks/useFin5ColorScheme.d.ts +2 -2
  171. package/dist_es/react/hooks/useFin5ColorScheme.js +38 -38
  172. package/package.json +8 -11
  173. package/dist/react/components/charts/line-bar/Chart.d.ts +0 -166
  174. package/dist/react/components/charts/line-bar/Chart.js +0 -443
  175. package/dist/react/components/charts/line-bar/Chart.js.map +0 -1
  176. package/dist/react/components/charts/line-bar/HGridChart.d.ts +0 -58
  177. package/dist/react/components/charts/line-bar/HGridChart.js +0 -289
  178. package/dist/react/components/charts/line-bar/HGridChart.js.map +0 -1
  179. package/dist/react/components/charts/line-bar/ZincGridChart.d.ts +0 -12
  180. package/dist/react/components/charts/line-bar/ZincGridChart.js +0 -24
  181. package/dist/react/components/charts/line-bar/ZincGridChart.js.map +0 -1
  182. package/dist/react/components/makeCustomElement.d.ts +0 -12
  183. package/dist/react/components/makeCustomElement.js +0 -140
  184. package/dist/react/components/makeCustomElement.js.map +0 -1
  185. package/dist/react/hooks/useScreenSize.d.ts +0 -8
  186. package/dist/react/hooks/useScreenSize.js +0 -31
  187. package/dist/react/hooks/useScreenSize.js.map +0 -1
  188. package/dist_es/react/app/Fin5AppContainer.jsx +0 -82
  189. package/dist_es/react/app/Fin5AppContainer.jsx.map +0 -1
  190. package/dist_es/react/components/ErrorBoundary.jsx +0 -150
  191. package/dist_es/react/components/ErrorBoundary.jsx.map +0 -1
  192. package/dist_es/react/components/ErrorDisplayer.jsx +0 -36
  193. package/dist_es/react/components/ErrorDisplayer.jsx.map +0 -1
  194. package/dist_es/react/components/Loader.jsx +0 -13
  195. package/dist_es/react/components/Loader.jsx.map +0 -1
  196. package/dist_es/react/components/LoadingSpinner.jsx +0 -22
  197. package/dist_es/react/components/LoadingSpinner.jsx.map +0 -1
  198. package/dist_es/react/components/charts/line-bar/Chart.d.ts +0 -166
  199. package/dist_es/react/components/charts/line-bar/Chart.js +0 -416
  200. package/dist_es/react/components/charts/line-bar/Chart.js.map +0 -1
  201. package/dist_es/react/components/charts/line-bar/HGridChart.d.ts +0 -58
  202. package/dist_es/react/components/charts/line-bar/HGridChart.js +0 -251
  203. package/dist_es/react/components/charts/line-bar/HGridChart.js.map +0 -1
  204. package/dist_es/react/components/charts/line-bar/ZincGridChart.d.ts +0 -12
  205. package/dist_es/react/components/charts/line-bar/ZincGridChart.js +0 -17
  206. package/dist_es/react/components/charts/line-bar/ZincGridChart.js.map +0 -1
  207. package/dist_es/react/components/graphics/GraphicViewer.jsx +0 -23
  208. package/dist_es/react/components/graphics/GraphicViewer.jsx.map +0 -1
  209. package/dist_es/react/components/graphics/GraphicsTabViewer.jsx +0 -63
  210. package/dist_es/react/components/graphics/GraphicsTabViewer.jsx.map +0 -1
  211. package/dist_es/react/components/makeCustomElement.d.ts +0 -12
  212. package/dist_es/react/components/makeCustomElement.js +0 -132
  213. package/dist_es/react/components/makeCustomElement.js.map +0 -1
  214. package/dist_es/react/components/navigation/BasicLayout.jsx +0 -133
  215. package/dist_es/react/components/navigation/BasicLayout.jsx.map +0 -1
  216. package/dist_es/react/components/navigation/MenuPage.jsx +0 -31
  217. package/dist_es/react/components/navigation/MenuPage.jsx.map +0 -1
  218. package/dist_es/react/components/navigation/Router.d.ts +0 -12
  219. package/dist_es/react/components/navigation/Router.js +0 -19
  220. package/dist_es/react/components/navigation/Router.js.map +0 -1
  221. package/dist_es/react/components/navigation/Router.jsx +0 -19
  222. package/dist_es/react/components/navigation/Router.jsx.map +0 -1
  223. package/dist_es/react/components/navigation/react-router/BasicLayout.d.ts +0 -23
  224. package/dist_es/react/components/navigation/react-router/BasicLayout.js +0 -82
  225. package/dist_es/react/components/navigation/react-router/BasicLayout.js.map +0 -1
  226. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.d.ts +0 -24
  227. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.js +0 -82
  228. package/dist_es/react/components/navigation/react-router/ReactRouterBasicLayout.js.map +0 -1
  229. package/dist_es/react/hooks/useScreenSize.d.ts +0 -8
  230. package/dist_es/react/hooks/useScreenSize.js +0 -29
  231. package/dist_es/react/hooks/useScreenSize.js.map +0 -1
@@ -1,133 +0,0 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
5
- import { Button, Layout, Menu } from '@j2inn/ui';
6
- import classNames from 'classnames';
7
- import React, { useEffect, useMemo, useState } from 'react';
8
- import { createUseStyles } from 'react-jss';
9
- import { ErrorDisplayer } from '../ErrorDisplayer';
10
- import { findPageByName } from './MenuPage';
11
- import { Router } from './Router';
12
- const HEADER_HEIGHT = 45;
13
- const useStyles = createUseStyles((theme) => {
14
- return {
15
- header: {
16
- position: 'fixed',
17
- width: '100%',
18
- zIndex: 1000,
19
- padding: 0,
20
- height: HEADER_HEIGHT,
21
- lineHeight: '45px',
22
- },
23
- sider: {
24
- overflow: 'auto',
25
- height: '100vh',
26
- position: 'fixed',
27
- left: 0,
28
- top: 0,
29
- bottom: 0,
30
- zIndex: 999,
31
- paddingTop: ({ isMobile }) => isMobile ? HEADER_HEIGHT : 0,
32
- },
33
- menuTrigger: {
34
- width: 45,
35
- height: '100%',
36
- textAlign: 'center',
37
- fontSize: 18,
38
- cursor: 'pointer',
39
- transition: 'color 0.3s ease-in-out',
40
- backgroundColor: 'transparent',
41
- color: 'white',
42
- '&:hover': {
43
- color: theme.linkActiveColor,
44
- },
45
- },
46
- content: ({ isMobile, compactSider, siderWidth = 200, }) => ({
47
- paddingLeft: isMobile ? 0 : compactSider ? 45 : siderWidth,
48
- paddingTop: isMobile ? HEADER_HEIGHT : 0,
49
- }),
50
- };
51
- });
52
- // Workaround j2inn/ui exporting problem
53
- const Header = Layout.Header;
54
- const Sider = Layout.Sider;
55
- const Content = Layout.Content;
56
- /**
57
- * Copy the array and recursively remove pages having the `showInMenu` flag set to false.
58
- * @param pages
59
- * @returns
60
- */
61
- const getMenuPages = (pages) => {
62
- const menuPages = [];
63
- pages.forEach((page) => {
64
- const show = page.showInMenu == null || page.showInMenu;
65
- if (show) {
66
- const copiedPage = Object.assign({}, page);
67
- if (copiedPage.children) {
68
- const filteredChildren = getMenuPages(copiedPage.children);
69
- copiedPage.children = filteredChildren.length
70
- ? filteredChildren
71
- : undefined;
72
- }
73
- menuPages.push(copiedPage);
74
- }
75
- });
76
- return menuPages;
77
- };
78
- /**
79
- * Basic layout that combines menu and routing into one.
80
- */
81
- export const BasicLayout = ({ pages = [], defaultPage = pages?.[0].key ?? '', onPageChange, compactSider, layoutProps, mobileHeaderProps, siderProps, contentProps, menuProps, page, }) => {
82
- const [currentPage, setCurrentPage] = useState(page ?? defaultPage);
83
- useEffect(() => {
84
- if (page) {
85
- setCurrentPage(page);
86
- }
87
- }, [page]);
88
- // Fire onChange
89
- useEffect(() => {
90
- onPageChange?.(currentPage);
91
- }, [currentPage]);
92
- // manage mobile navigation
93
- const [isMobile, setIsMobile] = useState(false);
94
- const [hiddenSider, setHiddenSider] = useState(false);
95
- const siderWidth = siderProps?.width;
96
- const classes = useStyles({ isMobile, compactSider, siderWidth });
97
- const menuPages = useMemo(() => getMenuPages(pages), [pages]);
98
- return (<Layout hasSider {...layoutProps}>
99
- {isMobile && (<Header {...mobileHeaderProps} className={classNames(classes.header, mobileHeaderProps?.className)}>
100
- {hiddenSider ? (<MenuUnfoldOutlined className={classes.menuTrigger} onClick={() => {
101
- setHiddenSider(!hiddenSider);
102
- }}/>) : (<MenuFoldOutlined className={classes.menuTrigger} onClick={() => {
103
- setHiddenSider(!hiddenSider);
104
- }}/>)}
105
- </Header>)}
106
- <Sider {...siderProps} className={classNames(classes.sider, siderProps?.className)} breakpoint='md' onBreakpoint={(broken) => {
107
- setIsMobile(broken);
108
- setHiddenSider(true);
109
- }} collapsed={(isMobile && hiddenSider) || compactSider} collapsedWidth={isMobile && hiddenSider
110
- ? 0
111
- : compactSider
112
- ? HEADER_HEIGHT
113
- : 0} trigger={null}>
114
- <Menu {...menuProps} items={menuPages} selectedKeys={[currentPage]} onSelect={({ key }) => {
115
- if (!hiddenSider) {
116
- setHiddenSider(true);
117
- }
118
- const page = findPageByName(pages, key);
119
- if (page?.component) {
120
- setCurrentPage(key);
121
- }
122
- }}/>
123
- </Sider>
124
- <Content {...contentProps} className={classNames(classes.content, contentProps?.className)}>
125
- <Router pages={pages} currentPage={currentPage} fallbackComponent={<ErrorDisplayer error={new Error('Page Not Found')} extra={[
126
- <Button type='primary' key='refresh' onClick={() => setCurrentPage(defaultPage)}>
127
- Go Home
128
- </Button>,
129
- ]}/>}/>
130
- </Content>
131
- </Layout>);
132
- };
133
- //# sourceMappingURL=BasicLayout.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BasicLayout.jsx","sourceRoot":"","sources":["../../../../src/react/components/navigation/BasicLayout.tsx"],"names":[],"mappings":"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,WAAW,CAAC,CAAC,CAC5B,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;YACrB,IAAI,CAAC,WAAW,EAAE;gBACjB,cAAc,CAAC,IAAI,CAAC,CAAA;aACpB;YACD,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;YACvC,IAAI,IAAI,EAAE,SAAS,EAAE;gBACpB,cAAc,CAAC,GAAG,CAAC,CAAA;aACnB;QACF,CAAC,CAAC,EAEJ;GAAA,EAAE,KAAK,CACP;GAAA,CAAC,OAAO,CACP,IAAI,YAAY,CAAC,CACjB,SAAS,CAAC,CAAC,UAAU,CACpB,OAAO,CAAC,OAAO,EACf,YAAY,EAAE,SAAS,CACvB,CAAC,CACF;IAAA,CAAC,MAAM,CACN,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,iBAAiB,CAAC,CACjB,CAAC,cAAc,CACd,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CACnC,KAAK,CAAC,CAAC;gBACN,CAAC,MAAM,CACN,IAAI,CAAC,SAAS,CACd,GAAG,CAAC,SAAS,CACb,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAC3C;;QACD,EAAE,MAAM,CAAC;aACT,CAAC,EACD,CACF,EAEH;GAAA,EAAE,OAAO,CACV;EAAA,EAAE,MAAM,CAAC,CACT,CAAA;AACF,CAAC,CAAA"}
@@ -1,31 +0,0 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- /**
5
- * Retrieve a specific page or subPage from a root page list
6
- * @param name the name of the searched page
7
- * @param pages the list of root pages
8
- */
9
- export function findPageByName(pages, name) {
10
- return pageTreeToPageList(pages).find((page) => page.key === name && !page.disabled);
11
- }
12
- /**
13
- * Expands the list of pages to include all the subpages
14
- */
15
- export function pageTreeToPageList(pages) {
16
- return pages.flatMap((page) => getAllSubPages(page));
17
- }
18
- /**
19
- * Recursively get all the subPages of a root page
20
- * @param page root page
21
- * @returns the whole tree of subPages as a list
22
- */
23
- export function getAllSubPages(page) {
24
- if (page.children) {
25
- return [page].concat(...page.children.map((subPage) => getAllSubPages(subPage)));
26
- }
27
- else {
28
- return [page];
29
- }
30
- }
31
- //# sourceMappingURL=MenuPage.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuPage.jsx","sourceRoot":"","sources":["../../../../src/react/components/navigation/MenuPage.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAyBH;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC7B,KAAU,EACV,IAAa;IAEb,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,IAAI,CACpC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAC7C,CAAA;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAqB,KAAU;IAChE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAS,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAqB,IAAO;IACzD,IAAI,IAAI,CAAC,QAAQ,EAAE;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CACnB,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,OAAY,CAAC,CAAC,CAC/D,CAAA;KACD;SAAM;QACN,OAAO,CAAC,IAAI,CAAC,CAAA;KACb;AACF,CAAC"}
@@ -1,12 +0,0 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { MenuPage } from './MenuPage';
3
- export interface RouterProps<T extends MenuPage> {
4
- pages?: T[];
5
- currentPage: string;
6
- onPageChange?: (selectedPage?: T) => void;
7
- fallbackComponent?: ReactElement;
8
- }
9
- /**
10
- * Renders the currently selected page from a tree of pages
11
- */
12
- export declare function Router<T extends MenuPage>({ pages, currentPage, onPageChange, fallbackComponent, }: PropsWithChildren<RouterProps<T>>): JSX.Element;
@@ -1,19 +0,0 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- import React, { Suspense, useEffect, useMemo, } from 'react';
5
- import { LoadingSpinner } from '../LoadingSpinner';
6
- import { findPageByName } from './MenuPage';
7
- /**
8
- * Renders the currently selected page from a tree of pages
9
- */
10
- export function Router({ pages = [], currentPage, onPageChange, fallbackComponent, }) {
11
- const page = useMemo(() => findPageByName(pages, currentPage), [pages, currentPage]);
12
- useEffect(() => {
13
- onPageChange?.(page);
14
- }, [page]);
15
- return page?.component ? (React.createElement(Suspense, { fallback: React.createElement(LoadingSpinner, null) }, React.createElement(page.component, page?.props))) : (fallbackComponent ?? React.createElement("div", null,
16
- currentPage,
17
- " page not found"));
18
- }
19
- //# sourceMappingURL=Router.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../../src/react/components/navigation/Router.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAGb,QAAQ,EACR,SAAS,EACT,OAAO,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAY,MAAM,YAAY,CAAA;AASrD;;GAEG;AACH,MAAM,UAAU,MAAM,CAAqB,EAC1C,KAAK,GAAG,EAAE,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,GACkB;IACnC,MAAM,IAAI,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,EACxC,CAAC,KAAK,EAAE,WAAW,CAAC,CACpB,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACd,YAAY,EAAE,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,OAAO,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CACxB,oBAAC,QAAQ,IAAC,QAAQ,EAAE,oBAAC,cAAc,OAAG,IACpC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CACvC,CACX,CAAC,CAAC,CAAC,CACH,iBAAiB,IAAI;QAAM,WAAW;0BAAsB,CAC5D,CAAA;AACF,CAAC"}
@@ -1,19 +0,0 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- import React, { Suspense, useEffect, useMemo, } from 'react';
5
- import { LoadingSpinner } from '../LoadingSpinner';
6
- import { findPageByName } from './MenuPage';
7
- /**
8
- * Renders the currently selected page from a tree of pages
9
- */
10
- export function Router({ pages = [], currentPage, onPageChange, fallbackComponent, }) {
11
- const page = useMemo(() => findPageByName(pages, currentPage), [pages, currentPage]);
12
- useEffect(() => {
13
- onPageChange?.(page);
14
- }, [page]);
15
- return page?.component ? (<Suspense fallback={<LoadingSpinner />}>
16
- {React.createElement(page.component, page?.props)}
17
- </Suspense>) : (fallbackComponent ?? <div>{currentPage} page not found</div>);
18
- }
19
- //# sourceMappingURL=Router.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Router.jsx","sourceRoot":"","sources":["../../../../src/react/components/navigation/Router.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAGb,QAAQ,EACR,SAAS,EACT,OAAO,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAY,MAAM,YAAY,CAAA;AASrD;;GAEG;AACH,MAAM,UAAU,MAAM,CAAqB,EAC1C,KAAK,GAAG,EAAE,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,GACkB;IACnC,MAAM,IAAI,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,EACxC,CAAC,KAAK,EAAE,WAAW,CAAC,CACpB,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACd,YAAY,EAAE,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,OAAO,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CACxB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,AAAD,EAAG,CAAC,CACtC;GAAA,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAClD;EAAA,EAAE,QAAQ,CAAC,CACX,CAAC,CAAC,CAAC,CACH,iBAAiB,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,CAAE,eAAc,EAAE,GAAG,CAAC,CAC5D,CAAA;AACF,CAAC"}
@@ -1,23 +0,0 @@
1
- import type { Location } from '@remix-run/router';
2
- import { LayoutProps, MenuProps, SiderProps } from 'antd';
3
- import React from 'react';
4
- import { MenuPage } from '../MenuPage';
5
- export interface BasicLayoutProps {
6
- pages?: MenuPage[];
7
- compactSider?: boolean;
8
- layoutProps?: LayoutProps;
9
- mobileHeaderProps?: LayoutProps;
10
- siderProps?: SiderProps;
11
- contentProps?: LayoutProps;
12
- menuProps?: Omit<MenuProps, 'items' | 'selectedKeys' | 'onSelect'>;
13
- isSelectedRoute?: (page: MenuPage, location: Location) => boolean;
14
- }
15
- /**
16
- * This hook can be used with react-router/BasicLayout,
17
- * to ensure FIN5 URL is aligned with the internal frame URL.
18
- */
19
- export declare const useLocationUpdate: () => void;
20
- /**
21
- * Basic layout that uses React Router.
22
- */
23
- export declare const BasicLayout: React.FC<BasicLayoutProps>;
@@ -1,82 +0,0 @@
1
- /*
2
- * Copyright (c) 2023, J2 Innovations. All Rights Reserved
3
- */
4
- import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
5
- import { Layout, Menu } from '@j2inn/ui';
6
- import classNames from 'classnames';
7
- import { IN_IFRAME, fin5SkipHashUpdate, getFin5HashFrameParameters, getTopLocation, } from 'fin5Top/useFin5AppURLHashParameter';
8
- import React, { useEffect, useMemo, useState } from 'react';
9
- import { Outlet, useLocation, useNavigate } from 'react-router';
10
- import { HEADER_HEIGHT, getMenuPages, useStyles } from '../BasicLayout';
11
- import { pageTreeToPageList } from '../MenuPage';
12
- // Workaround j2inn/ui exporting problem
13
- const Header = Layout.Header;
14
- const Sider = Layout.Sider;
15
- const Content = Layout.Content;
16
- /**
17
- * This hook can be used with react-router/BasicLayout,
18
- * to ensure FIN5 URL is aligned with the internal frame URL.
19
- */
20
- export const useLocationUpdate = () => {
21
- const location = useLocation();
22
- useEffect(() => {
23
- console.debug('Location changed', location);
24
- const hash = location.pathname;
25
- const queryParams = location.search;
26
- if (IN_IFRAME) {
27
- fin5SkipHashUpdate()?.then(() => {
28
- const frameParameters = getFin5HashFrameParameters();
29
- frameParameters.set('url', frameParameters.get('url')?.split('#')[0] +
30
- '#' +
31
- hash +
32
- queryParams);
33
- getTopLocation().hash = `#${getTopLocation().hash.slice(1).split('?')[0]}?${frameParameters.toString()}`;
34
- });
35
- }
36
- }, [location]);
37
- };
38
- const useSelectedRoutes = (pages, isSelectedRoute = (page, location) => location.pathname.includes(`/${page.key}`)) => {
39
- const location = useLocation();
40
- return useMemo(() => {
41
- const flatPages = pageTreeToPageList(pages);
42
- return flatPages
43
- .filter((page) => isSelectedRoute(page, location))
44
- .map((page) => page.key);
45
- }, [location, pages]);
46
- };
47
- /**
48
- * Basic layout that uses React Router.
49
- */
50
- export const BasicLayout = ({ pages = [], compactSider, layoutProps, mobileHeaderProps, siderProps, contentProps, menuProps, isSelectedRoute, }) => {
51
- const navigate = useNavigate();
52
- const selectedRoutes = useSelectedRoutes(pages, isSelectedRoute);
53
- // manage mobile navigation
54
- const [isMobile, setIsMobile] = useState(false);
55
- const [hiddenSider, setHiddenSider] = useState(false);
56
- const siderWidth = siderProps?.width;
57
- const classes = useStyles({ isMobile, compactSider, siderWidth });
58
- const menuPages = useMemo(() => getMenuPages(pages), [pages]);
59
- return (React.createElement(Layout, { hasSider: true, ...layoutProps },
60
- isMobile && (React.createElement(Header, { ...mobileHeaderProps, className: classNames(classes.header, mobileHeaderProps?.className) }, hiddenSider ? (React.createElement(MenuUnfoldOutlined, { className: classes.menuTrigger, onClick: () => {
61
- setHiddenSider(!hiddenSider);
62
- } })) : (React.createElement(MenuFoldOutlined, { className: classes.menuTrigger, onClick: () => {
63
- setHiddenSider(!hiddenSider);
64
- } })))),
65
- React.createElement(Sider, { ...siderProps, className: classNames(classes.sider, siderProps?.className), breakpoint: 'md', onBreakpoint: (broken) => {
66
- setIsMobile(broken);
67
- setHiddenSider(true);
68
- }, collapsed: (isMobile && hiddenSider) || compactSider, collapsedWidth: isMobile && hiddenSider
69
- ? 0
70
- : compactSider
71
- ? HEADER_HEIGHT
72
- : 0, trigger: null },
73
- React.createElement(Menu, { ...menuProps, items: menuPages, selectedKeys: selectedRoutes, onSelect: ({ key }) => {
74
- if (!hiddenSider) {
75
- setHiddenSider(true);
76
- }
77
- navigate(key);
78
- } })),
79
- React.createElement(Content, { ...contentProps, className: classNames(classes.content, contentProps?.className) },
80
- React.createElement(Outlet, null))));
81
- };
82
- //# sourceMappingURL=BasicLayout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BasicLayout.js","sourceRoot":"","sources":["../../../../../src/react/components/navigation/react-router/BasicLayout.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGxC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EACN,SA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a;oBACf,CAAC,CAAC,CAAC,EAEL,OAAO,EAAE,IAAI;YACb,oBAAC,IAAI,OACA,SAAS,EACb,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,cAAc,EAC5B,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;oBACrB,IAAI,CAAC,WAAW,EAAE;wBACjB,cAAc,CAAC,IAAI,CAAC,CAAA;qBACpB;oBACD,QAAQ,CAAC,GAAG,CAAC,CAAA;gBACd,CAAC,GACA,CACK;QACR,oBAAC,OAAO,OACH,YAAY,EAChB,SAAS,EAAE,UAAU,CACpB,OAAO,CAAC,OAAO,EACf,YAAY,EAAE,SAAS,CACvB;YACD,oBAAC,MAAM,OAAG,CACD,CACF,CACT,CAAA;AACF,CAAC,CAAA"}
@@ -1,24 +0,0 @@
1
- import type { Location } from '@remix-run/router';
2
- import { LayoutProps, MenuProps, SiderProps } from 'antd';
3
- import React from 'react';
4
- import { MenuPage } from '../MenuPage';
5
- export interface ReactRouterBasicLayoutProps {
6
- pages?: MenuPage[];
7
- defaultPage?: string;
8
- compactSider?: boolean;
9
- layoutProps?: LayoutProps;
10
- mobileHeaderProps?: LayoutProps;
11
- siderProps?: SiderProps;
12
- contentProps?: LayoutProps;
13
- menuProps?: Omit<MenuProps, 'items' | 'selectedKeys' | 'onSelect'>;
14
- isSelectedRoute?: (page: MenuPage, location: Location) => boolean;
15
- }
16
- /**
17
- * This hook can be used with react-router/BasicLayout,
18
- * to ensure FIN5 URL is aligned with the internal frame URL.
19
- */
20
- export declare const useLocationUpdate: () => void;
21
- /**
22
- * Basic layout that uses React Router.
23
- */
24
- export declare const ReactRouterBasicLayout: React.FC<ReactRouterBasicLayoutProps>;
@@ -1,82 +0,0 @@
1
- /*
2
- * Copyright (c) 2023, J2 Innovations. All Rights Reserved
3
- */
4
- import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
5
- import { Layout, Menu } from '@j2inn/ui';
6
- import classNames from 'classnames';
7
- import React, { useEffect, useMemo, useState } from 'react';
8
- import { Outlet, useLocation, useNavigate } from 'react-router';
9
- import { IN_IFRAME, fin5SkipHashUpdate, getFin5HashFrameParameters, getTopLocation, } from '../../../../fin5Top/useFin5AppURLHashParameter';
10
- import { HEADER_HEIGHT, getMenuPages, useStyles } from '../BasicLayout';
11
- import { pageTreeToPageList } from '../MenuPage';
12
- // Workaround j2inn/ui exporting problem
13
- const Header = Layout.Header;
14
- const Sider = Layout.Sider;
15
- const Content = Layout.Content;
16
- /**
17
- * This hook can be used with react-router/BasicLayout,
18
- * to ensure FIN5 URL is aligned with the internal frame URL.
19
- */
20
- export const useLocationUpdate = () => {
21
- const location = useLocation();
22
- useEffect(() => {
23
- console.debug('Location changed', location);
24
- const hash = location.pathname;
25
- const queryParams = location.search;
26
- if (IN_IFRAME) {
27
- fin5SkipHashUpdate()?.then(() => {
28
- const frameParameters = getFin5HashFrameParameters();
29
- frameParameters.set('url', frameParameters.get('url')?.split('#')[0] +
30
- '#' +
31
- hash +
32
- queryParams);
33
- getTopLocation().hash = `#${getTopLocation().hash.slice(1).split('?')[0]}?${frameParameters.toString()}`;
34
- });
35
- }
36
- }, [location]);
37
- };
38
- const useSelectedRoutes = (pages, isSelectedRoute = (page, location) => location.pathname.includes(`/${page.key}`)) => {
39
- const location = useLocation();
40
- return useMemo(() => {
41
- const flatPages = pageTreeToPageList(pages);
42
- return flatPages
43
- .filter((page) => isSelectedRoute(page, location))
44
- .map((page) => page.key);
45
- }, [location, pages]);
46
- };
47
- /**
48
- * Basic layout that uses React Router.
49
- */
50
- export const ReactRouterBasicLayout = ({ pages = [], defaultPage, compactSider, layoutProps, mobileHeaderProps, siderProps, contentProps, menuProps, isSelectedRoute, }) => {
51
- const navigate = useNavigate();
52
- const selectedRoutes = useSelectedRoutes(pages, isSelectedRoute);
53
- // manage mobile navigation
54
- const [isMobile, setIsMobile] = useState(false);
55
- const [hiddenSider, setHiddenSider] = useState(false);
56
- const siderWidth = siderProps?.width;
57
- const classes = useStyles({ isMobile, compactSider, siderWidth });
58
- const menuPages = useMemo(() => getMenuPages(pages), [pages]);
59
- return (React.createElement(Layout, { hasSider: true, ...layoutProps },
60
- isMobile && (React.createElement(Header, { ...mobileHeaderProps, className: classNames(classes.header, mobileHeaderProps?.className) }, hiddenSider ? (React.createElement(MenuUnfoldOutlined, { className: classes.menuTrigger, onClick: () => {
61
- setHiddenSider(!hiddenSider);
62
- } })) : (React.createElement(MenuFoldOutlined, { className: classes.menuTrigger, onClick: () => {
63
- setHiddenSider(!hiddenSider);
64
- } })))),
65
- React.createElement(Sider, { ...siderProps, className: classNames(classes.sider, siderProps?.className), breakpoint: 'md', onBreakpoint: (broken) => {
66
- setIsMobile(broken);
67
- setHiddenSider(true);
68
- }, collapsed: (isMobile && hiddenSider) || compactSider, collapsedWidth: isMobile && hiddenSider
69
- ? 0
70
- : compactSider
71
- ? HEADER_HEIGHT
72
- : 0, trigger: null },
73
- React.createElement(Menu, { ...menuProps, defaultSelectedKeys: defaultPage ? [defaultPage] : undefined, items: menuPages, selectedKeys: selectedRoutes, onSelect: ({ key }) => {
74
- if (!hiddenSider) {
75
- setHiddenSider(true);
76
- }
77
- navigate(key);
78
- } })),
79
- React.createElement(Content, { ...contentProps, className: classNames(classes.content, contentProps?.className) },
80
- React.createElement(Outlet, null))));
81
- };
82
- //# sourceMappingURL=ReactRouterBasicLayout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactRouterBasicLayout.js","sourceRoot":"","sources":["../../../../../src/react/components/navigation/react-router/ReactRouterBasicLayout.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGxC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM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AAE,IAAI;YACb,oBAAC,IAAI,OACA,SAAS,EACb,mBAAmB,EAClB,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAExC,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,cAAc,EAC5B,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;oBACrB,IAAI,CAAC,WAAW,EAAE;wBACjB,cAAc,CAAC,IAAI,CAAC,CAAA;qBACpB;oBACD,QAAQ,CAAC,GAAG,CAAC,CAAA;gBACd,CAAC,GACA,CACK;QACR,oBAAC,OAAO,OACH,YAAY,EAChB,SAAS,EAAE,UAAU,CACpB,OAAO,CAAC,OAAO,EACf,YAAY,EAAE,SAAS,CACvB;YACD,oBAAC,MAAM,OAAG,CACD,CACF,CACT,CAAA;AACF,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Observe screen size.
3
- */
4
- declare const useScreenSize: () => {
5
- width: number;
6
- height: number;
7
- };
8
- export default useScreenSize;
@@ -1,29 +0,0 @@
1
- /*
2
- * Copyright (c) 2025, J2 Innovations. All Rights Reserved
3
- */
4
- import { useEffect, useState } from 'react';
5
- /**
6
- * Observe screen size.
7
- */
8
- const useScreenSize = () => {
9
- const [screenSize, setScreenSize] = useState({
10
- width: window.innerWidth,
11
- height: window.innerHeight,
12
- });
13
- useEffect(() => {
14
- const handleResize = () => {
15
- setScreenSize({
16
- width: window.innerWidth,
17
- height: window.innerHeight,
18
- });
19
- };
20
- window.addEventListener('resize', handleResize);
21
- // Clean up the event listener when the component unmounts
22
- return () => {
23
- window.removeEventListener('resize', handleResize);
24
- };
25
- }, []);
26
- return screenSize;
27
- };
28
- export default useScreenSize;
29
- //# sourceMappingURL=useScreenSize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useScreenSize.js","sourceRoot":"","sources":["../../../src/react/hooks/useScreenSize.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C;;GAEG;AACH,MAAM,aAAa,GAAG,GAAG,EAAE;IAC1B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC;QAC5C,KAAK,EAAE,MAAM,CAAC,UAAU;QACxB,MAAM,EAAE,MAAM,CAAC,WAAW;KAC1B,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,YAAY,GAAG,GAAG,EAAE;YACzB,aAAa,CAAC;gBACb,KAAK,EAAE,MAAM,CAAC,UAAU;gBACxB,MAAM,EAAE,MAAM,CAAC,WAAW;aAC1B,CAAC,CAAA;QACH,CAAC,CAAA;QAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAE/C,0DAA0D;QAC1D,OAAO,GAAG,EAAE;YACX,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QACnD,CAAC,CAAA;IACF,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,UAAU,CAAA;AAClB,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}