@onehat/ui 0.4.77 → 0.4.79

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 (59) hide show
  1. package/package.json +1 -1
  2. package/src/Components/Editor/AttachmentDirectoriesEditor.js +51 -0
  3. package/src/Components/Editor/AttachmentsEditor.js +81 -0
  4. package/src/Components/Form/Field/Combo/AttachmentDirectoriesCombo.js +20 -0
  5. package/src/Components/Form/Field/Combo/AttachmentDirectoriesComboEditor.js +22 -0
  6. package/src/Components/Form/Field/Combo/AttachmentsCombo.js +20 -0
  7. package/src/Components/Form/Field/Combo/AttachmentsComboEditor.js +22 -0
  8. package/src/Components/Form/Field/Tag/AttachmentDirectoriesTag.js +22 -0
  9. package/src/Components/Form/Field/Tag/AttachmentDirectoriesTagEditor.js +22 -0
  10. package/src/Components/Form/Field/Tag/AttachmentsTag.js +22 -0
  11. package/src/Components/Form/Field/Tag/AttachmentsTagEditor.js +22 -0
  12. package/src/Components/Form/Form.js +17 -17
  13. package/src/Components/Grid/AttachmentDirectoriesFilteredGrid.js +17 -0
  14. package/src/Components/Grid/AttachmentDirectoriesFilteredGridEditor.js +17 -0
  15. package/src/Components/Grid/AttachmentDirectoriesFilteredInlineGridEditor.js +17 -0
  16. package/src/Components/Grid/AttachmentDirectoriesFilteredSideGridEditor.js +17 -0
  17. package/src/Components/Grid/AttachmentDirectoriesGrid.js +20 -0
  18. package/src/Components/Grid/AttachmentDirectoriesGridEditor.js +27 -0
  19. package/src/Components/Grid/AttachmentDirectoriesInlineGridEditor.js +25 -0
  20. package/src/Components/Grid/AttachmentDirectoriesSideGridEditor.js +24 -0
  21. package/src/Components/Grid/AttachmentsFilteredGrid.js +17 -0
  22. package/src/Components/Grid/AttachmentsFilteredGridEditor.js +17 -0
  23. package/src/Components/Grid/AttachmentsFilteredInlineGridEditor.js +17 -0
  24. package/src/Components/Grid/AttachmentsFilteredSideGridEditor.js +17 -0
  25. package/src/Components/Grid/AttachmentsGrid.js +20 -0
  26. package/src/Components/Grid/AttachmentsGridEditor.js +27 -0
  27. package/src/Components/Grid/AttachmentsInlineGridEditor.js +25 -0
  28. package/src/Components/Grid/AttachmentsSideGridEditor.js +24 -0
  29. package/src/Components/Grid/Columns/AttachmentDirectoriesGridColumns.js +32 -0
  30. package/src/Components/Grid/Columns/AttachmentsGridColumns.js +133 -0
  31. package/src/Components/Grid/Grid.js +194 -21
  32. package/src/Components/Grid/GridHeaderRow.js +10 -17
  33. package/src/Components/Grid/GridRow.js +49 -22
  34. package/src/Components/Grid/RowHandle.js +8 -6
  35. package/src/Components/Hoc/withEditor.js +18 -1
  36. package/src/Components/Hoc/withModal.js +4 -0
  37. package/src/Components/Hoc/withPdfButtons.js +1 -1
  38. package/src/Components/Hoc/withSelection.js +26 -4
  39. package/src/Components/Layout/AsyncOperation.js +299 -195
  40. package/src/Components/Messages/GlobalModals.js +1 -2
  41. package/src/Components/Panel/Panel.js +14 -2
  42. package/src/Components/Panel/TabPanel.js +1 -1
  43. package/src/Components/Panel/TreePanel.js +1 -1
  44. package/src/Components/Report/Report.js +106 -17
  45. package/src/Components/Toolbar/PaginationToolbar.js +4 -3
  46. package/src/Components/Toolbar/Toolbar.js +6 -3
  47. package/src/Components/Tree/Tree.js +219 -148
  48. package/src/Components/Tree/TreeNode.js +20 -13
  49. package/src/Components/Window/AttachmentDirectoriesEditorWindow.js +34 -0
  50. package/src/Components/Window/AttachmentsEditorWindow.js +34 -0
  51. package/src/Components/index.js +92 -1
  52. package/src/Constants/Attachments.js +2 -0
  53. package/src/Constants/Dates.js +2 -2
  54. package/src/Constants/Progress.js +5 -1
  55. package/src/Models/Schemas/AttachmentDirectories.js +66 -0
  56. package/src/Models/Schemas/Attachments.js +88 -0
  57. package/src/Models/Slices/SystemSlice.js +220 -0
  58. package/src/PlatformImports/Web/Attachments.js +855 -161
  59. package/src/Styles/Global.css +7 -2
