@headless-adminapp/fluent 1.4.8 → 1.4.9
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/PageCalendar/Header.js +1 -1
- package/PageEntityForm/RecordCard.js +2 -2
- package/PageEntityView/FormSubgridContainer.d.ts +2 -0
- package/PageEntityView/FormSubgridContainer.js +61 -3
- package/components/DialogLogin.js +14 -0
- package/form/controls/SelectControl.js +5 -1
- package/package.json +2 -2
package/PageCalendar/Header.js
CHANGED
|
@@ -36,7 +36,7 @@ function Header({ filterForm, onCreateButtonClick, }) {
|
|
|
36
36
|
} })] })] }), !!config.filterAttributes &&
|
|
37
37
|
Object.keys(config.filterAttributes).length > 0 && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.2 } }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', gap: react_components_1.tokens.spacingHorizontalS }, children: Object.entries(config.filterAttributes).map(([attributeName, attribute]) => {
|
|
38
38
|
return ((0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: filterForm.control, name: attributeName, render: ({ field }) => {
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) }));
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { width: 210, minWidth: 210 }, children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) }));
|
|
40
40
|
} }, attributeName));
|
|
41
41
|
}) })] }))] }));
|
|
42
42
|
}
|
|
@@ -78,9 +78,9 @@ function RecordCard({ schema, cardView, record, selected, }) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
if (column.variant === 'strong') {
|
|
81
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (0, utils_1.getAttributeFormattedValue)(
|
|
81
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (0, utils_1.getAttributeFormattedValue)(attribute, value, locale) }, column.name));
|
|
82
82
|
}
|
|
83
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: (0, utils_1.getAttributeFormattedValue)(
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: (0, utils_1.getAttributeFormattedValue)(attribute, value, locale) }, column.name));
|
|
84
84
|
}) }))] }));
|
|
85
85
|
}
|
|
86
86
|
function SecondaryColumnContent({ record: _record, column, schema, locale, }) {
|
|
@@ -4,4 +4,6 @@ interface FormSubgridContainerProps {
|
|
|
4
4
|
hideSearch?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const FormSubgridContainer: FC<FormSubgridContainerProps>;
|
|
7
|
+
export declare const FormSubgridDesktopContainer: FC<FormSubgridContainerProps>;
|
|
8
|
+
export declare const FormSubgridMobileContainer: FC<FormSubgridContainerProps>;
|
|
7
9
|
export {};
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormSubgridContainer = void 0;
|
|
3
|
+
exports.FormSubgridMobileContainer = exports.FormSubgridDesktopContainer = exports.FormSubgridContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
|
|
7
|
+
const hooks_2 = require("@headless-adminapp/app/hooks");
|
|
7
8
|
const icons_1 = require("@headless-adminapp/icons");
|
|
8
9
|
const AppStringContext_1 = require("../App/AppStringContext");
|
|
9
10
|
const FormSubgridCommandContainer_1 = require("../DataGrid/FormSubgridCommandContainer");
|
|
10
11
|
const FormSubgridViewSelector_1 = require("../DataGrid/FormSubgridViewSelector");
|
|
12
|
+
const GridListContainer_1 = require("../DataGrid/GridListContainer");
|
|
11
13
|
const GridPaginationContainer_1 = require("../DataGrid/GridPaginationContainer");
|
|
12
14
|
const GridTableContainer_1 = require("../DataGrid/GridTableContainer");
|
|
13
|
-
const FormSubgridContainer = (
|
|
15
|
+
const FormSubgridContainer = (props) => {
|
|
16
|
+
const isMobile = (0, hooks_2.useIsMobile)();
|
|
17
|
+
if (isMobile) {
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(exports.FormSubgridMobileContainer, { ...props });
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(exports.FormSubgridDesktopContainer, { ...props });
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.FormSubgridContainer = FormSubgridContainer;
|
|
25
|
+
const FormSubgridDesktopContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
14
26
|
const appStrings = (0, AppStringContext_1.useAppStrings)();
|
|
15
27
|
const [searchText, setSearchText] = (0, hooks_1.useSearchText)();
|
|
16
28
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -65,4 +77,50 @@ const FormSubgridContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
|
65
77
|
paddingBottom: 8,
|
|
66
78
|
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, { style: { opacity: 0.5 } }), (0, jsx_runtime_1.jsx)(GridPaginationContainer_1.GridPaginationContainer, {})] })] })] }) }));
|
|
67
79
|
};
|
|
68
|
-
exports.
|
|
80
|
+
exports.FormSubgridDesktopContainer = FormSubgridDesktopContainer;
|
|
81
|
+
const FormSubgridMobileContainer = ({ hideCommandBar, hideSearch, }) => {
|
|
82
|
+
const appStrings = (0, AppStringContext_1.useAppStrings)();
|
|
83
|
+
const [searchText, setSearchText] = (0, hooks_1.useSearchText)();
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
85
|
+
display: 'flex',
|
|
86
|
+
flex: 1,
|
|
87
|
+
flexDirection: 'column',
|
|
88
|
+
gap: 8,
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
91
|
+
flex: 1,
|
|
92
|
+
display: 'flex',
|
|
93
|
+
flexDirection: 'column',
|
|
94
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
95
|
+
display: 'flex',
|
|
96
|
+
flexDirection: 'row',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
height: 40,
|
|
99
|
+
}, 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: {
|
|
100
|
+
display: 'flex',
|
|
101
|
+
flexDirection: 'row',
|
|
102
|
+
gap: 10,
|
|
103
|
+
overflow: 'hidden',
|
|
104
|
+
width: '100%',
|
|
105
|
+
paddingBlock: 4,
|
|
106
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
107
|
+
flex: 1,
|
|
108
|
+
minWidth: 0,
|
|
109
|
+
}, children: !hideCommandBar && (0, jsx_runtime_1.jsx)(FormSubgridCommandContainer_1.FormSubgridCommandContainer, {}) }), !hideSearch && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
justifyContent: 'end',
|
|
113
|
+
flexShrink: 0,
|
|
114
|
+
paddingInline: 8,
|
|
115
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Input, { contentBefore: (0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, appearance: "filled-darker", value: searchText, onChange: (e) => setSearchText(e.target.value) }) }))] })), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
116
|
+
flex: 1,
|
|
117
|
+
display: 'flex',
|
|
118
|
+
flexDirection: 'column',
|
|
119
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
120
|
+
gap: 16,
|
|
121
|
+
display: 'flex',
|
|
122
|
+
flexDirection: 'column',
|
|
123
|
+
flex: 1,
|
|
124
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex', minHeight: 300 }, children: (0, jsx_runtime_1.jsx)(GridListContainer_1.GridListContainer, {}) }) }) })] }) }));
|
|
125
|
+
};
|
|
126
|
+
exports.FormSubgridMobileContainer = FormSubgridMobileContainer;
|
|
@@ -4,6 +4,20 @@ exports.DialogLogin = DialogLogin;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const LoginForm_1 = require("./LoginForm");
|
|
7
|
+
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
7
8
|
function DialogLogin(props) {
|
|
9
|
+
const isMobile = (0, hooks_1.useIsMobile)();
|
|
10
|
+
if (isMobile) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
12
|
+
position: 'fixed',
|
|
13
|
+
inset: 0,
|
|
14
|
+
zIndex: 1000,
|
|
15
|
+
padding: 24,
|
|
16
|
+
maxWidth: 360,
|
|
17
|
+
maxHeight: '100vh',
|
|
18
|
+
height: 'fit-content',
|
|
19
|
+
margin: 'auto',
|
|
20
|
+
}, children: (0, jsx_runtime_1.jsx)(LoginForm_1.LoginForm, { onLogin: props.onLogin, logoImageUrl: props.logoImageUrl, afterLoginContent: props.afterLoginContent, beforeLoginContent: props.beforeLoginContent, subtitle: props.subtitle }) }));
|
|
21
|
+
}
|
|
8
22
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Dialog, { open: true, onOpenChange: () => { }, modalType: "non-modal", children: (0, jsx_runtime_1.jsx)(react_components_1.DialogSurface, { style: { maxWidth: 360 }, children: (0, jsx_runtime_1.jsx)(react_components_1.DialogBody, { children: (0, jsx_runtime_1.jsx)(react_components_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(LoginForm_1.LoginForm, { onLogin: props.onLogin, logoImageUrl: props.logoImageUrl, afterLoginContent: props.afterLoginContent, beforeLoginContent: props.beforeLoginContent, subtitle: props.subtitle }) }) }) }) }));
|
|
9
23
|
}
|
|
@@ -26,5 +26,9 @@ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, o
|
|
|
26
26
|
// onChange={(e, v) => handleChange(v as string)}
|
|
27
27
|
selectedOptions: value ? [String(value)] : [], onOptionSelect: (event, data) => {
|
|
28
28
|
handleChange(data.optionValue);
|
|
29
|
-
}, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), style: {
|
|
29
|
+
}, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), style: {
|
|
30
|
+
pointerEvents: disabled ? 'none' : undefined,
|
|
31
|
+
width: '100%',
|
|
32
|
+
minWidth: 'unset',
|
|
33
|
+
}, children: transformedOptions.map((x) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: x.value, children: x.label }, x.value))) }));
|
|
30
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"uuid": "11.0.3",
|
|
53
53
|
"yup": "^1.4.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "39e62181f5436c5ceeaca2aa88d132593d53607a"
|
|
56
56
|
}
|