@headless-adminapp/fluent 0.0.17-alpha.53 → 0.0.17-alpha.55

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 (179) hide show
  1. package/App/App.js +11 -7
  2. package/App/AppHeaderContianer.js +50 -44
  3. package/App/AppLogo.js +12 -9
  4. package/App/AppStringContext.js +13 -9
  5. package/App/AppUI.js +15 -11
  6. package/App/LayoutProvider.js +16 -24
  7. package/App/NavigationContainer.js +28 -28
  8. package/App/QuickActionItem.js +10 -6
  9. package/App/index.js +5 -1
  10. package/App/utils.d.ts +1 -1
  11. package/App/utils.js +7 -5
  12. package/CommandBar/Button.js +17 -14
  13. package/CommandBar/Divider.js +9 -6
  14. package/CommandBar/IconButton.js +16 -13
  15. package/CommandBar/Label.js +11 -8
  16. package/CommandBar/MenuButton.js +20 -17
  17. package/CommandBar/MenuItem.js +19 -16
  18. package/CommandBar/MenuItems.js +10 -10
  19. package/CommandBar/MenuList.js +12 -9
  20. package/CommandBar/Wrapper.js +10 -7
  21. package/CommandBar/index.js +15 -13
  22. package/DataForm/SectionControl.js +7 -4
  23. package/DataGrid/ActionCell.js +14 -11
  24. package/DataGrid/CommandContainer.js +10 -6
  25. package/DataGrid/CustomizeColumns/AddColumns.js +61 -59
  26. package/DataGrid/CustomizeColumns/ColumnItem.js +23 -19
  27. package/DataGrid/CustomizeColumns/CustomizeColumns.js +41 -36
  28. package/DataGrid/CustomizeColumns/index.js +5 -1
  29. package/DataGrid/FormSubgridCommandContainer.js +17 -13
  30. package/DataGrid/FormSubgridViewSelector.js +21 -21
  31. package/DataGrid/GridColumnHeader/ConditionValueControl.js +33 -33
  32. package/DataGrid/GridColumnHeader/FilterForm.js +28 -27
  33. package/DataGrid/GridColumnHeader/OperatorSelect.js +19 -13
  34. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +35 -31
  35. package/DataGrid/GridColumnHeader/index.js +5 -1
  36. package/DataGrid/GridColumnHeader/utils.js +6 -2
  37. package/DataGrid/GridHeaderContainer.js +8 -4
  38. package/DataGrid/GridHeaderDesktop.js +28 -28
  39. package/DataGrid/GridHeaderMobile.js +20 -19
  40. package/DataGrid/GridListContainer.js +50 -44
  41. package/DataGrid/GridPaginationContainer.js +16 -13
  42. package/DataGrid/GridTableContainer.js +98 -89
  43. package/DataGrid/TableCell/TableCellAction.js +15 -11
  44. package/DataGrid/TableCell/TableCellBase.js +13 -4
  45. package/DataGrid/TableCell/TableCellCheckbox.js +11 -8
  46. package/DataGrid/TableCell/TableCellChoice.js +15 -13
  47. package/DataGrid/TableCell/TableCellLink.js +14 -11
  48. package/DataGrid/TableCell/TableCellText.js +10 -7
  49. package/DataGrid/TableCell/index.js +20 -4
  50. package/DataGrid/index.js +11 -4
  51. package/DataGrid/types.js +2 -1
  52. package/DataGrid/useTableColumns.js +98 -103
  53. package/DataGrid/utils.js +5 -1
  54. package/DialogContainer/AlertDialog.js +11 -11
  55. package/DialogContainer/ConfirmDialog.js +13 -14
  56. package/DialogContainer/DialogContainer.js +19 -26
  57. package/DialogContainer/ErrorDialog.js +15 -15
  58. package/DialogContainer/PromptDialog.js +76 -58
  59. package/DialogContainer/index.js +5 -1
  60. package/Insights/CommandBarContainer.js +17 -11
  61. package/Insights/FilterBarContainer.js +32 -37
  62. package/Insights/Grid.js +13 -9
  63. package/Insights/InsightsContainer.js +22 -19
  64. package/Insights/WidgetChartContainer.js +34 -30
  65. package/Insights/WidgetDataGridContainer.js +45 -33
  66. package/Insights/WidgetTableContainer.js +29 -26
  67. package/Insights/WidgetTileContainer.js +16 -12
  68. package/Insights/WidgetTitleBar.js +15 -10
  69. package/Insights/Widgets.js +28 -25
  70. package/Insights/charts/AreaChart.js +15 -12
  71. package/Insights/charts/BarChart.js +15 -12
  72. package/Insights/charts/ComposedChart.js +15 -13
  73. package/Insights/charts/CustomTooltipContent.js +13 -9
  74. package/Insights/charts/GaugeChart.js +6 -3
  75. package/Insights/charts/LineChart.js +15 -12
  76. package/Insights/charts/OhlcChart.js +46 -40
  77. package/Insights/charts/PieChart.js +25 -26
  78. package/Insights/charts/RadarChart.js +19 -17
  79. package/Insights/charts/ScatterChart.js +26 -28
  80. package/Insights/charts/constants.js +4 -1
  81. package/Insights/charts/formatters.js +33 -23
  82. package/Insights/charts/index.js +2 -1
  83. package/Insights/charts/renderers.js +36 -26
  84. package/Insights/hooks/useQueriesData.js +27 -30
  85. package/Insights/hooks/useWidgetDetail.js +24 -15
  86. package/OverflowCommandBar/OverflowCommandBar.js +19 -12
  87. package/OverflowCommandBar/OverflowMenu.js +22 -30
  88. package/OverflowCommandBar/OverflowMenuDivider.js +10 -6
  89. package/OverflowCommandBar/index.js +9 -3
  90. package/OverflowCommandBar/render.js +15 -10
  91. package/OverflowCommandBar/utils.js +6 -4
  92. package/PageBoard/BoardColumn.js +8 -5
  93. package/PageBoard/BoardColumnCard.d.ts +1 -1
  94. package/PageBoard/BoardColumnCard.js +15 -11
  95. package/PageBoard/BoardColumnUI.js +45 -46
  96. package/PageBoard/BoardingColumnCardLoading.js +13 -10
  97. package/PageBoard/Header.js +23 -28
  98. package/PageBoard/PageBoard.js +28 -26
  99. package/PageBoard/index.js +5 -1
  100. package/PageEntityForm/CommandContainer.js +25 -21
  101. package/PageEntityForm/FormTabRelated.js +20 -17
  102. package/PageEntityForm/PageEntityForm.js +20 -16
  103. package/PageEntityForm/PageEntityFormDesktopContainer.js +77 -70
  104. package/PageEntityForm/PageEntityFormStringContext.js +9 -5
  105. package/PageEntityForm/ProcessFlow.js +24 -21
  106. package/PageEntityForm/RecordCard.js +31 -24
  107. package/PageEntityForm/RecordCardLoading.js +13 -11
  108. package/PageEntityForm/RecordSetNavigatorContainer.js +34 -31
  109. package/PageEntityForm/RelatedViewSelector.js +34 -36
  110. package/PageEntityForm/SectionContainer.js +35 -31
  111. package/PageEntityForm/StandardControl.js +84 -76
  112. package/PageEntityForm/SubgridControl.js +23 -21
  113. package/PageEntityForm/index.js +5 -1
  114. package/PageEntityView/FormSubgridContainer.js +26 -22
  115. package/PageEntityView/PageEntityView.js +19 -15
  116. package/PageEntityView/PageEntityViewDesktopContainer.js +13 -9
  117. package/PageEntityView/PageEntityViewDesktopFrame.js +21 -17
  118. package/PageEntityView/PageEntityViewMobileContainer.js +13 -9
  119. package/PageEntityView/PageEntityViewStringContext.js +9 -5
  120. package/PageEntityView/index.js +5 -1
  121. package/PageInsights/PageInsights.js +13 -9
  122. package/PageInsights/index.js +6 -1
  123. package/ProgressIndicatorContainer/index.js +14 -10
  124. package/ToastNotificationContainer/index.js +18 -15
  125. package/componentStore.js +5 -2
  126. package/components/BodyLoading.js +11 -7
  127. package/components/DialogLogin.js +8 -5
  128. package/components/DndProvider.d.ts +12 -0
  129. package/components/DndProvider.js +68 -0
  130. package/components/LoginForm.js +46 -36
  131. package/components/PageBroken.js +8 -5
  132. package/components/PageLoading.js +8 -5
  133. package/components/PageLogin.js +17 -14
  134. package/form/FormControl.js +44 -50
  135. package/form/FormControlLoading.js +8 -4
  136. package/form/controls/AttachmentControl.js +72 -77
  137. package/form/controls/AttachmentsControl.js +24 -30
  138. package/form/controls/CurrencyControl.js +16 -13
  139. package/form/controls/DateControl.js +24 -18
  140. package/form/controls/DateRangeControl.js +22 -18
  141. package/form/controls/DateTimeControl.js +49 -43
  142. package/form/controls/DecimalControl.js +14 -11
  143. package/form/controls/DurationControl.js +18 -14
  144. package/form/controls/EmailControl.js +14 -11
  145. package/form/controls/IntegerControl.js +11 -8
  146. package/form/controls/LookupControl.js +58 -56
  147. package/form/controls/MultiSelectControl.js +12 -9
  148. package/form/controls/MultiSelectLookupControl.js +55 -53
  149. package/form/controls/PasswordControl.js +11 -8
  150. package/form/controls/RichTextControl.js +32 -5
  151. package/form/controls/SelectControl.js +15 -13
  152. package/form/controls/SwitchControl.js +7 -4
  153. package/form/controls/TelephoneControl.js +10 -7
  154. package/form/controls/TextAreaControl.js +11 -8
  155. package/form/controls/TextControl.js +12 -9
  156. package/form/controls/UrlControl.js +10 -7
  157. package/form/controls/types.js +2 -1
  158. package/form/controls/useLookupData.js +43 -54
  159. package/form/layout/FormBody/FormBody.js +10 -6
  160. package/form/layout/FormBody/index.js +17 -1
  161. package/form/layout/FormSection/FormSection.js +31 -20
  162. package/form/layout/FormSection/FormSectionColumn.js +7 -3
  163. package/form/layout/FormSection/FormSectionLoading.js +5 -1
  164. package/form/layout/FormSection/index.js +5 -1
  165. package/form/layout/FormTab/FormTab.js +21 -17
  166. package/form/layout/FormTab/FormTabColumn.js +9 -5
  167. package/form/layout/FormTab/index.js +5 -1
  168. package/form/layout/TabContext.js +5 -2
  169. package/form/layout/index.js +9 -3
  170. package/form/types.js +2 -1
  171. package/package.json +4 -12
  172. package/types/index.js +2 -1
  173. package/utils/avatar.js +4 -1
  174. package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
  175. package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
  176. package/form/controls/NumberControl.d.ts +0 -4
  177. package/form/controls/NumberControl.js +0 -16
  178. package/form/controls/utils.d.ts +0 -4
  179. package/form/controls/utils.js +0 -42
