@onehat/ui 0.4.70 → 0.4.72

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 (120) hide show
  1. package/package.json +2 -1
  2. package/src/Components/Accordion/Accordion.js +1 -0
  3. package/src/Components/Blank.js +1 -0
  4. package/src/Components/Buttons/BackButton.js +1 -0
  5. package/src/Components/Buttons/Button.js +18 -10
  6. package/src/Components/Buttons/CartButtonWithBadge.js +1 -0
  7. package/src/Components/Buttons/IconButton.js +9 -8
  8. package/src/Components/Buttons/PlusMinusButton.js +5 -4
  9. package/src/Components/Buttons/SquareButton.js +19 -18
  10. package/src/Components/Container/Container.js +1 -0
  11. package/src/Components/Container/ContainerColumn.js +4 -3
  12. package/src/Components/Container/ScreenContainer.js +14 -13
  13. package/src/Components/Container/Splitter.js +33 -28
  14. package/src/Components/Editor/InlineEditor.js +32 -30
  15. package/src/Components/Fab/DynamicFab.js +14 -13
  16. package/src/Components/Fab/FabWithTooltip.js +1 -0
  17. package/src/Components/Filter/DateRange.js +8 -7
  18. package/src/Components/Filter/NumberRange.js +8 -7
  19. package/src/Components/Form/Field/CKEditor/CKEditor.js +1 -0
  20. package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +1 -0
  21. package/src/Components/Form/Field/Color.js +41 -40
  22. package/src/Components/Form/Field/Combo/Combo.js +173 -172
  23. package/src/Components/Form/Field/Combo/MeterTypesCombo.js +4 -2
  24. package/src/Components/Form/Field/Combo/PageSizeCombo.js +1 -0
  25. package/src/Components/Form/Field/Date.js +117 -116
  26. package/src/Components/Form/Field/DisplayField.js +6 -5
  27. package/src/Components/Form/Field/File.js +1 -0
  28. package/src/Components/Form/Field/FormikForm.js +1 -0
  29. package/src/Components/Form/Field/Input.js +20 -18
  30. package/src/Components/Form/Field/Json.js +7 -6
  31. package/src/Components/Form/Field/Number.js +31 -30
  32. package/src/Components/Form/Field/RadioGroup/RadioGroup.js +1 -0
  33. package/src/Components/Form/Field/Select/PageSizeSelect.js +1 -0
  34. package/src/Components/Form/Field/Select/Select.js +9 -8
  35. package/src/Components/Form/Field/Slider.js +15 -14
  36. package/src/Components/Form/Field/Tag/Tag.js +25 -24
  37. package/src/Components/Form/Field/Tag/ValueBox.js +32 -31
  38. package/src/Components/Form/Field/Text.js +9 -8
  39. package/src/Components/Form/Field/TextArea.js +9 -8
  40. package/src/Components/Form/Field/Toggle.js +16 -15
  41. package/src/Components/Form/FieldSet.js +27 -26
  42. package/src/Components/Form/Form.js +104 -103
  43. package/src/Components/Form/Label.js +15 -14
  44. package/src/Components/Grid/Grid.js +62 -52
  45. package/src/Components/Grid/GridHeaderRow.js +42 -40
  46. package/src/Components/Grid/GridRow.js +92 -90
  47. package/src/Components/Grid/HeaderColumnSelectorHandle.js +9 -8
  48. package/src/Components/Grid/HeaderReorderHandle.js +9 -8
  49. package/src/Components/Grid/HeaderResizeHandle.js +9 -8
  50. package/src/Components/Grid/NoRecordsFound.js +4 -3
  51. package/src/Components/Grid/RowDragHandle.js +26 -10
  52. package/src/Components/Grid/RowHandle.js +55 -0
  53. package/src/Components/Grid/RowSelectHandle.js +1 -0
  54. package/src/{Hooks → Components/Grid}/useAsyncRenderers.js +1 -1
  55. package/src/Components/Hoc/Secondary/withSecondaryData.js +2 -1
  56. package/src/Components/Hoc/Secondary/withSecondaryEditor.js +4 -3
  57. package/src/Components/Hoc/Secondary/withSecondarySelection.js +3 -2
  58. package/src/Components/Hoc/Secondary/withSecondaryValue.js +2 -1
  59. package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +6 -5
  60. package/src/Components/Hoc/withAlert.js +38 -35
  61. package/src/Components/Hoc/withCollapsible.js +9 -4
  62. package/src/Components/Hoc/withComponent.js +6 -0
  63. package/src/Components/Hoc/withContextMenu.js +33 -26
  64. package/src/Components/Hoc/withData.js +3 -2
  65. package/src/Components/Hoc/withDnd.js +17 -8
  66. package/src/Components/Hoc/withDraggable.js +21 -5
  67. package/src/Components/Hoc/withEditor.js +3 -2
  68. package/src/Components/Hoc/withEvents.js +11 -1
  69. package/src/Components/Hoc/withFilters.js +26 -20
  70. package/src/Components/Hoc/withModal.js +10 -8
  71. package/src/Components/Hoc/withPdfButtons.js +3 -2
  72. package/src/Components/Hoc/withPermissions.js +3 -2
  73. package/src/Components/Hoc/withPresetButtons.js +3 -2
  74. package/src/Components/Hoc/withSelection.js +2 -8
  75. package/src/Components/Hoc/withToast.js +5 -2
  76. package/src/Components/Hoc/withTooltip.js +10 -1
  77. package/src/Components/Hoc/withValue.js +3 -9
  78. package/src/Components/Hoc/withWindowedEditor.js +6 -5
  79. package/src/Components/Layout/AsyncOperation.js +1 -0
  80. package/src/Components/Layout/CenterBox.js +9 -8
  81. package/src/Components/Layout/Footer.js +11 -10
  82. package/src/Components/Layout/ScreenHeader.js +5 -4
  83. package/src/Components/Layout/TextWithTooltip.js +1 -0
  84. package/src/Components/Messages/ConfirmationMessage.js +6 -5
  85. package/src/Components/Messages/ErrorMessage.js +40 -39
  86. package/src/Components/Messages/GlobalModals.js +47 -0
  87. package/src/Components/Messages/Loading.js +1 -0
  88. package/src/Components/Messages/OkMessage.js +11 -10
  89. package/src/Components/Messages/Unauthorized.js +1 -0
  90. package/src/Components/Messages/WaitMessage.js +16 -15
  91. package/src/Components/Panel/AccordionGridPanel.js +1 -0
  92. package/src/Components/Panel/FormPanel.js +1 -0
  93. package/src/Components/Panel/Header.js +59 -58
  94. package/src/Components/Panel/Mask.js +1 -0
  95. package/src/Components/Panel/Panel.js +7 -6
  96. package/src/Components/Picker/Picker.js +1 -0
  97. package/src/Components/Report/Report.js +35 -34
  98. package/src/Components/Screens/Manager.js +1 -0
  99. package/src/Components/Screens/ReportsManager.js +1 -0
  100. package/src/Components/Tab/Tab.js +1 -0
  101. package/src/Components/Tab/TabBar.js +67 -66
  102. package/src/Components/Toolbar/FilterToolbar.js +14 -11
  103. package/src/Components/Toolbar/Pagination.js +26 -25
  104. package/src/Components/Toolbar/PaginationToolbar.js +13 -12
  105. package/src/Components/Toolbar/Toolbar.js +13 -12
  106. package/src/Components/Tooltip/Tooltip.js +1 -0
  107. package/src/Components/Tree/Tree.js +34 -17
  108. package/src/Components/Tree/TreeNode.js +30 -29
  109. package/src/Components/Tree/TreeNodeDragHandle.js +18 -13
  110. package/src/Components/Viewer/MeterTypeText.js +29 -8
  111. package/src/Components/Viewer/TextWithLinks.js +16 -15
  112. package/src/Components/Viewer/Viewer.js +23 -22
  113. package/src/Components/Window/UploadsDownloadsWindow.js +6 -5
  114. package/src/Components/index.js +1 -0
  115. package/src/Constants/MeterTypes.js +2 -0
  116. package/src/Functions/addIconProps.js +46 -0
  117. package/src/Functions/testProps.js +1 -1
  118. package/src/Hooks/useWhyDidYouUpdate.js +33 -0
  119. package/src/PlatformImports/Web/Attachments.js +1 -1
  120. package/src/Components/Hoc/withBlank.js +0 -10
