@teselagen/ui 0.5.19 → 0.5.20

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": "@teselagen/ui",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -19,6 +19,7 @@
19
19
  "@dnd-kit/core": "^6.1.0",
20
20
  "@dnd-kit/modifiers": "^7.0.0",
21
21
  "@dnd-kit/sortable": "^8.0.0",
22
+ "@dnd-kit/utilities": "3.2.2",
22
23
  "@teselagen/react-table": "6.10.16",
23
24
  "bluebird": "3.7.2",
24
25
  "buffer": "5.7.1",
@@ -35,6 +36,7 @@
35
36
  "jszip": "^3.10.1",
36
37
  "lodash-es": "^4.17.21",
37
38
  "math-expression-evaluator": "^1.3.7",
39
+ "mobx": "^6.10.2",
38
40
  "mobx-react": "^9.0.1",
39
41
  "mock-fs": "5.2.0",
40
42
  "nanoid": "^4.0.0",
@@ -1,20 +1,21 @@
1
1
  import { flatMap } from "lodash-es";
2
2
  import { forEach } from "lodash-es";
3
3
  import React, { useRef } from "react";
4
+ import ReactDOM from "react-dom";
4
5
 
5
- export const CellDragHandle = ({
6
+ export function CellDragHandle({
6
7
  thisTable,
7
8
  onDragEnd,
8
9
  cellId,
9
10
  isSelectionARectangle
10
- }) => {
11
+ }) {
11
12
  const xStart = useRef(0);
12
13
  const timeoutkey = useRef();
13
14
  const rowsToSelect = useRef();
14
15
  const rectangleCellPaths = useRef();
15
16
 
16
17
  const handleDrag = useRef(e => {
17
- const table = thisTable.querySelector(".rt-table");
18
+ const table = ReactDOM.findDOMNode(thisTable).querySelector(".rt-table");
18
19
  const trs = table.querySelectorAll(`.rt-tr-group.with-row-data`);
19
20
  const [rowId, path] = cellId.split(":");
20
21
  const selectedTr = table.querySelector(
@@ -82,7 +83,7 @@ export const CellDragHandle = ({
82
83
 
83
84
  const mouseup = useRef(() => {
84
85
  clearTimeout(timeoutkey.current);
85
- const table = thisTable;
86
+ const table = ReactDOM.findDOMNode(thisTable);
86
87
  const trs = table.querySelectorAll(`.rt-tr-group.with-row-data`);
87
88
  const [, path] = cellId.split(":");
88
89
  //remove the dashed borders
@@ -125,6 +126,6 @@ export const CellDragHandle = ({
125
126
  document.addEventListener("mouseup", mouseup.current, false);
126
127
  }}
127
128
  className="cellDragHandle"
128
- />
129
+ ></div>
129
130
  );
130
- };
131
+ }
@@ -5,7 +5,7 @@ import { noop, get, toInteger } from "lodash-es";
5
5
  import { Button, Classes } from "@blueprintjs/core";
6
6
  import { onEnterOrBlurHelper } from "../utils/handlerHelpers";
7
7
  import { defaultPageSizes } from "./utils/queryParams";
8
- import { getIdOrCodeOrIndex } from "./utils";
8
+ import getIdOrCodeOrIndex from "./utils/getIdOrCodeOrIndex";
9
9
 
10
10
  function PagingInput({ disabled, onBlur, defaultPage }) {
11
11
  const [page, setPage] = useState(defaultPage);