@@ -1,39 +1,44 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Body1, Caption1, Divider, MessageBar, MessageBarBody, Subtitle2, Tab, TabList, tokens, } from '@fluentui/react-components';
3
- import { DataFormContext } from '@headless-adminapp/app/dataform';
4
- import { useDataFormSchema, useFormInstance, useFormIsDirty, useFormNotifications, useProcessFlowSteps, useRecordId, useRecordTitle, useSelectedForm, } from '@headless-adminapp/app/dataform/hooks';
5
- import { useLocale } from '@headless-adminapp/app/locale';
6
- import { localizedLabel } from '@headless-adminapp/app/locale/utils';
7
- import { useContextSelector, useContextValueSetter, } from '@headless-adminapp/app/mutable';
8
- import { getAttributeFormattedValue } from '@headless-adminapp/app/utils';
9
- import { Fragment, useEffect, useState } from 'react';
10
- import { Controller } from 'react-hook-form';
11
- import { PageBroken } from '../components/PageBroken';
12
- import { PageLoading } from '../components/PageLoading';
13
- import { FormBody } from '../form/layout/FormBody';
14
- import { FormTab } from '../form/layout/FormTab';
15
- import { CommandContainer } from './CommandContainer';
16
- import { FormTabRelated } from './FormTabRelated';
17
- import { usePageEntityFormStrings } from './PageEntityFormStringContext';
18
- import { ProcessFlow } from './ProcessFlow';
19
- import { RelatedViewSelector } from './RelatedViewSelector';
20
- import { SectionContainer } from './SectionContainer';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageEntityFormDesktopContainer = 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 utils_2 = require("@headless-adminapp/app/utils");
12
+ const react_1 = require("react");
13
+ const react_hook_form_1 = require("react-hook-form");
14
+ const PageBroken_1 = require("../components/PageBroken");
15
+ const PageLoading_1 = require("../components/PageLoading");
16
+ const FormBody_1 = require("../form/layout/FormBody");
17
+ const FormTab_1 = require("../form/layout/FormTab");
18
+ const CommandContainer_1 = require("./CommandContainer");
19
+ const FormTabRelated_1 = require("./FormTabRelated");
20
+ const PageEntityFormStringContext_1 = require("./PageEntityFormStringContext");
21
+ const ProcessFlow_1 = require("./ProcessFlow");
22
+ const RelatedViewSelector_1 = require("./RelatedViewSelector");
23
+ const SectionContainer_1 = require("./SectionContainer");
21
24
  let previousCachedActiveTabInfo = null;
