@headless-adminapp/fluent 1.4.33 → 1.4.38
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/DataGrid/GridListContainer.js +5 -1
- package/DataGrid/GridTableContainer.js +7 -2
- package/PageEntityForm/RecordCard.js +1 -1
- package/PageEntityForm/SectionContainer.js +2 -2
- package/PageEntityForm/SubgridControl.d.ts +3 -0
- package/PageEntityForm/SubgridControl.js +2 -2
- package/PageEntityView/FormSubgridContainer.d.ts +1 -0
- package/PageEntityView/FormSubgridContainer.js +14 -14
- package/package.json +2 -2
|
@@ -55,8 +55,12 @@ const GridListContainer = () => {
|
|
|
55
55
|
const virtualSize = virtualizer.getTotalSize();
|
|
56
56
|
const openFormInternal = (0, navigation_1.useOpenForm)();
|
|
57
57
|
const openRecord = (0, react_1.useCallback)(async (id) => {
|
|
58
|
+
const record = dataRef.current?.records.find((r) => r[schema.idAttribute] === id);
|
|
59
|
+
if (!record) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
58
62
|
await openFormInternal({
|
|
59
|
-
logicalName: schema.logicalName,
|
|
63
|
+
logicalName: record.$entity || schema.logicalName,
|
|
60
64
|
id,
|
|
61
65
|
recordSetIds: dataRef.current?.records.map((x) => x[schema.idAttribute]) ?? [],
|
|
62
66
|
});
|
|
@@ -110,11 +110,16 @@ const GridTableContainer = ({ noPadding, disableColumnFilter, disableColumnSort,
|
|
|
110
110
|
const tableWrapperRef = (0, react_1.useRef)(null);
|
|
111
111
|
const openFormInternal = (0, navigation_1.useOpenForm)();
|
|
112
112
|
const openRecord = (0, react_1.useCallback)((id) => {
|
|
113
|
+
const record = dataRef.current?.records.find((r) => r[schema.idAttribute] === id);
|
|
114
|
+
if (!record) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const logicalName = record.$entity || schema.logicalName;
|
|
113
118
|
openFormInternal({
|
|
114
|
-
logicalName:
|
|
119
|
+
logicalName: logicalName,
|
|
115
120
|
id,
|
|
116
121
|
recordSetIds: dataRef.current?.records.map((x) => x[schema.idAttribute]),
|
|
117
|
-
});
|
|
122
|
+
}).catch(console.error);
|
|
118
123
|
}, [openFormInternal, schema.idAttribute, schema.logicalName]);
|
|
119
124
|
const { direction } = (0, locale_1.useLocale)();
|
|
120
125
|
const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
|
|
@@ -93,7 +93,7 @@ function RecordCard({ schema, cardView, record, selected, }) {
|
|
|
93
93
|
}
|
|
94
94
|
function SecondaryColumnContent({ record: _record, column, schema, locale, }) {
|
|
95
95
|
const value = _record[column.name];
|
|
96
|
-
if (!value) {
|
|
96
|
+
if (!value && value !== 0) {
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const attribute = schema.attributes[column.name];
|
|
@@ -128,13 +128,13 @@ function SectionContainer({ section, skeleton, }) {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
const key = control.key ?? `${control.logicalName}-${index}`;
|
|
131
|
-
return ((0, jsx_runtime_1.jsx)(historystate_1.HistoryStateKeyProvider, { historyKey: `subgrid.${key}`, nested: true, children: (0, jsx_runtime_1.jsx)(SubgridControl_1.SubgridControl, { logicalName: control.logicalName, allowViewSelection: control.allowViewSelection, viewId: control.viewId, availableViewIds: control.availableViewIds, ContainerComponent: ContainerComponent, associated: !control.associatedAttribute
|
|
131
|
+
return ((0, jsx_runtime_1.jsx)(historystate_1.HistoryStateKeyProvider, { historyKey: `subgrid.${key}`, nested: true, children: (0, jsx_runtime_1.jsx)(SubgridControl_1.SubgridControl, { logicalName: control.logicalName, allowViewSelection: control.allowViewSelection, viewId: control.viewId, availableViewIds: control.availableViewIds, ContainerComponent: ContainerComponent, hideSelector: control.labelHidden, associated: !control.associatedAttribute
|
|
132
132
|
? false
|
|
133
133
|
: {
|
|
134
134
|
logicalName: schema.logicalName,
|
|
135
135
|
id: recordId,
|
|
136
136
|
refAttributeName: control.associatedAttribute,
|
|
137
|
-
} }, key)
|
|
137
|
+
}, view: control.view }) }, key));
|
|
138
138
|
}
|
|
139
139
|
case 'component': {
|
|
140
140
|
const Component = control.component === 'string'
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { ViewExperience } from '@headless-adminapp/core/experience/view';
|
|
1
2
|
interface SubgridControlProps {
|
|
2
3
|
logicalName: string;
|
|
3
4
|
allowViewSelection?: boolean;
|
|
4
5
|
viewId?: string;
|
|
6
|
+
view?: ViewExperience<any>;
|
|
5
7
|
availableViewIds?: string[];
|
|
8
|
+
hideSelector?: boolean;
|
|
6
9
|
associated: false | {
|
|
7
10
|
logicalName: string;
|
|
8
11
|
id: string;
|
|
@@ -11,7 +11,7 @@ const FormSubgridNotAvailableContainer_1 = require("../PageEntityView/FormSubgri
|
|
|
11
11
|
function SubgridControl(props) {
|
|
12
12
|
const schema = (0, hooks_1.useSchema)(props.logicalName);
|
|
13
13
|
const [viewId, setViewId] = (0, react_1.useState)(props.viewId);
|
|
14
|
-
const { view, isLoadingView } = (0, hooks_1.useExperienceView)(props.logicalName, viewId, !!props.associated, props.availableViewIds);
|
|
14
|
+
const { view, isLoadingView } = (0, hooks_1.useExperienceView)(props.logicalName, viewId, !!props.associated, props.availableViewIds, props.view);
|
|
15
15
|
const { viewLookup } = (0, hooks_1.useExperienceViewLookup)(props.logicalName, !!props.associated, props.availableViewIds);
|
|
16
16
|
const { commands } = (0, hooks_1.useExperienceViewCommands)(props.logicalName);
|
|
17
17
|
const { commands: subgridCommands } = (0, hooks_1.useExperienceViewSubgridCommands)(props.logicalName);
|
|
@@ -64,5 +64,5 @@ function SubgridControl(props) {
|
|
|
64
64
|
}
|
|
65
65
|
const ContainerComponent = props.ContainerComponent ?? FormSubgridContainer_1.FormSubgridContainer;
|
|
66
66
|
const disabled = !!props.associated && !props.associated.id;
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: viewLookup, onChangeView: setViewId, commands: (props.associated ? subgridCommands : commands), isSubGrid: !!props.associated, associated: props.associated, extraFilter: extraFilter, allowViewSelection: props.allowViewSelection ?? false, disabled: disabled, children: disabled ? (0, jsx_runtime_1.jsx)(FormSubgridNotAvailableContainer_1.FormSubgridNotAvailableContainer, {}) : (0, jsx_runtime_1.jsx)(ContainerComponent, {}) }));
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: viewLookup, onChangeView: setViewId, commands: (props.associated ? subgridCommands : commands), isSubGrid: !!props.associated, associated: props.associated, extraFilter: extraFilter, allowViewSelection: props.allowViewSelection ?? false, disabled: disabled, children: disabled ? ((0, jsx_runtime_1.jsx)(FormSubgridNotAvailableContainer_1.FormSubgridNotAvailableContainer, {})) : ((0, jsx_runtime_1.jsx)(ContainerComponent, { hideSelector: props.hideSelector })) }));
|
|
68
68
|
}
|
|
@@ -23,7 +23,7 @@ const FormSubgridContainer = (props) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
exports.FormSubgridContainer = FormSubgridContainer;
|
|
26
|
-
const FormSubgridDesktopContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
26
|
+
const FormSubgridDesktopContainer = ({ hideSelector, hideCommandBar, hideSearch, }) => {
|
|
27
27
|
const appStrings = (0, AppStringContext_1.useAppStrings)();
|
|
28
28
|
const [searchText, setSearchText] = (0, hooks_1.useSearchText)();
|
|
29
29
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -40,12 +40,12 @@ const FormSubgridDesktopContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
|
40
40
|
display: 'flex',
|
|
41
41
|
flexDirection: 'column',
|
|
42
42
|
// overflow: 'hidden',
|
|
43
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
}, children: [!hideSelector && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
height: 40,
|
|
48
|
+
}, children: (0, jsx_runtime_1.jsx)(FormSubgridViewSelector_1.FormSubgridViewSelector, {}) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2 } }) })] })), (!hideCommandBar || !hideSearch) && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
49
49
|
display: 'flex',
|
|
50
50
|
flexDirection: 'row',
|
|
51
51
|
gap: 10,
|
|
@@ -79,7 +79,7 @@ const FormSubgridDesktopContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
|
79
79
|
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.5 } }), (0, jsx_runtime_1.jsx)(GridPaginationContainer_1.GridPaginationContainer, {})] })] })] }) }));
|
|
80
80
|
};
|
|
81
81
|
exports.FormSubgridDesktopContainer = FormSubgridDesktopContainer;
|
|
82
|
-
const FormSubgridMobileContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
82
|
+
const FormSubgridMobileContainer = ({ hideSelector, hideCommandBar, hideSearch, }) => {
|
|
83
83
|
const appStrings = (0, AppStringContext_1.useAppStrings)();
|
|
84
84
|
const [searchText, setSearchText] = (0, hooks_1.useSearchText)();
|
|
85
85
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -92,12 +92,12 @@ const FormSubgridMobileContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
|
92
92
|
flex: 1,
|
|
93
93
|
display: 'flex',
|
|
94
94
|
flexDirection: 'column',
|
|
95
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
}, children: [!hideSelector && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
96
|
+
display: 'flex',
|
|
97
|
+
flexDirection: 'row',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
height: 40,
|
|
100
|
+
}, children: (0, jsx_runtime_1.jsx)(FormSubgridViewSelector_1.FormSubgridViewSelector, {}) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2 } }) })] })), (!hideCommandBar || !hideSearch) && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
101
101
|
display: 'flex',
|
|
102
102
|
flexDirection: 'row',
|
|
103
103
|
gap: 10,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/lodash": "4.17.20"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "f94f402ec1cbba0d94b6122d48dce471eba433e1"
|
|
58
58
|
}
|