@gisce/react-ooui 1.0.25 → 1.0.26
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/helpers/treeHelper.d.ts +1 -2
- package/dist/helpers/treeHelper.d.ts.map +1 -1
- package/dist/react-ooui.es.js +1 -7
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +2 -2
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/base/one2many/One2manyInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/helpers/treeHelper.ts +0 -17
- package/src/widgets/base/one2many/One2manyInput.tsx +4 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"One2manyInput.d.ts","sourceRoot":"","sources":["One2manyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAWvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAkBhC,aAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC5B,CAAC;AAQF,aAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EACN,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd;AAWD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"One2manyInput.d.ts","sourceRoot":"","sources":["One2manyInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAWvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAkBhC,aAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC5B,CAAC;AAQF,aAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EACN,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd;AAWD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwkB/C,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -160,22 +160,6 @@ function sortResults({
|
|
|
160
160
|
return resultsToSort.sort(sortFn);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
function sortResultsWithOrder(results: any[], order: number[]) {
|
|
164
|
-
if (!order) {
|
|
165
|
-
const sortResultsById = results.sort((a: any, b: any) => {
|
|
166
|
-
return a.id - b.id;
|
|
167
|
-
});
|
|
168
|
-
return sortResultsById;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const sortedResults = results.sort((a: any, b: any) => {
|
|
172
|
-
const aIndex = order.indexOf(a.id);
|
|
173
|
-
const bIndex = order.indexOf(b.id);
|
|
174
|
-
return aIndex - bIndex;
|
|
175
|
-
});
|
|
176
|
-
return sortedResults;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
163
|
export {
|
|
180
164
|
getTableColumns,
|
|
181
165
|
getTableItems,
|
|
@@ -184,5 +168,4 @@ export {
|
|
|
184
168
|
itemHasBooleans,
|
|
185
169
|
getColorMap,
|
|
186
170
|
sortResults,
|
|
187
|
-
sortResultsWithOrder,
|
|
188
171
|
};
|
|
@@ -26,7 +26,7 @@ import { readObjectValues, getNextPendingId } from "@/helpers/one2manyHelper";
|
|
|
26
26
|
import { SearchModal } from "@/widgets/modals/SearchModal";
|
|
27
27
|
import { LocaleContext, LocaleContextType } from "@/context/LocaleContext";
|
|
28
28
|
import { ViewModes } from "@/widgets/base/one2many/One2many";
|
|
29
|
-
import { sortResults
|
|
29
|
+
import { sortResults } from "@/helpers/treeHelper";
|
|
30
30
|
|
|
31
31
|
type One2manyValue = {
|
|
32
32
|
fields?: any;
|
|
@@ -90,9 +90,8 @@ const One2manyInput: React.FC<One2manyInputProps> = (
|
|
|
90
90
|
const [showSearchModal, setShowSearchModal] = useState<boolean>(false);
|
|
91
91
|
const [modalItem, setModalItem] = useState<One2manyItem>();
|
|
92
92
|
const [selectedRowKeys, setSelectedRowKeys] = useState<any[]>([]);
|
|
93
|
-
const [continuousEntryMode, setContinuousEntryMode] =
|
|
94
|
-
false
|
|
95
|
-
);
|
|
93
|
+
const [continuousEntryMode, setContinuousEntryMode] =
|
|
94
|
+
useState<boolean>(false);
|
|
96
95
|
const transformedDomain = useRef<any[]>([]);
|
|
97
96
|
const [sorter, setSorter] = useState<any>();
|
|
98
97
|
const originalSortItemIds = useRef<number[]>();
|
|
@@ -548,10 +547,7 @@ const One2manyInput: React.FC<One2manyInputProps> = (
|
|
|
548
547
|
...(views.get("form")?.fields || {}),
|
|
549
548
|
},
|
|
550
549
|
})
|
|
551
|
-
:
|
|
552
|
-
itemsToShow.map((item) => item.treeValues),
|
|
553
|
-
originalSortItemIds.current!
|
|
554
|
-
);
|
|
550
|
+
: itemsToShow.map((item) => item.treeValues);
|
|
555
551
|
|
|
556
552
|
if (currentView === "tree") {
|
|
557
553
|
return (
|