@headless-adminapp/fluent 0.0.17-alpha.52 → 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/AppHeaderContianer.js +13 -11
- package/App/AppLogo.js +1 -2
- package/App/LayoutProvider.js +3 -15
- package/App/NavigationContainer.js +2 -6
- package/App/QuickActionItem.js +1 -1
- package/App/utils.d.ts +1 -1
- package/App/utils.js +3 -4
- package/CommandBar/MenuItem.js +1 -1
- package/CommandBar/MenuItems.js +1 -4
- package/CommandBar/MenuList.js +1 -1
- package/DataGrid/CustomizeColumns/AddColumns.js +33 -34
- package/DataGrid/CustomizeColumns/ColumnItem.js +5 -5
- package/DataGrid/CustomizeColumns/CustomizeColumns.js +2 -3
- package/DataGrid/FormSubgridViewSelector.js +1 -5
- package/DataGrid/GridColumnHeader/ConditionValueControl.js +19 -25
- package/DataGrid/GridColumnHeader/FilterForm.js +6 -9
- package/DataGrid/GridColumnHeader/OperatorSelect.js +1 -1
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +4 -4
- package/DataGrid/GridHeaderDesktop.js +1 -5
- package/DataGrid/GridHeaderMobile.js +1 -4
- package/DataGrid/GridListContainer.js +9 -7
- package/DataGrid/GridPaginationContainer.js +1 -2
- package/DataGrid/GridTableContainer.js +25 -20
- package/DataGrid/TableCell/TableCellBase.js +6 -1
- package/DataGrid/TableCell/TableCellCheckbox.js +2 -2
- package/DataGrid/TableCell/TableCellChoice.js +1 -2
- package/DataGrid/TableCell/TableCellLink.d.ts +1 -1
- package/DataGrid/TableCell/TableCellLink.js +5 -1
- package/DataGrid/useTableColumns.js +85 -41
- package/DialogContainer/AlertDialog.js +3 -6
- package/DialogContainer/ConfirmDialog.js +5 -9
- package/DialogContainer/DialogContainer.js +2 -13
- package/DialogContainer/ErrorDialog.js +3 -6
- package/DialogContainer/PromptDialog.js +22 -31
- package/Insights/CommandBarContainer.js +4 -1
- package/Insights/FilterBarContainer.js +12 -20
- package/Insights/WidgetDataGridContainer.js +11 -2
- package/Insights/WidgetTableContainer.js +2 -3
- package/Insights/WidgetTitleBar.js +1 -2
- package/Insights/charts/ComposedChart.js +1 -2
- package/Insights/charts/CustomTooltipContent.js +1 -1
- package/Insights/charts/OhlcChart.js +8 -7
- package/Insights/charts/PieChart.js +4 -8
- package/Insights/charts/RadarChart.js +2 -3
- package/Insights/charts/ScatterChart.js +4 -9
- package/Insights/charts/formatters.js +4 -6
- package/Insights/charts/renderers.js +1 -2
- package/Insights/hooks/useQueriesData.js +3 -12
- package/Insights/hooks/useWidgetDetail.js +9 -3
- package/OverflowCommandBar/OverflowMenu.js +4 -16
- package/OverflowCommandBar/render.js +3 -4
- package/OverflowCommandBar/utils.js +2 -3
- package/PageBoard/BoardColumnCard.d.ts +1 -1
- package/PageBoard/BoardColumnCard.js +3 -2
- package/PageBoard/BoardColumnUI.js +12 -17
- package/PageBoard/Header.js +3 -12
- package/PageBoard/PageBoard.d.ts +1 -1
- package/PageBoard/PageBoard.js +2 -3
- package/PageEntityForm/PageEntityFormDesktopContainer.js +8 -5
- package/PageEntityForm/RecordCard.js +8 -4
- package/PageEntityForm/RecordCardLoading.js +1 -2
- package/PageEntityForm/RecordSetNavigatorContainer.js +1 -2
- package/PageEntityForm/RelatedViewSelector.js +5 -10
- package/PageEntityForm/SectionContainer.js +7 -6
- package/PageEntityForm/StandardControl.d.ts +3 -3
- package/PageEntityForm/StandardControl.js +33 -32
- package/PageEntityForm/SubgridControl.js +2 -3
- package/ToastNotificationContainer/index.js +1 -2
- package/components/DndProvider.d.ts +12 -0
- package/components/DndProvider.js +68 -0
- package/components/LoginForm.js +5 -21
- package/form/FormControl.js +17 -28
- package/form/controls/AttachmentControl.js +13 -22
- package/form/controls/AttachmentsControl.js +8 -18
- package/form/controls/CurrencyControl.js +4 -4
- package/form/controls/DateControl.js +2 -2
- package/form/controls/DateRangeControl.js +4 -6
- package/form/controls/DateTimeControl.js +7 -7
- package/form/controls/DecimalControl.js +4 -4
- package/form/controls/DurationControl.js +3 -3
- package/form/controls/EmailControl.js +4 -4
- package/form/controls/IntegerControl.js +5 -5
- package/form/controls/LookupControl.d.ts +1 -0
- package/form/controls/LookupControl.js +50 -11
- package/form/controls/MultiSelectControl.js +3 -3
- package/form/controls/MultiSelectLookupControl.js +16 -17
- package/form/controls/PasswordControl.js +1 -1
- package/form/controls/RichTextControl.js +1 -1
- package/form/controls/SelectControl.js +4 -5
- package/form/controls/SwitchControl.js +1 -1
- package/form/controls/TelephoneControl.js +1 -1
- package/form/controls/TextAreaControl.js +4 -4
- package/form/controls/TextControl.js +4 -4
- package/form/controls/UrlControl.js +1 -1
- package/form/controls/useLookupData.js +26 -41
- package/form/layout/FormSection/FormSection.js +10 -3
- package/form/layout/FormTab/FormTab.js +2 -2
- package/package.json +4 -11
- package/utils/avatar.d.ts +2 -0
- package/utils/avatar.js +45 -0
- 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
|
@@ -23,8 +23,12 @@ const AppHeaderContainer = ({ onNavToggle, }) => {
|
|
|
23
23
|
const { language } = (0, locale_1.useLocale)();
|
|
24
24
|
const isMobile = (0, hooks_2.useIsMobile)();
|
|
25
25
|
const initials = (0, react_1.useMemo)(() => {
|
|
26
|
-
return authSession
|
|
27
|
-
|
|
26
|
+
return authSession?.fullName
|
|
27
|
+
.split(' ')
|
|
28
|
+
.map((item) => item[0])
|
|
29
|
+
.slice(0, 2)
|
|
30
|
+
.join('');
|
|
31
|
+
}, [authSession?.fullName]);
|
|
28
32
|
const quickActionItems = (0, hooks_2.useItemsWithKey)(app.quickActionItems);
|
|
29
33
|
const accountMenuItems = (0, hooks_2.useItemsWithKey)(app.accountMenuItems);
|
|
30
34
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
@@ -46,11 +50,10 @@ const AppHeaderContainer = ({ onNavToggle, }) => {
|
|
|
46
50
|
paddingLeft: 8,
|
|
47
51
|
display: 'flex',
|
|
48
52
|
gap: 16,
|
|
49
|
-
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', gap: 8 }, children: quickActionItems
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
src: authSession === null || authSession === void 0 ? void 0 : authSession.profilePicture,
|
|
53
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', gap: 8 }, children: quickActionItems?.map((item) => {
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(QuickActionItem_1.QuickActionItem, { Icon: item.icon, label: item.localizedLabel?.[language] ?? item.label, onClick: () => item.onClick?.(), link: item.link }, item.__key));
|
|
55
|
+
}) }), (!isSkipAuthCheck || !!accountMenuItems?.length) && ((0, jsx_runtime_1.jsxs)(react_components_1.Popover, { children: [(0, jsx_runtime_1.jsx)(react_components_1.PopoverTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.Avatar, { initials: initials, color: "neutral", style: { cursor: 'pointer' }, image: {
|
|
56
|
+
src: authSession?.profilePicture,
|
|
54
57
|
} }) }), (0, jsx_runtime_1.jsxs)(react_components_1.PopoverSurface, { tabIndex: -1, style: { padding: 0 }, children: [!isSkipAuthCheck && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
55
58
|
display: 'flex',
|
|
56
59
|
gap: 8,
|
|
@@ -58,16 +61,15 @@ const AppHeaderContainer = ({ onNavToggle, }) => {
|
|
|
58
61
|
overflow: 'hidden',
|
|
59
62
|
width: 200,
|
|
60
63
|
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Avatar, { initials: initials, color: "neutral", image: {
|
|
61
|
-
src: authSession
|
|
64
|
+
src: authSession?.profilePicture,
|
|
62
65
|
} }) }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
63
66
|
display: 'flex',
|
|
64
67
|
flexDirection: 'column',
|
|
65
68
|
overflow: 'hidden',
|
|
66
69
|
flex: 1,
|
|
67
|
-
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Caption1Strong, { children: authSession
|
|
68
|
-
var _a, _b;
|
|
70
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Caption1Strong, { children: authSession?.fullName }), (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { textOverflow: 'ellipsis', overflow: 'hidden' }, children: authSession?.email })] })] })), !isSkipAuthCheck && (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, { style: { marginInline: 0 } }), (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { style: { width: 200, marginBottom: 4 }, children: [accountMenuItems?.map((item) => {
|
|
69
71
|
const Icon = item.icon;
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), onClick: () =>
|
|
72
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), onClick: () => item.onClick?.(), children: item.localizedLabel?.[language] ?? item.label }, item.__key));
|
|
71
73
|
}), !isSkipAuthCheck && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.SignOut, {}), onClick: () => logout(), children: strings.logout }))] })] })] }))] })] }));
|
|
72
74
|
};
|
|
73
75
|
exports.AppHeaderContainer = AppHeaderContainer;
|
package/App/AppLogo.js
CHANGED
|
@@ -4,9 +4,8 @@ exports.AppLogo = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const icons_1 = require("@headless-adminapp/icons");
|
|
6
6
|
const AppLogo = ({ logo, title }) => {
|
|
7
|
-
var _a;
|
|
8
7
|
if (logo.Icon) {
|
|
9
|
-
const Icon =
|
|
8
|
+
const Icon = logo.Icon ?? icons_1.IconPlaceholder;
|
|
10
9
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
11
10
|
display: 'flex',
|
|
12
11
|
alignItems: 'center',
|
package/App/LayoutProvider.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.LayoutProvider = void 0;
|
|
15
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -18,12 +7,11 @@ const LayoutProvider_1 = require("@headless-adminapp/app/app/LayoutProvider");
|
|
|
18
7
|
const DialogContainer_1 = require("../DialogContainer");
|
|
19
8
|
const ProgressIndicatorContainer_1 = require("../ProgressIndicatorContainer");
|
|
20
9
|
const ToastNotificationContainer_1 = require("../ToastNotificationContainer");
|
|
21
|
-
const LayoutProvider = (
|
|
22
|
-
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.FluentProvider, { theme: theme !== null && theme !== void 0 ? theme : react_components_1.webLightTheme, children: (0, jsx_runtime_1.jsx)(LayoutProvider_1.LayoutProvider, Object.assign({}, rest, { containers: {
|
|
10
|
+
const LayoutProvider = ({ children, theme, ...rest }) => {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.FluentProvider, { theme: theme ?? react_components_1.webLightTheme, children: (0, jsx_runtime_1.jsx)(LayoutProvider_1.LayoutProvider, { ...rest, containers: {
|
|
24
12
|
DialogContainer: DialogContainer_1.DialogContainer,
|
|
25
13
|
ProgressIndicatorContainer: ProgressIndicatorContainer_1.ProgressIndicatorContainer,
|
|
26
14
|
ToastNotificationContainer: ToastNotificationContainer_1.ToastNotificationContainer,
|
|
27
|
-
}, children: children })
|
|
15
|
+
}, children: children }) }));
|
|
28
16
|
};
|
|
29
17
|
exports.LayoutProvider = LayoutProvider;
|
|
@@ -34,14 +34,10 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
34
34
|
const NavigationContainer = ({ open, type, onOpenChange, }) => {
|
|
35
35
|
const styles = useStyles();
|
|
36
36
|
const { app } = (0, app_1.useAppContext)();
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: styles.root, children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawer, { selectedValue: "active", open: open, type: type, onOpenChange: (value, data) => onOpenChange(data.open), children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawerBody, { style: { paddingTop: 8 }, children: app.navItems.map((area) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: area.groups.map((group) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [!group.hideLabel && ((0, jsx_runtime_1.jsx)(react_nav_preview_1.NavSectionHeader, { children: group.label })), group.items.map((item, index) => {
|
|
38
|
-
var _a;
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(Test, { item: item, drawerType: type, onOpenChange: onOpenChange }, ((_a = item.label) !== null && _a !== void 0 ? _a : '') + String(index)));
|
|
40
|
-
})] }, group.label))) }, area.label))) }) }) }));
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles.root, children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawer, { selectedValue: "active", open: open, type: type, onOpenChange: (value, data) => onOpenChange(data.open), children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawerBody, { style: { paddingTop: 8 }, children: app.navItems.map((area) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: area.groups.map((group) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [!group.hideLabel && ((0, jsx_runtime_1.jsx)(react_nav_preview_1.NavSectionHeader, { children: group.label })), group.items.map((item, index) => ((0, jsx_runtime_1.jsx)(Test, { item: item, drawerType: type, onOpenChange: onOpenChange }, (item.label ?? '') + String(index))))] }, group.label))) }, area.label))) }) }) }));
|
|
41
38
|
};
|
|
42
39
|
exports.NavigationContainer = NavigationContainer;
|
|
43
40
|
const Test = ({ item, onOpenChange, drawerType }) => {
|
|
44
|
-
var _a, _b;
|
|
45
41
|
const { schemaMetadataDic } = (0, app_1.useAppContext)();
|
|
46
42
|
const router = (0, hooks_1.useRouter)();
|
|
47
43
|
const pathname = (0, hooks_1.usePathname)();
|
|
@@ -55,7 +51,7 @@ const Test = ({ item, onOpenChange, drawerType }) => {
|
|
|
55
51
|
language,
|
|
56
52
|
routeResolver,
|
|
57
53
|
});
|
|
58
|
-
const Icon =
|
|
54
|
+
const Icon = navItem.icon ?? icons_1.Icons.Entity ?? icons_1.IconPlaceholder;
|
|
59
55
|
const isActive = isRouteActive(selectedPath, item);
|
|
60
56
|
return ((0, jsx_runtime_1.jsx)(react_nav_preview_1.NavItem, { href: navItem.link, onClick: (event) => {
|
|
61
57
|
if (drawerType === 'overlay') {
|
package/App/QuickActionItem.js
CHANGED
|
@@ -26,7 +26,7 @@ const QuickActionItem = ({ label, Icon, onClick, link, }) => {
|
|
|
26
26
|
const styles = useStyles();
|
|
27
27
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Button, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), appearance: "transparent", as: "a", href: link, title: label, className: styles.root, onClick: (event) => {
|
|
28
28
|
event.preventDefault();
|
|
29
|
-
onClick
|
|
29
|
+
onClick?.();
|
|
30
30
|
} }));
|
|
31
31
|
};
|
|
32
32
|
exports.QuickActionItem = QuickActionItem;
|
package/App/utils.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function transformNavPageItem({ item, schemaMetadataDic: schemaMe
|
|
|
8
8
|
routeResolver: InternalRouteResolver;
|
|
9
9
|
}): {
|
|
10
10
|
label: string | undefined;
|
|
11
|
-
icon:
|
|
11
|
+
icon: any;
|
|
12
12
|
link: string;
|
|
13
13
|
isExternal: boolean;
|
|
14
14
|
};
|
package/App/utils.js
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformNavPageItem = transformNavPageItem;
|
|
4
4
|
function transformNavPageItem({ item, schemaMetadataDic: schemaMetadataObject, language, routeResolver, }) {
|
|
5
|
-
var _a, _b, _c, _d;
|
|
6
5
|
let icon = item.icon;
|
|
7
|
-
let label =
|
|
6
|
+
let label = item.localizedLabel?.[language] ?? item.label;
|
|
8
7
|
let link = routeResolver(item);
|
|
9
8
|
if (item.type === 'entityview') {
|
|
10
|
-
const metadata = schemaMetadataObject
|
|
9
|
+
const metadata = schemaMetadataObject?.[item.logicalName];
|
|
11
10
|
if (metadata) {
|
|
12
11
|
if (!label) {
|
|
13
12
|
label =
|
|
14
|
-
|
|
13
|
+
metadata.localizedPluralLabels?.[language] ?? metadata.pluralLabel;
|
|
15
14
|
}
|
|
16
15
|
if (!icon) {
|
|
17
16
|
icon = metadata.icon;
|
package/CommandBar/MenuItem.js
CHANGED
|
@@ -30,7 +30,7 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
30
30
|
});
|
|
31
31
|
exports.MenuItem = (0, react_1.memo)(({ Icon, text, disabled, danger, onClick, items }) => {
|
|
32
32
|
const styles = useStyles();
|
|
33
|
-
if (!
|
|
33
|
+
if (!items?.length) {
|
|
34
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 }));
|
|
35
35
|
}
|
|
36
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 }) })] }));
|
package/CommandBar/MenuItems.js
CHANGED
|
@@ -6,9 +6,6 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const MenuItem_1 = require("./MenuItem");
|
|
8
8
|
exports.MenuItems = (0, react_1.memo)(({ items }) => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: items
|
|
10
|
-
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));
|
|
12
|
-
})] }, index))) }));
|
|
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))) }));
|
|
13
10
|
});
|
|
14
11
|
exports.MenuItems.displayName = 'MenuItems';
|
package/CommandBar/MenuList.js
CHANGED
|
@@ -6,7 +6,7 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const MenuItems_1 = require("./MenuItems");
|
|
8
8
|
exports.MenuList = (0, react_1.memo)(({ items }) => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: !
|
|
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
10
|
color: react_components_1.tokens.colorNeutralForegroundDisabled,
|
|
11
11
|
fontStyle: 'italic',
|
|
12
12
|
}, children: "No items" })) : ((0, jsx_runtime_1.jsx)(MenuItems_1.MenuItems, { items: items })) }));
|
|
@@ -13,7 +13,6 @@ const react_1 = require("react");
|
|
|
13
13
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
14
14
|
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
15
15
|
function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, }) {
|
|
16
|
-
var _a;
|
|
17
16
|
const schema = (0, hooks_1.useDataGridSchema)();
|
|
18
17
|
const { schemaStore } = (0, hooks_2.useMetadata)();
|
|
19
18
|
const { language } = (0, locale_1.useLocale)();
|
|
@@ -25,26 +24,29 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
|
|
|
25
24
|
attribute,
|
|
26
25
|
}))
|
|
27
26
|
.filter(({ attribute }) => attribute.type === 'lookup');
|
|
28
|
-
const columnGroups =
|
|
27
|
+
const columnGroups = {
|
|
28
|
+
root: {
|
|
29
29
|
label: (0, utils_1.localizedLabel)(language, schema),
|
|
30
30
|
columns: (0, datagrid_1.transformViewColumns)(schema.logicalName, Object.keys(schema.attributes).map((key) => ({
|
|
31
31
|
name: key,
|
|
32
32
|
})), schemaStore, language),
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
+
};
|
|
48
50
|
const tableItems = Object.entries(columnGroups).map(([key, group]) => ({
|
|
49
51
|
key,
|
|
50
52
|
label: group.label,
|
|
@@ -64,27 +66,24 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
|
|
|
64
66
|
gap: 8,
|
|
65
67
|
marginBottom: react_components_1.tokens.spacingVerticalXS,
|
|
66
68
|
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:
|
|
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) => {
|
|
68
70
|
setSelectedGroup(data.optionValue);
|
|
69
71
|
}, style: { flex: 1, minWidth: 'unset' }, positioning: {
|
|
70
72
|
align: 'bottom',
|
|
71
73
|
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) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
}, 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: {
|
|
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: {
|
|
88
87
|
display: 'flex',
|
|
89
88
|
padding: 8,
|
|
90
89
|
gap: 8,
|
|
@@ -5,14 +5,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const icons_1 = require("@headless-adminapp/icons");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
8
|
+
const DndProvider_1 = require("../../components/DndProvider");
|
|
9
9
|
exports.ItemTypes = {
|
|
10
10
|
CARD: 'column',
|
|
11
11
|
};
|
|
12
12
|
const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSet = {}, // defaultCustomizeColumnStrings,
|
|
13
13
|
}) => {
|
|
14
|
+
const { useDrag, useDrop } = (0, DndProvider_1.useDndContext)();
|
|
14
15
|
const ref = (0, react_1.useRef)(null);
|
|
15
|
-
const [{ handlerId }, drop] =
|
|
16
|
+
const [{ handlerId }, drop] = useDrop({
|
|
16
17
|
accept: exports.ItemTypes.CARD,
|
|
17
18
|
collect(monitor) {
|
|
18
19
|
return {
|
|
@@ -20,7 +21,6 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
|
|
|
20
21
|
};
|
|
21
22
|
},
|
|
22
23
|
hover(item, monitor) {
|
|
23
|
-
var _a;
|
|
24
24
|
if (!ref.current) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -31,7 +31,7 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
// Determine rectangle on screen
|
|
34
|
-
const hoverBoundingRect =
|
|
34
|
+
const hoverBoundingRect = ref.current?.getBoundingClientRect();
|
|
35
35
|
// Get vertical middle
|
|
36
36
|
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
37
37
|
// Determine mouse position
|
|
@@ -58,7 +58,7 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
|
|
|
58
58
|
item.index = hoverIndex;
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
|
-
const [{ isDragging }, drag] =
|
|
61
|
+
const [{ isDragging }, drag] = useDrag({
|
|
62
62
|
type: exports.ItemTypes.CARD,
|
|
63
63
|
item: () => {
|
|
64
64
|
return { id: item.id, index };
|
|
@@ -12,8 +12,7 @@ const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
|
12
12
|
const icons_1 = require("@headless-adminapp/icons");
|
|
13
13
|
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
14
14
|
const react_1 = require("react");
|
|
15
|
-
const
|
|
16
|
-
const react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
|
15
|
+
const DndProvider_1 = require("../../components/DndProvider");
|
|
17
16
|
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
18
17
|
const AddColumns_1 = require("./AddColumns");
|
|
19
18
|
const ColumnItem_1 = require("./ColumnItem");
|
|
@@ -55,7 +54,7 @@ function CustomizeColumns({ onClose, opened }) {
|
|
|
55
54
|
minWidth: 'unset',
|
|
56
55
|
}, onClick: () => setShowAddColumns(true), children: strings.add }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Edit, {}), style: { fontWeight: react_components_1.tokens.fontSizeBase400, minWidth: 'unset' }, disabled: !isDirty, onClick: () => {
|
|
57
56
|
setItems(columns);
|
|
58
|
-
}, children: strings.reset })] }), (0, jsx_runtime_1.jsx)(AddColumns_1.AddColumns, { onColumnAdd: onColumnAdd, onColumnRemove: onColumnRemove, columns: items, opened: showAddColumns, onClose: () => setShowAddColumns(false) }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, {})] }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { paddingInline: react_components_1.tokens.spacingHorizontalS }, children: (0, jsx_runtime_1.jsx)(
|
|
57
|
+
}, children: strings.reset })] }), (0, jsx_runtime_1.jsx)(AddColumns_1.AddColumns, { onColumnAdd: onColumnAdd, onColumnRemove: onColumnRemove, columns: items, opened: showAddColumns, onClose: () => setShowAddColumns(false) }), (0, jsx_runtime_1.jsx)(react_components_1.Divider, {})] }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { paddingInline: react_components_1.tokens.spacingHorizontalS }, children: (0, jsx_runtime_1.jsx)(DndProvider_1.DndProvider, { children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
59
58
|
display: 'flex',
|
|
60
59
|
flexDirection: 'column',
|
|
61
60
|
width: '100%',
|
|
@@ -9,7 +9,6 @@ const locale_1 = require("@headless-adminapp/app/locale");
|
|
|
9
9
|
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
10
10
|
const icons_1 = require("@headless-adminapp/icons");
|
|
11
11
|
const FormSubgridViewSelector = () => {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
const viewLookup = (0, hooks_1.useGridViewLookupData)();
|
|
14
13
|
const selectedView = (0, hooks_1.useSelectedView)();
|
|
15
14
|
const changeView = (0, hooks_1.useChangeView)();
|
|
@@ -33,9 +32,6 @@ const FormSubgridViewSelector = () => {
|
|
|
33
32
|
paddingInline: 8,
|
|
34
33
|
paddingBlock: 4,
|
|
35
34
|
pointerEvents: allowViewSelection ? 'auto' : 'none',
|
|
36
|
-
}, children:
|
|
37
|
-
var _a, _b;
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => changeView(view.id), children: (_b = (_a = view.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : view.name }, view.id));
|
|
39
|
-
}) }) })] }) }) }));
|
|
35
|
+
}, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: viewLookup.map((view) => ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => changeView(view.id), children: view.localizedNames?.[language] ?? view.name }, view.id))) }) })] }) }) }));
|
|
40
36
|
};
|
|
41
37
|
exports.FormSubgridViewSelector = FormSubgridViewSelector;
|
|
@@ -9,28 +9,27 @@ const hooks_1 = require("@headless-adminapp/app/metadata/hooks");
|
|
|
9
9
|
const transport_1 = require("@headless-adminapp/app/transport");
|
|
10
10
|
const FormControl_1 = __importDefault(require("../../form/FormControl"));
|
|
11
11
|
function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
12
|
-
var _a, _b, _c, _d;
|
|
13
12
|
const dataService = (0, transport_1.useDataService)();
|
|
14
13
|
const { schemaStore, experienceStore } = (0, hooks_1.useMetadata)();
|
|
15
14
|
switch (type) {
|
|
16
15
|
case 'string':
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "text", value: value
|
|
18
|
-
onChange
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "text", value: value ?? null, onChange: (value) => {
|
|
17
|
+
onChange?.(value);
|
|
19
18
|
} }));
|
|
20
19
|
case 'number':
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "number", value: value
|
|
22
|
-
onChange
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "number", value: value ?? null, onChange: (value) => {
|
|
21
|
+
onChange?.(value);
|
|
23
22
|
} }));
|
|
24
23
|
case 'money':
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "currency", value: value
|
|
26
|
-
onChange
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "currency", value: value ?? null, onChange: (value) => {
|
|
25
|
+
onChange?.(value);
|
|
27
26
|
} }));
|
|
28
27
|
case 'lookup':
|
|
29
28
|
if (attribute.type !== 'lookup') {
|
|
30
29
|
return null;
|
|
31
30
|
}
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "lookups", async: true, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, value: value
|
|
33
|
-
onChange
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "lookups", async: true, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, value: value ?? null, onChange: (value) => {
|
|
32
|
+
onChange?.(value ?? []);
|
|
34
33
|
} }));
|
|
35
34
|
// return (
|
|
36
35
|
// <FormControl
|
|
@@ -46,8 +45,8 @@ function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
|
46
45
|
// />
|
|
47
46
|
// );
|
|
48
47
|
case 'date':
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "date", value: value
|
|
50
|
-
onChange
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "date", value: value ?? null, onChange: (value) => {
|
|
49
|
+
onChange?.(value);
|
|
51
50
|
} }));
|
|
52
51
|
case 'boolean':
|
|
53
52
|
if (attribute.type !== 'boolean') {
|
|
@@ -55,16 +54,15 @@ function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
|
55
54
|
}
|
|
56
55
|
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "multi-select", options: [
|
|
57
56
|
{
|
|
58
|
-
label:
|
|
57
|
+
label: attribute.trueLabel ?? 'Yes',
|
|
59
58
|
value: 'true',
|
|
60
59
|
},
|
|
61
60
|
{
|
|
62
|
-
label:
|
|
61
|
+
label: attribute.falseLabel ?? 'No',
|
|
63
62
|
value: 'false',
|
|
64
63
|
},
|
|
65
|
-
], value:
|
|
66
|
-
|
|
67
|
-
onChange === null || onChange === void 0 ? void 0 : onChange((_a = value === null || value === void 0 ? void 0 : value.map((x) => x === 'true')) !== null && _a !== void 0 ? _a : []);
|
|
64
|
+
], value: value?.map((x) => (x === true ? 'true' : 'false')) ?? [], onChange: (value) => {
|
|
65
|
+
onChange?.(value?.map((x) => x === 'true') ?? []);
|
|
68
66
|
} }));
|
|
69
67
|
case 'choice':
|
|
70
68
|
case 'choices':
|
|
@@ -73,15 +71,11 @@ function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
|
73
71
|
}
|
|
74
72
|
const isNumeric = 'number' in attribute && attribute.number === true;
|
|
75
73
|
// const isString = 'string' in attribute && attribute.string === true;
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "multi-select", options: attribute.options.map((x) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
}), value: (_d = value === null || value === void 0 ? void 0 : value.map((x) => (isNumeric ? x.toString() : x))) !== null && _d !== void 0 ? _d : [], onChange: (value) => {
|
|
83
|
-
var _a;
|
|
84
|
-
onChange === null || onChange === void 0 ? void 0 : onChange((_a = value === null || value === void 0 ? void 0 : value.map((x) => (isNumeric ? +x : x))) !== null && _a !== void 0 ? _a : []);
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)(FormControl_1.default, { type: "multi-select", options: attribute.options.map((x) => ({
|
|
75
|
+
label: x.label,
|
|
76
|
+
value: isNumeric ? x.value?.toString() : x.value,
|
|
77
|
+
})), value: value?.map((x) => (isNumeric ? x.toString() : x)) ?? [], onChange: (value) => {
|
|
78
|
+
onChange?.(value?.map((x) => (isNumeric ? +x : x)) ?? []);
|
|
85
79
|
} }));
|
|
86
80
|
default:
|
|
87
81
|
return null;
|
|
@@ -11,7 +11,7 @@ const ConditionValueControl_1 = require("./ConditionValueControl");
|
|
|
11
11
|
const OperatorSelect_1 = require("./OperatorSelect");
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const FilterForm = ({ defaultValue, attribute, onApply, onCancel, }) => {
|
|
14
|
-
const [operator, setOperator] = (0, react_1.useState)((0, utils_1.getDefaultOperator)(defaultValue
|
|
14
|
+
const [operator, setOperator] = (0, react_1.useState)((0, utils_1.getDefaultOperator)(defaultValue?.operator, attribute.type));
|
|
15
15
|
const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
|
|
16
16
|
const { operatorStrings } = (0, AppStringContext_1.useAppStrings)();
|
|
17
17
|
const operatorOptions = (0, react_1.useMemo)(() => {
|
|
@@ -20,7 +20,7 @@ const FilterForm = ({ defaultValue, attribute, onApply, onCancel, }) => {
|
|
|
20
20
|
const selectedOption = (0, react_1.useMemo)(() => {
|
|
21
21
|
return operatorOptions[attribute.type].find((option) => option.value === operator);
|
|
22
22
|
}, [operator, attribute.type, operatorOptions]);
|
|
23
|
-
const [values, setValues] = (0, react_1.useState)((0, utils_1.getDefaultValues)(selectedOption, defaultValue
|
|
23
|
+
const [values, setValues] = (0, react_1.useState)((0, utils_1.getDefaultValues)(selectedOption, defaultValue?.value, attribute.type));
|
|
24
24
|
const handleChangeOperator = (operator) => {
|
|
25
25
|
setOperator(operator);
|
|
26
26
|
setValues([]);
|
|
@@ -42,13 +42,10 @@ const FilterForm = ({ defaultValue, attribute, onApply, onCancel, }) => {
|
|
|
42
42
|
display: 'flex',
|
|
43
43
|
flexDirection: 'column',
|
|
44
44
|
gap: react_components_1.tokens.spacingVerticalS,
|
|
45
|
-
}, children: [(0, jsx_runtime_1.jsx)(OperatorSelect_1.OperatorSelect, { attribute: attribute, onChange: (value) => handleChangeOperator(value), value: operator }), selectedOption
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} }, x + String(i)));
|
|
50
|
-
})] }) }), (0, jsx_runtime_1.jsxs)(react_components_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(react_components_1.DialogTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "secondary", onClick: onCancel, children: strings.cancel }) }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { type: "submit", appearance: "primary", disabled: !isValid, onClick: () => {
|
|
51
|
-
onApply === null || onApply === void 0 ? void 0 : onApply({
|
|
45
|
+
}, children: [(0, jsx_runtime_1.jsx)(OperatorSelect_1.OperatorSelect, { attribute: attribute, onChange: (value) => handleChangeOperator(value), value: operator }), selectedOption?.controls.map((x, i) => ((0, jsx_runtime_1.jsx)(ConditionValueControl_1.ConditionValueControl, { type: x, attribute: attribute, value: values[i] ?? null, onChange: (value) => {
|
|
46
|
+
handleChangeValue(value, i);
|
|
47
|
+
} }, x + String(i))))] }) }), (0, jsx_runtime_1.jsxs)(react_components_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(react_components_1.DialogTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "secondary", onClick: onCancel, children: strings.cancel }) }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { type: "submit", appearance: "primary", disabled: !isValid, onClick: () => {
|
|
48
|
+
onApply?.({
|
|
52
49
|
operator,
|
|
53
50
|
value: values,
|
|
54
51
|
});
|
|
@@ -24,5 +24,5 @@ function OperatorSelect({ attribute, value, onChange, }) {
|
|
|
24
24
|
}
|
|
25
25
|
return operators;
|
|
26
26
|
}, [attribute.type, operatorOptions, dataService]);
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(SelectControl_1.default, { options: options, onChange: (value) => onChange
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(SelectControl_1.default, { options: options, onChange: (value) => onChange?.(value), value: value }));
|
|
28
28
|
}
|
|
@@ -90,7 +90,7 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
90
90
|
const onChangeFilterCondition = (condition) => {
|
|
91
91
|
setColumnFilters(column.id, condition);
|
|
92
92
|
};
|
|
93
|
-
const sortMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowUp, { size: 16 }), onClick: () => onChangeSortDirection
|
|
93
|
+
const sortMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowUp, { size: 16 }), onClick: () => onChangeSortDirection?.('asc'), children: strings.sortByAscending }), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowDown, { size: 16 }), onClick: () => onChangeSortDirection?.('desc'), children: strings.sortByDescending })] }));
|
|
94
94
|
const filterMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Filter, { size: 16 }), onClick: () => setVisible(!visible), children: strings.filter }), !!filterCondition && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.FilterDismiss, { size: 16 }), onClick: () => {
|
|
95
95
|
onChangeFilterCondition(undefined);
|
|
96
96
|
}, children: strings.clearFilter }))] }));
|
|
@@ -118,18 +118,18 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
118
118
|
}, onDoubleClick: (event) => {
|
|
119
119
|
event.stopPropagation();
|
|
120
120
|
event.preventDefault();
|
|
121
|
-
onResetSize
|
|
121
|
+
onResetSize?.();
|
|
122
122
|
}, onMouseDown: (event) => {
|
|
123
123
|
event.stopPropagation();
|
|
124
124
|
event.preventDefault();
|
|
125
|
-
resizeHandler
|
|
125
|
+
resizeHandler?.(event);
|
|
126
126
|
}, onMouseUp: (event) => {
|
|
127
127
|
event.stopPropagation();
|
|
128
128
|
event.preventDefault();
|
|
129
129
|
}, onTouchStart: (event) => {
|
|
130
130
|
event.stopPropagation();
|
|
131
131
|
event.preventDefault();
|
|
132
|
-
resizeHandler
|
|
132
|
+
resizeHandler?.(event);
|
|
133
133
|
}, children: (0, jsx_runtime_1.jsx)("div", { className: (0, react_components_1.mergeClasses)(styles.resizeHandleInner) }) })) : null, onMouseUp: (event) => {
|
|
134
134
|
event.preventDefault();
|
|
135
135
|
if (isResizingRef.current) {
|
|
@@ -11,7 +11,6 @@ const AppStringContext_1 = require("../App/AppStringContext");
|
|
|
11
11
|
const PageEntityViewStringContext_1 = require("../PageEntityView/PageEntityViewStringContext");
|
|
12
12
|
const CustomizeColumns_1 = require("./CustomizeColumns");
|
|
13
13
|
const GridHeaderDesktop = (props) => {
|
|
14
|
-
var _a, _b;
|
|
15
14
|
const viewLookup = (0, hooks_1.useGridViewLookupData)();
|
|
16
15
|
const selectedView = (0, hooks_1.useSelectedView)();
|
|
17
16
|
const changeView = (0, hooks_1.useChangeView)();
|
|
@@ -34,9 +33,6 @@ const GridHeaderDesktop = (props) => {
|
|
|
34
33
|
}, children: (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ChevronDown, {}), iconPosition: "after", style: {
|
|
35
34
|
fontSize: react_components_1.tokens.fontSizeBase400,
|
|
36
35
|
fontWeight: react_components_1.tokens.fontWeightMedium,
|
|
37
|
-
}, children:
|
|
38
|
-
var _a, _b;
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => changeView(view.id), children: (_b = (_a = view.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : view.name }, view.id));
|
|
40
|
-
}) }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { style: { alignItems: 'center', display: 'flex', gap: 16 }, children: [props.headingRight, (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.EditColumns, { size: 24 }), onClick: () => setIsColumnCustomizationOpen(true), children: strings.editColumns }), (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), appearance: "filled-darker" })] })] }));
|
|
36
|
+
}, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: viewLookup.map((view) => ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => changeView(view.id), children: view.localizedNames?.[language] ?? view.name }, view.id))) }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { style: { alignItems: 'center', display: 'flex', gap: 16 }, children: [props.headingRight, (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.EditColumns, { size: 24 }), onClick: () => setIsColumnCustomizationOpen(true), children: strings.editColumns }), (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), appearance: "filled-darker" })] })] }));
|
|
41
37
|
};
|
|
42
38
|
exports.GridHeaderDesktop = GridHeaderDesktop;
|