@headless-adminapp/fluent 1.4.20 → 1.4.22

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 (38) hide show
  1. package/App/App.js +1 -2
  2. package/App/AppHeaderContianer.js +4 -4
  3. package/App/LayoutProvider.js +3 -2
  4. package/App/Navigation/NavigationContainer.js +28 -19
  5. package/App/QuickActionItem.js +1 -1
  6. package/DataGrid/CustomFilter/CustomFilter.js +4 -6
  7. package/DataGrid/CustomizeColumns/AddColumns.js +15 -18
  8. package/DataGrid/CustomizeColumns/CustomizeColumns.js +21 -30
  9. package/Insights/charts/BarChart.js +1 -1
  10. package/Insights/charts/LineChart.js +1 -1
  11. package/Insights/charts/OhlcChart.js +1 -1
  12. package/PageEntityForm/CommandContainer.js +2 -2
  13. package/PageEntityForm/EditableGridControl/CardUi.js +1 -1
  14. package/PageEntityForm/SectionContainer.js +1 -1
  15. package/PageEntityForm/StandardControl.js +2 -2
  16. package/QuickCreateContainer/FormContainer.d.ts +8 -0
  17. package/QuickCreateContainer/FormContainer.js +50 -0
  18. package/QuickCreateContainer/QuickCreateContainer.d.ts +1 -0
  19. package/QuickCreateContainer/QuickCreateContainer.js +18 -0
  20. package/QuickCreateContainer/QuickCreateItemContent.d.ts +9 -0
  21. package/QuickCreateContainer/QuickCreateItemContent.js +28 -0
  22. package/QuickCreateContainer/QuickCreateTabContainer.d.ts +2 -0
  23. package/QuickCreateContainer/QuickCreateTabContainer.js +14 -0
  24. package/QuickCreateContainer/index.d.ts +1 -0
  25. package/QuickCreateContainer/index.js +5 -0
  26. package/QuickCreateContainer/useLoadQuickCreateFormInfo.d.ts +18 -0
  27. package/QuickCreateContainer/useLoadQuickCreateFormInfo.js +64 -0
  28. package/components/BodyLoading.js +2 -1
  29. package/components/DrawerFooter.d.ts +6 -0
  30. package/components/DrawerFooter.js +15 -0
  31. package/components/DrawerHeader.d.ts +10 -0
  32. package/components/DrawerHeader.js +22 -0
  33. package/form/controls/LookupControl.js +37 -16
  34. package/form/controls/SelectControl.d.ts +2 -1
  35. package/form/controls/SelectControl.js +2 -2
  36. package/package.json +2 -2
  37. package/DataGrid/CustomFilter/Header.d.ts +0 -6
  38. package/DataGrid/CustomFilter/Header.js +0 -19
package/App/App.js CHANGED
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.App = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const app_1 = require("@headless-adminapp/app/app");
6
5
  const AppUI_1 = require("./AppUI");
7
6
  const App = ({ children }) => {
8
- return ((0, jsx_runtime_1.jsx)(app_1.AppProvider, { children: (0, jsx_runtime_1.jsx)(AppUI_1.AppUI, { children: children }) }));
7
+ return (0, jsx_runtime_1.jsx)(AppUI_1.AppUI, { children: children });
9
8
  };
10
9
  exports.App = App;
@@ -40,8 +40,8 @@ const NavBackButton = () => {
40
40
  color: 'inherit',
41
41
  width: !isMobile ? 44 : undefined,
42
42
  maxWidth: !isMobile ? 44 : undefined,
43
- }, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowLeft, {}), onClick: () => {
44
- router.back();
43
+ }, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowLeft, {}), onClick: async () => {
44
+ await router.back();
45
45
  } }));
46
46
  };
47
47
  const NavTitle = () => {
@@ -98,12 +98,12 @@ const NavActions = () => {
98
98
  flex: 1,
99
99
  }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Caption1Strong, { children: authSession?.fullName }), (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { textOverflow: 'ellipsis', overflow: 'hidden' }, children: authSession?.email })] })] })), !isSkipAuthCheck && (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, { style: { marginInline: 0 } }), (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { style: { width: 200, marginBottom: 4 }, children: [accountMenuItems?.map((item) => {
100
100
  const Icon = item.icon;
101
- return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), onClick: () => {
101
+ return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), onClick: async () => {
102
102
  if (item.onClick) {
103
103
  item.onClick();
104
104
  }
105
105
  else if (item.link) {
106
- router.push(basePath + item.link);
106
+ await router.push(basePath + item.link);
107
107
  }
108
108
  }, children: item.localizedLabel?.[language] ?? item.label }, item.__key));
109
109
  }), !isSkipAuthCheck && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.SignOut, {}), onClick: () => logout(), children: strings.logout }))] })] })] }))] }));
@@ -6,12 +6,13 @@ const react_components_1 = require("@fluentui/react-components");
6
6
  const LayoutProvider_1 = require("@headless-adminapp/app/app/LayoutProvider");
7
7
  const DialogContainer_1 = require("../DialogContainer");
8
8
  const ProgressIndicatorContainer_1 = require("../ProgressIndicatorContainer");
9
+ const QuickCreateContainer_1 = require("../QuickCreateContainer");
9
10
  const ToastNotificationContainer_1 = require("../ToastNotificationContainer");
10
11
  const LayoutProvider = ({ children, theme, ...rest }) => {
11
- return ((0, jsx_runtime_1.jsx)(react_components_1.FluentProvider, { theme: theme ?? react_components_1.webLightTheme, children: (0, jsx_runtime_1.jsx)(LayoutProvider_1.LayoutProvider, { ...rest, containers: {
12
+ return ((0, jsx_runtime_1.jsx)(react_components_1.FluentProvider, { theme: theme ?? react_components_1.webLightTheme, children: (0, jsx_runtime_1.jsxs)(LayoutProvider_1.LayoutProvider, { ...rest, containers: {
12
13
  DialogContainer: DialogContainer_1.DialogContainer,
13
14
  ProgressIndicatorContainer: ProgressIndicatorContainer_1.ProgressIndicatorContainer,
14
15
  ToastNotificationContainer: ToastNotificationContainer_1.ToastNotificationContainer,
15
- }, children: children }) }));
16
+ }, children: [children, (0, jsx_runtime_1.jsx)(QuickCreateContainer_1.QuickCreateContainer, {})] }) }));
16
17
  };
17
18
  exports.LayoutProvider = LayoutProvider;
@@ -4,8 +4,9 @@ exports.NavigationContainer = 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 app_1 = require("@headless-adminapp/app/app");
7
+ const hooks_1 = require("@headless-adminapp/app/hooks");
7
8
  const locale_1 = require("@headless-adminapp/app/locale");
8
- const hooks_1 = require("@headless-adminapp/app/route/hooks");
9
+ const hooks_2 = require("@headless-adminapp/app/route/hooks");
9
10
  const app_2 = require("@headless-adminapp/core/experience/app");
