@tsed/react-formio 2.1.0 → 2.1.2
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/dist/index.js +49 -46
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +194 -191
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
- package/src/components/table/components/defaultCells.component.tsx +1 -0
- package/src/components/table/components/dragNDropContainer.tsx +1 -1
- package/src/components/table/hooks/useCustomTable.hook.tsx +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/react-formio",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Provide a react formio wrapper. Written in TypeScript.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"tooltip.js": ">=1.3.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tsed/tailwind": "2.1.
|
|
34
|
-
"@tsed/tailwind-formio": "2.1.
|
|
33
|
+
"@tsed/tailwind": "2.1.2",
|
|
34
|
+
"@tsed/tailwind-formio": "2.1.2"
|
|
35
35
|
},
|
|
36
36
|
"repository": "https://github.com/TypedProject/tsed-formio",
|
|
37
37
|
"bugs": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import noop from "lodash/noop";
|
|
2
|
-
import React, { PropsWithChildren, useState } from "react";
|
|
2
|
+
import React, { PropsWithChildren, useEffect, useState } from "react";
|
|
3
3
|
import { CellProps, FilterProps, Renderer, TableOptions, useFilters, useGroupBy, usePagination, useSortBy, useTable } from "react-table";
|
|
4
4
|
|
|
5
5
|
import { OnClickOperation, Operation, QueryOptions } from "../../../interfaces";
|
|
@@ -157,6 +157,11 @@ export function useCustomTable<Data extends object = {}>(props: PropsWithChildre
|
|
|
157
157
|
|
|
158
158
|
// DND
|
|
159
159
|
const [records, setRecords] = useState<Data[]>(data);
|
|
160
|
+
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
setRecords(data);
|
|
163
|
+
}, [data]);
|
|
164
|
+
|
|
160
165
|
const _onDrag = (dragIndex: number, hoverIndex: number) => {
|
|
161
166
|
const newRecords = swapElements([...records], dragIndex, hoverIndex);
|
|
162
167
|
|