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

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 (174) hide show
  1. package/App/App.js +7 -11
  2. package/App/AppHeaderContianer.js +38 -42
  3. package/App/AppLogo.js +8 -12
  4. package/App/AppStringContext.js +9 -13
  5. package/App/AppUI.js +11 -15
  6. package/App/LayoutProvider.js +11 -15
  7. package/App/NavigationContainer.js +25 -29
  8. package/App/QuickActionItem.js +5 -9
  9. package/App/index.js +1 -5
  10. package/App/utils.js +1 -4
  11. package/CommandBar/Button.js +14 -17
  12. package/CommandBar/Divider.js +6 -9
  13. package/CommandBar/IconButton.js +13 -16
  14. package/CommandBar/Label.js +8 -11
  15. package/CommandBar/MenuButton.js +17 -20
  16. package/CommandBar/MenuItem.js +15 -18
  17. package/CommandBar/MenuItems.js +8 -11
  18. package/CommandBar/MenuList.js +9 -12
  19. package/CommandBar/Wrapper.js +7 -10
  20. package/CommandBar/index.js +13 -15
  21. package/DataForm/SectionControl.js +4 -7
  22. package/DataGrid/ActionCell.js +11 -14
  23. package/DataGrid/CommandContainer.js +6 -10
  24. package/DataGrid/CustomizeColumns/AddColumns.js +34 -37
  25. package/DataGrid/CustomizeColumns/ColumnItem.js +19 -23
  26. package/DataGrid/CustomizeColumns/CustomizeColumns.js +36 -42
  27. package/DataGrid/CustomizeColumns/index.js +1 -5
  28. package/DataGrid/FormSubgridCommandContainer.js +13 -17
  29. package/DataGrid/FormSubgridViewSelector.js +18 -22
  30. package/DataGrid/GridColumnHeader/ConditionValueControl.js +14 -20
  31. package/DataGrid/GridColumnHeader/FilterForm.js +23 -27
  32. package/DataGrid/GridColumnHeader/OperatorSelect.js +13 -19
  33. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +28 -32
  34. package/DataGrid/GridColumnHeader/index.js +1 -5
  35. package/DataGrid/GridColumnHeader/utils.js +2 -6
  36. package/DataGrid/GridHeaderContainer.js +4 -8
  37. package/DataGrid/GridHeaderDesktop.js +26 -30
  38. package/DataGrid/GridHeaderMobile.js +17 -21
  39. package/DataGrid/GridListContainer.js +39 -43
  40. package/DataGrid/GridPaginationContainer.js +12 -16
  41. package/DataGrid/GridTableContainer.js +74 -78
  42. package/DataGrid/TableCell/TableCellAction.js +11 -15
  43. package/DataGrid/TableCell/TableCellBase.js +4 -8
  44. package/DataGrid/TableCell/TableCellCheckbox.js +7 -10
  45. package/DataGrid/TableCell/TableCellChoice.js +11 -14
  46. package/DataGrid/TableCell/TableCellLink.d.ts +1 -1
  47. package/DataGrid/TableCell/TableCellLink.js +13 -12
  48. package/DataGrid/TableCell/TableCellText.js +7 -10
  49. package/DataGrid/TableCell/index.js +4 -20
  50. package/DataGrid/index.js +4 -11
  51. package/DataGrid/types.js +1 -2
  52. package/DataGrid/useTableColumns.js +139 -90
  53. package/DataGrid/utils.js +1 -5
  54. package/DialogContainer/AlertDialog.js +5 -8
  55. package/DialogContainer/ConfirmDialog.js +6 -9
  56. package/DialogContainer/DialogContainer.js +14 -18
  57. package/DialogContainer/ErrorDialog.js +9 -12
  58. package/DialogContainer/PromptDialog.js +30 -57
  59. package/DialogContainer/index.js +1 -5
  60. package/Insights/CommandBarContainer.js +11 -14
  61. package/Insights/FilterBarContainer.js +17 -20
  62. package/Insights/Grid.js +9 -13
  63. package/Insights/InsightsContainer.js +19 -22
  64. package/Insights/WidgetChartContainer.js +30 -34
  65. package/Insights/WidgetDataGridContainer.js +32 -35
  66. package/Insights/WidgetTableContainer.js +24 -28
  67. package/Insights/WidgetTileContainer.js +12 -16
  68. package/Insights/WidgetTitleBar.js +9 -15
  69. package/Insights/Widgets.js +25 -28
  70. package/Insights/charts/AreaChart.js +12 -15
  71. package/Insights/charts/BarChart.js +12 -15
  72. package/Insights/charts/ComposedChart.js +12 -15
  73. package/Insights/charts/CustomTooltipContent.js +8 -12
  74. package/Insights/charts/GaugeChart.js +3 -6
  75. package/Insights/charts/LineChart.js +12 -15
  76. package/Insights/charts/OhlcChart.js +36 -41
  77. package/Insights/charts/PieChart.js +23 -26
  78. package/Insights/charts/RadarChart.js +16 -19
  79. package/Insights/charts/ScatterChart.js +23 -26
  80. package/Insights/charts/constants.js +1 -4
  81. package/Insights/charts/formatters.js +17 -29
  82. package/Insights/charts/index.js +1 -2
  83. package/Insights/charts/renderers.js +25 -36
  84. package/Insights/hooks/useQueriesData.js +19 -25
  85. package/Insights/hooks/useWidgetDetail.js +13 -16
  86. package/OverflowCommandBar/OverflowCommandBar.js +12 -19
  87. package/OverflowCommandBar/OverflowMenu.js +16 -20
  88. package/OverflowCommandBar/OverflowMenuDivider.js +6 -10
  89. package/OverflowCommandBar/index.js +3 -9
  90. package/OverflowCommandBar/render.js +9 -15
  91. package/OverflowCommandBar/utils.js +1 -4
  92. package/PageBoard/BoardColumn.js +5 -8
  93. package/PageBoard/BoardColumnCard.js +12 -15
  94. package/PageBoard/BoardColumnUI.js +34 -38
  95. package/PageBoard/BoardingColumnCardLoading.js +10 -13
  96. package/PageBoard/Header.js +16 -20
  97. package/PageBoard/PageBoard.d.ts +1 -1
  98. package/PageBoard/PageBoard.js +26 -29
  99. package/PageBoard/index.js +1 -5
  100. package/PageEntityForm/CommandContainer.js +21 -25
  101. package/PageEntityForm/FormTabRelated.js +17 -20
  102. package/PageEntityForm/PageEntityForm.js +16 -20
  103. package/PageEntityForm/PageEntityFormDesktopContainer.js +68 -72
  104. package/PageEntityForm/PageEntityFormStringContext.js +5 -9
  105. package/PageEntityForm/ProcessFlow.js +21 -24
  106. package/PageEntityForm/RecordCard.js +21 -24
  107. package/PageEntityForm/RecordCardLoading.js +10 -13
  108. package/PageEntityForm/RecordSetNavigatorContainer.js +30 -34
  109. package/PageEntityForm/RelatedViewSelector.js +28 -31
  110. package/PageEntityForm/SectionContainer.js +25 -28
  111. package/PageEntityForm/StandardControl.d.ts +3 -3
  112. package/PageEntityForm/StandardControl.js +74 -81
  113. package/PageEntityForm/SubgridControl.js +20 -23
  114. package/PageEntityForm/index.js +1 -5
  115. package/PageEntityView/FormSubgridContainer.js +22 -26
  116. package/PageEntityView/PageEntityView.js +15 -19
  117. package/PageEntityView/PageEntityViewDesktopContainer.js +9 -13
  118. package/PageEntityView/PageEntityViewDesktopFrame.js +17 -21
  119. package/PageEntityView/PageEntityViewMobileContainer.js +9 -13
  120. package/PageEntityView/PageEntityViewStringContext.js +5 -9
  121. package/PageEntityView/index.js +1 -5
  122. package/PageInsights/PageInsights.js +9 -13
  123. package/PageInsights/index.js +1 -6
  124. package/ProgressIndicatorContainer/index.js +10 -14
  125. package/ToastNotificationContainer/index.js +14 -18
  126. package/componentStore.js +2 -5
  127. package/components/BodyLoading.js +7 -11
  128. package/components/DialogLogin.js +5 -8
  129. package/components/LoginForm.js +21 -47
  130. package/components/PageBroken.js +5 -8
  131. package/components/PageLoading.js +5 -8
  132. package/components/PageLogin.js +14 -17
  133. package/form/FormControl.js +39 -44
  134. package/form/FormControlLoading.js +4 -8
  135. package/form/controls/AttachmentControl.js +56 -60
  136. package/form/controls/AttachmentsControl.js +15 -19
  137. package/form/controls/CurrencyControl.js +10 -13
  138. package/form/controls/DateControl.js +18 -24
  139. package/form/controls/DateRangeControl.js +14 -20
  140. package/form/controls/DateTimeControl.js +39 -45
  141. package/form/controls/DecimalControl.js +8 -11
  142. package/form/controls/DurationControl.js +11 -15
  143. package/form/controls/EmailControl.js +7 -10
  144. package/form/controls/IntegerControl.js +4 -7
  145. package/form/controls/LookupControl.d.ts +1 -0
  146. package/form/controls/LookupControl.js +75 -38
  147. package/form/controls/MultiSelectControl.js +8 -11
  148. package/form/controls/MultiSelectLookupControl.js +40 -43
  149. package/form/controls/PasswordControl.js +8 -11
  150. package/form/controls/RichTextControl.js +5 -32
  151. package/form/controls/SelectControl.js +8 -11
  152. package/form/controls/SwitchControl.js +4 -7
  153. package/form/controls/TelephoneControl.js +7 -10
  154. package/form/controls/TextAreaControl.js +4 -7
  155. package/form/controls/TextControl.js +5 -8
  156. package/form/controls/UrlControl.js +7 -10
  157. package/form/controls/types.js +1 -2
  158. package/form/controls/useLookupData.js +14 -18
  159. package/form/layout/FormBody/FormBody.js +6 -10
  160. package/form/layout/FormBody/index.js +1 -17
  161. package/form/layout/FormSection/FormSection.js +18 -22
  162. package/form/layout/FormSection/FormSectionColumn.js +3 -7
  163. package/form/layout/FormSection/FormSectionLoading.js +1 -5
  164. package/form/layout/FormSection/index.js +1 -5
  165. package/form/layout/FormTab/FormTab.js +16 -20
  166. package/form/layout/FormTab/FormTabColumn.js +5 -9
  167. package/form/layout/FormTab/index.js +1 -5
  168. package/form/layout/TabContext.js +2 -5
  169. package/form/layout/index.js +3 -9
  170. package/form/types.js +1 -2
  171. package/package.json +3 -2
  172. package/types/index.js +1 -2
  173. package/utils/avatar.d.ts +2 -0
  174. package/utils/avatar.js +42 -0