22
- export const PageEntityFormDesktopContainer = () => {
23
- var _a, _b, _c;
24
- const dataState = useContextSelector(DataFormContext, (state) => state.dataState);
25
- const strings = usePageEntityFormStrings();
26
- const recordId = useRecordId();
27
- const record = useContextSelector(DataFormContext, (state) => state.record);
28
- const activeTab = useContextSelector(DataFormContext, (state) => state.activeTab);
29
- const { language } = useLocale();
30
- const schema = useDataFormSchema();
31
- const formConfig = useSelectedForm();
32
- const processFlowSteps = useProcessFlowSteps();
33
- const setActiveTab = useContextValueSetter(DataFormContext, (setValue) => (value) => {
34
- setValue((state) => (Object.assign(Object.assign({}, state), { activeTab: value })));
25
+ const PageEntityFormDesktopContainer = () => {
26
+ const dataState = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.dataState);
27
+ const strings = (0, PageEntityFormStringContext_1.usePageEntityFormStrings)();
28
+ const recordId = (0, hooks_1.useRecordId)();
29
+ const record = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.record);
30
+ const activeTab = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.activeTab);
31
+ const { language } = (0, locale_1.useLocale)();
32
+ const schema = (0, hooks_1.useDataFormSchema)();
33
+ const formConfig = (0, hooks_1.useSelectedForm)();
34
+ const processFlowSteps = (0, hooks_1.useProcessFlowSteps)();
35
+ const setActiveTab = (0, mutable_1.useContextValueSetter)(dataform_1.DataFormContext, (setValue) => (value) => {
36
+ setValue((state) => ({
37
+ ...state,
38
+ activeTab: value,
39
+ }));
35
40
  });
36
- useEffect(() => {
41
+ (0, react_1.useEffect)(() => {
37
42
  if (previousCachedActiveTabInfo &&
38
43
  previousCachedActiveTabInfo.logicalName === schema.logicalName) {
39
44
  setActiveTab(previousCachedActiveTabInfo.name);
@@ -48,78 +53,79 @@ export const PageEntityFormDesktopContainer = () => {
48
53
  };
49
54
  }
50
55
  }, [setActiveTab, formConfig, schema]);
51
- const recordTitle = useRecordTitle();
56
+ const recordTitle = (0, hooks_1.useRecordTitle)();
52
57
  // const readonly = useIsFormReadonly();
53
- const formInstance = useFormInstance();
54
- const isDirty = useFormIsDirty();
55
- const notifications = useFormNotifications();
56
- const [selectedRelatedItem, setSelectedRelatedItem] = useState(null);
58
+ const formInstance = (0, hooks_1.useFormInstance)();
59
+ const isDirty = (0, hooks_1.useFormIsDirty)();
60
+ const notifications = (0, hooks_1.useFormNotifications)();
61
+ const [selectedRelatedItem, setSelectedRelatedItem] = (0, react_1.useState)(null);
57
62
  if (dataState.isFetching) {
58
- return _jsx(PageLoading, {});
63
+ return (0, jsx_runtime_1.jsx)(PageLoading_1.PageLoading, {});
59
64
  }
60
65
  if (dataState.isError) {
61
- return _jsx(PageBroken, { title: "Error", message: "Unable to load page" });
66
+ return (0, jsx_runtime_1.jsx)(PageBroken_1.PageBroken, { title: "Error", message: "Unable to load page" });
62
67
  }
63
68
  if (recordId && !record) {
64
- return (_jsx(PageBroken, { title: "Record not found", message: "Requested record not found in system or you may not have enought permission." }));
69
+ 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." }));
65
70
  }
66
- return (_jsxs("div", { style: {
71
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
67
72
  display: 'flex',
68
73
  flex: 1,
69
74
  flexDirection: 'column',
70
75
  // backgroundColor: tokens.colorNeutralBackground2,
71
76
  overflow: 'hidden',
72
- }, children: [_jsxs("div", { style: {
77
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
73
78
  display: 'flex',
74
79
  flexDirection: 'column',
75
- gap: tokens.spacingVerticalM,
76
- paddingTop: tokens.spacingVerticalM,
77
- paddingInline: tokens.spacingHorizontalM,
78
- }, children: [_jsx("div", { style: {
80
+ gap: react_components_1.tokens.spacingVerticalM,
81
+ paddingTop: react_components_1.tokens.spacingVerticalM,
82
+ paddingInline: react_components_1.tokens.spacingHorizontalM,
83
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
79
84
  // padding: 4,
80
- boxShadow: tokens.shadow2,
81
- borderRadius: tokens.borderRadiusMedium,
82
- background: tokens.colorNeutralBackground1,
85
+ boxShadow: react_components_1.tokens.shadow2,
86
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
87
+ background: react_components_1.tokens.colorNeutralBackground1,
83
88
  display: 'flex',
84
89
  // overflow: 'hidden',
85
- }, children: _jsx(CommandContainer, {}) }), notifications.length > 0 && (_jsx("div", { children: notifications.map((notification, index) => (_jsx(MessageBar, { intent: notification.level, icon: null, children: _jsx(MessageBarBody, { children: notification.message }) }, index))) })), _jsxs("div", { style: {
90
+ }, children: (0, jsx_runtime_1.jsx)(CommandContainer_1.CommandContainer, {}) }), 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: {
86
91
  display: 'flex',
87
92
  flexDirection: 'column',
88
- boxShadow: tokens.shadow4,
89
- borderRadius: tokens.borderRadiusMedium,
90
- background: tokens.colorNeutralBackground1,
93
+ boxShadow: react_components_1.tokens.shadow4,
94
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
95
+ background: react_components_1.tokens.colorNeutralBackground1,
91
96
  overflow: 'hidden',
92
97
  zIndex: 2,
93
- }, children: [_jsxs("div", { style: {
98
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
94
99
  display: 'flex',
95
100
  flexDirection: 'row',
96
- paddingInline: tokens.spacingHorizontalM,
97
- paddingTop: tokens.spacingVerticalS,
98
- marginBottom: tokens.spacingVerticalS,
99
- }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', flex: 1 }, children: [_jsxs("div", { style: {
101
+ paddingInline: react_components_1.tokens.spacingHorizontalM,
102
+ paddingTop: react_components_1.tokens.spacingVerticalS,
103
+ marginBottom: react_components_1.tokens.spacingVerticalS,
104
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', flex: 1 }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
100
105
  display: 'flex',
101
- gap: tokens.spacingHorizontalXS,
106
+ gap: react_components_1.tokens.spacingHorizontalXS,
102
107
  alignItems: 'center',
103
- }, children: [_jsx(Subtitle2, { children: recordTitle }), _jsx(Caption1, { style: { color: tokens.colorNeutralForeground4 }, children: isDirty
108
+ }, 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
104
109
  ? `- ${strings.unsaved}`
105
110
  : !!record
106
111
  ? `- ${strings.saved}`
107
- : '' })] }), _jsx(Body1, { style: { color: tokens.colorNeutralForeground3 }, children: localizedLabel(language, schema) })] }), _jsx("div", { style: { display: 'flex', flexDirection: 'row' }, children: (_a = formConfig.experience.headerControls) === null || _a === void 0 ? void 0 : _a.map((controlName, index) => {
112
+ : '' })] }), (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) => {
108
113
  const attribute = schema.attributes[controlName];
109
- return (_jsxs(Fragment, { children: [index > 0 && (_jsx(Divider, { vertical: true, style: {
110
- width: tokens.spacingHorizontalXXL,
114
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index > 0 && ((0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: true, style: {
115
+ width: react_components_1.tokens.spacingHorizontalXXL,
111
116
  opacity: 0.5,
112
- } })), _jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx(Body1, { style: { color: tokens.colorNeutralForeground4 }, children: attribute.label }), _jsx(Controller, { control: formInstance.control, name: controlName, render: ({ field }) => {
113
- return (_jsx(Body1, { children: getAttributeFormattedValue(attribute, field.value) }));
117
+ } })), (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 }) => {
118
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0, utils_2.getAttributeFormattedValue)(attribute, field.value) }));
114
119
  } })] })] }, controlName));