@@ -41,6 +41,8 @@ function Report(props) {
41
41
  disableExcel = false,
42
42
  showReportHeaders = true,
43
43
  isQuickReport = false,
44
+ isDisabled = false,
45
+ disabledMessage = 'Report is Disabled',
44
46
  additionalData = {},
45
47
  quickReportData = {},
46
48
  alert,
@@ -90,8 +92,9 @@ function Report(props) {
90
92
  className={className}
91
93
  >
92
94
  <Pressable
93
- onPress={onPressQuickReport}
95
+ onPress={!isDisabled ? onPressQuickReport : null}
94
96
  className={clsx(
97
+ 'relative', // creates the positioning context for absolute children
95
98
  'flex-1',
96
99
  'items-center',
97
100
  'justify-center',
@@ -101,7 +104,7 @@ function Report(props) {
101
104
  'rounded-lg',
102
105
  'border',
103
106
  'border-primary-300',
104
- 'hover:bg-primary-300',
107
+ !isDisabled ? 'hover:bg-primary-300' : null,
105
108
  )}
106
109
  >
107
110
  {icon}
@@ -114,6 +117,46 @@ function Report(props) {
114
117
  'mt-2',
115
118
  )}
116
119
  >{title}</Text>
120
+ {isDisabled &&
121
+ <Box
122
+ className={clsx(
123
+ 'absolute',
124
+ 'h-full',
125
+ 'w-full',
126
+ 'z-1000',
127
+ 'flex',
128
+ 'items-center',
129
+ 'justify-center',
130
+ )}
131
+ >
132
+ <Box
133
+ className={clsx(
134
+ 'absolute',
135
+ 'h-full',
136
+ 'w-full',
137
+ 'rounded-lg',
138
+ 'z-0',
139
+ 'bg-white',
140
+ 'opacity-[0.8]',
141
+ )}
142
+ />
143
+ <Text
144
+ className={clsx(
145
+ 'absolute',
146
+ 'h-full',
147
+ 'w-full',
148
+ 'z-1000',
149
+ 'flex',
150
+ 'items-center',
151
+ 'justify-center',
152
+ 'px-[20px]',
153
+ 'text-center',
154
+ 'text-[23px]',
155
+ 'text-red-500',
156
+ 'italic',
157
+ )}
158
+ >Disabled</Text>
159
+ </Box>}
117
160
  </Pressable>
118
161
  </VStackNative>;
119
162
  }
@@ -157,30 +200,76 @@ function Report(props) {
157
200
  return <VStackNative
158
201
  {...testProps('Report-' + reportId)}
159
202
  className={clsx(
203
+ 'relative', // creates the positioning context for absolute children
160
204
  'w-full',
161
205
  'border',
162
206
  'border-primary-300',
163
- 'p-4',
164
207
  'mb-3',
165
208
  'bg-white',
166
209
  'rounded-lg',
167
210
  'shadow-sm',
168
211
  )}
169
212
  >
170
- <HStack>
171
- <Box className="w-[50px] mr-4">
172
- {icon}
173
- </Box>
174
- <VStack className="flex-1">
175
- <Text className="text-2xl max-w-full">{title}</Text>
176
- <Text className="text-sm">{description}</Text>
177
- </VStack>
178
- </HStack>
179
- <Form
180
- type={EDITOR_TYPE__PLAIN}
181
- additionalFooterButtons={buttons}
182
- {...props._form}
183
- />
213
+ <Box
214
+ className={clsx(
215
+ 'p-4',
216
+ )}
217
+ >
218
+ <HStack>
219
+ <Box className="w-[50px] mr-4">
220
+ {icon}
221
+ </Box>
222
+ <VStack className="flex-1">
223
+ <Text className="text-2xl max-w-full">{title}</Text>
224
+ <Text className="text-sm">{description}</Text>
225
+ </VStack>
226
+ </HStack>
227
+ <Form
228
+ type={EDITOR_TYPE__PLAIN}
229
+ additionalFooterButtons={buttons}
230
+ {...props._form}
231
+ />
232
+ </Box>
233
+ {isDisabled &&
234
+ <Box
235
+ className={clsx(
236
+ 'absolute',
237
+ 'h-full',
238
+ 'w-full',
239
+ 'z-1000',
240
+ 'flex',
241
+ 'items-center',
242
+ 'justify-center',
243
+ )}
244
+ >
245
+ <Box
246
+ className={clsx(
247
+ 'absolute',
248
+ 'h-full',
249
+ 'w-full',
250
+ 'rounded-lg',
251
+ 'z-0',
252
+ 'bg-white',
253
+ 'opacity-[0.8]',
254
+ )}
255
+ />
256
+ <Text
257
+ className={clsx(
258
+ 'absolute',
259
+ 'h-full',
260
+ 'w-full',
261
+ 'z-1000',
262
+ 'flex',
263
+ 'items-center',
264
+ 'justify-center',
265
+ 'px-[20px]',
266
+ 'text-center',
267
+ 'text-[23px]',
268
+ 'text-red-500',
269
+ 'italic',
270
+ )}
271
+ >{disabledMessage}</Text>
272
+ </Box>}
184
273
  </VStackNative>;
185
274
  }
186
275
 
@@ -1,4 +1,4 @@
1
- import { useState } from 'react';
1
+ import { useState, forwardRef } from 'react';
2
2
  import {
3
3
  HStack,
4
4
  } from '@project-components/Gluestack';
@@ -7,7 +7,7 @@ import Pagination from './Pagination.js'
7
7
  import Toolbar from './Toolbar.js'
8
8
  import _ from 'lodash';
9
9
 
10
- export default function PaginationToolbar(props) {
10
+ export default forwardRef(function PaginationToolbar(props, ref) {
11
11
  const {
12
12
  toolbarItems = [],
13
13
  disablePageSize = false,
@@ -38,6 +38,7 @@ export default function PaginationToolbar(props) {
38
38
  };
39
39
 
40
40
  return <Toolbar
41
+ ref={ref}
41
42
  className={clsx(
42
43
  'border-t',
43
44
  'border-t-grey-400',
@@ -63,4 +64,4 @@ export default function PaginationToolbar(props) {
63
64
  disablePageSize={disablePageSize}
64
65
  />
65
66
  </Toolbar>;
66
- };
67
+ });
@@ -1,3 +1,4 @@
1
+ import { forwardRef } from 'react';
1
2
  import {
2
3
  HStackNative,
3
4
  ScrollView,
@@ -9,7 +10,7 @@ import {
9
10
  } from '../../Constants/UiModes.js';
10
11
  import UiGlobals from '../../UiGlobals.js';
11
12
 
12
- export default function Toolbar(props) {
13
+ export default forwardRef(function Toolbar(props, ref) {
13
14
 
14
15
  const styles = UiGlobals.styles;
15
16
 
@@ -18,7 +19,7 @@ export default function Toolbar(props) {
18
19
  'overflow-auto',
19
20
  'items-center',
20
21
  'justify-start',
21
- 'gap-2',
22
+ 'gap-1',
22
23
  'p-2',
23
24
  'border-b',
24
25
  'border-solid',
@@ -32,8 +33,10 @@ export default function Toolbar(props) {
32
33
  className += ' ' + props.className
33
34
  }
34
35
  let toolbar = <HStackNative
36
+ ref={ref}
35
37
  className={className}
36
38
  style={props.style || {}}
39
+ onLayout={props.onLayout}
37
40
  >
38
41
  {props.children}
39
42
  </HStackNative>;
@@ -49,4 +52,4 @@ export default function Toolbar(props) {
49
52
  }
50
53
 
51
54
  return toolbar;
52
- };
55
+ });