@@ -1,43 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandMenuButton = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const react_1 = require("react");
7
- const MenuList_1 = require("./MenuList");
8
- const useStyles = (0, react_components_1.makeStyles)({
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { makeStyles, Menu, MenuButton, MenuPopover, MenuTrigger, mergeClasses, SplitButton, tokens, } from '@fluentui/react-components';
3
+ import { forwardRef, memo } from 'react';
4
+ import { MenuList } from './MenuList';
5
+ const useStyles = makeStyles({
9
6
  splitButton: {
10
7
  '& > button:first-child': {
11
- fontWeight: react_components_1.tokens.fontWeightRegular,
12
- borderRightColor: react_components_1.tokens.colorNeutralStroke3,
8
+ fontWeight: tokens.fontWeightRegular,
9
+ borderRightColor: tokens.colorNeutralStroke3,
13
10
  },
14
11
  },
15
12
  menuButton: {
16
- fontWeight: react_components_1.tokens.fontWeightRegular,
13
+ fontWeight: tokens.fontWeightRegular,
17
14
  },
18
15
  splitButtonDanger: {
19
16
  '& > button:first-child:hover': {
20
- color: react_components_1.tokens.colorPaletteRedForeground1,
21
- background: react_components_1.tokens.colorPaletteRedBackground1,
17
+ color: tokens.colorPaletteRedForeground1,
18
+ background: tokens.colorPaletteRedBackground1,
22
19
  '& .fui-Button__icon': {
23
- color: react_components_1.tokens.colorPaletteRedForeground1,
20
+ color: tokens.colorPaletteRedForeground1,
24
21
  },
25
22
  '&:active': {
26
- color: react_components_1.tokens.colorPaletteRedForeground2,
27
- background: react_components_1.tokens.colorPaletteRedBackground2,
23
+ color: tokens.colorPaletteRedForeground2,
24
+ background: tokens.colorPaletteRedBackground2,
28
25
  '& .fui-Button__icon': {
29
- color: react_components_1.tokens.colorPaletteRedForeground2,
26
+ color: tokens.colorPaletteRedForeground2,
30
27
  },
31
28
  },
32
29
  },
33
30
  },
34
31
  });
35
- exports.CommandMenuButton = (0, react_1.memo)((0, react_1.forwardRef)(function CommandMenuButton({ Icon, items, text, danger, disabled, onClick }, ref) {
32
+ export const CommandMenuButton = memo(forwardRef(function CommandMenuButton({ Icon, items, text, danger, disabled, onClick }, ref) {
36
33
  const styles = useStyles();
37
34
  return (
38
35
  // <div ref={ref}>
39
- (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, positioning: "below-end", children: [onClick ? ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (triggerProps) => ((0, jsx_runtime_1.jsx)(react_components_1.SplitButton, { ref: ref, icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), appearance: "subtle", className: (0, react_components_1.mergeClasses)(styles.splitButton, danger && styles.splitButtonDanger), menuButton: triggerProps, disabled: disabled, children: text })) })) : ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuButton, { ref: ref, appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), className: (0, react_components_1.mergeClasses)(styles.menuButton), children: text }) })), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] })
36
+ _jsxs(Menu, { hasIcons: true, positioning: "below-end", children: [onClick ? (_jsx(MenuTrigger, { disableButtonEnhancement: true, children: (triggerProps) => (_jsx(SplitButton, { ref: ref, icon: _jsx(Icon, { size: 20 }), appearance: "subtle", className: mergeClasses(styles.splitButton, danger && styles.splitButtonDanger), menuButton: triggerProps, disabled: disabled, children: text })) })) : (_jsx(MenuTrigger, { disableButtonEnhancement: true, children: _jsx(MenuButton, { ref: ref, appearance: "subtle", icon: _jsx(Icon, { size: 20 }), className: mergeClasses(styles.menuButton), children: text }) })), _jsx(MenuPopover, { children: _jsx(MenuList, { items: items }) })] })
40
37
  // </div>