115
- }) })] }), !!(processFlowSteps === null || processFlowSteps === void 0 ? void 0 : processFlowSteps.length) && (_jsx(ProcessFlow, { height: 28, rounded: false, items: processFlowSteps })), _jsxs("div", { style: { display: 'flex', paddingBottom: tokens.spacingVerticalS }, children: [_jsxs(TabList, { selectedValue: activeTab, onTabSelect: (e, value) => {
120
+ }) })] }), !!processFlowSteps?.length && ((0, jsx_runtime_1.jsx)(ProcessFlow_1.ProcessFlow, { height: 28, rounded: false, items: processFlowSteps })), (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) => {
116
121
  setActiveTab(value.value);
117
122
  previousCachedActiveTabInfo = {
118
123
  logicalName: schema.logicalName,
119
124
  name: value.value,
120
125
  relatedItem: null,
121
126
  };
122
- }, children: [formConfig.experience.tabs.map((tab) => (_jsx(Tab, { value: tab.name, children: localizedLabel(language, tab) }, tab.name))), !!selectedRelatedItem && (_jsx(Tab, { value: "related", children: (_c = (_b = selectedRelatedItem.localizedPluralLabels) === null || _b === void 0 ? void 0 : _b[language]) !== null && _c !== void 0 ? _c : selectedRelatedItem.pluralLabel }))] }), _jsx(RelatedViewSelector, { onSelect: (item) => {
127
+ }, 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] ??
128
+ selectedRelatedItem.pluralLabel }))] }), (0, jsx_runtime_1.jsx)(RelatedViewSelector_1.RelatedViewSelector, { onSelect: (item) => {
123
129
  setSelectedRelatedItem(item);
124
130
  setActiveTab('related');
125
131
  previousCachedActiveTabInfo = {
@@ -127,5 +133,6 @@ export const PageEntityFormDesktopContainer = () => {
127
133
  name: 'related',
128
134
  relatedItem: item,
129
135
  };
130
- } })] })] })] }), _jsxs(FormBody, { children: [formConfig.experience.tabs.map((tab) => (_jsx(FormTab, { value: tab.name, columnCount: tab.columnCount, columnWidths: tab.columnWidths, children: tab.tabColumns.map((tabColumn, index) => (_jsx(FormTab.Column, { children: tabColumn.sections.map((section) => (_jsx(SectionContainer, { section: section, readOnly: false }, section.name))) }, index))) }, tab.name))), _jsx(FormTabRelated, { selectedRelatedItem: selectedRelatedItem })] })] }));
136
+ } })] })] })] }), (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 }, section.name))) }, index))) }, tab.name))), (0, jsx_runtime_1.jsx)(FormTabRelated_1.FormTabRelated, { selectedRelatedItem: selectedRelatedItem })] })] }));
131
137
  };