@@ -5,6 +5,7 @@ import {
5
5
  Modal, ModalBackdrop, ModalHeader, ModalContent, ModalCloseButton, ModalBody, ModalFooter,
6
6
  Text,
7
7
  } from '@project-components/Gluestack';
8
+ import clsx from 'clsx';
8
9
  import useAdjustedWindowSize from '../../Hooks/useAdjustedWindowSize.js';
9
10
  import Button from '../Buttons/Button.js';
10
11
  import Panel from '../Panel/Panel.js';
@@ -33,12 +34,12 @@ export default function ErrorMessage(props) {
33
34
  disableAutoFlex={true}
34
35
  onClose={onOk}
35
36
  footer={<Footer
36
- className={`
37
- justify-end
38
- py-2
39
- px-4
40
- bg-grey-100
41
- `}
37
+ className={clsx(
38
+ 'justify-end',
39
+ 'py-2',
40
+ 'px-4',
41
+ 'bg-grey-100',
42
+ )}
42
43
  >
43
44
  <Button
44
45
  {...testProps('okBtn')}
@@ -50,40 +51,40 @@ export default function ErrorMessage(props) {
50
51
  </Footer>}
51
52
  >
52
53
  <HStack className="ErrorMessage-HStack flex-1 w-full p-4">
53
- <Box className={`
54
- ErrorMessage-Box1
55
- h-full
56
- w-[100px]
57
- flex
58
- items-center
59
- justify-center
60
- pr-3
61
- `}>
62
- <Icon as={TriangleExclamation} className={`
63
- ErrorMessage-Icon
64
- h-[40px]
65
- w-[40px]
66
- text-${color}
67
- `} />
54
+ <Box className={clsx(
55
+ 'ErrorMessage-Box1',
56
+ 'h-full',
57
+ 'w-[100px]',
58
+ 'flex',
59
+ 'items-center',
60
+ 'justify-center',
61
+ 'pr-3',
62
+ )}>
63
+ <Icon as={TriangleExclamation} className={clsx(
64
+ 'ErrorMessage-Icon',
65
+ 'h-[40px]',
66
+ 'w-[40px]',
67
+ `text-${color}`,
68
+ )} />
68
69
  </Box>
69
- <Box className={`
70
- ErrorMessage-Box2
71
- h-full
72
- flex
73
- flex-1
74
- items-start
75
- justify-center
76
- overflow-hidden
77
- `}>
78
- <Text className={`
79
- ErrorMessage-Text
80
- text-${color}
81
- text-[18px]
82
- break-words
83
- whitespace-normal
84
- w-full
85
- overflow-auto
86
- `}>{text}</Text>
70
+ <Box className={clsx(
71
+ 'ErrorMessage-Box2',
72
+ 'h-full',
73
+ 'flex',
74
+ 'flex-1',
75
+ 'items-start',
76
+ 'justify-center',
77
+ 'overflow-hidden',
78
+ )}>
79
+ <Text className={clsx(
80
+ 'ErrorMessage-Text',
81
+ `text-${color}`,
82
+ 'text-[18px]',
83
+ 'break-words',
84
+ 'whitespace-normal',
85
+ 'w-full',
86
+ 'overflow-auto',
87
+ )}>{text}</Text>
87
88
  </Box>
88
89
  </HStack>
89
90
  </Panel>
@@ -0,0 +1,47 @@
1
+
2
+ import { useSelector, useDispatch, } from 'react-redux';
3
+ import {
4
+ selectIsWaitModalShown,
5
+ selectAlertMessage,
6
+ selectDebugMessage,
7
+ selectInfoMessage,
8
+ selectWaitMessage,
9
+ setAlertMessage,
10
+ setDebugMessage,
11
+ setInfoMessage,
12
+ } from '@src/models/Slices/DebugSlice';
13
+ import WaitMessage from './WaitMessage';
14
+ import ErrorMessage from './ErrorMessage';
15
+
16
+
17
+
18
+ export default function GlobalModals() {
19
+ const
20
+ dispatch = useDispatch(),
21
+ isWaitModalShown = useSelector(selectIsWaitModalShown),
22
+ alertMessage = useSelector(selectAlertMessage),
23
+ debugMessage = useSelector(selectDebugMessage),
24
+ infoMessage = useSelector(selectInfoMessage),
25
+ waitMessage = useSelector(selectWaitMessage);
26
+
27
+ return <>
28
+ {isWaitModalShown && <WaitMessage text={waitMessage} />}
29
+ {!isWaitModalShown && alertMessage &&
30
+ <ErrorMessage
31
+ text={alertMessage}
32
+ onOk={() => dispatch(setAlertMessage(null))}
33
+ />}
34
+ {!isWaitModalShown && debugMessage &&
35
+ <ErrorMessage
36
+ text={debugMessage}
37
+ color="green"
38
+ onOk={() => dispatch(setDebugMessage(null))}
39
+ />}
40
+ {!isWaitModalShown && infoMessage &&
41
+ <ErrorMessage
42
+ text={infoMessage}
43
+ color="#000"
44
+ onOk={() => dispatch(setInfoMessage(null))}
45
+ />}
46
+ </>;
47
+ }
@@ -4,6 +4,7 @@ import {
4
4
  Spinner,
5
5
  Text,
6
6
  } from '@project-components/Gluestack';
7
+ import clsx from 'clsx';
7
8
  import ScreenContainer from '../Container/ScreenContainer.js';
8
9
 
9
10
  export default function Loading(props) {
@@ -2,6 +2,7 @@ import {
2
2
  Modal, ModalBackdrop, ModalHeader, ModalContent, ModalCloseButton, ModalBody, ModalFooter,
3
3
  Text,
4
4
  } from '@project-components/Gluestack';
5
+ import clsx from 'clsx';
5
6
  import Button from '../Buttons/Button';
6
7
 
7
8
  export default function OkMessage(props) {
@@ -14,20 +15,20 @@ export default function OkMessage(props) {
14
15
  <ModalBackdrop />
15
16
  <ModalContent maxWidth="400px">
16
17
  <ModalBody
17
- className={`
18
- p-5
19
- pb-0
20
- border-t-0
21
- `}
18
+ className={clsx(
19
+ 'p-5',
20
+ 'pb-0',
21
+ 'border-t-0',
22
+ )}
22
23
  >
23
24
  <Text className="text-black">{textMessage}</Text>
24
25
  </ModalBody>
25
26
  <ModalFooter
26
- className={`
27
- p-0
28
- pr-4
29
- border-t-0
30
- `}
27
+ className={clsx(
28
+ 'p-0',
29
+ 'pr-4',
30
+ 'border-t-0',
31
+ )}
31
32
  >
32
33
  <Button
33
34
  variant="outline"
@@ -2,6 +2,7 @@ import {
2
2
  Text,
3
3
  VStack,
4
4
  } from '@project-components/Gluestack';
5
+ import clsx from 'clsx';
5
6
 
6
7
  export default function Unauthorized(props) {
7
8
  const
@@ -4,6 +4,7 @@ import {
4
4
  Spinner,
5
5
  Text,
6
6
  } from '@project-components/Gluestack';
7
+ import clsx from 'clsx';
7
8
  import testProps from '../../Functions/testProps.js';
8
9
 
9
10
  export default function WaitMessage(props) {
@@ -22,25 +23,25 @@ export default function WaitMessage(props) {
22
23
  >
23
24
  <ModalBackdrop />
24
25
  <ModalContent
25
- className={`
26
- ModalContent
27
- w-[200px]
28
- h-[50px]
29
- shadow-lg
30
- `}
26
+ className={clsx(
27
+ 'ModalContent',
28
+ 'w-[200px]',
29
+ 'h-[50px]',
30
+ 'shadow-lg',
31
+ )}
31
32
  >
32
33
  <HStack
33
- className={`
34
- HStack
35
- items-center
36
- justify-center
37
- `}
34
+ className={clsx(
35
+ 'HStack',
36
+ 'items-center',
37
+ 'justify-center',
38
+ )}
38
39
  >
39
40
  <Spinner
40
- className={`
41
- mr-2
42
- focus:outline-none
43
- `}
41
+ className={clsx(
42
+ 'mr-2',
43
+ 'focus:outline-none',
44
+ )}
44
45
  />
45
46
  <Text className="text-black">{text}</Text>
46
47
  </HStack>
@@ -3,6 +3,7 @@ import {
3
3
  ScrollView,
4
4
  VStack,
5
5
  } from '@project-components/Gluestack';
6
+ import clsx from 'clsx';
6
7
  import Accordion from 'react-native-collapsible/Accordion'; // https://www.npmjs.com/package/react-native-collapsible
7
8
  import testProps from '../../Functions/testProps';
8
9
  import Footer from '../Layout/Footer.js';
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  Text,
3
3
  } from '@project-components/Gluestack';
4
+ import clsx from 'clsx';
4
5
  import Panel from './Panel.js';
5
6
  import Form, { FormEditor } from '../Form/Form.js';
6
7
  import withData from '../Hoc/withData.js';
@@ -5,6 +5,7 @@ import {
5
5
  TextNative,
6
6
  VStack,
7
7
  } from '@project-components/Gluestack';
8
+ import clsx from 'clsx';
8
9
  import {
9
10
  HORIZONTAL,
10
11
  VERTICAL,
@@ -41,17 +42,17 @@ export default function Header(props) {
41
42
  let closeBtn = null,
42
43
  collapseBtn = null;
43
44
  if (onClose) {
44
- let closeClassName = `
45
- Header-closeBtn
46
- self-center
47
- border
48
- border-grey-400
49
- h-[20px]
50
- w-[20px]
51
- px-[2px]
52
- py-[2px]
53
- ${styles.PANEL_HEADER_BG}
54
- `;
45
+ let closeClassName = clsx(
46
+ 'Header-closeBtn',
47
+ 'self-center',
48
+ 'border',
49
+ 'border-grey-400',
50
+ 'h-[20px]',
51
+ 'w-[20px]',
52
+ 'px-[2px]',
53
+ 'py-[2px]',
54
+ styles.PANEL_HEADER_BG,
55
+ );
55
56
  if (collapseDirection === HORIZONTAL && isCollapsed) {
56
57
  closeClassName += ' mb-1';
57
58
  }
@@ -67,17 +68,17 @@ export default function Header(props) {
67
68
  />;
68
69
  }
69
70
  if (isCollapsible) {
70
- let collapseClassName = `
71
- Header-collapseBtn
72
- self-center
73
- border
74
- border-grey-400
75
- h-[20px]
76
- w-[20px]
77
- px-[2px]
78
- py-[2px]
79
- ${styles.PANEL_HEADER_BG}
80
- `;
71
+ let collapseClassName = clsx(
72
+ 'Header-collapseBtn',
73
+ 'self-center',
74
+ 'border',
75
+ 'border-grey-400',
76
+ 'h-[20px]',
77
+ 'w-[20px]',
78
+ 'px-[2px]',
79
+ 'py-[2px]',
80
+ styles.PANEL_HEADER_BG,
81
+ );
81
82
  if (collapseDirection === HORIZONTAL && isCollapsed) {
82
83
  collapseClassName += ' mb-1';
83
84
  }
@@ -97,17 +98,17 @@ export default function Header(props) {
97
98
  doubleClickStyle.cursor = 'pointer';
98
99
  }
99
100
 
100
- let panelClassName = `
101
- Header
102
- bg-grey-300
103
- items-center
104
- justify-start
105
- py-1
106
- border-b-grey-400
107
- border-b-1
108
- ${isWindow ? 'rounded-t-lg' : ''}
109
- ${styles.PANEL_HEADER_BG}
110
- `;
101
+ let panelClassName = clsx(
102
+ 'Header',
103
+ 'bg-grey-300',
104
+ 'items-center',
105
+ 'justify-start',
106
+ 'py-1',
107
+ 'border-b-grey-400',
108
+ 'border-b-1',
109
+ isWindow ? 'rounded-t-lg' : '',
110
+ styles.PANEL_HEADER_BG,
111
+ );
111
112
  if (CURRENT_MODE === UI_MODE_WEB) {
112
113
 
113
114
  if (isCollapsed) {
@@ -137,12 +138,12 @@ export default function Header(props) {
137
138
  <TextNative
138
139
  numberOfLines={1}
139
140
  ellipsizeMode="head"
140
- className={`
141
- Header-TextNative1
142
- flex-1
143
- font-bold
144
- ${styles.PANEL_HEADER_TEXT_CLASSNAME}
145
- `}>{title}</TextNative>
141
+ className={clsx(
142
+ 'Header-TextNative1',
143
+ 'flex-1',
144
+ 'font-bold',
145
+ styles.PANEL_HEADER_TEXT_CLASSNAME,
146
+ )}>{title}</TextNative>
146
147
  </div>
147
148
  </VStack>
148
149
  </div>;
@@ -175,12 +176,12 @@ export default function Header(props) {
175
176
  <TextNative
176
177
  numberOfLines={1}
177
178
  ellipsizeMode="head"
178
- className={`
179
- Header-TextNative2
180
- flex-1
181
- font-bold
182
- ${styles.PANEL_HEADER_TEXT_CLASSNAME}
183
- `}
179
+ className={clsx(
180
+ 'Header-TextNative2',
181
+ 'flex-1',
182
+ 'font-bold',
183
+ styles.PANEL_HEADER_TEXT_CLASSNAME,
184
+ )}
184
185
  >{title}</TextNative>
185
186
  {collapseBtn}
186
187
  </HStack>
@@ -215,13 +216,13 @@ export default function Header(props) {
215
216
  numberOfLines={1}
216
217
  ellipsizeMode="head"
217
218
  style={{ transform: [{ rotate: '-90deg'}] }}
218
- className={`
219
- Header-TextNative3
220
- font-bold
221
- w-[200px]
222
- text-right
223
- ${styles.PANEL_HEADER_TEXT_CLASSNAME}
224
- `}
219
+ className={clsx(
220
+ 'Header-TextNative3',
221
+ 'font-bold',
222
+ 'w-[200px]',
223
+ 'text-right',
224
+ styles.PANEL_HEADER_TEXT_CLASSNAME,
225
+ )}
225
226
  >{title}</TextNative>
226
227
  </VStack>
227
228
  </VStack>
@@ -251,12 +252,12 @@ export default function Header(props) {
251
252
  <TextNative
252
253
  numberOfLines={1}
253
254
  ellipsizeMode="head"
254
- className={`
255
- Header-TextNative4
256
- font-bold
257
- flex-1
258
- ${styles.PANEL_HEADER_TEXT_CLASSNAME}
259
- `}>{title}</TextNative>
255
+ className={clsx(
256
+ 'Header-TextNative4',
257
+ 'font-bold',
258
+ 'flex-1',
259
+ styles.PANEL_HEADER_TEXT_CLASSNAME,
260
+ )}>{title}</TextNative>
260
261
  {collapseBtn}
261
262
  </HStack>
262
263
  </Pressable>;
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  Box,
3
3
  } from '@project-components/Gluestack';
4
+ import clsx from 'clsx';
4
5
  import {
5
6
  CURRENT_MODE,
6
7
  UI_MODE_WEB,
@@ -4,6 +4,7 @@ import {
4
4
  VStack,
5
5
  VStackNative,
6
6
  } from '@project-components/Gluestack';
7
+ import clsx from 'clsx';
7
8
  import {
8
9
  HORIZONTAL,
9
10
  VERTICAL,
@@ -136,12 +137,12 @@ function Panel(props) {
136
137
  {!isCollapsed && <>
137
138
  {topToolbar}
138
139
  <VStack
139
- className={`
140
- Panel-VSstack
141
- flex-1
142
- w-full
143
- overflow-hidden
144
- `}
140
+ className={clsx(
141
+ 'Panel-VSstack',
142
+ 'flex-1',
143
+ 'w-full',
144
+ 'overflow-hidden',
145
+ )}
145
146
  >
146
147
  {isScrollable ?
147
148
  <ScrollView
@@ -5,6 +5,7 @@ import {
5
5
  Select, SelectItem,
6
6
  Tooltip,
7
7
  } from '@project-components/Gluestack';
8
+ import clsx from 'clsx';
8
9
  import CaretDown from '../Icons/CaretDown.js';
9
10
  import testProps from '../../Functions/testProps.js';
10
11
  import _ from 'lodash';
@@ -8,6 +8,7 @@ import {
8
8
  VStack,
9
9
  VStackNative,
10
10
  } from '@project-components/Gluestack';
11
+ import clsx from 'clsx';
11
12
  import { EDITOR_TYPE__PLAIN } from '../../Constants/Editor';
12
13
  import {
13
14
  UI_MODE_WEB,
@@ -72,11 +73,11 @@ function Report(props) {
72
73
  }
73
74
 
74
75
  if (isQuickReport) {
75
- let className = `
76
- Report
77
- max-w-[100px]
78
- m-2
79
- `;
76
+ let className = clsx(
77
+ 'Report',
78
+ 'max-w-[100px]',
79
+ 'm-2',
80
+ );
80
81
  if (props.className) {
81
82
  className += ' ' + props.className;
82
83
  }
@@ -86,28 +87,28 @@ function Report(props) {
86
87
  >
87
88
  <Pressable
88
89
  onPress={onPressQuickReport}
89
- className={`
90
- flex-1
91
- items-center
92
- justify-center
93
- flex-col
94
- bg-white
95
- p-3
96
- rounded-lg
97
- border
98
- border-primary-300
99
- hover:bg-primary-300
100
- `}
90
+ className={clsx(
91
+ 'flex-1',
92
+ 'items-center',
93
+ 'justify-center',
94
+ 'flex-col',
95
+ 'bg-white',
96
+ 'p-3',
97
+ 'rounded-lg',
98
+ 'border',
99
+ 'border-primary-300',
100
+ 'hover:bg-primary-300',
101
+ )}
101
102
  >
102
103
  {icon}
103
104
  <Text
104
- className={`
105
- text-black
106
- text-center
107
- text-[17px]
108
- leading-tight
109
- mt-2
110
- `}
105
+ className={clsx(
106
+ 'text-black',
107
+ 'text-center',
108
+ 'text-[17px]',
109
+ 'leading-tight',
110
+ 'mt-2',
111
+ )}
111
112
  >{title}</Text>
112
113
  </Pressable>
113
114
  </VStackNative>;
@@ -145,16 +146,16 @@ function Report(props) {
145
146
  }
146
147
  return <VStackNative
147
148
  {...testProps('Report-' + reportId)}
148
- className={`
149
- w-full
150
- border
151
- border-primary-300
152
- p-4
153
- mb-3
154
- bg-white
155
- rounded-lg
156
- shadow-sm
157
- `}
149
+ className={clsx(
150
+ 'w-full',
151
+ 'border',
152
+ 'border-primary-300',
153
+ 'p-4',
154
+ 'mb-3',
155
+ 'bg-white',
156
+ 'rounded-lg',
157
+ 'shadow-sm',
158
+ )}
158
159
  >
159
160
  <HStack>
160
161
  <Box className="w-[50px] mr-4">
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  VStackNative,
3
3
  } from '@project-components/Gluestack';
4
+ import clsx from 'clsx';
4
5
  import React, { useState, useEffect, } from 'react';
5
6
  import {
6
7
  SCREEN_MODES__FULL,
@@ -5,6 +5,7 @@ import {
5
5
  VStack,
6
6
  VStackNative,
7
7
  } from '@project-components/Gluestack';
8
+ import clsx from 'clsx';
8
9
  import ChartPie from '../Icons/ChartPie.js';
9
10
  import ScreenHeader from '../Layout/ScreenHeader.js';
10
11
 
@@ -3,6 +3,7 @@ import {
3
3
  HStack,
4
4
  Icon,
5
5
  } from '@project-components/Gluestack';
6
+ import clsx from 'clsx';
6
7
  import {
7
8
  HORIZONTAL,
8
9
  VERTICAL,