@onehat/ui 0.3.352 → 0.3.355

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.3.352",
3
+ "version": "0.3.355",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -778,7 +778,7 @@ export function ComboComponent(props) {
778
778
 
779
779
  }}
780
780
  onAdd={(selection) => {
781
- const entity = selection[0];
781
+ const entity = _.isArray(selection) ? selection[0] : selection;
782
782
  if (entity.id !== value && !isInTag) {
783
783
  // Select it and set the value of the combo.
784
784
  setGridSelection(selection);
@@ -789,7 +789,7 @@ export function ComboComponent(props) {
789
789
  }
790
790
  }}
791
791
  onSave={(selection) => {
792
- const entity = selection[0];
792
+ const entity = _.isArray(selection) ? selection[0] : selection;
793
793
  if (!isInTag) {
794
794
  if (entity?.id !== value) { // Tag doesn't use value, so don't do this comparison in the Tag
795
795
  // Either a phantom record was just solidified into a real record, or a new (non-phantom) record was added.
@@ -105,6 +105,7 @@ function GridComponent(props) {
105
105
  flatListProps = {},
106
106
  onRowPress,
107
107
  onRender,
108
+ disableLoadOnRender = false,
108
109
  forceLoadOnRender = false,
109
110
  pullToRefresh = true,
110
111
  hideNavColumn = true,
@@ -801,6 +802,10 @@ function GridComponent(props) {
801
802
  }
802
803
  };
803
804
 
805
+ if (forceLoadOnRender && disableLoadOnRender) {
806
+ throw new Error('incompatible config! forceLoadOnRender and disableLoadOnRender cannot both be true');
807
+ }
808
+
804
809
  useEffect(() => {
805
810
  if (!isInited) {
806
811
  // first call -- meant to render placeholder so we get container dimensions
@@ -934,7 +939,7 @@ function GridComponent(props) {
934
939
  applySelectorSelected();
935
940
  Repository.resumeEvents();
936
941
 
937
- if ((Repository.isRemote && !Repository.isLoaded) || forceLoadOnRender) {
942
+ if (((Repository.isRemote && !Repository.isLoaded) || forceLoadOnRender) && !disableLoadOnRender) { // default remote repositories to load on render, optionally force or disable load on render
938
943
  Repository.load();
939
944
  }
940
945
 
@@ -17,15 +17,18 @@ const
17
17
  height = 50,
18
18
  width = 200;
19
19
 
20
- // NOTE: THis component does NOT use the native-base Modal
20
+ // NOTE: This component does NOT use the native-base Modal
21
21
  // because we need it to appear on top of all other Modals.
22
22
  // Therefore, we're using the ReactNative Modal, which at least for web
23
23
  // we can control the zIndex of.
24
24
 
25
25
  export default function WaitMessage(props) {
26
- const {
27
- textMessage = 'Please wait...',
26
+ let {
27
+ text,
28
28
  } = props;
29
+ if (!text) { // do this here instead of setting default value in deconstructor, so we can use the default for text, even if text is defined and passed as null or empty string
30
+ text = 'Please wait...';
31
+ }
29
32
 
30
33
  let transform;
31
34
  if (UiGlobals.mode === UI_MODE_WEB) {
@@ -74,7 +77,7 @@ export default function WaitMessage(props) {
74
77
  flexDirection="row"
75
78
  >
76
79
  <Loading minHeight="auto" h={5} w={5} mr={2} />
77
- <Text color="#000">{textMessage}</Text>
80
+ <Text color="#000">{text}</Text>
78
81
  </Box>
79
82
  </View>
80
83
  </View>