@headless-adminapp/fluent 1.4.11 → 1.4.13
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/AppHeaderContianer.js +105 -49
- package/App/QuickActionItem.d.ts +1 -0
- package/App/QuickActionItem.js +7 -3
- package/DataGrid/MobileHeaderRightContainer.d.ts +2 -0
- package/DataGrid/MobileHeaderRightContainer.js +11 -0
- package/DataGrid/TableCell/TableCellBase.d.ts +2 -0
- package/DataGrid/TableCell/TableCellBase.js +2 -2
- package/DataGrid/TableCell/TableCellChoice.d.ts +3 -1
- package/DataGrid/TableCell/TableCellChoice.js +1 -1
- package/DataGrid/TableCell/TableCellLink.d.ts +3 -1
- package/DataGrid/TableCell/TableCellLink.js +2 -2
- package/DataGrid/TableCell/TableCellText.d.ts +3 -1
- package/DataGrid/TableCell/TableCellText.js +2 -2
- package/DataGrid/useTableColumns.d.ts +18 -0
- package/DataGrid/useTableColumns.js +27 -20
- package/Header/MobileHeaderCommandContainer.d.ts +7 -0
- package/Header/MobileHeaderCommandContainer.js +167 -0
- package/Header/MobileHeaderQuickActionButton.d.ts +10 -0
- package/Header/MobileHeaderQuickActionButton.js +36 -0
- package/Insights/Header.js +1 -1
- package/Insights/WidgetTableContainer.d.ts +7 -0
- package/Insights/WidgetTableContainer.js +62 -30
- package/Insights/WidgetTitleBar.d.ts +2 -1
- package/Insights/WidgetTitleBar.js +3 -3
- package/PageEntityForm/CommandContainer.js +3 -3
- package/PageEntityForm/MobileHeaderRightContainer.d.ts +2 -0
- package/PageEntityForm/MobileHeaderRightContainer.js +11 -0
- package/PageEntityForm/MobileHeaderTitleContainer.d.ts +2 -0
- package/PageEntityForm/MobileHeaderTitleContainer.js +38 -0
- package/PageEntityForm/PageEntityForm.js +2 -0
- package/PageEntityForm/PageEntityFormDesktopContainer.js +89 -74
- package/PageEntityForm/TabContainer.d.ts +2 -0
- package/PageEntityForm/TabContainer.js +35 -0
- package/PageEntityView/PageEntityView.js +4 -1
- package/PageEntityView/PageEntityViewMobileContainer.js +1 -2
- package/PageEntityView/PageEntityViewMobileFrame.d.ts +0 -1
- package/PageEntityView/PageEntityViewMobileFrame.js +25 -23
- package/ToastNotificationContainer/index.js +7 -5
- package/components/ChoiceBadge.js +4 -1
- package/components/DialogLogin.js +1 -1
- package/components/PageLogin.js +22 -2
- package/form/layout/FormBody/FormBody.js +16 -1
- package/package.json +2 -2
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageEntityFormDesktopContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const ScrollView_1 = require("@headless-adminapp/app/components/ScrollView");
|
|
6
7
|
const dataform_1 = require("@headless-adminapp/app/dataform");
|
|
7
8
|
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
8
9
|
const useFormDataState_1 = require("@headless-adminapp/app/dataform/hooks/useFormDataState");
|
|
10
|
+
const useMobileHeaderSetValue_1 = require("@headless-adminapp/app/header/hooks/useMobileHeaderSetValue");
|
|
11
|
+
const hooks_2 = require("@headless-adminapp/app/hooks");
|
|
9
12
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
10
13
|
const utils_1 = require("@headless-adminapp/app/locale/utils");
|
|
11
14
|
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
@@ -18,33 +21,27 @@ const FormTab_1 = require("../form/layout/FormTab");
|
|
|
18
21
|
const TextSkeleton_1 = require("../Skeleton/TextSkeleton");
|
|
19
22
|
const CommandContainer_1 = require("./CommandContainer");
|
|
20
23
|
const FormTabRelated_1 = require("./FormTabRelated");
|
|
24
|
+
const MobileHeaderRightContainer_1 = require("./MobileHeaderRightContainer");
|
|
25
|
+
const MobileHeaderTitleContainer_1 = require("./MobileHeaderTitleContainer");
|
|
21
26
|
const PageEntityFormStringContext_1 = require("./PageEntityFormStringContext");
|
|
22
27
|
const ProcessFlow_1 = require("./ProcessFlow");
|
|
23
28
|
const RecordAvatar_1 = require("./RecordAvatar");
|
|
24
|
-
const RelatedViewSelector_1 = require("./RelatedViewSelector");
|
|
25
29
|
const SectionContainer_1 = require("./SectionContainer");
|
|
30
|
+
const TabContainer_1 = require("./TabContainer");
|
|
26
31
|
const PageEntityFormDesktopContainer = () => {
|
|
32
|
+
const formHeaderDivRef = (0, react_1.useRef)(null);
|
|
27
33
|
const dataState = (0, useFormDataState_1.useFormDataState)();
|
|
34
|
+
const isMobile = (0, hooks_2.useIsMobile)();
|
|
28
35
|
const strings = (0, PageEntityFormStringContext_1.usePageEntityFormStrings)();
|
|
29
36
|
const locale = (0, locale_1.useLocale)();
|
|
30
37
|
const recordId = (0, hooks_1.useRecordId)();
|
|
31
38
|
const record = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.record);
|
|
32
|
-
const activeTab = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.activeTab);
|
|
33
39
|
const selectedRelatedItem = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.selectedRelatedItem);
|
|
34
40
|
const { language } = (0, locale_1.useLocale)();
|
|
35
41
|
const schema = (0, hooks_1.useDataFormSchema)();
|
|
42
|
+
(0, useMobileHeaderSetValue_1.useMobileHeaderSetValue)(schema.label, 2, 'title');
|
|
36
43
|
const formConfig = (0, hooks_1.useSelectedForm)();
|
|
37
44
|
const processFlowSteps = (0, hooks_1.useProcessFlowSteps)();
|
|
38
|
-
const setActiveTab = (0, mutable_1.useContextValueSetter)(dataform_1.DataFormContext, (setValue) => (value) => {
|
|
39
|
-
setValue(() => ({
|
|
40
|
-
activeTab: value,
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
43
|
-
const setSelectedRelatedItem = (0, mutable_1.useContextValueSetter)(dataform_1.DataFormContext, (setValue) => (item) => {
|
|
44
|
-
setValue(() => ({
|
|
45
|
-
selectedRelatedItem: item,
|
|
46
|
-
}));
|
|
47
|
-
});
|
|
48
45
|
const [recordTitle] = (0, hooks_1.useRecordTitle)();
|
|
49
46
|
// const readonly = useIsFormReadonly();
|
|
50
47
|
const formInstance = (0, hooks_1.useFormInstance)();
|
|
@@ -56,72 +53,90 @@ const PageEntityFormDesktopContainer = () => {
|
|
|
56
53
|
if (recordId && !record && !dataState.isFetching) {
|
|
57
54
|
return ((0, jsx_runtime_1.jsx)(PageBroken_1.PageBroken, { title: "Record not found", message: "Requested record not found in system or you may not have enought permission." }));
|
|
58
55
|
}
|
|
59
|
-
return ((0, jsx_runtime_1.
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
60
57
|
display: 'flex',
|
|
61
58
|
flex: 1,
|
|
62
59
|
flexDirection: 'column',
|
|
63
60
|
// backgroundColor: tokens.colorNeutralBackground2,
|
|
64
61
|
overflow: 'hidden',
|
|
65
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
setActiveTab('related');
|
|
125
|
-
} })] })] })] }), (0, jsx_runtime_1.jsxs)(FormBody_1.FormBody, { children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab, { value: tab.name, columnCount: tab.columnCount, columnWidths: tab.columnWidths, children: tab.tabColumns.map((tabColumn, index) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab.Column, { children: tabColumn.sections.map((section) => ((0, jsx_runtime_1.jsx)(SectionContainer_1.SectionContainer, { section: section, readOnly: false, skeleton: dataState.isFetching }, section.name))) }, index))) }, tab.name))), (0, jsx_runtime_1.jsx)(FormTabRelated_1.FormTabRelated, { selectedRelatedItem: selectedRelatedItem })] })] }));
|
|
62
|
+
}, children: (0, jsx_runtime_1.jsxs)(Wrapper, { formHeaderDivRef: formHeaderDivRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
63
|
+
display: 'flex',
|
|
64
|
+
flexDirection: 'column',
|
|
65
|
+
gap: react_components_1.tokens.spacingVerticalM,
|
|
66
|
+
paddingTop: react_components_1.tokens.spacingVerticalM,
|
|
67
|
+
paddingInline: react_components_1.tokens.spacingHorizontalM,
|
|
68
|
+
}, children: [!isMobile && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
69
|
+
// padding: 4,
|
|
70
|
+
boxShadow: react_components_1.tokens.shadow2,
|
|
71
|
+
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
72
|
+
background: react_components_1.tokens.colorNeutralBackground1,
|
|
73
|
+
display: 'flex',
|
|
74
|
+
// overflow: 'hidden',
|
|
75
|
+
}, children: (0, jsx_runtime_1.jsx)(CommandContainer_1.CommandContainer, { skeleton: dataState.isFetching }) })), notifications.length > 0 && ((0, jsx_runtime_1.jsx)("div", { children: notifications.map((notification, index) => ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { intent: notification.level, icon: null, children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: notification.message }) }, index))) })), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
76
|
+
display: 'flex',
|
|
77
|
+
flexDirection: 'column',
|
|
78
|
+
boxShadow: react_components_1.tokens.shadow4,
|
|
79
|
+
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
80
|
+
background: react_components_1.tokens.colorNeutralBackground1,
|
|
81
|
+
overflow: 'hidden',
|
|
82
|
+
zIndex: 2,
|
|
83
|
+
}, ref: formHeaderDivRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
flexDirection: 'row',
|
|
86
|
+
paddingInline: react_components_1.tokens.spacingHorizontalM,
|
|
87
|
+
paddingTop: react_components_1.tokens.spacingVerticalS,
|
|
88
|
+
marginBottom: react_components_1.tokens.spacingVerticalS,
|
|
89
|
+
}, children: [!isMobile && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(RecordAvatar_1.RecordAvatar, {}), dataState.isFetching ? ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
90
|
+
display: 'flex',
|
|
91
|
+
flexDirection: 'column',
|
|
92
|
+
flex: 1,
|
|
93
|
+
}, children: [(0, jsx_runtime_1.jsx)(TextSkeleton_1.Subtitle2Skeleton, { width: 200 }), (0, jsx_runtime_1.jsx)(TextSkeleton_1.Body1Skeleton, { width: 80 })] })) : ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
94
|
+
display: 'flex',
|
|
95
|
+
flexDirection: 'column',
|
|
96
|
+
flex: 1,
|
|
97
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
98
|
+
display: 'flex',
|
|
99
|
+
gap: react_components_1.tokens.spacingHorizontalXS,
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Subtitle2, { children: recordTitle }), (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: isDirty
|
|
102
|
+
? `- ${strings.unsaved}`
|
|
103
|
+
: record
|
|
104
|
+
? `- ${strings.saved}`
|
|
105
|
+
: '' })] }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground3 }, children: (0, utils_1.localizedLabel)(language, schema) })] }))] })), (0, jsx_runtime_1.jsx)(MobileHeaderTitleContainer_1.MobileHeaderTitleContainer, {}), (0, jsx_runtime_1.jsx)(MobileHeaderRightContainer_1.MobileHeaderRightContainer, {}), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row' }, children: formConfig.experience.headerControls?.map((controlName, index) => {
|
|
106
|
+
const attribute = schema.attributes[controlName];
|
|
107
|
+
if (!attribute) {
|
|
108
|
+
console.warn(`Attribute ${controlName} not found`);
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index > 0 && ((0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: true, style: {
|
|
112
|
+
width: react_components_1.tokens.spacingHorizontalXXL,
|
|
113
|
+
opacity: 0.5,
|
|
114
|
+
} })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: attribute.label }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: formInstance.control, name: controlName, render: ({ field }) => {
|
|
115
|
+
if (dataState.isFetching) {
|
|
116
|
+
return (0, jsx_runtime_1.jsx)(TextSkeleton_1.Body1Skeleton, { width: 100 });
|
|
117
|
+
}
|
|
118
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0, utils_2.getAttributeFormattedValue)(attribute, field.value, locale) }));
|
|
119
|
+
} })] })] }, controlName));
|
|
120
|
+
}) })] }), !!processFlowSteps?.length && ((0, jsx_runtime_1.jsx)(ProcessFlow_1.ProcessFlow, { height: 28, rounded: false, items: processFlowSteps, skeleton: dataState.isFetching })), (0, jsx_runtime_1.jsx)(TabContainer_1.TabContainer, {})] })] }), (0, jsx_runtime_1.jsxs)(FormBody_1.FormBody, { children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab, { value: tab.name, columnCount: tab.columnCount, columnWidths: tab.columnWidths, children: tab.tabColumns.map((tabColumn, index) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab.Column, { children: tabColumn.sections.map((section) => ((0, jsx_runtime_1.jsx)(SectionContainer_1.SectionContainer, { section: section, readOnly: false, skeleton: dataState.isFetching }, section.name))) }, index))) }, tab.name))), (0, jsx_runtime_1.jsx)(FormTabRelated_1.FormTabRelated, { selectedRelatedItem: selectedRelatedItem })] })] }) }));
|
|
126
121
|
};
|
|
127
122
|
exports.PageEntityFormDesktopContainer = PageEntityFormDesktopContainer;
|
|
123
|
+
const Wrapper = ({ children, formHeaderDivRef, }) => {
|
|
124
|
+
const isMobile = (0, hooks_2.useIsMobile)();
|
|
125
|
+
const rect = (0, hooks_2.useElementSize)(formHeaderDivRef, isMobile ? 100 : 5000);
|
|
126
|
+
const headerHeight = 50;
|
|
127
|
+
const tabContainerHeight = 36;
|
|
128
|
+
const visible = !!rect && rect.bottom < headerHeight + tabContainerHeight;
|
|
129
|
+
if (isMobile) {
|
|
130
|
+
return ((0, jsx_runtime_1.jsxs)(ScrollView_1.ScrollView, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
131
|
+
background: react_components_1.tokens.colorNeutralBackground1,
|
|
132
|
+
position: 'fixed',
|
|
133
|
+
transition: 'all 0.2s',
|
|
134
|
+
top: visible ? headerHeight : -headerHeight,
|
|
135
|
+
left: 0,
|
|
136
|
+
right: 0,
|
|
137
|
+
zIndex: visible ? 3 : 0,
|
|
138
|
+
boxShadow: react_components_1.tokens.shadow4,
|
|
139
|
+
}, children: (0, jsx_runtime_1.jsx)(TabContainer_1.TabContainer, {}) }), children] }));
|
|
140
|
+
}
|
|
141
|
+
return children;
|
|
142
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TabContainer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const dataform_1 = require("@headless-adminapp/app/dataform");
|
|
7
|
+
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
8
|
+
const locale_1 = require("@headless-adminapp/app/locale");
|
|
9
|
+
const utils_1 = require("@headless-adminapp/app/locale/utils");
|
|
10
|
+
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
11
|
+
const RelatedViewSelector_1 = require("./RelatedViewSelector");
|
|
12
|
+
const TabContainer = () => {
|
|
13
|
+
const formConfig = (0, hooks_1.useSelectedForm)();
|
|
14
|
+
const { language } = (0, locale_1.useLocale)();
|
|
15
|
+
const activeTab = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.activeTab);
|
|
16
|
+
const selectedRelatedItem = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.selectedRelatedItem);
|
|
17
|
+
const setActiveTab = (0, mutable_1.useContextValueSetter)(dataform_1.DataFormContext, (setValue) => (value) => {
|
|
18
|
+
setValue(() => ({
|
|
19
|
+
activeTab: value,
|
|
20
|
+
}));
|
|
21
|
+
});
|
|
22
|
+
const setSelectedRelatedItem = (0, mutable_1.useContextValueSetter)(dataform_1.DataFormContext, (setValue) => (item) => {
|
|
23
|
+
setValue(() => ({
|
|
24
|
+
selectedRelatedItem: item,
|
|
25
|
+
}));
|
|
26
|
+
});
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', paddingBottom: react_components_1.tokens.spacingVerticalS }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.TabList, { selectedValue: activeTab, onTabSelect: (e, value) => {
|
|
28
|
+
setActiveTab(value.value);
|
|
29
|
+
}, children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: tab.name, children: (0, utils_1.localizedLabel)(language, tab) }, tab.name))), !!selectedRelatedItem && ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: "related", children: selectedRelatedItem.localizedPluralLabels?.[language] ??
|
|
30
|
+
selectedRelatedItem.pluralLabel }))] }), (0, jsx_runtime_1.jsx)(RelatedViewSelector_1.RelatedViewSelector, { onSelect: (item) => {
|
|
31
|
+
setSelectedRelatedItem(item);
|
|
32
|
+
setActiveTab('related');
|
|
33
|
+
} })] }));
|
|
34
|
+
};
|
|
35
|
+
exports.TabContainer = TabContainer;
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageEntityView = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const datagrid_1 = require("@headless-adminapp/app/datagrid");
|
|
6
|
+
const header_1 = require("@headless-adminapp/app/header");
|
|
7
|
+
const MobileHeaderTitle_1 = require("@headless-adminapp/app/header/components/MobileHeaderTitle");
|
|
6
8
|
const historystate_1 = require("@headless-adminapp/app/historystate");
|
|
7
9
|
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
8
10
|
const PageEntityViewProvider_1 = require("@headless-adminapp/app/providers/PageEntityViewProvider");
|
|
@@ -14,6 +16,7 @@ const PageEntityViewMobileContainer_1 = require("./PageEntityViewMobileContainer
|
|
|
14
16
|
const PageEntityView = ({ logicalName, viewId, onChangeView, useV2, }) => {
|
|
15
17
|
const result = (0, datagrid_1.useLoadMainGridPage)(logicalName, viewId);
|
|
16
18
|
const isMobile = (0, hooks_1.useIsMobile)();
|
|
19
|
+
(0, header_1.useMobileHeader)(false);
|
|
17
20
|
if (result.loading) {
|
|
18
21
|
return (0, jsx_runtime_1.jsx)(PageLoading_1.PageLoading, {});
|
|
19
22
|
}
|
|
@@ -31,6 +34,6 @@ const PageEntityView = ({ logicalName, viewId, onChangeView, useV2, }) => {
|
|
|
31
34
|
else {
|
|
32
35
|
content = (0, jsx_runtime_1.jsx)(PageEntityViewDesktopContainer_1.PageEntityViewDesktopContainerV2, {});
|
|
33
36
|
}
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(historystate_1.HistoryStateKeyProvider, { historyKey: 'page-entity-view.' + logicalName, children: (0, jsx_runtime_1.
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(historystate_1.HistoryStateKeyProvider, { historyKey: 'page-entity-view.' + logicalName, children: (0, jsx_runtime_1.jsxs)(PageEntityViewProvider_1.PageEntityViewProvider, { schema: schema, view: view, availableViews: viewLookup, commands: commands, onChangeView: onChangeView, children: [(0, jsx_runtime_1.jsx)(MobileHeaderTitle_1.MobileHeaderTitle, { title: schema.label, order: 2 }), content] }) }));
|
|
35
38
|
};
|
|
36
39
|
exports.PageEntityView = PageEntityView;
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageEntityViewMobileContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const CommandContainer_1 = require("../DataGrid/CommandContainer");
|
|
6
5
|
const GridHeaderMobile_1 = require("../DataGrid/GridHeaderMobile");
|
|
7
6
|
const GridListContainer_1 = require("../DataGrid/GridListContainer");
|
|
8
7
|
const PageEntityViewMobileFrame_1 = require("./PageEntityViewMobileFrame");
|
|
9
8
|
const PageEntityViewMobileContainer = () => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(PageEntityViewMobileFrame_1.PageEntityViewMobileFrame, {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(PageEntityViewMobileFrame_1.PageEntityViewMobileFrame, { header: (0, jsx_runtime_1.jsx)(GridHeaderMobile_1.GridHeaderMobile, {}), content: (0, jsx_runtime_1.jsx)(GridListContainer_1.GridListContainer, {}) }));
|
|
11
10
|
};
|
|
12
11
|
exports.PageEntityViewMobileContainer = PageEntityViewMobileContainer;
|
|
@@ -3,36 +3,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageEntityViewMobileFrame = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const MobileHeaderRightContainer_1 = require("../DataGrid/MobileHeaderRightContainer");
|
|
7
|
+
const PageEntityViewMobileFrame = ({ header, content, }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
8
9
|
display: 'flex',
|
|
9
10
|
flex: 1,
|
|
10
11
|
flexDirection: 'column',
|
|
11
12
|
background: react_components_1.tokens.colorNeutralBackground1,
|
|
12
13
|
overflow: 'hidden',
|
|
13
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
display: 'flex',
|
|
22
|
-
minHeight: 40,
|
|
23
|
-
flexDirection: 'column',
|
|
24
|
-
gap: 4,
|
|
25
|
-
paddingBottom: 8,
|
|
26
|
-
}, children: [commandBar, header] }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
27
|
-
flex: 1,
|
|
28
|
-
display: 'flex',
|
|
29
|
-
flexDirection: 'column',
|
|
30
|
-
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
31
|
-
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
32
|
-
gap: 8,
|
|
14
|
+
}, children: [(0, jsx_runtime_1.jsx)(MobileHeaderRightContainer_1.MobileHeaderRightContainer, {}), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
15
|
+
gap: 4,
|
|
16
|
+
flex: 1,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
20
|
+
boxShadow: react_components_1.tokens.shadow2,
|
|
21
|
+
background: react_components_1.tokens.colorNeutralBackground1,
|
|
33
22
|
display: 'flex',
|
|
23
|
+
minHeight: 40,
|
|
34
24
|
flexDirection: 'column',
|
|
25
|
+
gap: 4,
|
|
26
|
+
paddingTop: 8,
|
|
27
|
+
paddingBottom: 8,
|
|
28
|
+
}, children: header }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
35
29
|
flex: 1,
|
|
36
|
-
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
33
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
34
|
+
gap: 8,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
flex: 1,
|
|
38
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex' }, children: content }) }) })] })] }));
|
|
37
39
|
};
|
|
38
40
|
exports.PageEntityViewMobileFrame = PageEntityViewMobileFrame;
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ToastNotificationContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
-
const hooks_1 = require("@headless-adminapp/app/
|
|
6
|
+
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
7
|
+
const hooks_2 = require("@headless-adminapp/app/toast-notification/hooks");
|
|
7
8
|
const react_1 = require("react");
|
|
8
9
|
const ToastNotificationContainer = () => {
|
|
9
|
-
const items = (0,
|
|
10
|
+
const items = (0, hooks_2.useToastNotificationItems)();
|
|
10
11
|
const toasterId = (0, react_components_1.useId)('toaster');
|
|
11
12
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Toaster, { toasterId: toasterId }), items.map((item) => {
|
|
12
13
|
return (0, jsx_runtime_1.jsx)(Item, { item: item, toasterId: toasterId }, item.id);
|
|
@@ -15,8 +16,9 @@ const ToastNotificationContainer = () => {
|
|
|
15
16
|
exports.ToastNotificationContainer = ToastNotificationContainer;
|
|
16
17
|
const Item = ({ item, toasterId, }) => {
|
|
17
18
|
const { dispatchToast, dismissToast } = (0, react_components_1.useToastController)(toasterId);
|
|
18
|
-
const closeToastNotification = (0,
|
|
19
|
+
const closeToastNotification = (0, hooks_2.useCloseToastNotification)();
|
|
19
20
|
const opened = (0, react_1.useRef)(false);
|
|
21
|
+
const isMobile = (0, hooks_1.useIsMobile)();
|
|
20
22
|
(0, react_1.useEffect)(() => {
|
|
21
23
|
if (!item.isOpen) {
|
|
22
24
|
dismissToast(item.id);
|
|
@@ -31,13 +33,13 @@ const Item = ({ item, toasterId, }) => {
|
|
|
31
33
|
intent: item.type,
|
|
32
34
|
pauseOnHover: true,
|
|
33
35
|
pauseOnWindowBlur: true,
|
|
34
|
-
position: 'top-end',
|
|
36
|
+
position: isMobile ? 'bottom' : 'top-end',
|
|
35
37
|
onStatusChange: (event, data) => {
|
|
36
38
|
if (data.status === 'dismissed') {
|
|
37
39
|
closeToastNotification(item.id);
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
42
|
});
|
|
41
|
-
}, [dispatchToast, closeToastNotification, item, dismissToast]);
|
|
43
|
+
}, [dispatchToast, closeToastNotification, item, dismissToast, isMobile]);
|
|
42
44
|
return null;
|
|
43
45
|
};
|
|
@@ -38,5 +38,8 @@ function ChoiceBadge(props) {
|
|
|
38
38
|
backgroundColor: bgColor ?? react_components_1.tokens.colorNeutralBackground3,
|
|
39
39
|
color: color ?? react_components_1.tokens.colorNeutralForeground2,
|
|
40
40
|
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
41
|
-
|
|
41
|
+
minWidth: 'unset',
|
|
42
|
+
maxWidth: 'max-content',
|
|
43
|
+
width: '100%',
|
|
44
|
+
}, size: props.size, children: (0, jsx_runtime_1.jsx)("div", { style: { textOverflow: 'ellipsis', overflow: 'hidden' }, children: formattedValue }) }));
|
|
42
45
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DialogLogin = DialogLogin;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
-
const LoginForm_1 = require("./LoginForm");
|
|
7
6
|
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
7
|
+
const LoginForm_1 = require("./LoginForm");
|
|
8
8
|
function DialogLogin(props) {
|
|
9
9
|
const isMobile = (0, hooks_1.useIsMobile)();
|
|
10
10
|
if (isMobile) {
|
package/components/PageLogin.js
CHANGED
|
@@ -3,11 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageLogin = PageLogin;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
6
7
|
const LoginForm_1 = require("./LoginForm");
|
|
7
8
|
function PageLogin(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
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
background: react_components_1.tokens.colorNeutralBackground2,
|
|
18
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
19
|
+
position: 'fixed',
|
|
20
|
+
inset: 0,
|
|
21
|
+
padding: 24,
|
|
22
|
+
maxWidth: 360,
|
|
23
|
+
maxHeight: '100vh',
|
|
24
|
+
height: 'fit-content',
|
|
25
|
+
margin: 'auto',
|
|
26
|
+
}, children: (0, jsx_runtime_1.jsx)(LoginForm_1.LoginForm, { onLogin: props.onLogin, logoImageUrl: props.logoImageUrl, afterLoginContent: props.afterLoginContent, beforeLoginContent: props.beforeLoginContent, subtitle: props.subtitle }) }) }));
|
|
27
|
+
}
|
|
8
28
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
9
|
-
|
|
10
|
-
|
|
29
|
+
position: 'fixed',
|
|
30
|
+
inset: 0,
|
|
11
31
|
display: 'flex',
|
|
12
32
|
alignItems: 'center',
|
|
13
33
|
justifyContent: 'center',
|
|
@@ -2,10 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormBody = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_components_1 = require("@fluentui/react-components");
|
|
5
6
|
const ScrollView_1 = require("@headless-adminapp/app/components/ScrollView");
|
|
7
|
+
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
6
8
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
7
9
|
const FormBody = ({ children }) => {
|
|
8
10
|
const { direction } = (0, locale_1.useLocale)();
|
|
9
|
-
|
|
11
|
+
const isMobile = (0, hooks_1.useIsMobile)();
|
|
12
|
+
if (isMobile) {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
flex: 1,
|
|
17
|
+
padding: react_components_1.tokens.spacingVerticalM,
|
|
18
|
+
}, children: children }));
|
|
19
|
+
}
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'column', flex: 1 }, children: (0, jsx_runtime_1.jsx)(ScrollView_1.ScrollView, { autoHide: true, className: "FormBody_scrollview", rtl: direction === 'rtl', children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'column',
|
|
23
|
+
padding: react_components_1.tokens.spacingVerticalM,
|
|
24
|
+
}, children: children }) }) }));
|
|
10
25
|
};
|
|
11
26
|
exports.FormBody = FormBody;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.13",
|
|
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": "70b319f4b807a300e6b01c8d7e8c1768839f9541"
|
|
56
56
|
}
|