@headless-adminapp/fluent 1.4.12 → 1.4.14

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.
Files changed (29) hide show
  1. package/App/AppHeaderContianer.js +105 -49
  2. package/App/QuickActionItem.d.ts +1 -0
  3. package/App/QuickActionItem.js +7 -3
  4. package/DataGrid/GridListContainer.js +61 -33
  5. package/DataGrid/MobileHeaderRightContainer.d.ts +2 -0
  6. package/DataGrid/MobileHeaderRightContainer.js +11 -0
  7. package/Header/MobileHeaderCommandContainer.d.ts +13 -0
  8. package/Header/MobileHeaderCommandContainer.js +168 -0
  9. package/Header/MobileHeaderQuickActionButton.d.ts +10 -0
  10. package/Header/MobileHeaderQuickActionButton.js +36 -0
  11. package/PageEntityForm/CommandContainer.js +3 -3
  12. package/PageEntityForm/MobileHeaderRightContainer.d.ts +2 -0
  13. package/PageEntityForm/MobileHeaderRightContainer.js +11 -0
  14. package/PageEntityForm/MobileHeaderTitleContainer.d.ts +2 -0
  15. package/PageEntityForm/MobileHeaderTitleContainer.js +38 -0
  16. package/PageEntityForm/PageEntityForm.js +2 -0
  17. package/PageEntityForm/PageEntityFormDesktopContainer.js +89 -74
  18. package/PageEntityForm/RecordCard.js +34 -36
  19. package/PageEntityForm/TabContainer.d.ts +2 -0
  20. package/PageEntityForm/TabContainer.js +35 -0
  21. package/PageEntityView/PageEntityView.js +4 -1
  22. package/PageEntityView/PageEntityViewMobileContainer.js +1 -2
  23. package/PageEntityView/PageEntityViewMobileFrame.d.ts +0 -1
  24. package/PageEntityView/PageEntityViewMobileFrame.js +25 -23
  25. package/ToastNotificationContainer/index.js +7 -5
  26. package/components/DialogLogin.js +1 -1
  27. package/components/PageLogin.js +22 -2
  28. package/form/layout/FormBody/FormBody.js +16 -1
  29. package/package.json +2 -2
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MobileHeaderRightContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const dataform_1 = require("@headless-adminapp/app/dataform");
6
+ const MobileHeaderCommandContainer_1 = require("../Header/MobileHeaderCommandContainer");
7
+ const MobileHeaderRightContainer = () => {
8
+ const commands = (0, dataform_1.useMainFormCommands)();
9
+ return (0, jsx_runtime_1.jsx)(MobileHeaderCommandContainer_1.MobileHeaderCommandContainer, { commands: commands });
10
+ };
11
+ exports.MobileHeaderRightContainer = MobileHeaderRightContainer;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const MobileHeaderTitleContainer: FC;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MobileHeaderTitleContainer = 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 useFormDataState_1 = require("@headless-adminapp/app/dataform/hooks/useFormDataState");
8
+ const MobileHeaderTitle_1 = require("@headless-adminapp/app/header/components/MobileHeaderTitle");
9
+ const locale_1 = require("@headless-adminapp/app/locale");
10
+ const utils_1 = require("@headless-adminapp/app/locale/utils");
11
+ const MobileHeaderTitleContainer = () => {
12
+ const [recordTitle] = (0, dataform_1.useRecordTitle)();
13
+ const { language } = (0, locale_1.useLocale)();
14
+ const schema = (0, dataform_1.useDataFormSchema)();
15
+ const dataState = (0, useFormDataState_1.useFormDataState)();
16
+ if (dataState.isFetching || dataState.isError) {
17
+ return null;
18
+ }
19
+ return ((0, jsx_runtime_1.jsx)(MobileHeaderTitle_1.MobileHeaderTitle, { order: 3, title: (0, jsx_runtime_1.jsx)("div", { style: {
20
+ display: 'flex',
21
+ flexDirection: 'row',
22
+ flex: 1,
23
+ overflow: 'hidden',
24
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ overflow: 'hidden',
28
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
29
+ display: 'flex',
30
+ gap: react_components_1.tokens.spacingHorizontalXS,
31
+ alignItems: 'center',
32
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Subtitle2, { style: {
33
+ textOverflow: 'ellipsis',
34
+ whiteSpace: 'nowrap',
35
+ overflow: 'hidden',
36
+ }, children: recordTitle }) }), (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { opacity: 0.8 }, children: (0, utils_1.localizedLabel)(language, schema) })] }) }) }));
37
+ };
38
+ exports.MobileHeaderTitleContainer = MobileHeaderTitleContainer;
@@ -4,6 +4,7 @@ exports.PageEntityForm = 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/dataform/hooks");
7
+ const hooks_2 = require("@headless-adminapp/app/header/hooks");
7
8
  const historystate_1 = require("@headless-adminapp/app/historystate");