10
11
  const react_1 = require("react");
11
12
  const NavCategoryItemComponent_1 = require("./NavCategoryItemComponent");
@@ -26,11 +27,12 @@ const NavigationContainer = ({ open, type, onOpenChange, isMini, }) => {
26
27
  const styles = useStyles();
27
28
  const { appExperience: app } = (0, app_1.useAppContext)();
28
29
  const { schemaMetadataDic } = (0, app_1.useAppContext)();
29
- const router = (0, hooks_1.useRouter)();
30
- const pathname = (0, hooks_1.usePathname)();
30
+ const isMobile = (0, hooks_1.useIsMobile)();
31
+ const router = (0, hooks_2.useRouter)();
32
+ const pathname = (0, hooks_2.usePathname)();
31
33
  const { language } = (0, locale_1.useLocale)();
32
- const isRouteActive = (0, hooks_1.useIsRouteActive)();
33
- const routeResolver = (0, hooks_1.useRouteResolver)();
34
+ const isRouteActive = (0, hooks_2.useIsRouteActive)();
35
+ const routeResolver = (0, hooks_2.useRouteResolver)();
34
36
  const sections = (0, react_1.useMemo)(() => (0, utils_1.transformNavSections)({
35
37
  navItems: app.navItems,
36
38
  schemaMetadataDic,
@@ -46,7 +48,7 @@ const NavigationContainer = ({ open, type, onOpenChange, isMini, }) => {
46
48
  isRouteActive,
47
49
  pathname,
48
50
  ]);
49
- const handleNavigation = (item) => {
51
+ const handleNavigation = async (item) => {
50
52
  if (type === 'overlay') {
51
53
  onOpenChange(false);
52
54
  }
@@ -54,22 +56,29 @@ const NavigationContainer = ({ open, type, onOpenChange, isMini, }) => {
54
56
  window.open(item.link, '_blank');
55
57
  }
56
58
  else {
57
- router.push(item.link);
59
+ await router.push(item.link);
58
60
  }
59
61
  };
60
- return ((0, jsx_runtime_1.jsx)("div", { className: styles.root, children: (0, jsx_runtime_1.jsx)(react_components_1.NavDrawer, { selectedValue: "active", selectedCategoryValue: "active", defaultOpenCategories: ['active'], open: open || isMini, type: type, onOpenChange: (_value, data) => onOpenChange(data.open), onNavItemSelect: () => {
62
+ return ((0, jsx_runtime_1.jsx)("div", { className: styles.root, children: (0, jsx_runtime_1.jsxs)(react_components_1.NavDrawer, { selectedValue: "active", selectedCategoryValue: "active", defaultOpenCategories: ['active'], open: open || isMini, type: type, onOpenChange: (_value, data) => onOpenChange(data.open), onNavItemSelect: () => {
61
63
  // do nothing
62
- }, style: { width: isMini ? 60 : undefined }, children: (0, jsx_runtime_1.jsx)(react_components_1.NavDrawerBody, { style: {
63
- paddingTop: 8,
64
- }, 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) => {
65
- if (item.type === app_2.PageType.Category) {
66
- const isActive = item.items.some((subItem) => subItem.active);
67
- if (isMini) {
68
- return ((0, jsx_runtime_1.jsx)(NavMiniCategoryMenu_1.NavMiniCategoryMenu, { isActive: isActive, item: item, onSelect: handleNavigation }, item.key));
64
+ }, style: { width: isMini ? 60 : undefined }, children: [isMobile && ((0, jsx_runtime_1.jsx)(react_components_1.NavDrawerHeader, { style: { padding: 0 }, children: (0, jsx_runtime_1.jsx)("div", { style: {
65
+ display: 'flex',
66
+ alignItems: 'center',
67
+ height: 50,
68
+ minHeight: 50,
69
+ paddingInline: 12,
70
+ gap: 8,
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
+ paddingTop: 8,
73
+ }, 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
+ if (item.type === app_2.PageType.Category) {
75
+ const isActive = item.items.some((subItem) => subItem.active);
76
+ if (isMini) {
77
+ return ((0, jsx_runtime_1.jsx)(NavMiniCategoryMenu_1.NavMiniCategoryMenu, { isActive: isActive, item: item, onSelect: handleNavigation }, item.key));
78
+ }
79
+ return ((0, jsx_runtime_1.jsxs)(react_components_1.NavCategory, { value: isActive ? 'active' : '', children: [(0, jsx_runtime_1.jsx)(NavCategoryItemComponent_1.NavCategoryItemComponent, { item: item, isActive: isActive }), (0, jsx_runtime_1.jsx)(react_components_1.NavSubItemGroup, { children: item.items.map((subItem) => ((0, jsx_runtime_1.jsx)(NavSubItemComponent_1.NavSubItemComponent, { item: subItem, onClick: handleNavigation }, subItem.key))) })] }, item.key));
69
80
  }
70
- return ((0, jsx_runtime_1.jsxs)(react_components_1.NavCategory, { value: isActive ? 'active' : '', children: [(0, jsx_runtime_1.jsx)(NavCategoryItemComponent_1.NavCategoryItemComponent, { item: item, isActive: isActive }), (0, jsx_runtime_1.jsx)(react_components_1.NavSubItemGroup, { children: item.items.map((subItem) => ((0, jsx_runtime_1.jsx)(NavSubItemComponent_1.NavSubItemComponent, { item: subItem, onClick: handleNavigation }, subItem.key))) })] }, item.key));
71
- }
72
- return ((0, jsx_runtime_1.jsx)(NavItemComponent_1.NavItemComponent, { item: item, onClick: handleNavigation, isMini: isMini }, item.key));
73
- })] }, section.label))) }) }) }));
81
+ return ((0, jsx_runtime_1.jsx)(NavItemComponent_1.NavItemComponent, { item: item, onClick: handleNavigation, isMini: isMini }, item.key));
82
+ })] }, section.label))) })] }) }));
74
83
  };
75
84
  exports.NavigationContainer = NavigationContainer;