41
38
  );
42
39
  }));
43
- exports.CommandMenuButton.displayName = 'CommandMenuButton';
40
+ CommandMenuButton.displayName = 'CommandMenuButton';
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MenuItem = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const react_1 = require("react");
7
- const MenuList_1 = require("./MenuList");
8
- const useStyles = (0, react_components_1.makeStyles)({
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { makeStyles, Menu, MenuItem as InternalMenuItem, MenuPopover, MenuSplitGroup, MenuTrigger, mergeClasses, tokens, } from '@fluentui/react-components';
3
+ import { memo } from 'react';
4
+ import { MenuList } from './MenuList';
5
+ const useStyles = makeStyles({
9
6
  splitMenuRight: {
10
7
  '& .fui-MenuItem__icon': {
11
8
  display: 'none',
@@ -13,26 +10,26 @@ const useStyles = (0, react_components_1.makeStyles)({
13
10
  },
14
11
  danger: {
15
12
  '&:hover': {
16
- color: react_components_1.tokens.colorPaletteRedForeground1,
17
- background: react_components_1.tokens.colorPaletteRedBackground1,
13
+ color: tokens.colorPaletteRedForeground1,
14
+ background: tokens.colorPaletteRedBackground1,
18
15
  '& .fui-MenuItem__icon': {
19
- color: react_components_1.tokens.colorPaletteRedForeground1,
16
+ color: tokens.colorPaletteRedForeground1,
20
17
  },
21
18
  '&:active': {
22
- color: react_components_1.tokens.colorPaletteRedForeground2,
23
- background: react_components_1.tokens.colorPaletteRedBackground2,
19
+ color: tokens.colorPaletteRedForeground2,
20
+ background: tokens.colorPaletteRedBackground2,
24
21
  '& .fui-MenuItem__icon': {
25
- color: react_components_1.tokens.colorPaletteRedForeground2,
22
+ color: tokens.colorPaletteRedForeground2,
26
23
  },
27
24
  },
28
25
  },
29
26
  },
30
27
  });
31
- exports.MenuItem = (0, react_1.memo)(({ Icon, text, disabled, danger, onClick, items }) => {
28
+ export const MenuItem = memo(({ Icon, text, disabled, danger, onClick, items }) => {
32
29
  const styles = useStyles();
33
30
  if (!(items === null || items === void 0 ? void 0 : items.length)) {
34
- return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { disabled: disabled, onClick: onClick, icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), className: (0, react_components_1.mergeClasses)(danger && styles.danger), children: text }));
31
+ return (_jsx(InternalMenuItem, { disabled: disabled, onClick: onClick, icon: _jsx(Icon, { size: 20 }), className: mergeClasses(danger && styles.danger), children: text }));
35
32
  }
36
- return ((0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, children: [onClick ? ((0, jsx_runtime_1.jsxs)(react_components_1.MenuSplitGroup, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), className: (0, react_components_1.mergeClasses)(danger && styles.danger), children: text }), (0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { className: (0, react_components_1.mergeClasses)(styles.splitMenuRight) }) })] })) : ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), children: text }) })), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] }));
33
+ return (_jsxs(Menu, { hasIcons: true, children: [onClick ? (_jsxs(MenuSplitGroup, { children: [_jsx(InternalMenuItem, { icon: _jsx(Icon, { size: 20 }), className: mergeClasses(danger && styles.danger), children: text }), _jsx(MenuTrigger, { disableButtonEnhancement: true, children: _jsx(InternalMenuItem, { className: mergeClasses(styles.splitMenuRight) }) })] })) : (_jsx(MenuTrigger, { disableButtonEnhancement: true, children: _jsx(InternalMenuItem, { icon: _jsx(Icon, { size: 20 }), children: text }) })), _jsx(MenuPopover, { children: _jsx(MenuList, { items: items }) })] }));
37
34
  });
