@onehat/ui 0.3.34 → 0.3.35

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.34",
3
+ "version": "0.3.35",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -145,6 +145,7 @@ function GridComponent(props) {
145
145
  } = props,
146
146
  styles = UiGlobals.styles,
147
147
  forceUpdate = useForceUpdate(),
148
+ containerRef = useRef(),
148
149
  gridRef = useRef(),
149
150
  isAddingRef = useRef(),
150
151
  [isReady, setIsReady] = useState(false),
@@ -775,7 +776,7 @@ function GridComponent(props) {
775
776
  }, [selectorId, selectorSelected]);
776
777
 
777
778
  if (self) {
778
- self.ref = gridRef;
779
+ self.ref = containerRef;
779
780
  }
780
781
 
781
782
  isAddingRef.current = isAdding;
@@ -801,7 +802,7 @@ function GridComponent(props) {
801
802
  let listFooterComponent = null;
802
803
  if (!disableBottomToolbar) {
803
804
  if (Repository && bottomToolbar === 'pagination' && !disablePagination && Repository.isPaginated) {
804
- listFooterComponent = <PaginationToolbar Repository={Repository} toolbarItems={footerToolbarItemComponents} disablePageSize={!disableAdjustingPageSizeToHeight} />;
805
+ listFooterComponent = <PaginationToolbar Repository={Repository} self={self} toolbarItems={footerToolbarItemComponents} disablePageSize={!disableAdjustingPageSizeToHeight} />;
805
806
  } else if (footerToolbarItemComponents.length) {
806
807
  listFooterComponent = <Toolbar>{footerToolbarItemComponents}</Toolbar>;
807
808
  }
@@ -816,6 +817,7 @@ function GridComponent(props) {
816
817
 
817
818
  return <Column
818
819
  {...testProps('Grid')}
820
+ ref={containerRef}
819
821
  w="100%"
820
822
  bg={bg}
821
823
  borderWidth={styles.GRID_BORDER_WIDTH}
@@ -106,6 +106,7 @@ export default function withInlineEditor(WrappedComponent) {
106
106
  >
107
107
  {isEditorShown && <Form
108
108
  parent={self}
109
+ reference="form"
109
110
  editorType={EDITOR_TYPE__INLINE}
110
111
  editorStateRef={editorStateRef}
111
112
  record={selection[0]}
@@ -37,6 +37,7 @@ export default function withSideEditor(WrappedComponent, isTree = false) {
37
37
  borderLeftColor="#ccc"
38
38
  {...editorProps}
39
39
  parent={self}
40
+ reference="editor"
40
41
  />}
41
42
  />;
42
43
  });
@@ -55,6 +55,7 @@ export default function withWindowedEditor(WrappedComponent, isTree = false) {
55
55
  {...propsToPass}
56
56
  {...editorProps}
57
57
  parent={self}
58
+ reference="editor"
58
59
  />
59
60
  </Modal>}
60
61
  </>;
@@ -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="M211 7.3C205 1 196-1.4 187.6.8s-14.9 8.9-17.1 17.3l-15.8 62.5-62-17.5c-8.4-2.4-17.4 0-23.5 6.1s-8.5 15.1-6.1 23.5l17.5 62-62.5 15.9c-8.4 2.1-15 8.7-17.3 17.1S1 205 7.3 211l46.2 45-46.2 45c-6.3 6-8.7 15-6.5 23.4s8.9 14.9 17.3 17.1l62.5 15.8-17.5 62c-2.4 8.4 0 17.4 6.1 23.5s15.1 8.5 23.5 6.1l62-17.5 15.8 62.5c2.1 8.4 8.7 15 17.1 17.3s17.3-.2 23.4-6.4l45-46.2 45 46.2c6.1 6.2 15 8.7 23.4 6.4s14.9-8.9 17.1-17.3l15.8-62.5 62 17.5c8.4 2.4 17.4 0 23.5-6.1s8.5-15.1 6.1-23.5l-17.5-62 62.5-15.8c8.4-2.1 15-8.7 17.3-17.1s-.2-17.3-6.4-23.4l-46.2-45 46.2-45c6.2-6.1 8.7-15 6.4-23.4s-8.9-14.9-17.3-17.1l-62.5-15.8 17.5-62c2.4-8.4 0-17.4-6.1-23.5s-15.1-8.5-23.5-6.1l-62 17.5-15.9-62.5c-2.1-8.4-8.7-15-17.1-17.3S307 1 301 7.3l-45 46.2-45-46.2z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -0,0 +1,21 @@
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
9
+ id="Layer_2"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ viewBox="0 0 9.51 12.68"
12
+ {...props}
13
+ >
14
+ <Path
15
+ d="M4.76 0C3.72 0 2.84.66 2.52 1.59h-.93C.72 1.59 0 2.3 0 3.18v7.93c0 .87.71 1.59 1.59 1.59h6.34c.87 0 1.59-.71 1.59-1.59V3.17c0-.87-.71-1.59-1.59-1.59H7A2.384 2.384 0 004.76-.01zm0 1.59c.44 0 .79.35.79.79s-.35.79-.79.79-.79-.35-.79-.79.35-.79.79-.79zm2.8 5.18L4.39 9.94c-.23.23-.61.23-.84 0L1.96 8.35c-.23-.23-.23-.61 0-.84s.61-.23.84 0l1.16 1.16 2.75-2.75c.23-.23.61-.23.84 0s.23.61 0 .84z"
16
+ />
17
+ </Icon>
18
+ )
19
+ }
20
+
21
+ export default SvgComponent
@@ -0,0 +1,21 @@
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
9
+ id="Layer_2"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ viewBox="0 0 10.46 10.46"
12
+ {...props}
13
+ >
14
+ <Path
15
+ d="M0 5.23C0 2.34 2.34 0 5.23 0s5.23 2.34 5.23 5.23-2.34 5.23-5.23 5.23S0 8.12 0 5.23zm5.89-3.27c0-.36-.29-.65-.65-.65s-.65.29-.65.65.29.65.65.65.65-.29.65-.65zM5.24 8.5c.72 0 1.31-.59 1.31-1.31 0-.36-.14-.68-.37-.91L7.49 3.3c.11-.25 0-.54-.25-.65s-.54 0-.65.25L5.28 5.88h-.04c-.72 0-1.31.59-1.31 1.31S4.52 8.5 5.24 8.5zM3.6 2.94c0-.36-.29-.65-.65-.65s-.65.29-.65.65.29.65.65.65.65-.29.65-.65zM1.96 5.88c.36 0 .65-.29.65-.65s-.29-.65-.65-.65-.65.29-.65.65.29.65.65.65zm7.19-.65c0-.36-.29-.65-.65-.65s-.65.29-.65.65.29.65.65.65.65-.29.65-.65z"
16
+ />
17
+ </Icon>
18
+ )
19
+ }
20
+
21
+ export default SvgComponent
@@ -0,0 +1,20 @@
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
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ viewBox="0 0 11.77 7.85"
11
+ {...props}
12
+ >
13
+ <Path
14
+ d="M0 1.31C0 .59.59 0 1.31 0h5.23c.72 0 1.31.59 1.31 1.31v5.23c0 .72-.59 1.31-1.31 1.31H1.31C.59 7.85 0 7.26 0 6.54V1.31zM11.43.73c.21.11.35.34.35.58v5.23c0 .24-.13.46-.35.58s-.47.1-.67-.03L8.8 5.78l-.29-.19V2.27l.29-.19L10.76.77c.2-.13.46-.15.67-.03z"
15
+ />
16
+ </Icon>
17
+ )
18
+ }
19
+
20
+ export default SvgComponent
@@ -18,6 +18,9 @@ export default function Pagination(props) {
18
18
  const {
19
19
  minimize = false,
20
20
  disablePageSize = false,
21
+
22
+ // withComponent
23
+ self,
21
24
 
22
25
  // withData
23
26
  Repository,
@@ -56,6 +59,8 @@ export default function Pagination(props) {
56
59
  isDisabled = page === 1;
57
60
  items.push(<IconButton
58
61
  key="first"
62
+ parent={self}
63
+ reference="firstPageBtn"
59
64
  {...iconButtonProps}
60
65
  isDisabled={isDisabled}
61
66
  icon={<Icon as={AnglesLeft} {...iconProps} color={isDisabled ? 'disabled' : 'trueGray.600'} />}
@@ -64,6 +69,8 @@ export default function Pagination(props) {
64
69
  />);
65
70
  items.push(<IconButton
66
71
  key="prev"
72
+ parent={self}
73
+ reference="prevPageBtn"
67
74
  {...iconButtonProps}
68
75
  isDisabled={isDisabled}
69
76
  icon={<Icon as={AngleLeft} {...iconProps} color={isDisabled ? 'disabled' : 'trueGray.600'} />}
@@ -79,6 +86,8 @@ export default function Pagination(props) {
79
86
  >
80
87
  <Text mr={2}>Page</Text>
81
88
  <Input
89
+ parent={self}
90
+ reference="pageInput"
82
91
  keyboardType="numeric"
83
92
  value={page?.toString()}
84
93
  onChangeValue={(value) => Repository.setPage(value)}
@@ -94,6 +103,8 @@ export default function Pagination(props) {
94
103
  isDisabled = page === totalPages || totalPages <= 1;
95
104
  items.push(<IconButton
96
105
  key="next"
106
+ parent={self}
107
+ reference="nextPageBtn"
97
108
  {...iconButtonProps}
98
109
  isDisabled={isDisabled}
99
110
  icon={<Icon as={AngleRight} {...iconProps} color={isDisabled ? 'disabled' : 'trueGray.600'} />}
@@ -102,6 +113,8 @@ export default function Pagination(props) {
102
113
  />);
103
114
  items.push(<IconButton
104
115
  key="last"
116
+ parent={self}
117
+ reference="lastPageBtn"
105
118
  {...iconButtonProps}
106
119
  isDisabled={isDisabled}
107
120
  icon={<Icon as={AnglesRight} {...iconProps} color={isDisabled ? 'disabled' : 'trueGray.600'} />}
@@ -111,6 +124,8 @@ export default function Pagination(props) {
111
124
  if (!Repository.isLocal) {
112
125
  items.push(<IconButton
113
126
  key="reload"
127
+ parent={self}
128
+ reference="reloadPageBtn"
114
129
  {...iconButtonProps}
115
130
  icon={<Icon as={Rotate} {...iconProps} color="trueGray.600" />}
116
131
  onPress={() => Repository.reload()}