@gisce/react-ooui 0.1.0 → 0.3.1
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/AttachmentsButton.d.ts +1 -0
- package/dist/actionbar/AttachmentsButton.d.ts.map +1 -1
- package/dist/actionbar/AttachmentsButton.js +2 -2
- package/dist/actionbar/AttachmentsButton.js.map +1 -1
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts +1 -0
- package/dist/actionbar/AttachmentsButtonWrapper.d.ts.map +1 -1
- package/dist/actionbar/AttachmentsButtonWrapper.js +13 -3
- package/dist/actionbar/AttachmentsButtonWrapper.js.map +1 -1
- package/dist/actionbar/FormActionBar.d.ts.map +1 -1
- package/dist/actionbar/FormActionBar.js +11 -0
- package/dist/actionbar/FormActionBar.js.map +1 -1
- package/dist/context/TabManagerContext.d.ts +2 -1
- package/dist/context/TabManagerContext.d.ts.map +1 -1
- package/dist/context/TabManagerContext.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/ca_ES.d.ts +1 -0
- package/dist/locales/ca_ES.d.ts.map +1 -1
- package/dist/locales/ca_ES.js +1 -0
- package/dist/locales/ca_ES.js.map +1 -1
- package/dist/locales/en_US.d.ts +1 -0
- package/dist/locales/en_US.d.ts.map +1 -1
- package/dist/locales/en_US.js +1 -0
- package/dist/locales/en_US.js.map +1 -1
- package/dist/locales/es_ES.d.ts +1 -0
- package/dist/locales/es_ES.d.ts.map +1 -1
- package/dist/locales/es_ES.js +1 -0
- package/dist/locales/es_ES.js.map +1 -1
- package/dist/views/RootView.d.ts.map +1 -1
- package/dist/views/RootView.js +20 -19
- package/dist/views/RootView.js.map +1 -1
- package/dist/widgets/containers/Container.d.ts.map +1 -1
- package/dist/widgets/containers/Container.js +7 -6
- package/dist/widgets/containers/Container.js.map +1 -1
- package/dist/widgets/views/Tree.d.ts.map +1 -1
- package/dist/widgets/views/Tree.js +4 -0
- package/dist/widgets/views/Tree.js.map +1 -1
- package/package.json +3 -2
- package/src/actionbar/AttachmentsButton.tsx +3 -0
- package/src/actionbar/AttachmentsButtonWrapper.tsx +16 -1
- package/src/actionbar/FormActionBar.tsx +12 -0
- package/src/context/TabManagerContext.tsx +2 -0
- package/src/locales/ca_ES.tsx +1 -0
- package/src/locales/en_US.tsx +1 -0
- package/src/locales/es_ES.tsx +1 -0
- package/src/stories/containers/Notebook.stories.tsx +0 -1
- package/src/views/RootView.tsx +6 -1
- package/src/widgets/containers/Container.tsx +32 -29
- package/src/widgets/views/Tree.tsx +10 -0
|
@@ -42,41 +42,44 @@ const Container = (props: Props): React.ReactElement => {
|
|
|
42
42
|
numberOfColumns: columns,
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
row: rowWithExpandedItems,
|
|
47
|
-
numberOfColumns: columns,
|
|
48
|
-
mustFillWithEmpties: responsiveBehaviour,
|
|
49
|
-
});
|
|
50
|
-
|
|
45
|
+
let rowWithEmptiesToFit;
|
|
51
46
|
if (i === 0) {
|
|
47
|
+
rowWithEmptiesToFit = fillRowWithEmptiesToFit({
|
|
48
|
+
row: rowWithExpandedItems,
|
|
49
|
+
numberOfColumns: columns,
|
|
50
|
+
mustFillWithEmpties: responsiveBehaviour,
|
|
51
|
+
});
|
|
52
|
+
|
|
52
53
|
firstRow = firstRow.concat(rowWithEmptiesToFit);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
return (i === 0 ? rowWithEmptiesToFit : rowWithExpandedItems).map(
|
|
57
|
+
(item: Widget, j: number) => {
|
|
58
|
+
// We check if we have any label+field inside the container.
|
|
59
|
+
// In this scenario, we must format the grid accordingly
|
|
60
|
+
// Otherwise, the grid will divide uniformly
|
|
61
|
+
if (item instanceof Label && (item as Label).fieldForLabel) {
|
|
62
|
+
fieldInRows = true;
|
|
63
|
+
}
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
const itemRowIndex = row.indexOf(item);
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
key={`${i.toString()}-${itemRowIndex.toString()}`}
|
|
70
|
+
style={{
|
|
71
|
+
...getSpanStyleForItem({ item, responsiveBehaviour }),
|
|
72
|
+
minWidth: 0,
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
{createReactWidget({
|
|
76
|
+
ooui: item,
|
|
77
|
+
responsiveBehaviour,
|
|
78
|
+
})}
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
);
|
|
80
83
|
});
|
|
81
84
|
|
|
82
85
|
const templateColumns =
|
|
@@ -70,6 +70,15 @@ const floatTimeComponent = (value: number): React.ReactElement => {
|
|
|
70
70
|
return <>{parseFloatToString(value)}</>;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
const imageComponent = (value: string): React.ReactElement => {
|
|
74
|
+
return (
|
|
75
|
+
<img
|
|
76
|
+
src={`data:image/*;base64,${value}`}
|
|
77
|
+
style={{ maxWidth: "50px", padding: "5px" }}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
73
82
|
function Tree(props: Props): React.ReactElement {
|
|
74
83
|
const {
|
|
75
84
|
page = 1,
|
|
@@ -108,6 +117,7 @@ function Tree(props: Props): React.ReactElement {
|
|
|
108
117
|
many2many: one2ManyComponentFn,
|
|
109
118
|
progressbar: progressBarComponentFn,
|
|
110
119
|
float_time: floatTimeComponent,
|
|
120
|
+
image: imageComponent,
|
|
111
121
|
});
|
|
112
122
|
setColumns(columns);
|
|
113
123
|
}, [treeView]);
|