@onehat/ui 0.3.157 → 0.3.160

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.157",
3
+ "version": "0.3.160",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -329,8 +329,15 @@ function GridComponent(props) {
329
329
  if (!isSelected) { // If a row was already selected when double-clicked, the first click will deselect it,
330
330
  onRowClick(item, e); // so reselect it
331
331
  }
332
- if (onEdit) {
333
- onEdit();
332
+
333
+ if (UiGlobals.doubleClickingGridRowOpensEditorInViewMode) { // global setting
334
+ if (onView) {
335
+ onView(true);
336
+ }
337
+ } else {
338
+ if (onEdit) {
339
+ onEdit();
340
+ }
334
341
  }
335
342
  break;
336
343
  case 3: // triple click
@@ -157,7 +157,7 @@ export default function withAlert(WrappedComponent) {
157
157
  onPress={onNo}
158
158
  color="trueGray.800"
159
159
  variant="ghost"
160
- colorScheme="neutral"
160
+ // colorScheme="neutral"
161
161
  mr={2}
162
162
  >No</Button>);
163
163
  buttons.push(<Button
@@ -259,14 +259,14 @@ export default function withEditor(WrappedComponent, isTree = false) {
259
259
  onDelete(selection);
260
260
  }
261
261
  },
262
- doView = async () => {
262
+ doView = async (allowEditing = false) => {
263
263
  if (!userCanView) {
264
264
  return;
265
265
  }
266
266
  if (selection.length !== 1) {
267
267
  return;
268
268
  }
269
- setIsEditorViewOnly(true);
269
+ setIsEditorViewOnly(!allowEditing);
270
270
  setEditorMode(EDITOR_MODE__VIEW);
271
271
  setIsEditorShown(true);
272
272
 
@@ -185,7 +185,7 @@ function AttachmentsElement(props) {
185
185
  },
186
186
  onFileDelete = (id) => {
187
187
  if (confirmBeforeDelete) {
188
- confirm('Are you sure you want to delete?', () => doDelete(id));
188
+ confirm('Are you sure you want to delete the file?', () => doDelete(id));
189
189
  } else {
190
190
  doDelete(id);
191
191
  }