@@ -32,7 +32,7 @@ const QuickActionItem = ({ label, Icon, onClick, link, badgeCount, badgeColor =
32
32
  position: 'relative',
33
33
  fontWeight: react_components_1.tokens.fontWeightRegular,
34
34
  minWidth: 'unset',
35
- }, as: "a", href: fullLink, title: label, className: styles.root, onClick: (event) => {
35
+ }, as: "a", href: fullLink, title: label, "aria-label": label, className: styles.root, onClick: (event) => {
36
36
  event.preventDefault();
37
37
  if (fullLink) {
38
38
  router.push(fullLink);
@@ -9,11 +9,12 @@ const react_components_1 = require("@fluentui/react-components");
9
9
  const datagrid_1 = require("@headless-adminapp/app/datagrid");
10
10
  const constants_1 = require("@headless-adminapp/app/datagrid/column-filter/constants");
11
11
  const react_1 = require("react");
12
+ const DrawerFooter_1 = require("../../components/DrawerFooter");
13
+ const DrawerHeader_1 = require("../../components/DrawerHeader");
12
14
  const SectionControl_1 = require("../../DataForm/SectionControl");
13
15
  const SelectControl_1 = __importDefault(require("../../form/controls/SelectControl"));
14
16
  const utils_1 = require("../GridColumnHeader/utils");
15
17
  const ColumnFilterItem_1 = require("./ColumnFilterItem");
16
- const Header_1 = require("./Header");
17
18
  const CustomFilter = ({ open, onClose }) => {
18
19
  return ((0, jsx_runtime_1.jsx)(react_components_1.Drawer, { open: open, position: "end", size: "small", style: { borderLeftWidth: 0 }, children: (0, jsx_runtime_1.jsx)(DrawerContent, { onClose: onClose }) }));
19
20
  };
@@ -79,7 +80,7 @@ const DrawerContent = ({ onClose }) => {
79
80
  setSortingInternal(sorting);
80
81
  onClose();
81
82
  };
82
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.Header, { onClose: handleCancel }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { padding: react_components_1.tokens.spacingHorizontalM }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
83
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: "Sort and Filter", onClose: handleCancel, showCloseButton: true }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { padding: react_components_1.tokens.spacingHorizontalM }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
83
84
  display: 'flex',
84
85
  flexDirection: 'column',
85
86
  gap: react_components_1.tokens.spacingVerticalM,
@@ -134,8 +135,5 @@ const DrawerContent = ({ onClose }) => {
134
135
  if (!value)
135
136
  return;
136
137
  handleAddFilter(value);
137
- }, options: attributeOptions.filter((x) => !columnFiltersInternal[x.value]) }) })] }) }), (0, jsx_runtime_1.jsxs)(react_components_1.DrawerFooter, { style: {
138
- padding: react_components_1.tokens.spacingHorizontalM,
139
- gap: react_components_1.tokens.spacingHorizontalM,
140
- }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "primary", disabled: !isValid, onClick: handleApply, children: "Apply" }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: handleCancel, children: "Cancel" })] })] }));
138
+ }, options: attributeOptions.filter((x) => !columnFiltersInternal[x.value]) }) })] }) }), (0, jsx_runtime_1.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "primary", disabled: !isValid, onClick: handleApply, children: "Apply" }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: handleCancel, children: "Cancel" })] })] }));
141
139
  };
@@ -11,6 +11,8 @@ const hooks_2 = require("@headless-adminapp/app/metadata/hooks");
11
11
  const icons_1 = require("@headless-adminapp/icons");
12
12
  const react_1 = require("react");
13
13
  const AppStringContext_1 = require("../../App/AppStringContext");
14
+ const DrawerFooter_1 = require("../../components/DrawerFooter");
15
+ const DrawerHeader_1 = require("../../components/DrawerHeader");
14
16
  const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
15
17
  function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, }) {
16
18
  const schema = (0, hooks_1.useDataGridSchema)();
@@ -60,18 +62,18 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
60
62
  acc[column.id] = true;
61
63
  return acc;
62
64
  }, {});
63
- return ((0, jsx_runtime_1.jsxs)(react_components_1.Drawer, { separator: true, open: opened, position: "end", children: [(0, jsx_runtime_1.jsx)(react_components_1.DrawerHeader, { children: (0, jsx_runtime_1.jsx)(react_components_1.DrawerHeaderTitle, { action: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", "aria-label": "Close", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Close, {}), onClick: onClose }), children: strings.addColumns }) }), (0, jsx_runtime_1.jsxs)("div", { style: { width: '100%', display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
64
- display: 'flex',
65
- flexDirection: 'column-reverse',
66
- gap: 8,
67
- marginBottom: react_components_1.tokens.spacingVerticalXS,
68
- paddingInline: react_components_1.tokens.spacingHorizontalS,
69
- }, 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, value: searchText, onChange: (e) => setSearchText(e.target.value) }), (0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { value: selectedGroupItem?.label ?? '', selectedOptions: selectedGroupItem ? [String(selectedGroupItem.key)] : [], onOptionSelect: (event, data) => {
70
- setSelectedGroup(data.optionValue);
71
- }, style: { flex: 1, minWidth: 'unset' }, positioning: {
72
- align: 'bottom',
73
- position: 'below',
74
- }, children: tableItems.map((x) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: x.key, children: x.label }, x.key))) })] }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, {})] }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { paddingInline: 0 }, children: filteredColumns.map((column) => ((0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(react_components_1.Checkbox, { checked: includedColumnsObj[column.id] ?? false }), style: {
65
+ return ((0, jsx_runtime_1.jsxs)(react_components_1.Drawer, { separator: true, open: opened, position: "end", children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: strings.addColumns, showCloseButton: true, onClose: onClose, bottomContent: (0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
66
+ display: 'flex',
67
+ flexDirection: 'column-reverse',
68
+ gap: 8,
69
+ marginBlock: react_components_1.tokens.spacingVerticalS,
70
+ paddingInline: react_components_1.tokens.spacingHorizontalS,
71
+ }, 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, value: searchText, onChange: (e) => setSearchText(e.target.value) }), (0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { value: selectedGroupItem?.label ?? '', selectedOptions: selectedGroupItem ? [String(selectedGroupItem.key)] : [], onOptionSelect: (event, data) => {
72
+ setSelectedGroup(data.optionValue);
73
+ }, style: { flex: 1, minWidth: 'unset' }, positioning: {
74
+ align: 'bottom',
75
+ position: 'below',
76
+ }, children: tableItems.map((x) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: x.key, children: x.label }, x.key))) })] }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, {})] }) }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { paddingInline: 0 }, children: filteredColumns.map((column) => ((0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(react_components_1.Checkbox, { checked: includedColumnsObj[column.id] ?? false }), style: {
75
77
  fontWeight: react_components_1.tokens.fontSizeBase400,
76
78
  width: '100%',
77
79
  justifyContent: 'flex-start',
@@ -83,10 +85,5 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
83
85
  else {
84
86
  onColumnAdd(column);
85
87
  }
86
- }, children: column.label }, column.id))) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', width: '100%' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: {
87
- display: 'flex',
88
- padding: 8,
89
- gap: 8,
90
- justifyContent: 'flex-end',
91
- }, children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: onClose, children: strings.close }) })] })] }));
88
+ }, children: column.label }, column.id))) }), (0, jsx_runtime_1.jsx)(DrawerFooter_1.DrawerFooter, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: onClose, children: strings.close }) })] }));
92
89
  }
@@ -12,7 +12,11 @@ const mutable_1 = require("@headless-adminapp/app/mutable");
12
12
  const icons_1 = require("@headless-adminapp/icons");
13
13
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
14
14
  const react_1 = require("react");
15
+ const Button_1 = require("../../CommandBar/Button");
16
+ const Wrapper_1 = require("../../CommandBar/Wrapper");
15
17
  const DndProvider_1 = require("../../components/DndProvider");
