@onehat/ui 0.3.114 → 0.3.116

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.114",
3
+ "version": "0.3.116",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -171,6 +171,17 @@ function GridComponent(props) {
171
171
  styles = UiGlobals.styles,
172
172
  id = props.id || props.self?.path,
173
173
  localColumnsConfigKey = id && id + '-localColumnsConfig',
174
+ [hasFunctionColumn, setHasActionColumns] = useState((() => {
175
+ // We can't save localColumnsConfig when there's a function column, so we need to determine if this is the case (only run once per Grid)
176
+ let ret = false;
177
+ _.each(columnsConfig, (column) => {
178
+ if (column.renderer || _.isFunction(column)) {
179
+ ret = true;
180
+ return false;
181
+ }
182
+ });
183
+ return ret;
184
+ })()),
174
185
  forceUpdate = useForceUpdate(),
175
186
  containerRef = useRef(),
176
187
  gridRef = useRef(),
@@ -184,7 +195,7 @@ function GridComponent(props) {
184
195
  [dragRowSlot, setDragRowSlot] = useState(null),
185
196
  [dragRowIx, setDragRowIx] = useState(),
186
197
  setLocalColumnsConfig = (config) => {
187
- if (localColumnsConfigKey) {
198
+ if (localColumnsConfigKey && !hasFunctionColumn) {
188
199
  setSaved(localColumnsConfigKey, config);
189
200
  }
190
201
 
@@ -733,7 +744,7 @@ function GridComponent(props) {
733
744
  // calculate localColumnsConfig
734
745
  let localColumnsConfig = [];
735
746
  let savedLocalColumnsConfig;
736
- if (localColumnsConfigKey) {
747
+ if (localColumnsConfigKey && !hasFunctionColumn) {
737
748
  savedLocalColumnsConfig = await getSaved(localColumnsConfigKey);
738
749
  }
739
750
  if (savedLocalColumnsConfig) {
@@ -342,7 +342,7 @@ export default function GridHeaderRow(props) {
342
342
  if (isBlocked.current) { // withDraggable initiates block
343
343
  return;
344
344
  }
345
- if (canColumnsSort) {
345
+ if (sortable && canColumnsSort) {
346
346
  onSort(config, e);
347
347
  }
348
348
  }}
@@ -6,7 +6,7 @@ import { Icon } from 'native-base';
6
6
  function SvgComponent(props) {
7
7
  return (
8
8
  <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" {...props}>
9
- <Path d="M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32v301.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32z" />
9
+ <Path d="M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32v301.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320z" />
10
10
  </Icon>
11
11
  )
12
12
  }
@@ -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 576 512" {...props}>
9
+ <Path d="M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32v301.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32z" />
10
+ </Icon>
11
+ )
12
+ }
13
+
14
+ export default SvgComponent
@@ -5,12 +5,8 @@ import { Icon } from 'native-base';
5
5
 
6
6
  function SvgComponent(props) {
7
7
  return (
8
- <Icon
9
- xmlns="http://www.w3.org/2000/svg"
10
- viewBox="0 0 576 512"
11
- {...props}
12
- >
13
- <Path d="M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 480h32c17.7 0 32-14.3 32-32s-14.3-32-32-32h-32c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h96c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h160c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h224c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32z" />
8
+ <Icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" {...props}>
9
+ <Path d="M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 480h32c17.7 0 32-14.3 32-32s-14.3-32-32-32h-32c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h96c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h160c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h224c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32z" />
14
10
  </Icon>
15
11
  )
16
12
  }
@@ -0,0 +1,18 @@
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 576 512"
11
+ {...props}
12
+ >
13
+ <Path d="M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 480h32c17.7 0 32-14.3 32-32s-14.3-32-32-32h-32c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h96c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h160c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128h224c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32s14.3 32 32 32z" />
14
+ </Icon>
15
+ )
16
+ }
17
+
18
+ export default SvgComponent
@@ -151,7 +151,9 @@ import Scroll from '../Components/Icons/Scroll.js';
151
151
  import Share from '../Components/Icons/Share.js';
152
152
  import Shop from '../Components/Icons/Shop.js';
153
153
  import SideBySide from '../Components/Icons/SideBySide.js';
154
+ import SortDownAlt from '../Components/Icons/SortDownAlt.js';
154
155
  import SortDown from '../Components/Icons/SortDown.js';
156
+ import SortUpAlt from '../Components/Icons/SortUpAlt.js';
155
157
  import SortUp from '../Components/Icons/SortUp.js';
156
158
  import Square from '../Components/Icons/Square.js';
157
159
  import SquareCheck from '../Components/Icons/SquareCheck.js';
@@ -376,7 +378,9 @@ const components = {
376
378
  Share,
377
379
  Shop,
378
380
  SideBySide,
381
+ SortDownAlt,
379
382
  SortDown,
383
+ SortUpAlt,
380
384
  SortUp,
381
385
  Square,
382
386
  SquareCheck,