@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.
- package/App/App.js +11 -7
- package/App/AppHeaderContianer.js +50 -44
- package/App/AppLogo.js +12 -9
- package/App/AppStringContext.js +13 -9
- package/App/AppUI.js +15 -11
- package/App/LayoutProvider.js +16 -24
- package/App/NavigationContainer.js +28 -28
- package/App/QuickActionItem.js +10 -6
- package/App/index.js +5 -1
- package/App/utils.d.ts +1 -1
- package/App/utils.js +7 -5
- package/CommandBar/Button.js +17 -14
- package/CommandBar/Divider.js +9 -6
- package/CommandBar/IconButton.js +16 -13
- package/CommandBar/Label.js +11 -8
- package/CommandBar/MenuButton.js +20 -17
- package/CommandBar/MenuItem.js +19 -16
- package/CommandBar/MenuItems.js +10 -10
- package/CommandBar/MenuList.js +12 -9
- package/CommandBar/Wrapper.js +10 -7
- package/CommandBar/index.js +15 -13
- package/DataForm/SectionControl.js +7 -4
- package/DataGrid/ActionCell.js +14 -11
- package/DataGrid/CommandContainer.js +10 -6
- package/DataGrid/CustomizeColumns/AddColumns.js +61 -59
- package/DataGrid/CustomizeColumns/ColumnItem.js +23 -19
- package/DataGrid/CustomizeColumns/CustomizeColumns.js +41 -36
- package/DataGrid/CustomizeColumns/index.js +5 -1
- package/DataGrid/FormSubgridCommandContainer.js +17 -13
- package/DataGrid/FormSubgridViewSelector.js +21 -21
- package/DataGrid/GridColumnHeader/ConditionValueControl.js +33 -33
- package/DataGrid/GridColumnHeader/FilterForm.js +28 -27
- package/DataGrid/GridColumnHeader/OperatorSelect.js +19 -13
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +35 -31
- package/DataGrid/GridColumnHeader/index.js +5 -1
- package/DataGrid/GridColumnHeader/utils.js +6 -2
- package/DataGrid/GridHeaderContainer.js +8 -4
- package/DataGrid/GridHeaderDesktop.js +28 -28
- package/DataGrid/GridHeaderMobile.js +20 -19
- package/DataGrid/GridListContainer.js +50 -44
- package/DataGrid/GridPaginationContainer.js +16 -13
- package/DataGrid/GridTableContainer.js +98 -89
- package/DataGrid/TableCell/TableCellAction.js +15 -11
- package/DataGrid/TableCell/TableCellBase.js +13 -4
- package/DataGrid/TableCell/TableCellCheckbox.js +11 -8
- package/DataGrid/TableCell/TableCellChoice.js +15 -13
- package/DataGrid/TableCell/TableCellLink.js +14 -11
- package/DataGrid/TableCell/TableCellText.js +10 -7
- package/DataGrid/TableCell/index.js +20 -4
- package/DataGrid/index.js +11 -4
- package/DataGrid/types.js +2 -1
- package/DataGrid/useTableColumns.js +98 -103
- package/DataGrid/utils.js +5 -1
- package/DialogContainer/AlertDialog.js +11 -11
- package/DialogContainer/ConfirmDialog.js +13 -14
- package/DialogContainer/DialogContainer.js +19 -26
- package/DialogContainer/ErrorDialog.js +15 -15
- package/DialogContainer/PromptDialog.js +76 -58
- package/DialogContainer/index.js +5 -1
- package/Insights/CommandBarContainer.js +17 -11
- package/Insights/FilterBarContainer.js +32 -37
- package/Insights/Grid.js +13 -9
- package/Insights/InsightsContainer.js +22 -19
- package/Insights/WidgetChartContainer.js +34 -30
- package/Insights/WidgetDataGridContainer.js +45 -33
- package/Insights/WidgetTableContainer.js +29 -26
- package/Insights/WidgetTileContainer.js +16 -12
- package/Insights/WidgetTitleBar.js +15 -10
- package/Insights/Widgets.js +28 -25
- package/Insights/charts/AreaChart.js +15 -12
- package/Insights/charts/BarChart.js +15 -12
- package/Insights/charts/ComposedChart.js +15 -13
- package/Insights/charts/CustomTooltipContent.js +13 -9
- package/Insights/charts/GaugeChart.js +6 -3
- package/Insights/charts/LineChart.js +15 -12
- package/Insights/charts/OhlcChart.js +46 -40
- package/Insights/charts/PieChart.js +25 -26
- package/Insights/charts/RadarChart.js +19 -17
- package/Insights/charts/ScatterChart.js +26 -28
- package/Insights/charts/constants.js +4 -1
- package/Insights/charts/formatters.js +33 -23
- package/Insights/charts/index.js +2 -1
- package/Insights/charts/renderers.js +36 -26
- package/Insights/hooks/useQueriesData.js +27 -30
- package/Insights/hooks/useWidgetDetail.js +24 -15
- package/OverflowCommandBar/OverflowCommandBar.js +19 -12
- package/OverflowCommandBar/OverflowMenu.js +22 -30
- package/OverflowCommandBar/OverflowMenuDivider.js +10 -6
- package/OverflowCommandBar/index.js +9 -3
- package/OverflowCommandBar/render.js +15 -10
- package/OverflowCommandBar/utils.js +6 -4
- package/PageBoard/BoardColumn.js +8 -5
- package/PageBoard/BoardColumnCard.d.ts +1 -1
- package/PageBoard/BoardColumnCard.js +15 -11
- package/PageBoard/BoardColumnUI.js +45 -46
- package/PageBoard/BoardingColumnCardLoading.js +13 -10
- package/PageBoard/Header.js +23 -28
- package/PageBoard/PageBoard.js +28 -26
- package/PageBoard/index.js +5 -1
- package/PageEntityForm/CommandContainer.js +25 -21
- package/PageEntityForm/FormTabRelated.js +20 -17
- package/PageEntityForm/PageEntityForm.js +20 -16
- package/PageEntityForm/PageEntityFormDesktopContainer.js +77 -70
- package/PageEntityForm/PageEntityFormStringContext.js +9 -5
- package/PageEntityForm/ProcessFlow.js +24 -21
- package/PageEntityForm/RecordCard.js +31 -24
- package/PageEntityForm/RecordCardLoading.js +13 -11
- package/PageEntityForm/RecordSetNavigatorContainer.js +34 -31
- package/PageEntityForm/RelatedViewSelector.js +34 -36
- package/PageEntityForm/SectionContainer.js +35 -31
- package/PageEntityForm/StandardControl.js +84 -76
- package/PageEntityForm/SubgridControl.js +23 -21
- package/PageEntityForm/index.js +5 -1
- package/PageEntityView/FormSubgridContainer.js +26 -22
- package/PageEntityView/PageEntityView.js +19 -15
- package/PageEntityView/PageEntityViewDesktopContainer.js +13 -9
- package/PageEntityView/PageEntityViewDesktopFrame.js +21 -17
- package/PageEntityView/PageEntityViewMobileContainer.js +13 -9
- package/PageEntityView/PageEntityViewStringContext.js +9 -5
- package/PageEntityView/index.js +5 -1
- package/PageInsights/PageInsights.js +13 -9
- package/PageInsights/index.js +6 -1
- package/ProgressIndicatorContainer/index.js +14 -10
- package/ToastNotificationContainer/index.js +18 -15
- package/componentStore.js +5 -2
- package/components/BodyLoading.js +11 -7
- package/components/DialogLogin.js +8 -5
- package/components/DndProvider.d.ts +12 -0
- package/components/DndProvider.js +68 -0
- package/components/LoginForm.js +46 -36
- package/components/PageBroken.js +8 -5
- package/components/PageLoading.js +8 -5
- package/components/PageLogin.js +17 -14
- package/form/FormControl.js +44 -50
- package/form/FormControlLoading.js +8 -4
- package/form/controls/AttachmentControl.js +72 -77
- package/form/controls/AttachmentsControl.js +24 -30
- package/form/controls/CurrencyControl.js +16 -13
- package/form/controls/DateControl.js +24 -18
- package/form/controls/DateRangeControl.js +22 -18
- package/form/controls/DateTimeControl.js +49 -43
- package/form/controls/DecimalControl.js +14 -11
- package/form/controls/DurationControl.js +18 -14
- package/form/controls/EmailControl.js +14 -11
- package/form/controls/IntegerControl.js +11 -8
- package/form/controls/LookupControl.js +58 -56
- package/form/controls/MultiSelectControl.js +12 -9
- package/form/controls/MultiSelectLookupControl.js +55 -53
- package/form/controls/PasswordControl.js +11 -8
- package/form/controls/RichTextControl.js +32 -5
- package/form/controls/SelectControl.js +15 -13
- package/form/controls/SwitchControl.js +7 -4
- package/form/controls/TelephoneControl.js +10 -7
- package/form/controls/TextAreaControl.js +11 -8
- package/form/controls/TextControl.js +12 -9
- package/form/controls/UrlControl.js +10 -7
- package/form/controls/types.js +2 -1
- package/form/controls/useLookupData.js +43 -54
- package/form/layout/FormBody/FormBody.js +10 -6
- package/form/layout/FormBody/index.js +17 -1
- package/form/layout/FormSection/FormSection.js +31 -20
- package/form/layout/FormSection/FormSectionColumn.js +7 -3
- package/form/layout/FormSection/FormSectionLoading.js +5 -1
- package/form/layout/FormSection/index.js +5 -1
- package/form/layout/FormTab/FormTab.js +21 -17
- package/form/layout/FormTab/FormTabColumn.js +9 -5
- package/form/layout/FormTab/index.js +5 -1
- package/form/layout/TabContext.js +5 -2
- package/form/layout/index.js +9 -3
- package/form/types.js +2 -1
- package/package.json +4 -12
- package/types/index.js +2 -1
- package/utils/avatar.js +4 -1
- package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
- package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
- package/form/controls/NumberControl.d.ts +0 -4
- package/form/controls/NumberControl.js +0 -16
- package/form/controls/utils.d.ts +0 -4
- package/form/controls/utils.js +0 -42
package/CommandBar/Label.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandLabel = 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)({
|
|
5
8
|
root: {
|
|
6
9
|
fontWeight: 'normal',
|
|
7
10
|
minWidth: 'unset',
|
|
@@ -9,12 +12,12 @@ const useStyles = makeStyles({
|
|
|
9
12
|
flexShrink: 0,
|
|
10
13
|
cursor: 'default !important',
|
|
11
14
|
'&:hover:active': {
|
|
12
|
-
backgroundColor: tokens.colorNeutralBackground2Hover,
|
|
15
|
+
backgroundColor: react_components_1.tokens.colorNeutralBackground2Hover,
|
|
13
16
|
},
|
|
14
17
|
},
|
|
15
18
|
});
|
|
16
|
-
|
|
19
|
+
exports.CommandLabel = (0, react_1.memo)((0, react_1.forwardRef)(function CommandLabel({ Icon, text }, ref) {
|
|
17
20
|
const styles = useStyles();
|
|
18
|
-
return (
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.ToolbarButton, { ref: ref, type: "button", icon: !!Icon ? (0, jsx_runtime_1.jsx)(Icon, { size: 20 }) : undefined, className: (0, react_components_1.mergeClasses)(styles.root), children: text }));
|
|
19
22
|
}));
|
|
20
|
-
CommandLabel.displayName = 'CommandLabel';
|
|
23
|
+
exports.CommandLabel.displayName = 'CommandLabel';
|
package/CommandBar/MenuButton.js
CHANGED
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
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)({
|
|
6
9
|
splitButton: {
|
|
7
10
|
'& > button:first-child': {
|
|
8
|
-
fontWeight: tokens.fontWeightRegular,
|
|
9
|
-
borderRightColor: tokens.colorNeutralStroke3,
|
|
11
|
+
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
12
|
+
borderRightColor: react_components_1.tokens.colorNeutralStroke3,
|
|
10
13
|
},
|
|
11
14
|
},
|
|
12
15
|
menuButton: {
|
|
13
|
-
fontWeight: tokens.fontWeightRegular,
|
|
16
|
+
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
14
17
|
},
|
|
15
18
|
splitButtonDanger: {
|
|
16
19
|
'& > button:first-child:hover': {
|
|
17
|
-
color: tokens.colorPaletteRedForeground1,
|
|
18
|
-
background: tokens.colorPaletteRedBackground1,
|
|
20
|
+
color: react_components_1.tokens.colorPaletteRedForeground1,
|
|
21
|
+
background: react_components_1.tokens.colorPaletteRedBackground1,
|
|
19
22
|
'& .fui-Button__icon': {
|
|
20
|
-
color: tokens.colorPaletteRedForeground1,
|
|
23
|
+
color: react_components_1.tokens.colorPaletteRedForeground1,
|
|
21
24
|
},
|
|
22
25
|
'&:active': {
|
|
23
|
-
color: tokens.colorPaletteRedForeground2,
|
|
24
|
-
background: tokens.colorPaletteRedBackground2,
|
|
26
|
+
color: react_components_1.tokens.colorPaletteRedForeground2,
|
|
27
|
+
background: react_components_1.tokens.colorPaletteRedBackground2,
|
|
25
28
|
'& .fui-Button__icon': {
|
|
26
|
-
color: tokens.colorPaletteRedForeground2,
|
|
29
|
+
color: react_components_1.tokens.colorPaletteRedForeground2,
|
|
27
30
|
},
|
|
28
31
|
},
|
|
29
32
|
},
|
|
30
33
|
},
|
|
31
34
|
});
|
|
32
|
-
|
|
35
|
+
exports.CommandMenuButton = (0, react_1.memo)((0, react_1.forwardRef)(function CommandMenuButton({ Icon, items, text, danger, disabled, onClick }, ref) {
|
|
33
36
|
const styles = useStyles();
|
|
34
37
|
return (
|
|
35
38
|
// <div ref={ref}>
|
|
36
|
-
|
|
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 }) })] })
|
|
37
40
|
// </div>
|
|
38
41
|
);
|
|
39
42
|
}));
|
|
40
|
-
CommandMenuButton.displayName = 'CommandMenuButton';
|
|
43
|
+
exports.CommandMenuButton.displayName = 'CommandMenuButton';
|
package/CommandBar/MenuItem.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
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)({
|
|
6
9
|
splitMenuRight: {
|
|
7
10
|
'& .fui-MenuItem__icon': {
|
|
8
11
|
display: 'none',
|
|
@@ -10,26 +13,26 @@ const useStyles = makeStyles({
|
|
|
10
13
|
},
|
|
11
14
|
danger: {
|
|
12
15
|
'&:hover': {
|
|
13
|
-
color: tokens.colorPaletteRedForeground1,
|
|
14
|
-
background: tokens.colorPaletteRedBackground1,
|
|
16
|
+
color: react_components_1.tokens.colorPaletteRedForeground1,
|
|
17
|
+
background: react_components_1.tokens.colorPaletteRedBackground1,
|
|
15
18
|
'& .fui-MenuItem__icon': {
|
|
16
|
-
color: tokens.colorPaletteRedForeground1,
|
|
19
|
+
color: react_components_1.tokens.colorPaletteRedForeground1,
|
|
17
20
|
},
|
|
18
21
|
'&:active': {
|
|
19
|
-
color: tokens.colorPaletteRedForeground2,
|
|
20
|
-
background: tokens.colorPaletteRedBackground2,
|
|
22
|
+
color: react_components_1.tokens.colorPaletteRedForeground2,
|
|
23
|
+
background: react_components_1.tokens.colorPaletteRedBackground2,
|
|
21
24
|
'& .fui-MenuItem__icon': {
|
|
22
|
-
color: tokens.colorPaletteRedForeground2,
|
|
25
|
+
color: react_components_1.tokens.colorPaletteRedForeground2,
|
|
23
26
|
},
|
|
24
27
|
},
|
|
25
28
|
},
|
|
26
29
|
},
|
|
27
30
|
});
|
|
28
|
-
|
|
31
|
+
exports.MenuItem = (0, react_1.memo)(({ Icon, text, disabled, danger, onClick, items }) => {
|
|
29
32
|
const styles = useStyles();
|
|
30
|
-
if (!
|
|
31
|
-
return (
|
|
33
|
+
if (!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 }));
|
|
32
35
|
}
|
|
33
|
-
return (
|
|
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 }) })] }));
|
|
34
37
|
});
|
|
35
|
-
MenuItem.displayName = 'MenuItem';
|
|
38
|
+
exports.MenuItem.displayName = 'MenuItem';
|
package/CommandBar/MenuItems.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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?.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) => ((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 }, (item.text ?? '') + index)))] }, index))) }));
|
|
10
10
|
});
|
|
11
|
-
MenuItems.displayName = 'MenuItems';
|
|
11
|
+
exports.MenuItems.displayName = 'MenuItems';
|
package/CommandBar/MenuList.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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?.length ? ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { style: {
|
|
10
|
+
color: react_components_1.tokens.colorNeutralForegroundDisabled,
|
|
8
11
|
fontStyle: 'italic',
|
|
9
|
-
}, children: "No items" })) : (
|
|
12
|
+
}, children: "No items" })) : ((0, jsx_runtime_1.jsx)(MenuItems_1.MenuItems, { items: items })) }));
|
|
10
13
|
});
|
|
11
|
-
MenuList.displayName = 'MenuList';
|
|
14
|
+
exports.MenuList.displayName = 'MenuList';
|
package/CommandBar/Wrapper.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
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)({
|
|
5
8
|
root: {
|
|
6
9
|
flexWrap: 'nowrap',
|
|
7
10
|
minWidth: 0,
|
|
@@ -14,8 +17,8 @@ const useStyles = makeStyles({
|
|
|
14
17
|
overflow: 'auto',
|
|
15
18
|
},
|
|
16
19
|
});
|
|
17
|
-
|
|
20
|
+
exports.CommandBarWrapper = (0, react_1.memo)((0, react_1.forwardRef)(function CommandBarWrapper({ children, overflow, className, align = 'start' }, ref) {
|
|
18
21
|
const styles = useStyles();
|
|
19
|
-
return (
|
|
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 }));
|
|
20
23
|
}));
|
|
21
|
-
CommandBarWrapper.displayName = 'CommandBarWrapper';
|
|
24
|
+
exports.CommandBarWrapper.displayName = 'CommandBarWrapper';
|
package/CommandBar/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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");
|
|
7
9
|
const CommandBar = {
|
|
8
|
-
Wrapper: CommandBarWrapper,
|
|
9
|
-
Button: CommandButton,
|
|
10
|
-
MenuButton: CommandMenuButton,
|
|
11
|
-
Divider: CommandDivider,
|
|
12
|
-
IconButton: CommandIconButton,
|
|
13
|
-
Label: CommandLabel,
|
|
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,
|
|
14
16
|
};
|
|
15
|
-
|
|
17
|
+
exports.default = CommandBar;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 }));
|
|
5
8
|
}
|
package/DataGrid/ActionCell.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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)) }));
|
|
11
14
|
});
|
|
12
|
-
ActionCell.displayName = 'ActionCell';
|
|
15
|
+
exports.ActionCell.displayName = 'ActionCell';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 });
|
|
7
10
|
};
|
|
11
|
+
exports.CommandContainer = CommandContainer;
|
|
@@ -1,90 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
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, }) {
|
|
16
|
+
const schema = (0, hooks_1.useDataGridSchema)();
|
|
17
|
+
const { schemaStore } = (0, hooks_2.useMetadata)();
|
|
18
|
+
const { language } = (0, locale_1.useLocale)();
|
|
19
|
+
const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
|
|
20
|
+
const appStrings = (0, AppStringContext_1.useAppStrings)();
|
|
19
21
|
const lookupAttributes = Object.entries(schema.attributes)
|
|
20
22
|
.map(([key, attribute]) => ({
|
|
21
23
|
key,
|
|
22
24
|
attribute,
|
|
23
25
|
}))
|
|
24
26
|
.filter(({ attribute }) => attribute.type === 'lookup');
|
|
25
|
-
const columnGroups =
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
const columnGroups = {
|
|
28
|
+
root: {
|
|
29
|
+
label: (0, utils_1.localizedLabel)(language, schema),
|
|
30
|
+
columns: (0, datagrid_1.transformViewColumns)(schema.logicalName, Object.keys(schema.attributes).map((key) => ({
|
|
28
31
|
name: key,
|
|
29
32
|
})), schemaStore, language),
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
},
|
|
34
|
+
...lookupAttributes.reduce((acc, { key, attribute }) => {
|
|
35
|
+
const lookupSchema = schemaStore.getSchema(attribute.entity);
|
|
36
|
+
const columns = (0, datagrid_1.transformViewColumns)(schema.logicalName, Object.keys(lookupSchema.attributes).map((nestedKey) => ({
|
|
37
|
+
name: key,
|
|
38
|
+
expandedKey: nestedKey,
|
|
39
|
+
})), schemaStore, language);
|
|
40
|
+
acc[key] = {
|
|
41
|
+
label: (0, utils_1.localizedLabel)(language, attribute) +
|
|
42
|
+
' (' +
|
|
43
|
+
(0, utils_1.localizedLabel)(language, lookupSchema) +
|
|
44
|
+
')',
|
|
45
|
+
columns,
|
|
46
|
+
};
|
|
47
|
+
return acc;
|
|
48
|
+
}, {}),
|
|
49
|
+
};
|
|
45
50
|
const tableItems = Object.entries(columnGroups).map(([key, group]) => ({
|
|
46
51
|
key,
|
|
47
52
|
label: group.label,
|
|
48
53
|
}));
|
|
49
|
-
const [selectedGroup, setSelectedGroup] = useState('root');
|
|
54
|
+
const [selectedGroup, setSelectedGroup] = (0, react_1.useState)('root');
|
|
50
55
|
const selectedGroupItem = tableItems.find((x) => x.key === selectedGroup);
|
|
51
56
|
const availableColumns = columnGroups[selectedGroup].columns;
|
|
52
|
-
const [searchText, setSearchText] = useState('');
|
|
57
|
+
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
53
58
|
const filteredColumns = availableColumns.filter((column) => column.label.toLowerCase().includes(searchText.toLowerCase()));
|
|
54
59
|
const includedColumnsObj = columns.reduce((acc, column) => {
|
|
55
60
|
acc[column.id] = true;
|
|
56
61
|
return acc;
|
|
57
62
|
}, {});
|
|
58
|
-
return (
|
|
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: {
|
|
59
64
|
display: 'flex',
|
|
60
65
|
flexDirection: 'column-reverse',
|
|
61
66
|
gap: 8,
|
|
62
|
-
marginBottom: tokens.spacingVerticalXS,
|
|
63
|
-
paddingInline: tokens.spacingHorizontalS,
|
|
64
|
-
}, children: [
|
|
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) => {
|
|
65
70
|
setSelectedGroup(data.optionValue);
|
|
66
71
|
}, style: { flex: 1, minWidth: 'unset' }, positioning: {
|
|
67
72
|
align: 'bottom',
|
|
68
73
|
position: 'below',
|
|
69
|
-
}, children: tableItems.map((x) => (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
}, children: column.label }, column.id));
|
|
84
|
-
}) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', width: '100%' }, children: [_jsx(Divider, {}), _jsx("div", { style: {
|
|
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: {
|
|
75
|
+
fontWeight: react_components_1.tokens.fontSizeBase400,
|
|
76
|
+
width: '100%',
|
|
77
|
+
justifyContent: 'flex-start',
|
|
78
|
+
paddingInline: react_components_1.tokens.spacingHorizontalS,
|
|
79
|
+
}, onClick: () => {
|
|
80
|
+
if (includedColumnsObj[column.id]) {
|
|
81
|
+
onColumnRemove(column);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
onColumnAdd(column);
|
|
85
|
+
}
|
|
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: {
|
|
85
87
|
display: 'flex',
|
|
86
88
|
padding: 8,
|
|
87
89
|
gap: 8,
|
|
88
90
|
justifyContent: 'flex-end',
|
|
89
|
-
}, children:
|
|
91
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { onClick: onClose, children: strings.close }) })] })] }));
|
|
90
92
|
}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 DndProvider_1 = require("../../components/DndProvider");
|
|
9
|
+
exports.ItemTypes = {
|
|
7
10
|
CARD: 'column',
|
|
8
11
|
};
|
|
9
|
-
|
|
12
|
+
const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSet = {}, // defaultCustomizeColumnStrings,
|
|
10
13
|
}) => {
|
|
11
|
-
const
|
|
14
|
+
const { useDrag, useDrop } = (0, DndProvider_1.useDndContext)();
|
|
15
|
+
const ref = (0, react_1.useRef)(null);
|
|
12
16
|
const [{ handlerId }, drop] = useDrop({
|
|
13
|
-
accept: ItemTypes.CARD,
|
|
17
|
+
accept: exports.ItemTypes.CARD,
|
|
14
18
|
collect(monitor) {
|
|
15
19
|
return {
|
|
16
20
|
handlerId: monitor.getHandlerId(),
|
|
17
21
|
};
|
|
18
22
|
},
|
|
19
23
|
hover(item, monitor) {
|
|
20
|
-
var _a;
|
|
21
24
|
if (!ref.current) {
|
|
22
25
|
return;
|
|
23
26
|
}
|
|
@@ -28,7 +31,7 @@ export const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, s
|
|
|
28
31
|
return;
|
|
29
32
|
}
|
|
30
33
|
// Determine rectangle on screen
|
|
31
|
-
const hoverBoundingRect =
|
|
34
|
+
const hoverBoundingRect = ref.current?.getBoundingClientRect();
|
|
32
35
|
// Get vertical middle
|
|
33
36
|
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
34
37
|
// Determine mouse position
|
|
@@ -56,7 +59,7 @@ export const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, s
|
|
|
56
59
|
},
|
|
57
60
|
});
|
|
58
61
|
const [{ isDragging }, drag] = useDrag({
|
|
59
|
-
type: ItemTypes.CARD,
|
|
62
|
+
type: exports.ItemTypes.CARD,
|
|
60
63
|
item: () => {
|
|
61
64
|
return { id: item.id, index };
|
|
62
65
|
},
|
|
@@ -66,19 +69,20 @@ export const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, s
|
|
|
66
69
|
});
|
|
67
70
|
const opacity = isDragging ? 0 : 1;
|
|
68
71
|
drag(drop(ref));
|
|
69
|
-
return (
|
|
70
|
-
background: tokens.colorNeutralBackground4,
|
|
71
|
-
paddingBlock: tokens.spacingVerticalXS,
|
|
72
|
-
paddingLeft: tokens.spacingHorizontalS,
|
|
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,
|
|
73
76
|
cursor: 'move',
|
|
74
77
|
opacity,
|
|
75
|
-
borderRadius: tokens.borderRadiusMedium,
|
|
78
|
+
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
76
79
|
display: 'flex',
|
|
77
80
|
flexDirection: 'row',
|
|
78
81
|
alignItems: 'center',
|
|
79
|
-
}, "data-handler-id": handlerId, children: [
|
|
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: () => {
|
|
80
83
|
moveItem(index, index - 1);
|
|
81
|
-
}, children: stringSet.moveUp })), !isLast && (
|
|
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: () => {
|
|
82
85
|
moveItem(index, index + 1);
|
|
83
86
|
}, children: stringSet.moveDown }))] }) })] })] }));
|
|
84
87
|
};
|
|
88
|
+
exports.ColumnItem = ColumnItem;
|