38
- exports.MenuItem.displayName = 'MenuItem';
35
+ MenuItem.displayName = 'MenuItem';
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MenuItems = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const react_1 = require("react");
7
- const MenuItem_1 = require("./MenuItem");
8
- exports.MenuItems = (0, react_1.memo)(({ items }) => {
9
- return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: items === null || items === void 0 ? void 0 : items.map((group, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index > 0 && (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, {}), group.map((item, index) => {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MenuDivider } from '@fluentui/react-components';
3
+ import { Fragment, memo } from 'react';
4
+ import { MenuItem } from './MenuItem';
5
+ export const MenuItems = memo(({ items }) => {
6
+ return (_jsx(Fragment, { children: items === null || items === void 0 ? void 0 : items.map((group, index) => (_jsxs(Fragment, { children: [index > 0 && _jsx(MenuDivider, {}), group.map((item, index) => {
10
7
  var _a;
11
- return ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, { Icon: item.Icon, onClick: item.onClick, text: item.text, danger: item.danger, disabled: item.disabled, items: item.items }, ((_a = item.text) !== null && _a !== void 0 ? _a : '') + index));
8
+ return (_jsx(MenuItem, { Icon: item.Icon, onClick: item.onClick, text: item.text, danger: item.danger, disabled: item.disabled, items: item.items }, ((_a = item.text) !== null && _a !== void 0 ? _a : '') + index));
12
9
  })] }, index))) }));
13
10
  });
14
- exports.MenuItems.displayName = 'MenuItems';
11
+ MenuItems.displayName = 'MenuItems';
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MenuList = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const react_1 = require("react");
7
- const MenuItems_1 = require("./MenuItems");
8
- exports.MenuList = (0, react_1.memo)(({ items }) => {
9
- return ((0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: !(items === null || items === void 0 ? void 0 : items.length) ? ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { style: {
10
- color: react_components_1.tokens.colorNeutralForegroundDisabled,
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { MenuItem, MenuList as InternalMenuList, tokens, } from '@fluentui/react-components';
3
+ import { memo } from 'react';
4
+ import { MenuItems } from './MenuItems';
5
+ export const MenuList = memo(({ items }) => {
6
+ return (_jsx(InternalMenuList, { children: !(items === null || items === void 0 ? void 0 : items.length) ? (_jsx(MenuItem, { style: {
7
+ color: tokens.colorNeutralForegroundDisabled,
11
8
  fontStyle: 'italic',
12
- }, children: "No items" })) : ((0, jsx_runtime_1.jsx)(MenuItems_1.MenuItems, { items: items })) }));
9
+ }, children: "No items" })) : (_jsx(MenuItems, { items: items })) }));
13
10
  });
14
- exports.MenuList.displayName = 'MenuList';
11
+ MenuList.displayName = 'MenuList';
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandBarWrapper = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const react_1 = require("react");
7
- const useStyles = (0, react_components_1.makeStyles)({
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { makeStyles, mergeClasses, Toolbar, } from '@fluentui/react-components';
3
+ import { forwardRef, memo, } from 'react';
4
+ const useStyles = makeStyles({
8
5
  root: {
9
6
  flexWrap: 'nowrap',
10
7
  minWidth: 0,
@@ -17,8 +14,8 @@ const useStyles = (0, react_components_1.makeStyles)({
17
14
  overflow: 'auto',
18
15
  },
19
16
  });
20
- exports.CommandBarWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function CommandBarWrapper({ children, overflow, className, align = 'start' }, ref) {
17
+ export const CommandBarWrapper = memo(forwardRef(function CommandBarWrapper({ children, overflow, className, align = 'start' }, ref) {
21
18
  const styles = useStyles();
22
- return ((0, jsx_runtime_1.jsx)(react_components_1.Toolbar, { ref: ref, style: { justifyContent: 'flex-' + align }, className: (0, react_components_1.mergeClasses)(styles.root, overflow === 'hidden' ? styles.overflowHidden : styles.overflowAuto, className), children: children }));
19
+ return (_jsx(Toolbar, { ref: ref, style: { justifyContent: 'flex-' + align }, className: mergeClasses(styles.root, overflow === 'hidden' ? styles.overflowHidden : styles.overflowAuto, className), children: children }));
23
20
  }));
24
- exports.CommandBarWrapper.displayName = 'CommandBarWrapper';
21
+ CommandBarWrapper.displayName = 'CommandBarWrapper';
@@ -1,17 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Button_1 = require("./Button");
4
- const Divider_1 = require("./Divider");
5
- const IconButton_1 = require("./IconButton");
6
- const Label_1 = require("./Label");
7
- const MenuButton_1 = require("./MenuButton");
8
- const Wrapper_1 = require("./Wrapper");
1
+ import { CommandButton } from './Button';
2
+ import { CommandDivider } from './Divider';
3
+ import { CommandIconButton } from './IconButton';
4
+ import { CommandLabel } from './Label';
5
+ import { CommandMenuButton } from './MenuButton';
6
+ import { CommandBarWrapper } from './Wrapper';
9
7
  const CommandBar = {
10
- Wrapper: Wrapper_1.CommandBarWrapper,
11
- Button: Button_1.CommandButton,
12
- MenuButton: MenuButton_1.CommandMenuButton,
13
- Divider: Divider_1.CommandDivider,
14
- IconButton: IconButton_1.CommandIconButton,
15
- Label: Label_1.CommandLabel,
8
+ Wrapper: CommandBarWrapper,
9
+ Button: CommandButton,
10
+ MenuButton: CommandMenuButton,
11
+ Divider: CommandDivider,
12
+ IconButton: CommandIconButton,
13
+ Label: CommandLabel,
16
14
  };
17
- exports.default = CommandBar;
15
+ export default CommandBar;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SectionControlWrapper = SectionControlWrapper;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- function SectionControlWrapper(props) {
7
- return ((0, jsx_runtime_1.jsx)(react_components_1.Field, { label: props.label, orientation: props.labelPosition === 'top' ? 'vertical' : 'horizontal', required: props.required, validationState: props.isError ? 'error' : undefined, validationMessage: props.errorMessage, validationMessageIcon: null, children: props.children }));
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Field } from '@fluentui/react-components';
3
+ export function SectionControlWrapper(props) {
4
+ return (_jsx(Field, { label: props.label, orientation: props.labelPosition === 'top' ? 'vertical' : 'horizontal', required: props.required, validationState: props.isError ? 'error' : undefined, validationMessage: props.errorMessage, validationMessageIcon: null, children: props.children }));
8
5
  }
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionCell = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const locale_1 = require("@headless-adminapp/app/locale");
6
- const mutable_1 = require("@headless-adminapp/app/mutable");
7
- const react_1 = require("react");
8
- const TableCell_1 = require("../DataGrid/TableCell");
9
- const OverflowCommandBar_1 = require("../OverflowCommandBar");
10
- exports.ActionCell = (0, react_1.memo)(function ActionCell({ onOpen, mutableState, }) {
11
- const transformedCommands = (0, mutable_1.useMutableStateSelector)(mutableState, (state) => state);
12
- const { language } = (0, locale_1.useLocale)();
13
- return ((0, jsx_runtime_1.jsx)(TableCell_1.TableCellAction, { onOpen: onOpen, items: transformedCommands.map((item) => (0, OverflowCommandBar_1.transformMenuItems)(item, language)) }));
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useLocale } from '@headless-adminapp/app/locale';
3
+ import { useMutableStateSelector, } from '@headless-adminapp/app/mutable';
4
+ import { memo } from 'react';
5
+ import { TableCellAction } from '../DataGrid/TableCell';
6
+ import { transformMenuItems } from '../OverflowCommandBar';
7
+ export const ActionCell = memo(function ActionCell({ onOpen, mutableState, }) {
8
+ const transformedCommands = useMutableStateSelector(mutableState, (state) => state);
9
+ const { language } = useLocale();
10
+ return (_jsx(TableCellAction, { onOpen: onOpen, items: transformedCommands.map((item) => transformMenuItems(item, language)) }));
14
11
  });
15
- exports.ActionCell.displayName = 'ActionCell';
12
+ ActionCell.displayName = 'ActionCell';
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandContainer = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
6
- const OverflowCommandBar_1 = require("../OverflowCommandBar");
7
- const CommandContainer = () => {
8
- const gridCommands = (0, hooks_1.useMainGridCommands)();
9
- return (0, jsx_runtime_1.jsx)(OverflowCommandBar_1.OverflowCommandBar, { commands: gridCommands });
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMainGridCommands } from '@headless-adminapp/app/datagrid/hooks';
3
+ import { OverflowCommandBar } from '../OverflowCommandBar';
4
+ export const CommandContainer = () => {
5
+ const gridCommands = useMainGridCommands();
6
+ return _jsx(OverflowCommandBar, { commands: gridCommands });
10
7
  };
11
- exports.CommandContainer = CommandContainer;
@@ -1,24 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AddColumns = AddColumns;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_components_1 = require("@fluentui/react-components");
6
- const datagrid_1 = require("@headless-adminapp/app/datagrid");
7
- const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
8
- const locale_1 = require("@headless-adminapp/app/locale");
9
- const utils_1 = require("@headless-adminapp/app/locale/utils");
10
- const hooks_2 = require("@headless-adminapp/app/metadata/hooks");
11
- const icons_1 = require("@headless-adminapp/icons");
12
- const react_1 = require("react");
13
- const AppStringContext_1 = require("../../App/AppStringContext");
14
- const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
15
- function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, }) {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Checkbox, Divider, Drawer, DrawerBody, DrawerHeader, DrawerHeaderTitle, Dropdown, Input, Option, tokens, } from '@fluentui/react-components';
3
+ import { transformViewColumns, } from '@headless-adminapp/app/datagrid';
4
+ import { useDataGridSchema } from '@headless-adminapp/app/datagrid/hooks';
5
+ import { useLocale } from '@headless-adminapp/app/locale';
6
+ import { localizedLabel } from '@headless-adminapp/app/locale/utils';
7
+ import { useMetadata } from '@headless-adminapp/app/metadata/hooks';
8
+ import { Icons } from '@headless-adminapp/icons';
9
+ import { useState } from 'react';
10
+ import { useAppStrings } from '../../App/AppStringContext';
11
+ import { usePageEntityViewStrings } from '../../PageEntityView/PageEntityViewStringContext';
12
+ export function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, }) {
16
13
  var _a;
17
- const schema = (0, hooks_1.useDataGridSchema)();
18
- const { schemaStore } = (0, hooks_2.useMetadata)();
19
- const { language } = (0, locale_1.useLocale)();
20
- const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
21
- const appStrings = (0, AppStringContext_1.useAppStrings)();
14
+ const schema = useDataGridSchema();
15
+ const { schemaStore } = useMetadata();
16
+ const { language } = useLocale();
17
+ const strings = usePageEntityViewStrings();
18
+ const appStrings = useAppStrings();
22
19
  const lookupAttributes = Object.entries(schema.attributes)
23
20
  .map(([key, attribute]) => ({
24
21
  key,
@@ -26,20 +23,20 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
26
23
  }))
27
24
  .filter(({ attribute }) => attribute.type === 'lookup');
28
25
  const columnGroups = Object.assign({ root: {
29
- label: (0, utils_1.localizedLabel)(language, schema),
30
- columns: (0, datagrid_1.transformViewColumns)(schema.logicalName, Object.keys(schema.attributes).map((key) => ({
26
+ label: localizedLabel(language, schema),
27
+ columns: transformViewColumns(schema.logicalName, Object.keys(schema.attributes).map((key) => ({
31
28
  name: key,
32
29
  })), schemaStore, language),
33
30
  } }, lookupAttributes.reduce((acc, { key, attribute }) => {
34
31
  const lookupSchema = schemaStore.getSchema(attribute.entity);
35
- const columns = (0, datagrid_1.transformViewColumns)(schema.logicalName, Object.keys(lookupSchema.attributes).map((nestedKey) => ({
32
+ const columns = transformViewColumns(schema.logicalName, Object.keys(lookupSchema.attributes).map((nestedKey) => ({
36
33
  name: key,
37
34
  expandedKey: nestedKey,
38
35
  })), schemaStore, language);
39
36
  acc[key] = {
40
- label: (0, utils_1.localizedLabel)(language, attribute) +
37
+ label: localizedLabel(language, attribute) +
41
38
  ' (' +
42
- (0, utils_1.localizedLabel)(language, lookupSchema) +
39
+ localizedLabel(language, lookupSchema) +
43
40
  ')',
44
41
  columns,
45
42
  };
@@ -49,33 +46,33 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
49
46
  key,
50
47
  label: group.label,
51
48
  }));
52
- const [selectedGroup, setSelectedGroup] = (0, react_1.useState)('root');
49
+ const [selectedGroup, setSelectedGroup] = useState('root');
53
50
  const selectedGroupItem = tableItems.find((x) => x.key === selectedGroup);
54
51
  const availableColumns = columnGroups[selectedGroup].columns;
55
- const [searchText, setSearchText] = (0, react_1.useState)('');
52
+ const [searchText, setSearchText] = useState('');
56
53
  const filteredColumns = availableColumns.filter((column) => column.label.toLowerCase().includes(searchText.toLowerCase()));
57
54
  const includedColumnsObj = columns.reduce((acc, column) => {
58
55
  acc[column.id] = true;
59
56
  return acc;
60
57
  }, {});
61
- 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: {
58
+ return (_jsxs(Drawer, { separator: true, open: opened, position: "end", children: [_jsx(DrawerHeader, { children: _jsx(DrawerHeaderTitle, { action: _jsx(Button, { appearance: "subtle", "aria-label": "Close", icon: _jsx(Icons.Close, {}), onClick: onClose }), children: strings.addColumns }) }), _jsxs("div", { style: { width: '100%', display: 'flex', flexDirection: 'column' }, children: [_jsxs("div", { style: {
62
59
  display: 'flex',
63
60
  flexDirection: 'column-reverse',
64
61
  gap: 8,
65
- marginBottom: react_components_1.tokens.spacingVerticalXS,
66
- paddingInline: react_components_1.tokens.spacingHorizontalS,
67
- }, 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: (_a = selectedGroupItem === null || selectedGroupItem === void 0 ? void 0 : selectedGroupItem.label) !== null && _a !== void 0 ? _a : '', selectedOptions: selectedGroupItem ? [String(selectedGroupItem.key)] : [], onOptionSelect: (event, data) => {
62
+ marginBottom: tokens.spacingVerticalXS,
63
+ paddingInline: tokens.spacingHorizontalS,
64
+ }, children: [_jsx(Input, { contentBefore: _jsx(Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value) }), _jsx(Dropdown, { value: (_a = selectedGroupItem === null || selectedGroupItem === void 0 ? void 0 : selectedGroupItem.label) !== null && _a !== void 0 ? _a : '', selectedOptions: selectedGroupItem ? [String(selectedGroupItem.key)] : [], onOptionSelect: (event, data) => {
68
65
  setSelectedGroup(data.optionValue);
69
66
  }, style: { flex: 1, minWidth: 'unset' }, positioning: {
70
67
  align: 'bottom',
71
68
  position: 'below',
72
- }, 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) => {
69
+ }, children: tableItems.map((x) => (_jsx(Option, { value: x.key, children: x.label }, x.key))) })] }), _jsx(Divider, {})] }), _jsx(DrawerBody, { style: { paddingInline: 0 }, children: filteredColumns.map((column) => {
73
70
  var _a;
74
- return ((0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(react_components_1.Checkbox, { checked: (_a = includedColumnsObj[column.id]) !== null && _a !== void 0 ? _a : false }), style: {
75
- fontWeight: react_components_1.tokens.fontSizeBase400,
71
+ return (_jsx(Button, { appearance: "transparent", icon: _jsx(Checkbox, { checked: (_a = includedColumnsObj[column.id]) !== null && _a !== void 0 ? _a : false }), style: {
72
+ fontWeight: tokens.fontSizeBase400,
76
73
  width: '100%',
77
74
  justifyContent: 'flex-start',
78
- paddingInline: react_components_1.tokens.spacingHorizontalS,
75
+ paddingInline: tokens.spacingHorizontalS,
79
76
  }, onClick: () => {
80
77
  if (includedColumnsObj[column.id]) {
81
78
  onColumnRemove(column);
@@ -84,10 +81,10 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
84
81
  onColumnAdd(column);
85
82
  }
86
83
  }, children: column.label }, column.id));
87
- }) }), (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: {
84
+ }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', width: '100%' }, children: [_jsx(Divider, {}), _jsx("div", { style: {
88
85
  display: 'flex',
89
86
  padding: 8,
90
87
  gap: 8,
91
88
  justifyContent: 'flex-end',
92
- }, children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: onClose, children: strings.close }) })] })] }));
89
+ }, children: _jsx(Button, { onClick: onClose, children: strings.close }) })] })] }));
93
90
  }