8
9
  const PageEntityFormProvider_1 = require("@headless-adminapp/app/providers/PageEntityFormProvider");
9
10
  const recordset_1 = require("@headless-adminapp/app/recordset");
@@ -14,6 +15,7 @@ const PageEntityFormDesktopContainer_1 = require("./PageEntityFormDesktopContain
14
15
  const RecordSetNavigatorContainer_1 = require("./RecordSetNavigatorContainer");
15
16
  const PageEntityForm = ({ logicalName, formId, recordId, }) => {
16
17
  const result = (0, hooks_1.useLoadFormGridPage)(logicalName, formId);
18
+ (0, hooks_2.useMobileHeader)(true);
17
19
  if (result.loading) {
18
20
  return (0, jsx_runtime_1.jsx)(PageLoading_1.PageLoading, {});
19
21
  }
@@ -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.jsxs)("div", { style: {
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
- display: 'flex',
67
- flexDirection: 'column',
68
- gap: react_components_1.tokens.spacingVerticalM,
69
- paddingTop: react_components_1.tokens.spacingVerticalM,
70
- paddingInline: react_components_1.tokens.spacingHorizontalM,
71
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
72
- // padding: 4,
73
- boxShadow: react_components_1.tokens.shadow2,
74
- borderRadius: react_components_1.tokens.borderRadiusMedium,
75
- background: react_components_1.tokens.colorNeutralBackground1,
76
- display: 'flex',
77
- // overflow: 'hidden',
78
- }, 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: {
79
- display: 'flex',
80
- flexDirection: 'column',
81
- boxShadow: react_components_1.tokens.shadow4,
82
- borderRadius: react_components_1.tokens.borderRadiusMedium,
83
- background: react_components_1.tokens.colorNeutralBackground1,
84
- overflow: 'hidden',
85
- zIndex: 2,
86
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
87
- display: 'flex',
88
- flexDirection: 'row',
89
- paddingInline: react_components_1.tokens.spacingHorizontalM,
90
- paddingTop: react_components_1.tokens.spacingVerticalS,
91
- marginBottom: react_components_1.tokens.spacingVerticalS,
92
- }, children: [(0, jsx_runtime_1.jsx)(RecordAvatar_1.RecordAvatar, {}), dataState.isFetching ? ((0, jsx_runtime_1.jsxs)("div", { style: {
93
- display: 'flex',
94
- flexDirection: 'column',
95
- flex: 1,
96
- }, 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: { display: 'flex', flexDirection: 'column', flex: 1 }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
97
- display: 'flex',
98
- gap: react_components_1.tokens.spacingHorizontalXS,
99
- alignItems: 'center',
100
- }, 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
101
- ? `- ${strings.unsaved}`
102
- : record
103
- ? `- ${strings.saved}`
104
- : '' })] }), (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)("div", { style: { display: 'flex', flexDirection: 'row' }, children: formConfig.experience.headerControls?.map((controlName, index) => {
105
- const attribute = schema.attributes[controlName];
106
- if (!attribute) {
107
- console.warn(`Attribute ${controlName} not found`);
108
- return null;
109
- }
110
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index > 0 && ((0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: true, style: {
111
- width: react_components_1.tokens.spacingHorizontalXXL,
112
- opacity: 0.5,
113
- } })), (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 }) => {
114
- if (dataState.isFetching) {
115
- return (0, jsx_runtime_1.jsx)(TextSkeleton_1.Body1Skeleton, { width: 100 });
116
- }
117
- return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0, utils_2.getAttributeFormattedValue)(attribute, field.value, locale) }));
118
- } })] })] }, controlName));
119
- }) })] }), !!processFlowSteps?.length && ((0, jsx_runtime_1.jsx)(ProcessFlow_1.ProcessFlow, { height: 28, rounded: false, items: processFlowSteps, skeleton: dataState.isFetching })), (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) => {
120
- setActiveTab(value.value);
121
- }, 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] ??
122
- selectedRelatedItem.pluralLabel }))] }), (0, jsx_runtime_1.jsx)(RelatedViewSelector_1.RelatedViewSelector, { onSelect: (item) => {
123
- setSelectedRelatedItem(item);
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: [(!!formConfig.experience.headerControls?.length || !isMobile) && ((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)("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
+ }) })] })), (0, jsx_runtime_1.jsx)(MobileHeaderTitleContainer_1.MobileHeaderTitleContainer, {}), (0, jsx_runtime_1.jsx)(MobileHeaderRightContainer_1.MobileHeaderRightContainer, {}), !!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, (0, jsx_runtime_1.jsx)("div", { style: { height: 'env(safe-area-inset-bottom)' } })] }));
140
+ }
141
+ return children;
142
+ };
@@ -8,24 +8,22 @@ const utils_1 = require("@headless-adminapp/app/utils");
8
8
  const ChoiceBadge_1 = require("../components/ChoiceBadge");
