@headless-adminapp/fluent 1.4.31 → 1.4.33
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/App/App.d.ts +1 -0
- package/App/App.js +2 -2
- package/App/AppUI.d.ts +5 -1
- package/App/AppUI.js +2 -2
- package/App/Navigation/NavigationContainer.js +1 -0
- package/DataForm/SectionControl.d.ts +1 -0
- package/DataForm/SectionControl.js +10 -1
- package/PageEntityForm/SectionContainer.js +4 -2
- package/form/layout/FormSection/FormSection.js +1 -1
- package/package.json +2 -2
package/App/App.d.ts
CHANGED
package/App/App.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.App = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const AppUI_1 = require("./AppUI");
|
|
6
|
-
const App = (
|
|
7
|
-
return (0, jsx_runtime_1.jsx)(AppUI_1.AppUI, {
|
|
6
|
+
const App = (props) => {
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(AppUI_1.AppUI, { ...props });
|
|
8
8
|
};
|
|
9
9
|
exports.App = App;
|
package/App/AppUI.d.ts
CHANGED
package/App/AppUI.js
CHANGED
|
@@ -7,7 +7,7 @@ const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const AppHeaderContianer_1 = require("./AppHeaderContianer");
|
|
9
9
|
const Navigation_1 = require("./Navigation");
|
|
10
|
-
const AppUI = ({ children }) => {
|
|
10
|
+
const AppUI = ({ children, appFooter, }) => {
|
|
11
11
|
const isMobile = (0, hooks_1.useIsMobile)();
|
|
12
12
|
const isTablet = (0, hooks_1.useIsTablet)();
|
|
13
13
|
const [isNavOpen, setIsNavOpen] = (0, react_1.useState)(!isMobile);
|
|
@@ -31,6 +31,6 @@ const AppUI = ({ children }) => {
|
|
|
31
31
|
flex: 1,
|
|
32
32
|
position: 'relative',
|
|
33
33
|
overflow: 'hidden',
|
|
34
|
-
}, children: children })] })] }));
|
|
34
|
+
}, children: children })] }), appFooter] }));
|
|
35
35
|
};
|
|
36
36
|
exports.AppUI = AppUI;
|
|
@@ -70,6 +70,7 @@ const NavigationContainer = ({ open, type, onOpenChange, isMini, }) => {
|
|
|
70
70
|
gap: 8,
|
|
71
71
|
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Hamburger, { onClick: () => onOpenChange(false) }) }) })), (0, jsx_runtime_1.jsx)(react_components_1.NavDrawerBody, { style: {
|
|
72
72
|
paddingTop: 8,
|
|
73
|
+
paddingBottom: 8,
|
|
73
74
|
}, children: sections.map((section, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [!section.hideLabel && !isMini && ((0, jsx_runtime_1.jsx)(react_components_1.NavSectionHeader, { children: section.label })), isMini && index > 0 && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.5 } }) })), section.items.map((item) => {
|
|
74
75
|
if (item.type === app_2.PageType.Category) {
|
|
75
76
|
const isActive = item.items.some((subItem) => subItem.active);
|
|
@@ -6,6 +6,7 @@ interface SectionControlWrapperProps {
|
|
|
6
6
|
required?: boolean;
|
|
7
7
|
isError?: boolean;
|
|
8
8
|
errorMessage?: string;
|
|
9
|
+
grow?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function SectionControlWrapper(props: PropsWithChildren<SectionControlWrapperProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -4,5 +4,14 @@ exports.SectionControlWrapper = SectionControlWrapper;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
function SectionControlWrapper(props) {
|
|
7
|
-
|
|
7
|
+
const gridTemplateRows = !props.grow
|
|
8
|
+
? undefined
|
|
9
|
+
: props.labelPosition === 'top' && !props.labelHidden
|
|
10
|
+
? 'auto 1fr auto auto'
|
|
11
|
+
: '1fr auto auto auto';
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Field, { label: props.labelHidden ? undefined : props.label, orientation: props.labelPosition === 'top' ? 'vertical' : 'horizontal', required: props.labelHidden ? undefined : props.required, validationState: props.isError ? 'error' : undefined, validationMessage: props.errorMessage, validationMessageIcon: null, style: {
|
|
13
|
+
paddingLeft: props.labelHidden ? 0 : undefined,
|
|
14
|
+
gridTemplateRows,
|
|
15
|
+
flexGrow: props.grow ? 1 : undefined,
|
|
16
|
+
}, children: props.children }));
|
|
8
17
|
}
|
|
@@ -80,6 +80,8 @@ function SectionContainer({ section, skeleton, }) {
|
|
|
80
80
|
gridColumn: control.span
|
|
81
81
|
? `var(--section-item-span-${control.span})`
|
|
82
82
|
: undefined,
|
|
83
|
+
display: control.fullHeight ? 'flex' : undefined,
|
|
84
|
+
flexDirection: control.fullHeight ? 'column' : undefined,
|
|
83
85
|
}, children: (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: formInstance.control, name: control.attributeName, render: ({ field, fieldState, formState }) => {
|
|
84
86
|
const isError = (fieldState.isTouched || formState.isSubmitted) &&
|
|
85
87
|
!!fieldState.error?.message;
|
|
@@ -91,7 +93,7 @@ function SectionContainer({ section, skeleton, }) {
|
|
|
91
93
|
control.label ??
|
|
92
94
|
attribute.label;
|
|
93
95
|
const labelHidden = control.labelHidden;
|
|
94
|
-
return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelHidden: labelHidden, labelPosition: isMobile ? 'top' : section.labelPosition, required: required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: (value) => {
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelHidden: labelHidden, labelPosition: isMobile ? 'top' : section.labelPosition, required: required, isError: isError, errorMessage: errorMessage, grow: control.fullHeight, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: (value) => {
|
|
95
97
|
const previousValue = field.value;
|
|
96
98
|
field.onChange(value);
|
|
97
99
|
eventManager.emit(constants_1.EVENT_KEY_ON_FIELD_CHANGE, control.attributeName, value, previousValue);
|
|
@@ -100,7 +102,7 @@ function SectionContainer({ section, skeleton, }) {
|
|
|
100
102
|
recordId,
|
|
101
103
|
attributeName: control.attributeName,
|
|
102
104
|
logicalName: schema.logicalName,
|
|
103
|
-
}, autoHeight: control.autoHeight, maxHeight: control.maxHeight, skeleton: skeleton, required: required }) }));
|
|
105
|
+
}, autoHeight: control.autoHeight, maxHeight: control.maxHeight, fullHeight: control.fullHeight, skeleton: skeleton, required: required }) }));
|
|
104
106
|
} }, control.attributeName) }, control.attributeName));
|
|
105
107
|
}
|
|
106
108
|
case 'editablegrid': {
|
|
@@ -77,7 +77,7 @@ const FormSection = ({ title, children, columnCount, labelPosition, noPadding, h
|
|
|
77
77
|
paddingBlock: 8,
|
|
78
78
|
height: 40,
|
|
79
79
|
alignItems: 'center',
|
|
80
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: title }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } })] }) }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2 } })] })), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
80
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', width: '100%' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: title }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } })] }) }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2, flexGrow: 0 } })] })), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
81
81
|
flex: 1,
|
|
82
82
|
display: 'flex',
|
|
83
83
|
flexDirection: 'column',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.33",
|
|
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": "a6fc880774f7d5a7fb5b1a8e1654262904df93fc"
|
|
58
58
|
}
|