18
+ const DrawerFooter_1 = require("../../components/DrawerFooter");
19
+ const DrawerHeader_1 = require("../../components/DrawerHeader");
16
20
  const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
17
21
  const AddColumns_1 = require("./AddColumns");
18
22
  const ColumnItem_1 = require("./ColumnItem");
@@ -44,34 +48,21 @@ function CustomizeColumns({ onClose, opened }) {
44
48
  const onColumnRemove = (0, react_1.useCallback)((column) => {
45
49
  setItems((prev) => prev.filter((x) => x.id !== column.id));
46
50
  }, []);
47
- return ((0, jsx_runtime_1.jsxs)(react_components_1.Drawer, { separator: true, open: opened, position: "end", size: "small", children: [(0, jsx_runtime_1.jsx)(react_components_1.DrawerHeader, { children: (0, jsx_runtime_1.jsx)(react_components_1.DrawerHeaderTitle, { action: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", "aria-label": "Close", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Close, {}), onClick: onClose }), children: strings.editColumns }) }), (0, jsx_runtime_1.jsxs)("div", { style: { width: '100%', display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
48
- display: 'flex',
49
- gap: 8,
50
- marginBottom: react_components_1.tokens.spacingVerticalXS,
51
- paddingInline: react_components_1.tokens.spacingHorizontalS,
52
- }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), style: {
53
- fontWeight: react_components_1.tokens.fontSizeBase400,
54
- minWidth: 'unset',
55
- }, onClick: () => setShowAddColumns(true), children: strings.add }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Edit, {}), style: { fontWeight: react_components_1.tokens.fontSizeBase400, minWidth: 'unset' }, disabled: !isDirty, onClick: () => {
56
- setItems(columns);
57
- }, children: strings.reset })] }), (0, jsx_runtime_1.jsx)(AddColumns_1.AddColumns, { onColumnAdd: onColumnAdd, onColumnRemove: onColumnRemove, columns: items, opened: showAddColumns, onClose: () => setShowAddColumns(false) }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, {})] }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { paddingInline: react_components_1.tokens.spacingHorizontalS }, children: (0, jsx_runtime_1.jsx)(DndProvider_1.DndProvider, { children: (0, jsx_runtime_1.jsx)("div", { style: {
58
- display: 'flex',
59
- flexDirection: 'column',
60
- width: '100%',
61
- gap: react_components_1.tokens.spacingVerticalS,
62
- // padding: tokens.spacingHorizontalS,
63
- paddingBlock: react_components_1.tokens.spacingVerticalS,
64
- }, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(ColumnItem_1.ColumnItem, { index: index, item: item, moveItem: moveItem, isFirst: index === 0, isLast: index === items.length - 1, onRemove: () => onColumnRemove(item), stringSet: strings }, item.id))) }) }) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', width: '100%' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsxs)("div", { style: {
65
- display: 'flex',
66
- padding: 8,
67
- gap: 8,
68
- justifyContent: 'flex-end',
69
- }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: () => {
70
- setContextValue({
71
- columns: items,
72
- });
73
- onClose();
74
- }, appearance: "primary", children: strings.apply }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: () => {
75
- onClose();
76
- }, children: strings.cancel })] })] })] }));
51
+ return ((0, jsx_runtime_1.jsxs)(react_components_1.Drawer, { separator: true, open: opened, position: "end", size: "small", children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: strings.editColumns, showCloseButton: true, onClose: onClose }), (0, jsx_runtime_1.jsxs)(react_components_1.DrawerBody, { style: { paddingInline: react_components_1.tokens.spacingHorizontalM }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { marginInline: -8, marginTop: 8 }, children: [(0, jsx_runtime_1.jsxs)(Wrapper_1.CommandBarWrapper, { children: [(0, jsx_runtime_1.jsx)(Button_1.CommandButton, { Icon: icons_1.Icons.Add, text: strings.add, onClick: () => setShowAddColumns(true) }), (0, jsx_runtime_1.jsx)(Button_1.CommandButton, { Icon: icons_1.Icons.Edit, text: strings.reset, disabled: !isDirty, onClick: () => {
52
+ setItems(columns);
53
+ } })] }), (0, jsx_runtime_1.jsx)(AddColumns_1.AddColumns, { onColumnAdd: onColumnAdd, onColumnRemove: onColumnRemove, columns: items, opened: showAddColumns, onClose: () => setShowAddColumns(false) })] }), (0, jsx_runtime_1.jsx)(DndProvider_1.DndProvider, { children: (0, jsx_runtime_1.jsx)("div", { style: {
54
+ display: 'flex',
55
+ flexDirection: 'column',
56
+ width: '100%',
57
+ gap: react_components_1.tokens.spacingVerticalS,
58
+ // padding: tokens.spacingHorizontalS,
59
+ paddingBlock: react_components_1.tokens.spacingVerticalS,
60
+ }, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(ColumnItem_1.ColumnItem, { index: index, item: item, moveItem: moveItem, isFirst: index === 0, isLast: index === items.length - 1, onRemove: () => onColumnRemove(item), stringSet: strings }, item.id))) }) })] }), (0, jsx_runtime_1.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: () => {
61
+ setContextValue({
62
+ columns: items,
63
+ });
64
+ onClose();
65
+ }, appearance: "primary", children: strings.apply }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: () => {
66
+ onClose();
67
+ }, children: strings.cancel })] })] }));
77
68
  }
@@ -15,7 +15,7 @@ function BarChart({ dataset, chartInfo, }) {
15
15
  const bars = chartInfo.bars;
16
16
  const xAxisFullFormatter = (0, formatters_1.createLongAxisFormatter)(locale, xAxis.tick);
17
17
  const yAxisFullFormatter = (0, formatters_1.createLongAxisFormatter)(locale, yAxis.tick);
18
- return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, { data: dataset[0], stackOffset: chartInfo.stackOffset, children: [(0, renderers_1.renderGrid)(), (0, renderers_1.renderYAxis)(locale, yAxis), (0, renderers_1.renderXAxis)(locale, xAxis), (0, renderers_1.renderBars)(bars, dataset), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { cursor: {
18
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, { data: dataset[0], stackOffset: chartInfo.stackOffset, children: [(0, renderers_1.renderGrid)(), (0, renderers_1.renderYAxis)(locale, yAxis), (0, renderers_1.renderXAxis)(locale, xAxis, dataset[0].length < 3), (0, renderers_1.renderBars)(bars, dataset), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { cursor: {
19
19
  fill: react_components_1.tokens.colorNeutralBackground6,
20
20
  opacity: 0.2,
21
21
  }, content: ({ active, payload, label }) => ((0, jsx_runtime_1.jsx)(CustomTooltipContent_1.CustomTooltipContent, { xAxisFormatter: xAxisFullFormatter, yAxisFormatter: yAxisFullFormatter, active: active, payload: payload, label: label })) })] }) }));
