@onehat/ui 0.3.253 → 0.3.254
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
|
@@ -209,8 +209,7 @@ function GridComponent(props) {
|
|
|
209
209
|
[isReady, setIsReady] = useState(false),
|
|
210
210
|
[isLoading, setIsLoading] = useState(false),
|
|
211
211
|
[localColumnsConfig, setLocalColumnsConfigRaw] = useState([]),
|
|
212
|
-
[
|
|
213
|
-
[dragRow, setDragRow] = useState(),
|
|
212
|
+
[isReorderMode, setIsReorderMode] = useState(false),
|
|
214
213
|
[isColumnSelectorShown, setIsColumnSelectorShown] = useState(false),
|
|
215
214
|
getIsExpanded = (index) => {
|
|
216
215
|
return !!expandedRowsRef.current[index];
|
|
@@ -309,8 +308,8 @@ function GridComponent(props) {
|
|
|
309
308
|
key="reorderBtn"
|
|
310
309
|
parent={self}
|
|
311
310
|
reference="reorderBtn"
|
|
312
|
-
onPress={() =>
|
|
313
|
-
icon={<Icon as={
|
|
311
|
+
onPress={() => setIsReorderMode(!isReorderMode)}
|
|
312
|
+
icon={<Icon as={isReorderMode ? NoReorderRows : ReorderRows} color={styles.GRID_TOOLBAR_ITEMS_COLOR} />}
|
|
314
313
|
tooltip="Reorder Rows"
|
|
315
314
|
/>);
|
|
316
315
|
}
|
|
@@ -339,7 +338,7 @@ function GridComponent(props) {
|
|
|
339
338
|
if (e.preventDefault && e.cancelable) {
|
|
340
339
|
e.preventDefault();
|
|
341
340
|
}
|
|
342
|
-
if (isHeaderRow ||
|
|
341
|
+
if (isHeaderRow || isReorderMode) {
|
|
343
342
|
return
|
|
344
343
|
}
|
|
345
344
|
if (CURRENT_MODE === UI_MODE_WEB) {
|
|
@@ -383,7 +382,7 @@ function GridComponent(props) {
|
|
|
383
382
|
if (e.preventDefault && e.cancelable) {
|
|
384
383
|
e.preventDefault();
|
|
385
384
|
}
|
|
386
|
-
if (isHeaderRow ||
|
|
385
|
+
if (isHeaderRow || isReorderMode) {
|
|
387
386
|
return
|
|
388
387
|
}
|
|
389
388
|
|
|
@@ -454,7 +453,7 @@ function GridComponent(props) {
|
|
|
454
453
|
const getSelection = () => dragSelectionRef.current;
|
|
455
454
|
|
|
456
455
|
// assign event handlers
|
|
457
|
-
if (canRowsReorder &&
|
|
456
|
+
if (canRowsReorder && isReorderMode) {
|
|
458
457
|
WhichRow = DragSourceGridRow;
|
|
459
458
|
rowReorderProps.isDragSource = true;
|
|
460
459
|
rowReorderProps.dragSourceType = 'row';
|
|
@@ -894,7 +893,7 @@ function GridComponent(props) {
|
|
|
894
893
|
|
|
895
894
|
isAddingRef.current = isAdding;
|
|
896
895
|
|
|
897
|
-
const footerToolbarItemComponents = useMemo(() => getFooterToolbarItems(), [Repository?.hash, additionalToolbarButtons,
|
|
896
|
+
const footerToolbarItemComponents = useMemo(() => getFooterToolbarItems(), [Repository?.hash, additionalToolbarButtons, isReorderMode]);
|
|
898
897
|
|
|
899
898
|
if (!isInited) {
|
|
900
899
|
// first time through, render a placeholder so we can get container dimensions
|
|
@@ -1000,7 +999,7 @@ function GridComponent(props) {
|
|
|
1000
999
|
}
|
|
1001
1000
|
|
|
1002
1001
|
const gridContainerBorderProps = {};
|
|
1003
|
-
if (
|
|
1002
|
+
if (isReorderMode) {
|
|
1004
1003
|
gridContainerBorderProps.borderWidth = styles.REORDER_BORDER_WIDTH;
|
|
1005
1004
|
gridContainerBorderProps.borderColor = styles.REORDER_BORDER_COLOR;
|
|
1006
1005
|
gridContainerBorderProps.borderStyle = styles.REORDER_BORDER_STYLE;
|
|
@@ -1056,7 +1055,7 @@ function GridComponent(props) {
|
|
|
1056
1055
|
minHeight={40}
|
|
1057
1056
|
{...gridContainerBorderProps}
|
|
1058
1057
|
onClick={() => {
|
|
1059
|
-
if (!
|
|
1058
|
+
if (!isReorderMode && !isInlineEditorShown && deselectAll) {
|
|
1060
1059
|
deselectAll();
|
|
1061
1060
|
}
|
|
1062
1061
|
}}
|
|
@@ -483,7 +483,7 @@ export default function withSecondaryEditor(WrappedComponent, isTree = false) {
|
|
|
483
483
|
if (_.isPlainObject(val1)) {
|
|
484
484
|
for (let key2 in val1) { if (val1.hasOwnProperty(key2)) {
|
|
485
485
|
const val2 = val1[key2];
|
|
486
|
-
msg += "\n" + val2;
|
|
486
|
+
msg += "\n" + key2 + ': ' + val2;
|
|
487
487
|
} }
|
|
488
488
|
} else if (_.isString(data)) {
|
|
489
489
|
msg += "\n" + data;
|
|
@@ -492,7 +492,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
|
|
|
492
492
|
if (_.isPlainObject(val1)) {
|
|
493
493
|
for (let key2 in val1) { if (val1.hasOwnProperty(key2)) {
|
|
494
494
|
const val2 = val1[key2];
|
|
495
|
-
msg += "\n" + val2;
|
|
495
|
+
msg += "\n" + key2 + ': ' + val2;
|
|
496
496
|
} }
|
|
497
497
|
} else if (_.isString(data)) {
|
|
498
498
|
msg += "\n" + data;
|