138
+ exports.PageEntityFormDesktopContainer = PageEntityFormDesktopContainer;
@@ -1,11 +1,15 @@
1
- import { createContext, useContext } from 'react';
2
- export const defaultPageEntityFormStrings = {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageEntityFormStringContext = exports.defaultPageEntityFormStrings = void 0;
4
+ exports.usePageEntityFormStrings = usePageEntityFormStrings;
5
+ const react_1 = require("react");
6
+ exports.defaultPageEntityFormStrings = {
3
7
  saved: 'Saved',
4
8
  unsaved: 'Unsaved',
5
9
  related: 'Related',
6
10
  };
7
- export const PageEntityFormStringContext = createContext(defaultPageEntityFormStrings);
8
- export function usePageEntityFormStrings() {
9
- const context = useContext(PageEntityFormStringContext);
11
+ exports.PageEntityFormStringContext = (0, react_1.createContext)(exports.defaultPageEntityFormStrings);
12
+ function usePageEntityFormStrings() {
13
+ const context = (0, react_1.useContext)(exports.PageEntityFormStringContext);
10
14
  return context;
11
15
  }
@@ -1,31 +1,34 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Caption1, tokens } from '@fluentui/react-components';
3
- export function ProcessFlow({ height = 32, rounded = true, items, }) {
4
- return (_jsx("div", { style: { position: 'relative', height }, children: _jsx("div", { style: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessFlow = ProcessFlow;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ function ProcessFlow({ height = 32, rounded = true, items, }) {
7
+ return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', height }, children: (0, jsx_runtime_1.jsx)("div", { style: {
5
8
  display: 'flex',
6
9
  overflow: 'hidden',
7
- borderRadius: rounded ? tokens.borderRadiusMedium : 0,
8
- }, children: items.map((item, index) => (_jsx(ProcessFlowItem, { height: height, label: item.label, isActivated: item.isActivated, isFirst: index === 0, isLast: index === items.length - 1 }, index))) }) }));
10
+ borderRadius: rounded ? react_components_1.tokens.borderRadiusMedium : 0,
11
+ }, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(ProcessFlowItem, { height: height, label: item.label, isActivated: item.isActivated, isFirst: index === 0, isLast: index === items.length - 1 }, index))) }) }));
9
12
  }
10
13
  const ProcessFlowItem = ({ label, height, isActivated, isFirst, isLast, }) => {
11
14
  const backgroundColor = isActivated
12
- ? tokens.colorBrandBackground
13
- : tokens.colorNeutralStrokeDisabled;
14
- return (_jsxs("div", { style: {
15
+ ? react_components_1.tokens.colorBrandBackground
16
+ : react_components_1.tokens.colorNeutralStrokeDisabled;
17
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
15
18
  flex: 1,
16
19
  position: 'relative',
17
20
  display: 'flex',
18
21
  alignItems: 'center',
19
22
  justifyContent: 'center',
20
23
  height,
21
- }, children: [_jsxs("div", { style: { zIndex: 1 }, children: [_jsx("div", { style: {
24
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { zIndex: 1 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
22
25
  position: 'absolute',
23
26
  left: 20,
24
27
  right: 20,
25
28
  top: 0,
26
29
  height: '100%',
27
30
  backgroundColor: backgroundColor,
28
- } }), _jsx("div", { style: {
31
+ } }), (0, jsx_runtime_1.jsx)("div", { style: {
29
32
  position: 'absolute',
30
33
  left: 0,
31
34
  top: 0,
@@ -35,8 +38,8 @@ const ProcessFlowItem = ({ label, height, isActivated, isFirst, isLast, }) => {
35
38
  transform: isFirst ? 'skewX(0deg)' : 'skewX(30deg)',
36
39
  borderLeft: isFirst
37
40
  ? 'none'
38
- : `1px solid ${tokens.colorNeutralBackground1}`,
39
- } }), _jsx("div", { style: {
41
+ : `1px solid ${react_components_1.tokens.colorNeutralBackground1}`,
42
+ } }), (0, jsx_runtime_1.jsx)("div", { style: {
40
43
  position: 'absolute',
41
44
  right: 0,
42
45
  top: 0,
@@ -46,8 +49,8 @@ const ProcessFlowItem = ({ label, height, isActivated, isFirst, isLast, }) => {
46
49
  transform: isLast ? 'skewX(0deg)' : 'skewX(30deg)',
47
50
  borderRight: isLast
48
51
  ? 'none'
49
- : `1px solid ${tokens.colorNeutralBackground1}`,
50
- } }), _jsx("div", { style: {
52
+ : `1px solid ${react_components_1.tokens.colorNeutralBackground1}`,
53
+ } }), (0, jsx_runtime_1.jsx)("div", { style: {
51
54
  position: 'absolute',
52
55
  left: 0,
53
56
  top: '50%',
@@ -57,8 +60,8 @@ const ProcessFlowItem = ({ label, height, isActivated, isFirst, isLast, }) => {
57
60
  transform: isFirst ? 'skewX(0deg)' : 'skewX(-30deg)',
58
61
  borderLeft: isFirst
59
62
  ? 'none'
60
- : `1px solid ${tokens.colorNeutralBackground1}`,
61
- } }), _jsx("div", { style: {
63
+ : `1px solid ${react_components_1.tokens.colorNeutralBackground1}`,
64
+ } }), (0, jsx_runtime_1.jsx)("div", { style: {
62
65
  position: 'absolute',
63
66
  right: 0,
64
67
  top: '50%',
@@ -68,14 +71,14 @@ const ProcessFlowItem = ({ label, height, isActivated, isFirst, isLast, }) => {
68
71
  transform: isLast ? 'skewX(0deg)' : 'skewX(-30deg)',
69
72
  borderRight: isLast
70
73
  ? 'none'
71
- : `1px solid ${tokens.colorNeutralBackground1}`,
72
- } })] }), _jsx("div", { style: {
74
+ : `1px solid ${react_components_1.tokens.colorNeutralBackground1}`,
75
+ } })] }), (0, jsx_runtime_1.jsx)("div", { style: {
73
76
  display: 'flex',
74
77
  flexDirection: 'column',
75
78
  flex: 1,
76
79
  alignItems: 'center',
77
- gap: tokens.spacingVerticalS,
80
+ gap: react_components_1.tokens.spacingVerticalS,
78
81
  color: isActivated ? 'white' : undefined,
79
82
  zIndex: 2,
80
- }, children: _jsx(Caption1, { children: label }) })] }));
83
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { children: label }) })] }));
81
84
  };