@@ -15,7 +15,7 @@ function LineChart({ dataset, chartInfo, }) {
15
15
  const lines = chartInfo.lines;
16
16
  const xAxisFullFormatter = (0, formatters_1.createLongAxisFormatter)(locale, xAxis.tick);
17
17
  const yAxisFullFormatter = (0, formatters_1.createLongAxisFormatter)(locale, yAxis.tick);
18
- return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.LineChart, { data: dataset[0], children: [(0, renderers_1.renderGrid)(), (0, renderers_1.renderYAxis)(locale, yAxis), (0, renderers_1.renderXAxis)(locale, xAxis), (0, renderers_1.renderLines)(lines), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { cursor: {
18
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.LineChart, { data: dataset[0], children: [(0, renderers_1.renderGrid)(), (0, renderers_1.renderYAxis)(locale, yAxis), (0, renderers_1.renderXAxis)(locale, xAxis, dataset[0].length < 3), (0, renderers_1.renderLines)(lines), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { cursor: {
19
19
  stroke: react_components_1.tokens.colorNeutralBackground6,
20
20
  opacity: 0.5,
21
21
  }, content: ({ active, payload, label }) => ((0, jsx_runtime_1.jsx)(CustomTooltipContent_1.CustomTooltipContent, { xAxisFormatter: xAxisFullFormatter, yAxisFormatter: yAxisFullFormatter, active: active, payload: payload, label: label })) })] }) }));
@@ -51,7 +51,7 @@ function OhlcChart({ dataset, chartInfo, }) {
51
51
  return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.ScatterChart, { data: data, children: [(0, renderers_1.renderGrid)(), (0, renderers_1.renderYAxis)(locale, {
52
52
  ...chartInfo.yAxis,
53
53
  domain,
54
- }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: xAxis.dataKey, name: xAxis.name, tickFormatter: xAxisFormatter, tickLine: false, minTickGap: 10, padding: "gap", axisLine: {
54
+ }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: xAxis.dataKey, name: xAxis.name, tickFormatter: xAxisFormatter, tickLine: false, minTickGap: 10, padding: "no-gap", axisLine: {
55
55
  stroke: react_components_1.tokens.colorNeutralBackground6,
56
56
  }, fontSize: react_components_1.tokens.fontSizeBase100, tick: {
57
57
  fill: react_components_1.tokens.colorNeutralForeground1,
@@ -31,8 +31,8 @@ const CommandContainer = ({ skeleton }) => {
31
31
  {
32
32
  type: 'icon',
33
33
  Icon: icons_1.Icons.ArrowLeft,
34
- onClick: () => {
35
- router.back();
34
+ onClick: async () => {
35
+ await router.back();
36
36
  },
37
37
  },
38
38
  ],
@@ -61,7 +61,7 @@ const CardUi = ({ schema, control, formControl, onAddRow, onRemoveRow, rows, ali
61
61
  }, children: (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { name: `${alias}.${index}.${attributeName}`, control: formControl, render: ({ field, fieldState, formState }) => {
62
62
  const isError = (fieldState.isTouched || formState.isSubmitted) &&
63
63
  !!fieldState.error?.message;
64
- return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: attribute.label, labelPosition: "top", isError: isError, children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value ?? null, readOnly: isControlReadonly, onChange: (value) => {
64
+ return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: attribute.label, labelPosition: "top", isError: isError, required: attribute.required, children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value ?? null, readOnly: isControlReadonly, onChange: (value) => {
65
65
  const previousValue = field.value;
66
66
  field.onChange(value);
67
67
  eventManager.emit(constants_1.EVENT_KEY_ON_FIELD_CHANGE, field.name, value, previousValue);
@@ -99,7 +99,7 @@ function SectionContainer({ section, skeleton, }) {
99
99
  recordId,
100
100
  attributeName: control.attributeName,
101
101
  logicalName: schema.logicalName,
102
- }, autoHeight: control.autoHeight, maxHeight: control.maxHeight, skeleton: skeleton }) }));
102
+ }, autoHeight: control.autoHeight, maxHeight: control.maxHeight, skeleton: skeleton, required: required }) }));
103
103
  } }, control.attributeName) }, control.attributeName));
104
104
  }
105
105
  case 'editablegrid': {
@@ -44,7 +44,7 @@ const StandardControl = (props) => {
44
44
  // hideLabel,
45
45
  hidePlaceholder, readOnly,
46
46
  // quickViewControl,
47
- allowNavigation, allowNewRecord, autoHeight, maxHeight, skeleton, } = props;
47
+ allowNavigation, allowNewRecord, autoHeight, maxHeight, skeleton, required, } = props;
48
48
  const isDisabled = readOnly;
49
49
  const placeholder = hidePlaceholder
50
50
  ? undefined
@@ -192,7 +192,7 @@ const StandardControl = (props) => {
192
192
  }
193
193
  case 'choice': {
194
194
  const Control = componentStore_1.componentStore.getComponent('Form.SelectControl') ?? SelectControl_1.default;
195
- return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly, skeleton: skeleton }));
195
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly, skeleton: skeleton, clearable: !required }));
196
196
  }
