@onehat/ui 0.3.31 → 0.3.33

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 (51) hide show
  1. package/package.json +1 -1
  2. package/src/Components/Buttons/Button.js +20 -0
  3. package/src/Components/Buttons/IconButton.js +68 -51
  4. package/src/Components/Buttons/SquareButton.js +6 -4
  5. package/src/Components/Container/Container.js +4 -1
  6. package/src/Components/Container/ScreenContainer.js +4 -1
  7. package/src/Components/Editor/Editor.js +15 -1
  8. package/src/Components/Form/Field/CKEditor/CKEditor.js +2 -1
  9. package/src/Components/Form/Field/Checkbox/Checkbox.js +2 -1
  10. package/src/Components/Form/Field/Color.js +2 -1
  11. package/src/Components/Form/Field/Combo/Combo.js +7 -4
  12. package/src/Components/Form/Field/Date.js +2 -1
  13. package/src/Components/Form/Field/DisplayField.js +2 -1
  14. package/src/Components/Form/Field/File.js +2 -1
  15. package/src/Components/Form/Field/Input.js +2 -1
  16. package/src/Components/Form/Field/Number.js +2 -1
  17. package/src/Components/Form/Field/RadioGroup/RadioGroup.js +2 -1
  18. package/src/Components/Form/Field/Text.js +2 -1
  19. package/src/Components/Form/Field/TextArea.js +3 -2
  20. package/src/Components/Form/Field/Toggle.js +2 -1
  21. package/src/Components/Form/Form.js +93 -45
  22. package/src/Components/Grid/Grid.js +67 -53
  23. package/src/Components/Grid/GridHeaderRow.js +5 -2
  24. package/src/Components/Grid/GridRow.js +8 -2
  25. package/src/Components/Hoc/withAlert.js +1 -3
  26. package/src/Components/Hoc/withComponent.js +65 -0
  27. package/src/Components/Hoc/withData.js +6 -0
  28. package/src/Components/Hoc/withEditor.js +54 -4
  29. package/src/Components/Hoc/withFilters.js +35 -5
  30. package/src/Components/Hoc/withInlineEditor.js +4 -0
  31. package/src/Components/Hoc/withPdfButton.js +12 -13
  32. package/src/Components/Hoc/withPresetButtons.js +14 -1
  33. package/src/Components/Hoc/withSelection.js +16 -0
  34. package/src/Components/Hoc/withSideEditor.js +7 -1
  35. package/src/Components/Hoc/withWindowedEditor.js +7 -1
  36. package/src/Components/Icons/HighPriority.js +20 -0
  37. package/src/Components/Icons/LowPriority.js +20 -0
  38. package/src/Components/Icons/MedPriority.js +20 -0
  39. package/src/Components/Icons/Pdf.js +14 -0
  40. package/src/Components/Screens/Manager.js +5 -2
  41. package/src/Components/Tab/TabBar.js +5 -2
  42. package/src/Components/Toolbar/Pagination.js +2 -1
  43. package/src/Components/Tree/Tree.js +47 -40
  44. package/src/Components/Viewer/TagViewer.js +3 -1
  45. package/src/Components/Viewer/Viewer.js +57 -14
  46. package/src/Components/index.js +2 -0
  47. package/src/Functions/getIconButtonFromConfig.js +3 -1
  48. package/src/Components/Form/Field/Field.js +0 -14
  49. package/src/Components/Grid/ReactGrid.js +0 -468
  50. package/src/Components/Grid/SenchaGrid.js +0 -421
  51. package/src/Components/Grid/reactgrid.css +0 -6
@@ -22,6 +22,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
22
22
  disableDelete = false,
23
23
  disableDuplicate = false,
24
24
  disableView = false,