@@ -1,15 +1,18 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Avatar, Body1, Body1Strong, Caption1, makeStyles, mergeClasses, Tag, tokens, } from '@fluentui/react-components';
3
- import { getAttributeFormattedValue } from '@headless-adminapp/app/utils';
4
- import { isColorDark } from '@headless-adminapp/app/utils/color';
5
- const useStyles = makeStyles({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordCard = RecordCard;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const utils_1 = require("@headless-adminapp/app/utils");
7
+ const color_1 = require("@headless-adminapp/app/utils/color");
8
+ const useStyles = (0, react_components_1.makeStyles)({
6
9
  root: {
7
10
  width: '100%',
8
11
  display: 'flex',
9
12
  flexDirection: 'row',
10
- paddingInline: tokens.spacingHorizontalL,
11
- paddingBlock: tokens.spacingVerticalS,
12
- gap: tokens.spacingHorizontalS,
13
+ paddingInline: react_components_1.tokens.spacingHorizontalL,
14
+ paddingBlock: react_components_1.tokens.spacingVerticalS,
15
+ gap: react_components_1.tokens.spacingHorizontalS,
13
16
  // cursor: 'pointer',
14
17
  // '&:hover': {
15
18
  // background: tokens.colorNeutralBackground1Hover,
@@ -24,10 +27,14 @@ const useStyles = makeStyles({
24
27
  selected: {},
25
28
  });
26
29
  function createIntial(name) {
27
- return name === null || name === void 0 ? void 0 : name.split(' ').map((x) => x[0]).slice(0, 2).join('').toUpperCase();
30
+ return name
31
+ ?.split(' ')
32
+ .map((x) => x[0])
33
+ .slice(0, 2)
34
+ .join('')
35
+ .toUpperCase();
28
36
  }
29
- export function RecordCard({ schema, cardView, record, selected, }) {
30
- var _a, _b, _c;
37
+ function RecordCard({ schema, cardView, record, selected, }) {
31
38
  const styles = useStyles();
32
39
  const _record = record;
33
40
  const recordTitle = _record[schema.primaryAttribute];
@@ -37,20 +44,20 @@ export function RecordCard({ schema, cardView, record, selected, }) {
37
44
  const avatarAttribute = schema.attributes[cardView.avatarColumn];
38
45
  if (avatarAttribute.type === 'attachment' &&
39
46
  avatarAttribute.format === 'image') {
40
- avatarSrc = (_a = _record[cardView.avatarColumn]) === null || _a === void 0 ? void 0 : _a.url;
47
+ avatarSrc = _record[cardView.avatarColumn]?.url;
41
48
  }
42
49
  else if (avatarAttribute.type === 'string' &&
43
50
  avatarAttribute.format === 'url') {
44
51
  avatarSrc = _record[cardView.avatarColumn];
45
52
  }
46
53
  }
47
- return (_jsxs("div", { className: mergeClasses(styles.root, selected && styles.selected), children: [cardView.showAvatar && (_jsx(Avatar, { initials: initials, color: "neutral", style: { cursor: 'pointer' }, image: {
54
+ 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", style: { cursor: 'pointer' }, image: {
48
55
  src: avatarSrc,
49
- } })), _jsxs("div", { style: {
56
+ } })), (0, jsx_runtime_1.jsxs)("div", { style: {
50
57
  display: 'flex',
51
58
  flexDirection: 'column',
52
59
  flex: 1,
53
- }, children: [_jsx(Body1, { style: { wordBreak: 'break-all' }, children: _record[cardView.primaryColumn] }), (_b = cardView.secondaryColumns) === null || _b === void 0 ? void 0 : _b.map((column) => (_jsx(SecondaryColumnContent, { record: _record, column: column, schema: schema }, column.name)))] }), !!((_c = cardView.rightColumn) === null || _c === void 0 ? void 0 : _c.length) && (_jsx("div", { style: {
60
+ }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { wordBreak: 'break-all' }, children: _record[cardView.primaryColumn] }), cardView.secondaryColumns?.map((column) => ((0, jsx_runtime_1.jsx)(SecondaryColumnContent, { record: _record, column: column, schema: schema }, column.name)))] }), !!cardView.rightColumn?.length && ((0, jsx_runtime_1.jsx)("div", { style: {
54
61
  display: 'flex',
55
62
  flexDirection: 'column',
56
63
  alignItems: 'flex-end',
@@ -66,7 +73,7 @@ export function RecordCard({ schema, cardView, record, selected, }) {
66
73
  if (!choice) {
67
74
  return null;
68
75
  }
69
- return (_jsx(Tag, { size: "extra-small", appearance: "filled", style: {
76
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Tag, { size: "extra-small", appearance: "filled", style: {
70
77
  background: choice.color,
71
78
  color: 'white',
72
79
  height: 16,
@@ -77,9 +84,9 @@ export function RecordCard({ schema, cardView, record, selected, }) {
77
84
  }
78
85
  }
79
86
  if (column.variant === 'strong') {
80
- return (_jsx(Body1Strong, { children: getAttributeFormattedValue(value, attribute) }, column.name));
87
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (0, utils_1.getAttributeFormattedValue)(value, attribute) }, column.name));
81
88
  }
82
- return (_jsx(Caption1, { style: { color: tokens.colorNeutralForeground4 }, children: getAttributeFormattedValue(value, attribute) }, column.name));
89
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: (0, utils_1.getAttributeFormattedValue)(value, attribute) }, column.name));
83
90
  }) }))] }));
84
91
  }
85
92
  function SecondaryColumnContent({ record: _record, column, schema, }) {
@@ -97,21 +104,21 @@ function SecondaryColumnContent({ record: _record, column, schema, }) {
97
104
  }
98
105
  if (column.variant === 'choice') {
99
106
  if (attribute.type === 'choice') {
100
- return _jsx(ChoiceTag, { attribute: attribute, value: value });
107
+ return (0, jsx_runtime_1.jsx)(ChoiceTag, { attribute: attribute, value: value });
101
108
  }
102
109
  if (attribute.type === 'choices') {
103
110
  const choices = attribute.options.filter((option) => value.includes(option.value));
104
111
  if (!choices.length) {
105
112
  return null;
106
113
  }
107
- return (_jsx("div", { style: {
114
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
108
115
  display: 'flex',
109
116
  flexDirection: 'row',
110
117
  gap: 4,
111
- }, children: choices.map((choice) => (_jsx(ChoiceTag, { attribute: attribute, value: choice.value }, choice.value))) }, column.name));
118
+ }, children: choices.map((choice) => ((0, jsx_runtime_1.jsx)(ChoiceTag, { attribute: attribute, value: choice.value }, choice.value))) }, column.name));
112
119
  }