197
197
  case 'choices': {
198
198
  const Control = componentStore_1.componentStore.getComponent('Form.MultiSelectControl') ?? MultiSelectControl_1.default;
@@ -0,0 +1,8 @@
1
+ import { DataLookup, Id } from '@headless-adminapp/core/attributes';
2
+ import { FC } from 'react';
3
+ interface FormContainerProps {
4
+ onClose: () => void;
5
+ onCreate: (value: DataLookup<Id>) => void;
6
+ }
7
+ export declare const FormContainer: FC<FormContainerProps>;
8
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
7
+ const useFormDataState_1 = require("@headless-adminapp/app/dataform/hooks/useFormDataState");
8
+ const useMobileHeaderSetValue_1 = require("@headless-adminapp/app/header/hooks/useMobileHeaderSetValue");
9
+ const useFormSave_1 = require("@headless-adminapp/app/quickcreate/hooks/useFormSave");
10
+ const react_query_1 = require("@tanstack/react-query");
11
+ const react_1 = require("react");
12
+ const BodyLoading_1 = require("../components/BodyLoading");
13
+ const DrawerFooter_1 = require("../components/DrawerFooter");
14
+ const DrawerHeader_1 = require("../components/DrawerHeader");
15
+ const PageBroken_1 = require("../components/PageBroken");
16
+ const FormTab_1 = require("../form/layout/FormTab");
17
+ const SectionContainer_1 = require("../PageEntityForm/SectionContainer");
18
+ const QuickCreateTabContainer_1 = require("./QuickCreateTabContainer");
19
+ const FormContainer = ({ onClose, onCreate, }) => {
20
+ const dataState = (0, useFormDataState_1.useFormDataState)();
21
+ const schema = (0, hooks_1.useDataFormSchema)();
22
+ (0, useMobileHeaderSetValue_1.useMobileHeaderSetValue)(schema.label, 2, 'title');
23
+ const formConfig = (0, hooks_1.useSelectedForm)();
24
+ const notifications = (0, hooks_1.useFormNotifications)();
25
+ const saveForm = (0, useFormSave_1.useFormSave)();
26
+ const { mutate: save, isPending: isCreating } = (0, react_query_1.useMutation)({
27
+ mutationFn: saveForm,
28
+ onSuccess: (data) => {
29
+ if (data) {
30
+ onCreate(data);
31
+ }
32
+ },
33
+ });
34
+ if (!dataState.isFetching && dataState.isError) {
35
+ return (0, jsx_runtime_1.jsx)(PageBroken_1.PageBroken, { title: "Error", message: "Unable to load page" });
36
+ }
37
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BodyLoading_1.BodyLoading, { loading: isCreating }), (0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: `Quick Create - ${schema.label}`, showCloseButton: true, onClose: onClose, bottomContent: (0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(QuickCreateTabContainer_1.QuickCreateTabContainer, {}), notifications.length > 0 && ((0, jsx_runtime_1.jsx)("div", { style: {
38
+ display: 'flex',
39
+ flexDirection: 'column',
40
+ gap: react_components_1.tokens.spacingVerticalS,
41
+ paddingInline: react_components_1.tokens.spacingHorizontalS,
42
+ paddingTop: react_components_1.tokens.spacingVerticalS,
43
+ }, 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.jsx)(react_components_1.DrawerBody, { style: {
44
+ display: 'flex',
45
+ flexDirection: 'column',
46
+ padding: react_components_1.tokens.spacingVerticalM,
47
+ // backgroundColor: tokens.colorNeutralBackground2,
48
+ }, 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.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "primary", onClick: () => save(), children: isCreating ? ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny", appearance: "inverted", style: { marginRight: 8 } }), "Creating..."] })) : ('Create') }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: onClose, children: "Cancel" })] })] }));
49
+ };
50
+ exports.FormContainer = FormContainer;
@@ -0,0 +1 @@
1
+ export declare const QuickCreateContainer: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuickCreateContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const hooks_1 = require("@headless-adminapp/app/quickcreate/hooks");
7
+ const QuickCreateItemContent_1 = require("./QuickCreateItemContent");
8
+ const QuickCreateContainer = () => {
9
+ const items = (0, hooks_1.useQuickCreateItems)();
10
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: items.map((item) => {
11
+ const { id, isOpen, ...options } = item;
12
+ return ((0, jsx_runtime_1.jsx)(QuickCreateItem, { logicalName: options.logicalName, onClose: () => options.onCancel?.(), onCreate: (value) => options.onCreate?.(value), isOpen: isOpen }, id));
13
+ }) }));
14
+ };
15
+ exports.QuickCreateContainer = QuickCreateContainer;
16
+ const QuickCreateItem = ({ isOpen, logicalName, onClose, onCreate, }) => {
17
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Drawer, { separator: true, open: isOpen, position: "end", size: "medium", children: (0, jsx_runtime_1.jsx)(QuickCreateItemContent_1.QuickCreateItemContent, { logicalName: logicalName, onClose: onClose, onCreate: onCreate }) }));
18
+ };
@@ -0,0 +1,9 @@
1
+ import { DataLookup, Id } from '@headless-adminapp/core/attributes';
2
+ import { FC } from 'react';
3
+ interface QuickCreateItemContentProps {
4
+ logicalName: string;
5
+ onClose: () => void;
6
+ onCreate: (value: DataLookup<Id>) => void;
7
+ }
8
+ export declare const QuickCreateItemContent: FC<QuickCreateItemContentProps>;
9
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuickCreateItemContent = 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 icons_1 = require("@headless-adminapp/icons");
8
+ const react_1 = require("react");
9
+ const BodyLoading_1 = require("../components/BodyLoading");
10
+ const DrawerHeader_1 = require("../components/DrawerHeader");
11
+ const PageBroken_1 = require("../components/PageBroken");
12
+ const FormContainer_1 = require("./FormContainer");
13
+ const useLoadQuickCreateFormInfo_1 = require("./useLoadQuickCreateFormInfo");
14
+ const QuickCreateItemContent = ({ logicalName, onClose, onCreate, }) => {
15
+ const result = (0, useLoadQuickCreateFormInfo_1.useLoadQuickCreateFormInfo)(logicalName, undefined);
16
+ if (result.loading) {
17
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: "Quick Create", showCloseButton: true, onClose: onClose }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { children: (0, jsx_runtime_1.jsx)(BodyLoading_1.BodyLoading, { loading: true }) })] }));
18
+ }
19
+ if (result.error) {
20
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: "Quick Create", showCloseButton: true, onClose: onClose }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { children: (0, jsx_runtime_1.jsx)(PageBroken_1.PageBroken, { Icon: icons_1.Icons.Error, title: result.title, message: result.message }) })] }));
21
+ }
22
+ const { schema, form, commands } = result;
23
+ if (schema.restrictions?.disableCreate) {
24
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: `Quick Create - ${schema.label}`, showCloseButton: true, onClose: onClose }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { children: (0, jsx_runtime_1.jsx)(PageBroken_1.PageBroken, { Icon: icons_1.Icons.Error, title: "Creating is disabled", message: "Creating records is disabled for this entity." }) })] }));
25
+ }
26
+ return ((0, jsx_runtime_1.jsx)(dataform_1.DataFormProvider, { schema: schema, form: form, commands: commands, children: (0, jsx_runtime_1.jsx)(FormContainer_1.FormContainer, { onClose: onClose, onCreate: onCreate }) }));
27
+ };
28
+ exports.QuickCreateItemContent = QuickCreateItemContent;
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const QuickCreateTabContainer: FC;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuickCreateTabContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const dataform_1 = require("@headless-adminapp/app/dataform");
6
+ const TabContainer_1 = require("../PageEntityForm/TabContainer");
7
+ const QuickCreateTabContainer = () => {
8
+ const formConfig = (0, dataform_1.useSelectedForm)();
9
+ if (formConfig.experience.tabs.length < 2) {
10
+ return null;
11
+ }
12
+ return (0, jsx_runtime_1.jsx)(TabContainer_1.TabContainer, {});
13
+ };
14
+ exports.QuickCreateTabContainer = QuickCreateTabContainer;
@@ -0,0 +1 @@
1
+ export { QuickCreateContainer } from './QuickCreateContainer';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuickCreateContainer = void 0;
4
+ var QuickCreateContainer_1 = require("./QuickCreateContainer");
5
+ Object.defineProperty(exports, "QuickCreateContainer", { enumerable: true, get: function () { return QuickCreateContainer_1.QuickCreateContainer; } });
@@ -0,0 +1,18 @@
1
+ import { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
2
+ import { Schema } from '@headless-adminapp/core/schema';
3
+ type UseLoadMainFormPageResult = {
4
+ loading: true;
5
+ } | {
6
+ loading: false;
7
+ error: true;
8
+ title: string;
9
+ message: string;
10
+ } | {
11
+ loading: false;
12
+ error: false;
13
+ schema: Schema;
14
+ form: Form;
15
+ commands: EntityMainFormCommandItemExperience[][];
16
+ };
17
+ export declare function useLoadQuickCreateFormInfo(logicalName: string, formId: string | undefined): UseLoadMainFormPageResult;
18
+ export {};
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLoadQuickCreateFormInfo = useLoadQuickCreateFormInfo;
4
+ const metadata_1 = require("@headless-adminapp/app/metadata");
5
+ const react_query_1 = require("@tanstack/react-query");
6
+ function useLoadQuickCreateFormInfo(logicalName, formId) {
7
+ const schema = (0, metadata_1.useSchema)(logicalName);
8
+ const experienceStore = (0, metadata_1.useExperienceStore)();
9
+ const { data: form, isFetching: isFetchingForm } = (0, react_query_1.useQuery)({
10
+ queryKey: ['experience-schema-quick-create-form', logicalName, formId],
11
+ queryFn: async () => {
12
+ return experienceStore.getQuickCreateForm(logicalName, formId);
13
+ },
14
+ placeholderData: react_query_1.keepPreviousData,
15
+ });
16
+ const { data: commands } = (0, react_query_1.useQuery)({
17
+ queryKey: ['experience-schema-form-commands', logicalName],
18
+ queryFn: async () => {
19
+ return [];
20
+ },
21
+ initialData: [],
22
+ });
23
+ if (!schema) {
24
+ return {
25
+ loading: false,
26
+ error: true,
27
+ title: 'Schema not found',
28
+ message: `The schema "${logicalName}" was not found`,
29
+ };
30
+ }
31
+ if (!form) {
32
+ if (isFetchingForm) {
33
+ return {
34
+ loading: true,
35
+ };
36
+ }
37
+ return {
38
+ loading: false,
39
+ error: true,
40
+ title: 'Form not found',
41
+ message: `The form was not found for "${logicalName}"`,
42
+ };
43
+ }
44
+ if (form.logicalName !== schema.logicalName) {
45
+ if (isFetchingForm) {
46
+ return {
47
+ loading: true,
48
+ };
49
+ }
50
+ return {
51
+ loading: false,
52
+ error: true,
53
+ title: 'Form not found',
54
+ message: 'The form was not found (missmatch)',
55
+ };
56
+ }
57
+ return {
58
+ loading: false,
59
+ error: false,
60
+ schema,
61
+ form,
62
+ commands,
63
+ };
64
+ }
@@ -12,13 +12,14 @@ const BodyLoading = ({ loading }) => {
12
12
  inset: 0,
13
13
  backgroundColor: react_components_1.tokens.colorNeutralBackground1,
14
14
  opacity: 0.7,
15
- zIndex: 1,
15
+ zIndex: 10,
16
16
  } }), (0, jsx_runtime_1.jsx)("div", { style: {
17
17
  position: 'absolute',
18
18
  inset: 0,
19
19
  display: 'flex',
20
20
  alignItems: 'center',
21
21
  justifyContent: 'center',
22
+ zIndex: 11,
22
23
  }, children: (0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "small" }) })] }));
