@onehat/ui 0.3.115 → 0.3.117

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.115",
3
+ "version": "0.3.117",
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) {
@@ -74,7 +74,7 @@ export default function withContextMenu(WrappedComponent) {
74
74
  key={ix}
75
75
  onPress={() => {
76
76
  setIsContextMenuShown(false);
77
- handler();
77
+ handler(selection);
78
78
  }}
79
79
  flexDirection="row"
80
80
  borderBottomWidth={1}