113
120
  }
114
- return (_jsxs(Caption1, { style: { color: tokens.colorNeutralForeground4 }, children: [!!label && `${label}: `, getAttributeFormattedValue(attribute, value)] }, column.name));
121
+ return ((0, jsx_runtime_1.jsxs)(react_components_1.Caption1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: [!!label && `${label}: `, (0, utils_1.getAttributeFormattedValue)(attribute, value)] }, column.name));
115
122
  }
116
123
  const ChoiceTag = ({ attribute, value, }) => {
117
124
  const choice = attribute.options.find((option) => option.value === value);
@@ -121,9 +128,9 @@ const ChoiceTag = ({ attribute, value, }) => {
121
128
  const bgColor = choice.color;
122
129
  let color;
123
130
  if (bgColor) {
124
- color = isColorDark(bgColor) ? '#FFFFFF' : '#000000';
131
+ color = (0, color_1.isColorDark)(bgColor) ? '#FFFFFF' : '#000000';
125
132
  }
126
- return (_jsx(Tag, { size: "extra-small", appearance: "filled", style: {
133
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Tag, { size: "extra-small", appearance: "filled", style: {
127
134
  background: bgColor,
128
135
  color: color,
129
136
  height: 16,
@@ -1,22 +1,24 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Avatar, makeStyles, mergeClasses, SkeletonItem, tokens, } from '@fluentui/react-components';
3
- const useStyles = makeStyles({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordCardLoading = RecordCardLoading;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const useStyles = (0, react_components_1.makeStyles)({
4
7
  root: {
5
8
  width: '100%',
6
9
  display: 'flex',
7
10
  flexDirection: 'row',
8
- paddingInline: tokens.spacingHorizontalL,
9
- paddingBlock: tokens.spacingVerticalS,
10
- gap: tokens.spacingHorizontalS,
11
+ paddingInline: react_components_1.tokens.spacingHorizontalL,
12
+ paddingBlock: react_components_1.tokens.spacingVerticalS,
13
+ gap: react_components_1.tokens.spacingHorizontalS,
11
14
  },
12
15
  });
13
- export function RecordCardLoading({ cardView }) {
14
- var _a;
16
+ function RecordCardLoading({ cardView }) {
15
17
  const styles = useStyles();
16
- return (_jsxs("div", { className: mergeClasses(styles.root), children: [cardView.showAvatar && (_jsx(Avatar, { color: "neutral", style: { cursor: 'pointer' } })), _jsxs("div", { style: {
18
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, react_components_1.mergeClasses)(styles.root), children: [cardView.showAvatar && ((0, jsx_runtime_1.jsx)(react_components_1.Avatar, { color: "neutral", style: { cursor: 'pointer' } })), (0, jsx_runtime_1.jsxs)("div", { style: {
17
19
  display: 'flex',
18
20
  flexDirection: 'column',
19
21
  flex: 1,
20
- gap: tokens.spacingVerticalXXS,
21
- }, children: [_jsx("div", { style: { paddingBlock: 2 }, children: _jsx(SkeletonItem, { size: 16, style: { height: 16 } }) }), (_a = cardView.secondaryColumns) === null || _a === void 0 ? void 0 : _a.map((_, index) => (_jsx("div", { style: { paddingBlock: 2 }, children: _jsx(SkeletonItem, { size: 16, style: { width: 160, height: 12 } }) }, index)))] })] }));
22
+ gap: react_components_1.tokens.spacingVerticalXXS,
23
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: { paddingBlock: 2 }, children: (0, jsx_runtime_1.jsx)(react_components_1.SkeletonItem, { size: 16, style: { height: 16 } }) }), cardView.secondaryColumns?.map((_, index) => ((0, jsx_runtime_1.jsx)("div", { style: { paddingBlock: 2 }, children: (0, jsx_runtime_1.jsx)(react_components_1.SkeletonItem, { size: 16, style: { width: 160, height: 12 } }) }, index)))] })] }));
22
24
  }
@@ -1,58 +1,60 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Body1Strong, Divider, makeStyles, mergeClasses, tokens, } from '@fluentui/react-components';
3
- import { ScrollView } from '@headless-adminapp/app/components/ScrollView';
4
- import { useRecordId } from '@headless-adminapp/app/dataform/hooks';
5
- import { useLocale } from '@headless-adminapp/app/locale';
6
- import { useOpenForm } from '@headless-adminapp/app/navigation';
7
- import { useRecordSetResult, useRecordSetVisibility, } from '@headless-adminapp/app/recordset/hooks';
8
- import { Fragment } from 'react';
9
- import { RecordCard } from './RecordCard';
10
- const useStyles = makeStyles({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordSetNavigatorContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const ScrollView_1 = require("@headless-adminapp/app/components/ScrollView");
7
+ const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
8
+ const locale_1 = require("@headless-adminapp/app/locale");
9
+ const navigation_1 = require("@headless-adminapp/app/navigation");
10
+ const hooks_2 = require("@headless-adminapp/app/recordset/hooks");
11
+ const react_1 = require("react");
12
+ const RecordCard_1 = require("./RecordCard");
13
+ const useStyles = (0, react_components_1.makeStyles)({
11
14
  item: {
12
15
  cursor: 'pointer',
13
16
  '&:hover': {
14
- background: tokens.colorNeutralBackground1Hover,
17
+ background: react_components_1.tokens.colorNeutralBackground1Hover,
15
18
  },
16
19
  '&:active': {
17
- background: tokens.colorNeutralBackground1Pressed,
20
+ background: react_components_1.tokens.colorNeutralBackground1Pressed,
18
21
  },
19
22
  },
20
23
  selected: {
21
- background: tokens.colorNeutralBackground1Selected,
24
+ background: react_components_1.tokens.colorNeutralBackground1Selected,
22
25
  },
23
26
  });
24
- export const RecordSetNavigatorContainer = () => {
25
- var _a, _b;
26
- const { data, cardView, schema } = useRecordSetResult();
27
- const [visible] = useRecordSetVisibility();
28
- const recordId = useRecordId();
27
+ const RecordSetNavigatorContainer = () => {
28
+ const { data, cardView, schema } = (0, hooks_2.useRecordSetResult)();
29
+ const [visible] = (0, hooks_2.useRecordSetVisibility)();
30
+ const recordId = (0, hooks_1.useRecordId)();
29
31
  const styles = useStyles();
30
- const openForm = useOpenForm();
31
- const { language, direction } = useLocale();
32
+ const openForm = (0, navigation_1.useOpenForm)();
33
+ const { language, direction } = (0, locale_1.useLocale)();
32
34
  if (!schema) {
33
35
  return null;
34
36
  }
35
37
  if (!visible) {
36
38
  return null;
37
39
  }
38
- return (_jsx("div", { style: {
39
- [direction === 'rtl' ? 'paddingRight' : 'paddingLeft']: tokens.spacingVerticalM,
40
- paddingBlock: tokens.spacingVerticalM,
40
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
41
+ [direction === 'rtl' ? 'paddingRight' : 'paddingLeft']: react_components_1.tokens.spacingVerticalM,
42
+ paddingBlock: react_components_1.tokens.spacingVerticalM,
41
43
  display: 'flex',
42
44
  // display: 'none',
43
- }, children: _jsxs("div", { style: {
44
- boxShadow: tokens.shadow2,
45
- borderRadius: tokens.borderRadiusMedium,
46
- background: tokens.colorNeutralBackground1,
45
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
46
+ boxShadow: react_components_1.tokens.shadow2,
47
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
48
+ background: react_components_1.tokens.colorNeutralBackground1,
47
49
  display: 'flex',
48
50
  minWidth: 320,
49
51
  flexDirection: 'column',
50
- }, children: [_jsx("div", { style: {
52
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
51
53
  display: 'flex',
52
54
  flexDirection: 'column',
53
55
  paddingInline: 16,
54
56
  paddingBlock: 8,
55
- }, children: _jsx(Body1Strong, { children: (_b = (_a = schema.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : schema === null || schema === void 0 ? void 0 : schema.pluralLabel }) }), _jsx("div", { children: _jsx(Divider, { vertical: false, style: { opacity: 0.2 } }) }), _jsx("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: _jsx(ScrollView, { autoHide: true, rtl: direction === 'rtl', children: data === null || data === void 0 ? void 0 : data.map((record) => (_jsxs(Fragment, { children: [_jsx("div", { role: "button", className: mergeClasses(styles.item, recordId ===
57
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: schema.localizedPluralLabels?.[language] ?? schema?.pluralLabel }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: false, style: { opacity: 0.2 } }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(ScrollView_1.ScrollView, { autoHide: true, rtl: direction === 'rtl', children: data?.map((record) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { role: "button", className: (0, react_components_1.mergeClasses)(styles.item, recordId ===
56
58
  record[schema.idAttribute] &&
57
59
  styles.selected), onClick: () => {
58
60
  openForm({
@@ -60,6 +62,7 @@ export const RecordSetNavigatorContainer = () => {
60
62
  id: record[schema.idAttribute],
61
63
  replace: true,
62
64
  });
63
- }, children: _jsx(RecordCard, { cardView: cardView, record: record, schema: schema, selected: recordId ===
64
- record[schema.idAttribute] }) }), _jsx("div", { style: { paddingInline: tokens.spacingHorizontalL }, children: _jsx(Divider, { vertical: false, style: { opacity: 0.2 } }) })] }, record[schema.idAttribute]))) }) })] }) }));
65
+ }, children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: cardView, record: record, schema: schema, selected: recordId ===
66
+ record[schema.idAttribute] }) }), (0, jsx_runtime_1.jsx)("div", { style: { paddingInline: react_components_1.tokens.spacingHorizontalL }, children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: false, style: { opacity: 0.2 } }) })] }, record[schema.idAttribute]))) }) })] }) }));
65
67
  };
68
+ exports.RecordSetNavigatorContainer = RecordSetNavigatorContainer;