@gisce/react-ooui 2.0.0-alpha.42 → 2.0.0-alpha.44
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/actionbar/FormActionBar.d.ts.map +1 -1
- package/dist/common/Field.d.ts.map +1 -1
- package/dist/react-ooui.es.js +1871 -1865
- package/dist/react-ooui.es.js.map +1 -1
- package/package.json +2 -2
- package/src/actionbar/FormActionBar.tsx +18 -13
- package/src/common/Field.tsx +2 -1
- package/src/stories/Char.stories.tsx +27 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.44",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": "20.5.0"
|
|
6
6
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ant-design/plots": "^1.0.9",
|
|
36
36
|
"@gisce/fiber-diagram": "^1.1.0-rc.3",
|
|
37
|
-
"@gisce/ooui": "1.0.0-alpha.
|
|
37
|
+
"@gisce/ooui": "1.0.0-alpha.19",
|
|
38
38
|
"@gisce/react-formiga-components": "^1.0.9-rc.21",
|
|
39
39
|
"@gisce/react-formiga-table": "^0.8.6",
|
|
40
40
|
"@monaco-editor/react": "^4.4.5",
|
|
@@ -415,14 +415,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
415
415
|
const res_id = result.currentId as number;
|
|
416
416
|
const res_model = currentModel as string;
|
|
417
417
|
openDefaultActionForModel({
|
|
418
|
-
|
|
419
|
-
values: {
|
|
420
|
-
selection_associated_object: `${res_model},${res_id}`,
|
|
421
|
-
},
|
|
422
|
-
forced_values: {
|
|
423
|
-
res_model,
|
|
424
|
-
res_id,
|
|
425
|
-
},
|
|
418
|
+
...getAttachmentActionPayload(res_model, res_id),
|
|
426
419
|
initialViewType: "form",
|
|
427
420
|
});
|
|
428
421
|
}}
|
|
@@ -438,11 +431,7 @@ function FormActionBar({ toolbar }: { toolbar: any }) {
|
|
|
438
431
|
const res_id = result.currentId as number;
|
|
439
432
|
const res_model = currentModel as string;
|
|
440
433
|
openDefaultActionForModel({
|
|
441
|
-
|
|
442
|
-
domain: [
|
|
443
|
-
["res_model", "=", `${res_model}`],
|
|
444
|
-
["res_id", "=", `${res_id}`],
|
|
445
|
-
],
|
|
434
|
+
...getAttachmentActionPayload(res_model, res_id),
|
|
446
435
|
initialViewType: "tree",
|
|
447
436
|
});
|
|
448
437
|
}}
|
|
@@ -483,4 +472,20 @@ async function saveDocument({
|
|
|
483
472
|
}
|
|
484
473
|
}
|
|
485
474
|
|
|
475
|
+
function getAttachmentActionPayload(res_model: string, res_id: number) {
|
|
476
|
+
return {
|
|
477
|
+
model: "ir.attachment",
|
|
478
|
+
domain: [
|
|
479
|
+
["res_model", "=", `${res_model}`],
|
|
480
|
+
["res_id", "=", `${res_id}`],
|
|
481
|
+
],
|
|
482
|
+
values: {
|
|
483
|
+
selection_associated_object: `${res_model},${res_id}`,
|
|
484
|
+
},
|
|
485
|
+
forced_values: {
|
|
486
|
+
res_model,
|
|
487
|
+
res_id,
|
|
488
|
+
},
|
|
489
|
+
};
|
|
490
|
+
}
|
|
486
491
|
export default FormActionBar;
|
package/src/common/Field.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export default function Field({
|
|
|
45
45
|
name={id}
|
|
46
46
|
valuePropName={valuePropName}
|
|
47
47
|
rules={rules}
|
|
48
|
+
help={ooui.tooltipInline ? ooui.tooltip : null}
|
|
48
49
|
>
|
|
49
50
|
{children}
|
|
50
51
|
</Form.Item>
|
|
@@ -60,7 +61,7 @@ export default function Field({
|
|
|
60
61
|
new LabelOoui({
|
|
61
62
|
name: id + "_label",
|
|
62
63
|
string: label,
|
|
63
|
-
help: tooltip,
|
|
64
|
+
help: ooui.tooltipInline ? false : tooltip,
|
|
64
65
|
fieldForLabel: id,
|
|
65
66
|
})
|
|
66
67
|
}
|
|
@@ -47,3 +47,30 @@ export const Translatable = (): React.ReactElement => {
|
|
|
47
47
|
</LocaleProvider>
|
|
48
48
|
);
|
|
49
49
|
};
|
|
50
|
+
|
|
51
|
+
export const Tooltip = (): React.ReactElement => {
|
|
52
|
+
const ooui = new CharOoui({
|
|
53
|
+
name: "field",
|
|
54
|
+
string: "Lorem ipsum",
|
|
55
|
+
help: "This is a simple help",
|
|
56
|
+
});
|
|
57
|
+
return (
|
|
58
|
+
<LocaleProvider lang="en_US">
|
|
59
|
+
<Char ooui={ooui} showLabel />
|
|
60
|
+
</LocaleProvider>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const TooltipInline = (): React.ReactElement => {
|
|
65
|
+
const ooui = new CharOoui({
|
|
66
|
+
name: "field",
|
|
67
|
+
string: "Lorem ipsum",
|
|
68
|
+
help: "This is a simple help",
|
|
69
|
+
help_inline: "true",
|
|
70
|
+
});
|
|
71
|
+
return (
|
|
72
|
+
<LocaleProvider lang="en_US">
|
|
73
|
+
<Char ooui={ooui} showLabel />
|
|
74
|
+
</LocaleProvider>
|
|
75
|
+
);
|
|
76
|
+
};
|