@gisce/react-ooui 1.4.16 → 1.4.17-rc.0
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/hooks/useSearch.d.ts +1 -0
- package/dist/hooks/useSearch.d.ts.map +1 -1
- package/dist/locales/ca_ES.d.ts +3 -0
- package/dist/locales/ca_ES.d.ts.map +1 -1
- package/dist/locales/en_US.d.ts +3 -0
- package/dist/locales/en_US.d.ts.map +1 -1
- package/dist/locales/es_ES.d.ts +3 -0
- package/dist/locales/es_ES.d.ts.map +1 -1
- package/dist/react-ooui.es.js +3060 -3028
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +13 -13
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/views/SearchTree.d.ts.map +1 -1
- package/dist/widgets/views/Tree.d.ts +1 -0
- package/dist/widgets/views/Tree.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/hooks/useSearch.ts +14 -3
- package/src/locales/ca_ES.tsx +4 -0
- package/src/locales/en_US.tsx +4 -0
- package/src/locales/es_ES.tsx +4 -0
- package/src/widgets/views/SearchTree.tsx +9 -4
- package/src/widgets/views/Tree.tsx +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchTree.d.ts","sourceRoot":"","sources":["SearchTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBnD,aAAK,gBAAgB,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EA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CAC1C,CAAC;AAmHF,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CAiO9C;AAED,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.17-rc.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@gisce/fiber-diagram": "^1.1.0-rc.3",
|
|
36
36
|
"@gisce/ooui": "^0.22.3",
|
|
37
37
|
"@gisce/react-formiga-components": "^1.0.9-rc.21",
|
|
38
|
-
"@gisce/react-formiga-table": "^0.8.
|
|
38
|
+
"@gisce/react-formiga-table": "^0.8.7-rc.0",
|
|
39
39
|
"@monaco-editor/react": "^4.4.5",
|
|
40
40
|
"@tabler/icons-react": "^2.11.0",
|
|
41
41
|
"antd": "^5.5.2",
|
package/src/hooks/useSearch.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mergeParams } from "@/helpers/searchHelper";
|
|
2
2
|
import {
|
|
3
|
-
getColorMap,
|
|
3
|
+
getColorMap,
|
|
4
|
+
getStatusMap,
|
|
4
5
|
getTableItems,
|
|
5
6
|
getTree,
|
|
6
7
|
sortResults,
|
|
@@ -176,7 +177,8 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
176
177
|
const { params, newOffset } = opts || {};
|
|
177
178
|
|
|
178
179
|
const mergedParams = mergeParams(params || searchParams, domain);
|
|
179
|
-
const { colors, status } = getTree(treeView!);
|
|
180
|
+
const { colors, status } = getTree(treeView!);
|
|
181
|
+
const attrs: any = {};
|
|
180
182
|
if (colors) {
|
|
181
183
|
attrs.colors = colors;
|
|
182
184
|
}
|
|
@@ -184,7 +186,6 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
184
186
|
attrs.status = status;
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
|
|
188
189
|
const { totalItems, results, attrsEvaluated } =
|
|
189
190
|
await ConnectionProvider.getHandler().searchForTree({
|
|
190
191
|
params: mergedParams,
|
|
@@ -402,6 +403,15 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
402
403
|
[treeView, model, context, getResults, setResults]
|
|
403
404
|
);
|
|
404
405
|
|
|
406
|
+
const getAllIds = useCallback(async () => {
|
|
407
|
+
return await ConnectionProvider.getHandler().searchAllIds({
|
|
408
|
+
params: mergeParams(searchParams, domain),
|
|
409
|
+
model,
|
|
410
|
+
context,
|
|
411
|
+
totalItems,
|
|
412
|
+
});
|
|
413
|
+
}, [model, context, totalItems, searchParams, domain]);
|
|
414
|
+
|
|
405
415
|
return {
|
|
406
416
|
submit,
|
|
407
417
|
clear,
|
|
@@ -419,5 +429,6 @@ export const useSearch = (opts: UseSearchOpts) => {
|
|
|
419
429
|
colorsForResults,
|
|
420
430
|
statusForResults,
|
|
421
431
|
totalItems,
|
|
432
|
+
getAllIds,
|
|
422
433
|
};
|
|
423
434
|
};
|
package/src/locales/ca_ES.tsx
CHANGED
|
@@ -91,4 +91,8 @@ export default {
|
|
|
91
91
|
savedRegisters: "Registre guardat correctament",
|
|
92
92
|
errorWhileSavingForm: "Error en guardar el formulari",
|
|
93
93
|
autor: "Autor",
|
|
94
|
+
recordsSelected:
|
|
95
|
+
"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta pàgina.",
|
|
96
|
+
selectAllRecords: "Seleccionar tots els {totalRecords} registres.",
|
|
97
|
+
allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
|
|
94
98
|
};
|
package/src/locales/en_US.tsx
CHANGED
|
@@ -88,4 +88,8 @@ export default {
|
|
|
88
88
|
savedRegisters: "Record successfully saved",
|
|
89
89
|
errorWhileSavingForm: "Error while saving form",
|
|
90
90
|
author: "Author",
|
|
91
|
+
recordsSelected:
|
|
92
|
+
"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta pàgina.",
|
|
93
|
+
selectAllRecords: "Seleccionar tots els {totalRecords} registres.",
|
|
94
|
+
allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
|
|
91
95
|
};
|
package/src/locales/es_ES.tsx
CHANGED
|
@@ -92,4 +92,8 @@ export default {
|
|
|
92
92
|
savedRegisters: "Registro guardado correctamente",
|
|
93
93
|
errorWhileSavingForm: "Error al guardar el formulario",
|
|
94
94
|
author: "Autor",
|
|
95
|
+
recordsSelected:
|
|
96
|
+
"Hay {numberOfSelectedRows} registros seleccionados en ésta página.",
|
|
97
|
+
selectAllRecords: "Seleccionar todos los {totalRecords} registros.",
|
|
98
|
+
allRecordsSelected: "Hay {totalRecords} registros seleccionados.",
|
|
95
99
|
};
|
|
@@ -125,6 +125,7 @@ function SearchTree(props: Props, ref: any) {
|
|
|
125
125
|
colorsForResults,
|
|
126
126
|
statusForResults,
|
|
127
127
|
totalItems,
|
|
128
|
+
getAllIds,
|
|
128
129
|
} = useSearch({
|
|
129
130
|
model: currentModel!,
|
|
130
131
|
setSearchTreeNameSearch,
|
|
@@ -269,13 +270,16 @@ function SearchTree(props: Props, ref: any) {
|
|
|
269
270
|
};
|
|
270
271
|
|
|
271
272
|
function changeSelectedRowKeys(selectedRowKeys: any[]) {
|
|
272
|
-
|
|
273
|
-
selectedRowKeys.includes(entry.id)
|
|
274
|
-
);
|
|
275
|
-
setSelectedRowItems?.(selectedRowItems);
|
|
273
|
+
setSelectedRowItems?.(selectedRowKeys.map((id: number) => ({ id })));
|
|
276
274
|
onChangeSelectedRowKeys?.(selectedRowKeys);
|
|
277
275
|
}
|
|
278
276
|
|
|
277
|
+
async function selectAllRecords() {
|
|
278
|
+
const allIds = await getAllIds();
|
|
279
|
+
setSelectedRowItems?.(allIds.map((id: number) => ({ id })));
|
|
280
|
+
onChangeSelectedRowKeys?.(allIds);
|
|
281
|
+
}
|
|
282
|
+
|
|
279
283
|
function calculateTableHeight() {
|
|
280
284
|
if (treeView?.isExpandable) {
|
|
281
285
|
return height - 160;
|
|
@@ -331,6 +335,7 @@ function SearchTree(props: Props, ref: any) {
|
|
|
331
335
|
}
|
|
332
336
|
childField={treeView.field_parent}
|
|
333
337
|
rootTree={rootTree}
|
|
338
|
+
onSelectAllRecords={selectAllRecords}
|
|
334
339
|
/>
|
|
335
340
|
</>
|
|
336
341
|
);
|
|
@@ -53,6 +53,7 @@ type Props = {
|
|
|
53
53
|
rootTree?: boolean;
|
|
54
54
|
context?: any;
|
|
55
55
|
readonly?: boolean;
|
|
56
|
+
onSelectAllRecords?: () => Promise<void>;
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
const booleanComponentFn = (value: boolean): React.ReactElement => {
|
|
@@ -190,6 +191,7 @@ function Tree(props: Props): React.ReactElement {
|
|
|
190
191
|
rootTree = false,
|
|
191
192
|
context,
|
|
192
193
|
readonly,
|
|
194
|
+
onSelectAllRecords,
|
|
193
195
|
} = props;
|
|
194
196
|
|
|
195
197
|
const [items, setItems] = useState<Array<any>>([]);
|
|
@@ -381,6 +383,13 @@ function Tree(props: Props): React.ReactElement {
|
|
|
381
383
|
}
|
|
382
384
|
: undefined
|
|
383
385
|
}
|
|
386
|
+
onSelectAllRecords={onSelectAllRecords}
|
|
387
|
+
totalItems={total || 0}
|
|
388
|
+
translations={{
|
|
389
|
+
recordsSelected: t("recordsSelected"),
|
|
390
|
+
selectAllRecords: t("selectAllRecords"),
|
|
391
|
+
allRecordsSelected: t("allRecordsSelected"),
|
|
392
|
+
}}
|
|
384
393
|
/>
|
|
385
394
|
{getSums()}
|
|
386
395
|
</div>
|