@headless-adminapp/fluent 1.4.32 → 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.
|
@@ -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
|
}
|