25
+ useRemoteDuplicate = false, // call specific copyToNew function on server, rather than simple duplicate on client
25
26
  getRecordIdentifier = (selection) => {
26
27
  if (selection.length > 1) {
27
28
  return 'records?';
@@ -30,6 +31,9 @@ export default function withEditor(WrappedComponent, isTree = false) {
30
31
  },
31
32
  record,
32
33
 
34
+ // withComponent
35
+ self,
36
+
33
37
  // parent container
34
38
  selectorId,
35
39
  selectorSelected,
@@ -199,7 +203,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
199
203
  cb();
200
204
  }
201
205
  },
202
- viewRecord = async () => {
206
+ onView = async () => {
203
207
  if (!userCanView) {
204
208
  return;
205
209
  }
@@ -214,13 +218,16 @@ export default function withEditor(WrappedComponent, isTree = false) {
214
218
  await getListeners().onAfterView(entity);
215
219
  }
216
220
  },
217
- duplicateRecord = async () => {
221
+ onDuplicate = async () => {
218
222
  if (!userCanEdit || disableDuplicate) {
219
223
  return;
220
224
  }
221
225
  if (selection.length !== 1) {
222
226
  return;
223
227
  }
228
+ if (useRemoteDuplicate) {
229
+ return onRemoteDuplicate();
230
+ }
224
231
  const
225
232
  entity = selection[0],
226
233
  idProperty = Repository.getSchema().model.idProperty,
@@ -230,6 +237,40 @@ export default function withEditor(WrappedComponent, isTree = false) {
230
237
  setEditorMode(EDITOR_MODE__EDIT);
231
238
  setIsEditorShown(true);
232
239
  },
240
+ onRemoteDuplicate = async () => {
241
+
242
+ // Call /duplicate on server
243
+ const
244
+ Model = Repository.getSchema().name,
245
+ entity = selection[0],
246
+ id = entity.id;
247
+ const result = await Repository._send('POST', Model + '/duplicate', { id });
248
+ const {
249
+ root,
250
+ success,
251
+ total,
252
+ message
253
+ } = Repository._processServerResponse(result);
254
+
255
+ if (!success) {
256
+ throw Error(message);
257
+ }
258
+
259
+ const duplicateId = root.id;
260
+
261
+ // Filter the grid with only the duplicate's ID, and open it for editing.
262
+ self.filterById(duplicateId, () => { // because of the way useFilters is made, we have to use a callback, not await a Promise.
263
+
264
+ // Select the only node
265
+ const duplicateEntity = Repository.getById(duplicateId);
266
+ self.setSelection([duplicateEntity]);
267
+
268
+ // edit it
269
+ onEdit();
270
+
271
+ });
272
+
273
+ },
233
274
  onEditorSave = async (data, e) => {
234
275
  const
235
276
  what = record || selection,
@@ -339,6 +380,15 @@ export default function withEditor(WrappedComponent, isTree = false) {
339
380
  setLastSelection(selection);
340
381
  }, [selection]);
341
382
 
383
+ if (self) {
384
+ self.add = onAdd;
385
+ self.edit = onEdit;
386
+ self.delete = onDelete;
387
+ self.moveChildren = onMoveChildren;
388
+ self.deleteChildren = onDeleteChildren;
389
+ self.duplicate = onDuplicate;
390
+ }
391
+
342
392
  if (lastSelection !== selection) {
343
393
  // NOTE: If I don't calculate this on the fly for selection changes,
344
394
  // we see a flash of the previous state, since useEffect hasn't yet run.
@@ -361,8 +411,8 @@ export default function withEditor(WrappedComponent, isTree = false) {
361
411
  onAdd={(!userCanEdit || disableAdd) ? null : onAdd}
362
412
  onEdit={(!userCanEdit || disableEdit) ? null : onEdit}
363
413
  onDelete={(!userCanEdit || disableDelete) ? null : onDelete}
364
- onView={viewRecord}
365
- onDuplicate={duplicateRecord}
414
+ onView={onView}
415
+ onDuplicate={onDuplicate}
366
416
  onEditorSave={onEditorSave}
367
417
  onEditorCancel={onEditorCancel}
368
418
  onEditorDelete={(!userCanEdit || disableDelete) ? null : onEditorDelete}
@@ -1,4 +1,4 @@
1
- import { useState, useEffect, useId, } from 'react';
1
+ import { useState, useEffect, useId, useRef, } from 'react';
2
2
  import {
3
3
  Column,
4
4
  Modal,
@@ -46,6 +46,9 @@ export default function withFilters(WrappedComponent) {
46
46
 
47
47
  // withData
48
48
  Repository,
49
+
50
+ // withComponent
51
+ self,
49
52
  } = props;
50
53
 
51
54
  let modal = null,
@@ -59,7 +62,7 @@ export default function withFilters(WrappedComponent) {
59
62
  defaultFilters: modelDefaultFilters,
60
63
  ancillaryFilters: modelAncillaryFilters,
61
64
  } = Repository.getSchema().model,
62
- id = props.id || useId(),
65
+ id = props.id || props.reference || useId(),
63
66
 
64
67
  // determine the starting filters
65
68
  startingFilters = !_.isEmpty(customFilters) ? customFilters : // custom filters override component filters
@@ -124,6 +127,7 @@ export default function withFilters(WrappedComponent) {
124
127
  }
125
128
 
126
129
  const
130
+ filterCallbackRef = useRef(),
127
131
  [filters, setFiltersRaw] = useState(formattedStartingFilters), // array of formatted filters
128
132
  [slots, setSlots] = useState(startingSlots), // array of field names user is currently filtering on; blank slots have a null entry in array
129
133
  [modalFilters, setModalFilters] = useState([]),
@@ -230,6 +234,21 @@ export default function withFilters(WrappedComponent) {
230
234
  }
231
235
  return inArray(filterType, ['NumberRange', 'DateRange']);
232
236
  },
237
+ filterById = (id, cb) => {
238
+ onClearFilters();
239
+ filterCallbackRef.current = cb; // store the callback, so we can call it the next time this HOC renders with new filters
240
+ const newFilters = _.clone(filters);
241
+ _.remove(newFilters, (filter) => {
242
+ return filter.field === 'q';
243
+ });
244
+ newFilters.unshift({
245
+ field: 'q',
246
+ title: 'Search all text fields',
247
+ type: 'Input',
248
+ value: 'id:' + id,
249
+ });
250
+ setFilters(newFilters, false, false);
251
+ },
233
252
  renderFilters = () => {
234
253
  const
235
254
  filterProps = {
@@ -347,7 +366,7 @@ export default function withFilters(WrappedComponent) {
347
366
  } else {
348
367
  const
349
368
  isAncillary = type === FILTER_TYPE_ANCILLARY,
350
- filterName = (isAncillary ? 'ancillary___' : '') + field;
369
+ filterName = (isAncillary ? 'ancillary___' : '') + field;
351
370
  newFilterNames.push(filterName);
352
371
  newRepoFilters.push({ name: filterName, value, });
353
372
  }
@@ -362,12 +381,17 @@ export default function withFilters(WrappedComponent) {
362
381
  setPreviousFilterNames(newFilterNames);
363
382
  }
364
383
 
365
- Repository.filter(newRepoFilters, null, false); // false so other filters remain
366
-
367
384
  if (searchAllText && Repository.searchAncillary && !Repository.hasBaseParam('searchAncillary')) {
368
385
  Repository.setBaseParam('searchAncillary', true);
369
386
  }
370
387
 
388
+ await Repository.filter(newRepoFilters, null, false); // false so other filters remain
389
+
390
+ if (filterCallbackRef.current) {
391
+ filterCallbackRef.current(); // call the callback
392
+ filterCallbackRef.current = null; // clear the callback
393
+ }
394
+
371
395
  if (!isReady) {
372
396
  setIsReady(true);
373
397
  }
@@ -378,6 +402,11 @@ export default function withFilters(WrappedComponent) {
378
402
  return null;
379
403
  }
380
404
 
405
+ if (self) {
406
+ self.filterById = filterById;
407
+ self.setFilters = setFilters;
408
+ }
409
+
381
410
  const
382
411
  renderedFilters = renderFilters(),
383
412
  hasFilters = !!renderedFilters.length;
@@ -499,6 +528,7 @@ export default function withFilters(WrappedComponent) {
499
528
  editorType={EDITOR_TYPE__PLAIN}
500
529
  flex={1}
501
530
  startingValues={formStartingValues}
531
+ minHeight={minHeight}
502
532
  items={[
503
533
  {
504
534
  type: 'Column',
@@ -30,6 +30,9 @@ export default function withInlineEditor(WrappedComponent) {
30
30
  onEditorClose,
31
31
  editorStateRef,
32
32
 
33
+ // withComponent
34
+ self,
35
+
33
36
  // withSelection
34
37
  selection,
35
38
 
@@ -102,6 +105,7 @@ export default function withInlineEditor(WrappedComponent) {
102
105
  zIndex={10}
103
106
  >
104
107
  {isEditorShown && <Form
108
+ parent={self}
105
109
  editorType={EDITOR_TYPE__INLINE}
106
110
  editorStateRef={editorStateRef}
107
111
  record={selection[0]}
@@ -9,6 +9,7 @@ import Inflector from 'inflector-js';
9
9
  import qs from 'qs';
10
10
  import FormPanel from '../Panel/FormPanel.js';
11
11
  import inArray from '../../Functions/inArray.js';
12
+ import Pdf from '../Icons/Pdf.js';
12
13
  import useAdjustedWindowSize from '../../Hooks/useAdjustedWindowSize.js';
13
14
  import { EDITOR_TYPE__PLAIN } from '@onehat/ui/src/Constants/Editor.js';
14
15
  import UiGlobals from '../../UiGlobals.js';
@@ -149,19 +150,17 @@ export default function withPdfButton(WrappedComponent) {
149
150
  window.open(url + queryString, '_blank');
150
151
  };
151
152
 
152
- const button = <Button
153
- key="viewPdfBtn"
154
- borderRadius="md"
155
- colorScheme="primary"
156
- flexDirection="row"
157
- justifyContent="center"
158
- alignItems="center"
159
- px={4}
160
- onPress={(e) => setIsModalShown(true)}
161
- >View PDF</Button>;
162
- additionalEditButtons.unshift(button);
153
+ const button = {
154
+ key: 'viewPdfBtn',
155
+ text: 'View PDF',
156
+ icon: Pdf,
157
+ handler: () => {
158
+ setIsModalShown(true);
159
+ },
160
+ };
161
+ additionalEditButtons.push(button);
163
162
  if (additionalEditButtons !== additionalViewButtons) { // Ensure they're NOT the same object, otherwise this would be adding it twice!
164
- additionalViewButtons.unshift(button);
163
+ additionalViewButtons.push(button);
165
164
  }
166
165
 
167
166
  let modal = null;
@@ -202,7 +201,7 @@ export default function withPdfButton(WrappedComponent) {
202
201
  {...props}
203
202
  additionalEditButtons={additionalEditButtons}
204
203
  additionalViewButtons={additionalViewButtons}
205
- />;
204
+ />
206
205
  {modal}
207
206
  </>;
208
207
  };
@@ -54,6 +54,9 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
54
54
  disableDuplicate = !isEditor,
55
55
  disablePrint = !isGrid,
56
56
 
57
+ // withComponent
58
+ self,
59
+
57
60
  // withEditor
58
61
  userCanEdit = true,
59
62
  userCanView = true,
@@ -123,12 +126,14 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
123
126
  return isDisabled;
124
127
  },
125
128
  getPresetButtonProps = (type) => {
126
- let text,
129
+ let key,
130
+ text,
127
131
  handler,
128
132
  icon = null,
129
133
  isDisabled = false;
130
134
  switch(type) {
131
135
  case 'add':
136
+ key = 'addBtn';
132
137
  text = 'Add';
133
138
  handler = onAdd;
134
139
  icon = <Plus />;
@@ -140,6 +145,7 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
140
145
  }
141
146
  break;
142
147
  case 'edit':
148
+ key = 'editBtn';
143
149
  text = 'Edit';
144
150
  handler = onEdit;
145
151
  icon = <Edit />;
@@ -154,6 +160,7 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
154
160
  }
155
161
  break;
156
162
  case 'delete':
163
+ key = 'deleteBtn';
157
164
  text = 'Delete';
158
165
  handler = onDelete;
159
166
  icon = <Trash />;
@@ -168,6 +175,7 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
168
175
  }
169
176
  break;
170
177
  case 'view':
178
+ key = 'viewBtn';
171
179
  text = 'View';
172
180
  handler = onView;
173
181
  icon = <Eye />;
@@ -180,6 +188,7 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
180
188
  }
181
189
  break;
182
190
  case 'copy':
191
+ key = 'copyBtn';
183
192
  text = 'Copy to Clipboard';
184
193
  handler = onCopyToClipboard;
185
194
  icon = <Clipboard />;
@@ -192,6 +201,7 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
192
201
  }
193
202
  break;
194
203
  case 'duplicate':
204
+ key = 'duplicateBtn';
195
205
  text = 'Duplicate';
196
206
  handler = onDuplicate;
197
207
  icon = <Duplicate />;
@@ -214,10 +224,13 @@ export default function withPresetButtons(WrappedComponent, isGrid = false) {
214
224
  default:
215
225
  }
216
226
  return {
227
+ key,
217
228
  text,
218
229
  handler,
219
230
  icon,
220
231
  isDisabled,
232
+ parent: self,
233
+ reference: key,
221
234
  };
222
235
  },
223
236
  generatePresetButtons = () => {
@@ -27,6 +27,9 @@ export default function withSelection(WrappedComponent) {
27
27
  autoSelectFirstItem = false,
28
28
  fireEvent,
29
29
 
30
+ // withComponent
31
+ self,
32
+
30
33
  // withValue
31
34
  value,
32
35
  setValue,
@@ -309,6 +312,19 @@ export default function withSelection(WrappedComponent) {
309
312
 
310
313
  }, []);
311
314
 
315
+ if (self) {
316
+ self.setSelection = setSelection;
317
+ self.selectNext = selectNext;
318
+ self.selectPrev = selectPrev;
319
+ self.addToSelection = addToSelection;
320
+ self.removeFromSelection = removeFromSelection;
321
+ self.deselectAll = deselectAll;
322
+ self.selectRangeTo = selectRangeTo;
323
+ self.isInSelection = isInSelection;
324
+ self.getIdsFromLocalSelection = getIdsFromLocalSelection;
325
+ self.getDisplayValuesFromSelection = getDisplayValuesFromLocalSelection;
326
+ }
327
+
312
328
  if (usesWithValue) {
313
329
  useEffect(() => {
314
330
  if (!isReady) {
@@ -12,6 +12,11 @@ export default function withSideEditor(WrappedComponent, isTree = false) {
12
12
  Editor,
13
13
  editorProps = {},
14
14
  sideFlex = 100,
15
+
16
+ // withComponent
17
+ self,
18
+
19
+ ...propsToPass
15
20
  } = props;
16
21
 
17
22
  if (!Editor) {
@@ -25,12 +30,13 @@ export default function withSideEditor(WrappedComponent, isTree = false) {
25
30
  {...props}
26
31
  />}
27
32
  east={<Editor
28
- {...props}
33
+ {...propsToPass}
29
34
  editorType={EDITOR_TYPE__SIDE}
30
35
  flex={sideFlex}
31
36
  borderLeftWidth={1}
32
37
  borderLeftColor="#ccc"
33
38
  {...editorProps}
39
+ parent={self}
34
40
  />}
35
41
  />;
36
42
  });
@@ -32,6 +32,11 @@ export default function withWindowedEditor(WrappedComponent, isTree = false) {
32
32
  setIsEditorShown,
33
33
  Editor,
34
34
  editorProps = {},
35
+
36
+ // withComponent
37
+ self,
38
+
39
+ ...propsToPass
35
40
  } = props;
36
41
 
37
42
  if (!Editor) {
@@ -47,8 +52,9 @@ export default function withWindowedEditor(WrappedComponent, isTree = false) {
47
52
  >
48
53
  <Editor
49
54
  editorType={EDITOR_TYPE__WINDOWED}
50
- {...props}
55
+ {...propsToPass}
51
56
  {...editorProps}
57
+ parent={self}
52
58
  />
53
59
  </Modal>}
54
60
  </>;
@@ -0,0 +1,20 @@
1
+ import * as React from "react"
2
+ import Svg, { Path } from "react-native-svg"
3
+ import { Icon } from 'native-base';
4
+
5
+ function SvgComponent(props) {
6
+ return (
7
+ <Icon
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 101.44 83.8"
10
+ {...props}
11
+ >
12
+ <Path
13
+ d="M58.92 4.5L99.9 68.86c4.12 6.47-.53 14.94-8.2 14.94H9.74c-7.67 0-12.32-8.47-8.2-14.94L42.52 4.5c3.82-6 12.58-6 16.4 0zM34.64 72.71c3.24 0 5.34-2.34 5.34-5.46-.06-3.18-2.16-5.46-5.34-5.46s-5.4 2.28-5.4 5.46 2.16 5.46 5.4 5.46zm3.42-13.92l1.32-27.18h-9.54l1.38 27.18h6.84zm12.66 13.92c3.24 0 5.34-2.34 5.34-5.46-.06-3.18-2.16-5.46-5.34-5.46s-5.4 2.28-5.4 5.46 2.16 5.46 5.4 5.46zm3.42-13.92l1.32-27.18h-9.54l1.38 27.18h6.84zM66.8 72.71c3.24 0 5.34-2.34 5.34-5.46-.06-3.18-2.16-5.46-5.34-5.46s-5.4 2.28-5.4 5.46 2.16 5.46 5.4 5.46zm3.42-13.92l1.32-27.18H62l1.38 27.18h6.84z"
14
+ strokeWidth={0}
15
+ />
16
+ </Icon>
17
+ )
18
+ }
19
+
20
+ export default SvgComponent
@@ -0,0 +1,20 @@
1
+ import * as React from "react"
2
+ import Svg, { Path } from "react-native-svg"
3
+ import { Icon } from 'native-base';
4
+
5
+ function SvgComponent(props) {
6
+ return (
7
+ <Icon
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 101.44 83.8"
10
+ {...props}
11
+ >
12
+ <Path
13
+ d="M58.92 4.5L99.9 68.86c4.12 6.47-.53 14.94-8.2 14.94H9.74c-7.67 0-12.32-8.47-8.2-14.94L42.52 4.5c3.82-6 12.58-6 16.4 0zm-8.2 68.21c3.24 0 5.34-2.34 5.34-5.46-.06-3.18-2.16-5.46-5.34-5.46s-5.4 2.28-5.4 5.46 2.16 5.46 5.4 5.46zm3.42-13.92l1.32-27.18h-9.54l1.38 27.18h6.84z"
14
+ strokeWidth={0}
15
+ />
16
+ </Icon>
17
+ )
18
+ }
19
+
20
+ export default SvgComponent
@@ -0,0 +1,20 @@
1
+ import * as React from "react"
2
+ import Svg, { Path } from "react-native-svg"
3
+ import { Icon } from 'native-base';
4
+
5
+ function SvgComponent(props) {
6
+ return (
7
+ <Icon
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 101.44 83.8"
10
+ {...props}
11
+ >
12
+ <Path
13
+ d="M58.92 4.5L99.9 68.86c4.12 6.47-.53 14.94-8.2 14.94H9.74c-7.67 0-12.32-8.47-8.2-14.94L42.52 4.5c3.82-6 12.58-6 16.4 0zM42.68 72.71c3.24 0 5.34-2.34 5.34-5.46-.06-3.18-2.16-5.46-5.34-5.46s-5.4 2.28-5.4 5.46 2.16 5.46 5.4 5.46zm3.42-13.92l1.32-27.18h-9.54l1.38 27.18h6.84zm12.66 13.92c3.24 0 5.34-2.34 5.34-5.46-.06-3.18-2.16-5.46-5.34-5.46s-5.4 2.28-5.4 5.46 2.16 5.46 5.4 5.46zm3.42-13.92l1.32-27.18h-9.54l1.38 27.18h6.84z"
14
+ strokeWidth={0}
15
+ />
16
+ </Icon>
17
+ )
18
+ }
19
+
20
+ export default SvgComponent
@@ -0,0 +1,14 @@
1
+ // Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.
2
+ import * as React from "react"
3
+ import Svg, { Path } from "react-native-svg"
4
+ import { Icon } from 'native-base';
5
+
6
+ function SvgComponent(props) {
7
+ return (
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>
9
+ <Path d="M0 64C0 28.7 28.7 0 64 0h160v128c0 17.7 14.3 32 32 32h128v144H176c-35.3 0-64 28.7-64 64v144H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0l128 128zM176 352h32c30.9 0 56 25.1 56 56s-25.1 56-56 56h-16v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V368c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24h-16v48h16zm96-80h32c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48h-32c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16v-64c0-8.8-7.2-16-16-16h-16v96h16zm80-112c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16s-7.2 16-16 16h-32v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16h-32v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V368z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -4,6 +4,7 @@ import {
4
4
  Row,
5
5
  Text,
6
6
  } from 'native-base';
7
+ import withComponent from '../Hoc/withComponent.js';
7
8
  import IconButton from '../Buttons/IconButton';
8
9
  import FullWidth from '../Icons/FullWidth';
9
10
  import SideBySide from '../Icons/SideBySide';
@@ -15,7 +16,7 @@ const
15
16
  MODE_FULL = 'MODE_FULL',
16
17
  MODE_SIDE = 'MODE_SIDE';
17
18
 
18
- export default function ManagerScreen(props) {
19
+ function ManagerScreen(props) {
19
20
  const {
20
21
  title,
21
22
  sideModeComponent,
@@ -93,4 +94,6 @@ export default function ManagerScreen(props) {
93
94
  {whichComponent}
94
95
 
95
96
  </Column>;
96
- }
97
+ }
98
+
99
+ export default withComponent(ManagerScreen);
@@ -11,6 +11,7 @@ import {
11
11
  VERTICAL,
12
12
  } from '../../Constants/Directions.js';
13
13
  import UiGlobals from '../../UiGlobals.js';
14
+ import withComponent from '../Hoc/withComponent.js';
14
15
  import IconButton from '../Buttons/IconButton.js';
15
16
  import Minimize from '../Icons/Minimize.js';
16
17
  import Maximize from '../Icons/Maximize.js';
@@ -19,7 +20,7 @@ import setSaved from '../../Functions/setSaved.js';
19
20
  import _ from 'lodash';
20
21
 
21
22
 
22
- export default function TabBar(props) {
23
+ function TabBar(props) {
23
24
  const {
24
25
  tabs = [], // { _icon, title, content, path, items, }
25
26
  content, // e.g. Expo Router slot
@@ -386,4 +387,6 @@ export default function TabBar(props) {
386
387
  {renderedCurrentTabContent}
387
388
  </Column>}
388
389
  </Column>;
389
- }
390
+ }
391
+
392
+ export default withComponent(TabBar);
@@ -79,7 +79,8 @@ export default function Pagination(props) {
79
79
  >
80
80
  <Text mr={2}>Page</Text>
81
81
  <Input
82
- value={page}
82
+ keyboardType="numeric"
83
+ value={page?.toString()}
83
84
  onChangeValue={(value) => Repository.setPage(value)}
84
85
  maxValue={totalPages}
85
86
  isDisabled={totalPages === 1}