23
24
  };
24
25
  exports.BodyLoading = BodyLoading;
@@ -0,0 +1,6 @@
1
+ import { CSSProperties, FC, PropsWithChildren } from 'react';
2
+ interface DrawerFooterProps {
3
+ justify?: CSSProperties['justifyContent'];
4
+ }
5
+ export declare const DrawerFooter: FC<PropsWithChildren<DrawerFooterProps>>;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DrawerFooter = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const DrawerFooter = ({ children, justify, }) => {
7
+ return ((0, jsx_runtime_1.jsx)(react_components_1.DrawerFooter, { style: {
8
+ padding: react_components_1.tokens.spacingHorizontalM,
9
+ background: react_components_1.tokens.colorNeutralBackground2,
10
+ gap: react_components_1.tokens.spacingHorizontalM,
11
+ justifyContent: justify,
12
+ paddingBottom: `max(env(safe-area-inset-bottom), ${react_components_1.tokens.spacingHorizontalM})`,
13
+ }, children: children }));
14
+ };
15
+ exports.DrawerFooter = DrawerFooter;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ interface DrawerHeaderProps {
3
+ title: string;
4
+ onClose?: () => void;
5
+ showCloseButton: boolean;
6
+ rightContent?: React.ReactNode;
7
+ bottomContent?: React.ReactNode;
8
+ }
9
+ export declare const DrawerHeader: FC<DrawerHeaderProps>;
10
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DrawerHeader = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const icons_1 = require("@headless-adminapp/icons");
7
+ const QuickActionItem_1 = require("../App/QuickActionItem");
8
+ const DrawerHeader = ({ title, onClose, showCloseButton, rightContent, bottomContent, }) => {
9
+ return ((0, jsx_runtime_1.jsx)(react_components_1.DrawerHeader, { style: { padding: 0 }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
10
+ display: 'flex',
11
+ flexDirection: 'column',
12
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ height: 50,
16
+ minHeight: 50,
17
+ background: react_components_1.tokens.colorNeutralBackground3,
18
+ paddingInline: 8,
19
+ gap: 8,
20
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, alignItems: 'center', gap: 8 }, children: (0, jsx_runtime_1.jsx)(react_components_1.Subtitle2, { style: { paddingLeft: 4 }, children: title }) }), rightContent, showCloseButton && ((0, jsx_runtime_1.jsx)(QuickActionItem_1.QuickActionItem, { Icon: icons_1.Icons.Close, label: "Close", onClick: onClose }))] }), bottomContent] }) }));
21
+ };
22
+ exports.DrawerHeader = DrawerHeader;
@@ -6,7 +6,8 @@ const react_components_1 = require("@fluentui/react-components");
6
6
  const app_1 = require("@headless-adminapp/app/app");
7
7
  const hooks_1 = require("@headless-adminapp/app/hooks");
8
8
  const useRecentItemStore_1 = require("@headless-adminapp/app/metadata/hooks/useRecentItemStore");
9
- const hooks_2 = require("@headless-adminapp/app/route/hooks");
9
+ const hooks_2 = require("@headless-adminapp/app/quickcreate/hooks");
10
+ const hooks_3 = require("@headless-adminapp/app/route/hooks");
10
11
  const app_2 = require("@headless-adminapp/core/experience/app");
11
12
  const icons_1 = require("@headless-adminapp/icons");
12
13
  const react_1 = require("react");
@@ -34,13 +35,23 @@ const useStyles = (0, react_components_1.makeStyles)({
34
35
  },
35
36
  },
36
37
  });