9
9
  const useStyles = (0, react_components_1.makeStyles)({
10
10
  root: {
11
+ minHeight: '44px',
12
+ display: 'flex',
13
+ flexDirection: 'row',
14
+ alignItems: 'center',
15
+ },
16
+ inner: {
11
17
  width: '100%',
12
18
  display: 'flex',
13
19
  flexDirection: 'row',
14
20
  paddingInline: react_components_1.tokens.spacingHorizontalL,
15
21
  paddingBlock: react_components_1.tokens.spacingVerticalS,
16
22
  gap: react_components_1.tokens.spacingHorizontalS,
17
- // cursor: 'pointer',
18
- // '&:hover': {
19
- // background: tokens.colorNeutralBackground1Hover,
20
- // },
21
- // '&:active': {
22
- // background: tokens.colorNeutralBackground1Pressed,
23
- // },
24
23
  },
25
- // selected: {
26
- // background: tokens.colorNeutralBackground1Selected,
27
- // },
28
- selected: {},
24
+ selected: {
25
+ background: react_components_1.tokens.colorNeutralBackground1Hover,
26
+ },
29
27
  });
30
28
  function createIntial(name) {
31
29
  return name
@@ -56,32 +54,32 @@ function RecordCard({ schema, cardView, record, selected, }) {
56
54
  }
57
55
  }
58
56
  }