@@ -1,19 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColumnItem = exports.ItemTypes = 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 react_1 = require("react");
8
- const react_dnd_1 = require("react-dnd");
9
- exports.ItemTypes = {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Body1, Button, Menu, MenuItem, MenuList, MenuPopover, MenuTrigger, tokens, } from '@fluentui/react-components';
3
+ import { Icons } from '@headless-adminapp/icons';
4
+ import { useRef } from 'react';
5
+ import { useDrag, useDrop } from 'react-dnd';
6
+ export const ItemTypes = {
10
7
  CARD: 'column',
11
8
  };
12
- const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSet = {}, // defaultCustomizeColumnStrings,
9
+ export const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSet = {}, // defaultCustomizeColumnStrings,
13
10
  }) => {
14
- const ref = (0, react_1.useRef)(null);
15
- const [{ handlerId }, drop] = (0, react_dnd_1.useDrop)({
16
- accept: exports.ItemTypes.CARD,
11
+ const ref = useRef(null);
12
+ const [{ handlerId }, drop] = useDrop({
13
+ accept: ItemTypes.CARD,
17
14
  collect(monitor) {
18
15
  return {
19
16
  handlerId: monitor.getHandlerId(),
@@ -58,8 +55,8 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
58
55
  item.index = hoverIndex;
59
56
  },
60
57
  });
61
- const [{ isDragging }, drag] = (0, react_dnd_1.useDrag)({
62
- type: exports.ItemTypes.CARD,
58
+ const [{ isDragging }, drag] = useDrag({
59
+ type: ItemTypes.CARD,
63
60
  item: () => {
64
61
  return { id: item.id, index };
65
62
  },
@@ -69,20 +66,19 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
69
66
  });
70
67
  const opacity = isDragging ? 0 : 1;
71
68
  drag(drop(ref));
72
- return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: {
73
- background: react_components_1.tokens.colorNeutralBackground4,
74
- paddingBlock: react_components_1.tokens.spacingVerticalXS,
75
- paddingLeft: react_components_1.tokens.spacingHorizontalS,
69
+ return (_jsxs("div", { ref: ref, style: {
70
+ background: tokens.colorNeutralBackground4,
71
+ paddingBlock: tokens.spacingVerticalXS,
72
+ paddingLeft: tokens.spacingHorizontalS,
76
73
  cursor: 'move',
77
74
  opacity,
78
- borderRadius: react_components_1.tokens.borderRadiusMedium,
75
+ borderRadius: tokens.borderRadiusMedium,
79
76
  display: 'flex',
80
77
  flexDirection: 'row',
81
78
  alignItems: 'center',
82
- }, "data-handler-id": handlerId, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { flex: 1 }, children: item.label }), (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: "below-start", children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.MoreVertical, {}), appearance: "transparent", size: "small" }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Delete, {}), onClick: onRemove, children: stringSet.remove }), !isFirst && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
79
+ }, "data-handler-id": handlerId, children: [_jsx(Body1, { style: { flex: 1 }, children: item.label }), _jsxs(Menu, { positioning: "below-start", children: [_jsx(MenuTrigger, { children: _jsx(Button, { icon: _jsx(Icons.MoreVertical, {}), appearance: "transparent", size: "small" }) }), _jsx(MenuPopover, { children: _jsxs(MenuList, { children: [_jsx(MenuItem, { icon: _jsx(Icons.Delete, {}), onClick: onRemove, children: stringSet.remove }), !isFirst && (_jsx(MenuItem, { icon: _jsx(Icons.Add, {}), onClick: () => {
83
80
  moveItem(index, index - 1);
84
- }, children: stringSet.moveUp })), !isLast && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
81
+ }, children: stringSet.moveUp })), !isLast && (_jsx(MenuItem, { icon: _jsx(Icons.Add, {}), onClick: () => {
85
82
  moveItem(index, index + 1);
86
83
  }, children: stringSet.moveDown }))] }) })] })] }));
87
84
  };
88
- exports.ColumnItem = ColumnItem;