38
+ const recordToDataLookup = (value, schema) => {
39
+ return {
40
+ id: value[schema.idAttribute],
41
+ name: value[schema.primaryAttribute],
42
+ logicalName: schema.logicalName,
43
+ avatar: schema.avatarAttribute
44
+ ? value[schema.avatarAttribute]
45
+ : undefined,
46
+ };
47
+ };
37
48
  const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, readOnly, dataService, schema, viewId, allowNavigation, allowNewRecord, skeleton, }) => {
38
49
  const [lookupEnabled, setLookupEnabled] = (0, react_1.useState)(false);
39
50
  const [open, setOpen] = (0, react_1.useState)(false);
40
51
  const [searchText, setSearchText] = (0, react_1.useState)('');
41
52
  const { lookupStrings } = (0, AppStringContext_1.useAppStrings)();
42
- const routeResolver = (0, hooks_2.useRouteResolver)();
43
- const router = (0, hooks_2.useRouter)();
53
+ const routeResolver = (0, hooks_3.useRouteResolver)();
54
+ const router = (0, hooks_3.useRouter)();
44
55
  const recentItemStore = (0, useRecentItemStore_1.useRecentItemStore)();
45
56
  const path = (0, react_1.useMemo)(() => {
46
57
  if (!value) {
@@ -55,13 +66,13 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
55
66
  id: value.id,
56
67
  });
57
68
  }, [allowNavigation, routeResolver, schema.logicalName, value]);
58
- const handleOpenRecord = (0, react_1.useCallback)((event) => {
69
+ const handleOpenRecord = (0, react_1.useCallback)(async (event) => {
59
70
  event.preventDefault();
60
71
  event.stopPropagation();
61
72
  if (!path) {
62
73
  return;
63
74
  }
64
- router.push(path);
75
+ await router.push(path);
65
76
  }, [path, router]);
66
77
  (0, react_1.useEffect)(() => {
67
78
  if (open)
@@ -77,6 +88,8 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
77
88
  dataService,
78
89
  enabled: lookupEnabled && !isViewLoading && !value && !readOnly && !disabled,
79
90
  });
91
+ const isQuickCreateSupported = (0, hooks_2.useIsQuickCreateSupported)(schema.logicalName);
92
+ const openQuickCreate = (0, hooks_2.useOpenQuickCreate)();
80
93
  (0, react_1.useEffect)(() => {
81
94
  if (value) {
82
95
  setSearchText(value.name);
@@ -91,11 +104,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
91
104
  return onChange?.(null);
92
105
  }
93
106
  else {
94
- return onChange?.({
95
- id: value[schema.idAttribute],
96
- name: value[schema.primaryAttribute],
97
- logicalName: schema.logicalName,
98
- });
107
+ return onChange?.(recordToDataLookup(value, schema));
99
108
  }
100
109
  };
101
110
  if (skeleton) {
@@ -115,14 +124,26 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
115
124
  recentItemStore.addItem((0, useLookupData_1.createLookupRecentKey)(schema.logicalName), _item[schema.idAttribute], _item[schema.idAttribute]);
116
125
  }
117
126
  handleChange(_item ?? null);
118
- }, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: view?.experience.card ? ((0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view.experience.card, record: item, schema: schema })) : item[schema.primaryAttribute] }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
127
+ }, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, autoCapitalize: "none", autoCorrect: "off", spellCheck: false, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: view?.experience.card ? ((0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view.experience.card, record: item, schema: schema })) : item[schema.primaryAttribute] }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
119
128
  paddingInline: react_components_1.tokens.spacingHorizontalL,
120
129
  paddingBlock: react_components_1.tokens.spacingVerticalS,
121
- }, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: lookupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(react_components_1.ToolbarButton, { style: { fontWeight: 'normal' }, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
122
- router.push(routeResolver({
123
- logicalName: schema.logicalName,
124
- type: app_2.PageType.EntityForm,
125
- }));
130
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: lookupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(react_components_1.ToolbarButton, { style: { fontWeight: 'normal' }, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: async () => {
131
+ if (isQuickCreateSupported) {
132
+ const result = await openQuickCreate({
133
+ logicalName: schema.logicalName,
134
+ });
135
+ if (result) {
136
+ setSearchText('');
137
+ onChange?.(result);
138
+ recentItemStore.addItem((0, useLookupData_1.createLookupRecentKey)(schema.logicalName), result.id, result.id);
139
+ }
140
+ }
141
+ else {
142
+ await router.push(routeResolver({
143
+ logicalName: schema.logicalName,
144
+ type: app_2.PageType.EntityForm,
145
+ }));
146
+ }
126
147
  }, children: lookupStrings.newRecord }) })] }))] }), !!value && ((0, jsx_runtime_1.jsx)("div", { style: {
127
148
  position: 'absolute',
128
149
  inset: 0,
@@ -5,5 +5,6 @@ export interface Lookup<T = string> {
5
5
  }
6
6
  export interface SelectControlProps<T> extends ControlProps<T> {
7
7
  options: Lookup<T>[];
8
+ clearable?: boolean;
8
9
  }
9
- export default function SelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, }: Readonly<SelectControlProps<T>>): import("react/jsx-runtime").JSX.Element;
10
+ export default function SelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, clearable, }: Readonly<SelectControlProps<T>>): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const react_1 = require("react");
7
7
  const SkeletonControl_1 = require("./SkeletonControl");
8
- function SelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, }) {
8
+ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, clearable, }) {
9
9
  const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
10
10
  const handleChange = (value) => {
11
11
  const option = options.find((x) => String(x.value) === value);
@@ -30,5 +30,5 @@ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, o
30
30
  pointerEvents: disabled ? 'none' : undefined,
31
31
  width: '100%',
32
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))) }));
33
+ }, clearable: clearable, children: transformedOptions.map((x) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: x.value, children: x.label }, x.value))) }));
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "1.4.20",
3
+ "version": "1.4.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -51,5 +51,5 @@
51
51
  "uuid": "11.0.3",
52
52
  "yup": "^1.4.0"
53
53
  },
54
- "gitHead": "be1677e04dcd2ac91082078c0b59f81b0799d469"
54
+ "gitHead": "8f687a2b8c3151c30c57f43105ac47c5d8c3ee79"
55
55
  }
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- interface HeaderProps {
3
- onClose: () => void;
4
- }
5
- export declare const Header: FC<HeaderProps>;
6
- export {};
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Header = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const icons_1 = require("@headless-adminapp/icons");
7
- const QuickActionItem_1 = require("../../App/QuickActionItem");
8
- const Header = ({ onClose }) => {
9
- return ((0, jsx_runtime_1.jsx)(react_components_1.DrawerHeader, { style: { padding: 0 }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
10
- display: 'flex',
11
- alignItems: 'center',
12
- height: 50,
13
- minHeight: 50,
14
- background: react_components_1.tokens.colorNeutralBackground3,
15
- paddingInline: 8,
16
- gap: 8,
17
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, alignItems: 'center', gap: 8 }, children: (0, jsx_runtime_1.jsx)(react_components_1.Subtitle2, { style: { paddingLeft: 4 }, children: "Sort and Filter" }) }), (0, jsx_runtime_1.jsx)(QuickActionItem_1.QuickActionItem, { Icon: icons_1.Icons.Close, label: "Close", onClick: onClose })] }) }));
18
- };
19
- exports.Header = Header;