59
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, react_components_1.mergeClasses)(styles.root, selected && styles.selected), children: [cardView.showAvatar && ((0, jsx_runtime_1.jsx)(react_components_1.Avatar, { initials: initials, color: "neutral", size: !cardView.secondaryColumns?.length ? 20 : 32, style: { cursor: 'pointer' }, image: {
60
- src: avatarSrc,
61
- } })), (0, jsx_runtime_1.jsxs)("div", { style: {
62
- display: 'flex',
63
- flexDirection: 'column',
64
- flex: 1,
65
- }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { wordBreak: 'break-all' }, children: (0, utils_1.getAttributeFormattedValue)(schema.attributes[cardView.primaryColumn], _record[cardView.primaryColumn], locale) }), cardView.secondaryColumns?.map((column) => ((0, jsx_runtime_1.jsx)(SecondaryColumnContent, { record: _record, column: column, schema: schema, locale: locale }, column.name)))] }), !!cardView.rightColumn?.length && ((0, jsx_runtime_1.jsx)("div", { style: {
66
- display: 'flex',
67
- flexDirection: 'column',
68
- alignItems: 'flex-end',
69
- }, children: cardView.rightColumn.map((column) => {
70
- const value = _record[column.name];
71
- if (!value) {
72
- return null;
73
- }
74
- const attribute = schema.attributes[column.name];
75
- if (column.variant === 'choice') {
76
- if (attribute.type === 'choice') {
77
- return ((0, jsx_runtime_1.jsx)(ChoiceTag, { attribute: attribute, value: value }, column.name));
57
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, react_components_1.mergeClasses)(styles.root, selected && styles.selected), children: (0, jsx_runtime_1.jsxs)("div", { className: styles.inner, children: [cardView.showAvatar && ((0, jsx_runtime_1.jsx)(react_components_1.Avatar, { initials: initials, color: "neutral", size: !cardView.secondaryColumns?.length ? 20 : 32, style: { cursor: 'pointer' }, image: {
58
+ src: avatarSrc,
59
+ } })), (0, jsx_runtime_1.jsxs)("div", { style: {
60
+ display: 'flex',
61
+ flexDirection: 'column',
62
+ flex: 1,
63
+ }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { wordBreak: 'break-all' }, children: (0, utils_1.getAttributeFormattedValue)(schema.attributes[cardView.primaryColumn], _record[cardView.primaryColumn], locale) }), cardView.secondaryColumns?.map((column) => ((0, jsx_runtime_1.jsx)(SecondaryColumnContent, { record: _record, column: column, schema: schema, locale: locale }, column.name)))] }), !!cardView.rightColumn?.length && ((0, jsx_runtime_1.jsx)("div", { style: {
64
+ display: 'flex',
65
+ flexDirection: 'column',
66
+ alignItems: 'flex-end',
67
+ }, children: cardView.rightColumn.map((column) => {
68
+ const value = _record[column.name];
69
+ if (!value) {
70
+ return null;
71
+ }
72
+ const attribute = schema.attributes[column.name];
73
+ if (column.variant === 'choice') {
74
+ if (attribute.type === 'choice') {
75
+ return ((0, jsx_runtime_1.jsx)(ChoiceTag, { attribute: attribute, value: value }, column.name));
76
+ }
77
+ }
78
+ if (column.variant === 'strong') {
79
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (0, utils_1.getAttributeFormattedValue)(attribute, value, locale) }, column.name));
78
80
  }
79
- }
80
- if (column.variant === 'strong') {
81
- return ((0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (0, utils_1.getAttributeFormattedValue)(attribute, value, locale) }, column.name));
82
- }
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
- }) }))] }));
81
+ 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));
82
+ }) }))] }) }));
85
83
  }
86
84
  function SecondaryColumnContent({ record: _record, column, schema, locale, }) {
87
85
  const value = _record[column.name];
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const TabContainer: FC;
@@ -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.jsx)(PageEntityViewProvider_1.PageEntityViewProvider, { schema: schema, view: view, availableViews: viewLookup, commands: commands, onChangeView: onChangeView, children: content }) }));
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, { commandBar: (0, jsx_runtime_1.jsx)(CommandContainer_1.CommandContainer, {}), header: (0, jsx_runtime_1.jsx)(GridHeaderMobile_1.GridHeaderMobile, {}), content: (0, jsx_runtime_1.jsx)(GridListContainer_1.GridListContainer, {}) }));
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;
@@ -1,6 +1,5 @@
1
1
  import React, { FC } from 'react';
2
2
  interface PageEntityViewMobileFrameProps {
3
- commandBar: React.ReactNode;
4
3
  header: React.ReactNode;
5
4
  content: React.ReactNode;
6
5
  }
@@ -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 PageEntityViewMobileFrame = ({ commandBar, header, content, }) => {
7
- return ((0, jsx_runtime_1.jsx)("div", { style: {
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
- gap: 4,
15
- flex: 1,
16
- display: 'flex',
17
- flexDirection: 'column',
18
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
19
- boxShadow: react_components_1.tokens.shadow2,
20
- background: react_components_1.tokens.colorNeutralBackground1,
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
- }, children: (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, display: 'flex' }, children: content }) }) })] }) }));
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/toast-notification/hooks");
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, hooks_1.useToastNotificationItems)();
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, hooks_1.useCloseToastNotification)();
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
  };
@@ -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) {