@headless-adminapp/fluent 1.4.25 → 1.4.27
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 +33 -16
- package/App/LayoutProvider.d.ts +2 -1
- package/App/LayoutProvider.js +3 -2
- package/App/Navigation/NavCategoryItemComponent.js +4 -1
- package/App/Navigation/NavItemComponent.js +4 -1
- package/App/Navigation/NavMiniCategoryMenu.js +3 -2
- package/App/QuickActionItem.js +5 -4
- package/CommandBar/Button.js +2 -3
- package/CommandBar/IconButton.js +2 -1
- package/CommandBar/Label.js +2 -2
- package/CommandBar/MenuButton.js +5 -2
- package/CommandBar/MenuItem.js +3 -2
- package/CommandBar/MenuList.js +2 -1
- package/CommandBar/Wrapper.js +1 -0
- package/DataGrid/CustomFilter/ColumnFilterItem.js +4 -2
- package/DataGrid/CustomFilter/CustomFilter.js +2 -1
- package/DataGrid/CustomizeColumns/AddColumns.js +5 -5
- package/DataGrid/CustomizeColumns/ColumnItem.js +4 -3
- package/DataGrid/CustomizeColumns/CustomizeColumns.js +4 -3
- package/DataGrid/FormSubgridViewSelector.js +3 -2
- package/DataGrid/GridColumnHeader/FilterForm.js +2 -1
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +4 -3
- package/DataGrid/GridHeaderDesktop.js +3 -2
- package/DataGrid/GridHeaderDesktopV2.js +8 -7
- package/DataGrid/GridHeaderMobile.js +3 -2
- package/DataGrid/GridListContainer.js +6 -5
- package/DataGrid/MobileHeaderTitleContainer.js +3 -2
- package/DataGrid/TableCell/TableCellAction.js +3 -2
- package/DataGrid/TableCell/TableCellCheckbox.js +2 -1
- package/DataGrid/useTableColumns.js +10 -1
- package/DialogContainer/AlertDialog.js +2 -1
- package/DialogContainer/ConfirmDialog.js +3 -2
- package/DialogContainer/ErrorDialog.js +3 -2
- package/DialogContainer/PromptDialog.js +4 -3
- package/Header/MobileHeaderCommandContainer.js +11 -10
- package/Header/MobileHeaderQuickActionButton.js +2 -2
- package/Insights/Header.js +7 -2
- package/Insights/InsightsContainer.js +22 -20
- package/Insights/WidgetDataGridContainer.js +8 -5
- package/Insights/WidgetSection.js +2 -1
- package/Insights/WidgetTileContainer.js +2 -1
- package/OverflowCommandBar/OverflowMenu.js +2 -1
- package/PageBoard/BoardColumnCard.js +2 -1
- package/PageBoard/BoardColumnUI.js +3 -2
- package/PageBoard/BoardingColumnCardLoading.js +2 -1
- package/PageBoard/Header.js +2 -1
- package/PageBoard/PageBoard.js +2 -1
- package/PageCalendar/CalendarSection.js +3 -2
- package/PageCalendar/EventDialog/EventDialog.js +2 -1
- package/PageCalendar/EventDialog/EventFormBody.js +3 -2
- package/PageCalendar/Header.js +4 -2
- package/PageCalendar/TitleSelector.js +3 -2
- package/PageCalendar/ViewSelector.js +2 -1
- package/PageCalendar/renderEventContent.js +5 -4
- package/PageEntityForm/EditableGridControl/CardUi.js +4 -4
- package/PageEntityForm/EditableGridControl/EditableGridControl.js +2 -1
- package/PageEntityForm/EditableGridControl/TableUi.js +3 -2
- package/PageEntityForm/FormTabRelated.js +2 -1
- package/PageEntityForm/PageCustomEntityForm.js +2 -0
- package/PageEntityForm/PageEntityFormDesktopContainer.js +8 -4
- package/PageEntityForm/RecordSetNavigatorContainer.js +2 -1
- package/PageEntityForm/RelatedViewSelector.js +2 -2
- package/PageEntityForm/TabContainer.js +5 -1
- package/PageEntityForm/UploadImageDialog.js +6 -5
- package/PageEntityView/FormSubgridContainer.js +3 -2
- package/PageEntityView/PageEntityViewDesktopFrame.js +3 -2
- package/PageEntityView/PageEntityViewDesktopFrameV2.js +2 -1
- package/PageEntityView/PageEntityViewMobileFrame.js +2 -1
- package/ProgressIndicatorContainer/index.js +2 -1
- package/QuickCreateContainer/FormContainer.js +2 -1
- package/components/ComponentErrorBoundary.d.ts +1 -1
- package/components/DialogLogin.js +2 -1
- package/components/DrawerHeader.js +3 -2
- package/components/LoginForm.js +2 -1
- package/components/PageBroken.js +2 -1
- package/components/PageLogin.js +2 -1
- package/components/fluent/Button.d.ts +4 -0
- package/components/fluent/Button.js +38 -0
- package/components/fluent/Checkbox.d.ts +4 -0
- package/components/fluent/Checkbox.js +18 -0
- package/components/fluent/Combobox.d.ts +4 -0
- package/components/fluent/Combobox.js +22 -0
- package/components/fluent/DialogSurface.d.ts +4 -0
- package/components/fluent/DialogSurface.js +16 -0
- package/components/fluent/Dropdown.d.ts +4 -0
- package/components/fluent/Dropdown.js +41 -0
- package/components/fluent/FluentProvider.d.ts +12 -0
- package/components/fluent/FluentProvider.js +179 -0
- package/components/fluent/Input.d.ts +4 -0
- package/components/fluent/Input.js +44 -0
- package/components/fluent/MenuItem.d.ts +4 -0
- package/components/fluent/MenuItem.js +17 -0
- package/components/fluent/MenuPopover.d.ts +4 -0
- package/components/fluent/MenuPopover.js +17 -0
- package/components/fluent/Option.d.ts +4 -0
- package/components/fluent/Option.js +17 -0
- package/components/fluent/PopoverSurface.d.ts +4 -0
- package/components/fluent/PopoverSurface.js +16 -0
- package/components/fluent/SearchBox.d.ts +4 -0
- package/components/fluent/SearchBox.js +42 -0
- package/components/fluent/SpinButton.d.ts +4 -0
- package/components/fluent/SpinButton.js +17 -0
- package/components/fluent/Tag.d.ts +4 -0
- package/components/fluent/Tag.js +16 -0
- package/components/fluent/Textarea.d.ts +4 -0
- package/components/fluent/Textarea.js +30 -0
- package/components/fluent/ToolbarButton.d.ts +6 -0
- package/components/fluent/ToolbarButton.js +22 -0
- package/components/fluent/index.d.ts +17 -0
- package/components/fluent/index.js +38 -0
- package/components/fluent/tokens.d.ts +29 -0
- package/components/fluent/tokens.js +32 -0
- package/form/controls/AttachmentControl.js +9 -8
- package/form/controls/AttachmentsControl.js +6 -2
- package/form/controls/CurrencyControl.js +2 -2
- package/form/controls/DateControl.js +7 -0
- package/form/controls/DateRangeControl/DateRangeControl.js +3 -2
- package/form/controls/DateRangeControl/PopoverContent.js +3 -2
- package/form/controls/DateTimeControl.js +17 -2
- package/form/controls/DecimalControl.js +2 -2
- package/form/controls/DurationControl.js +8 -2
- package/form/controls/EmailControl.js +3 -2
- package/form/controls/IntegerControl.js +2 -2
- package/form/controls/LookupControl.js +10 -4
- package/form/controls/MultiSelectControl.js +11 -2
- package/form/controls/MultiSelectLookupControl.js +12 -5
- package/form/controls/PasswordControl.js +6 -2
- package/form/controls/RegardingControl.js +7 -5
- package/form/controls/SelectControl.js +12 -2
- package/form/controls/SkeletonControl.js +6 -1
- package/form/controls/TelephoneControl.js +3 -2
- package/form/controls/TextAreaControl.js +2 -2
- package/form/controls/TextControl.js +6 -5
- package/form/controls/TimeControl/TimeControl.js +8 -1
- package/form/controls/UrlControl.js +3 -2
- package/form/layout/FormSection/FormSection.js +2 -2
- package/package.json +2 -2
- package/styles.css +1 -5
|
@@ -14,6 +14,8 @@ const route_1 = require("@headless-adminapp/app/route");
|
|
|
14
14
|
const color_1 = require("@headless-adminapp/app/utils/color");
|
|
15
15
|
const icons_1 = require("@headless-adminapp/icons");
|
|
16
16
|
const react_1 = require("react");
|
|
17
|
+
const fluent_1 = require("../components/fluent");
|
|
18
|
+
const FluentProvider_1 = require("../components/fluent/FluentProvider");
|
|
17
19
|
const AppLogo_1 = require("./AppLogo");
|
|
18
20
|
const AppStringContext_1 = require("./AppStringContext");
|
|
19
21
|
const QuickActionItem_1 = require("./QuickActionItem");
|
|
@@ -36,10 +38,20 @@ const NavHamburger = ({ onNavToggle }) => {
|
|
|
36
38
|
const NavBackButton = () => {
|
|
37
39
|
const isMobile = (0, hooks_2.useIsMobile)();
|
|
38
40
|
const router = (0, route_1.useRouter)();
|
|
41
|
+
const { density } = (0, FluentProvider_1.useExtendedThemeContext)();
|
|
42
|
+
let size = undefined;
|
|
43
|
+
if (isMobile) {
|
|
44
|
+
size = 44;
|
|
45
|
+
}
|
|
46
|
+
if (density === 'comfortable') {
|
|
47
|
+
size = 48;
|
|
48
|
+
}
|
|
39
49
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Hamburger, { style: {
|
|
40
50
|
color: 'inherit',
|
|
41
|
-
width:
|
|
42
|
-
maxWidth:
|
|
51
|
+
width: size,
|
|
52
|
+
maxWidth: size,
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
height: size,
|
|
43
55
|
}, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowLeft, {}), onClick: async () => {
|
|
44
56
|
await router.back();
|
|
45
57
|
} }));
|
|
@@ -84,7 +96,7 @@ const NavActions = () => {
|
|
|
84
96
|
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));
|
|
85
97
|
}) }), (!isSkipAuthCheck || !!accountMenuItems?.length) && ((0, jsx_runtime_1.jsxs)(react_components_1.Popover, { open: accountMenuOpen, onOpenChange: (e, data) => setAccountMenuOpen(data.open), 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: {
|
|
86
98
|
src: authSession?.profilePicture,
|
|
87
|
-
} }) }), (0, jsx_runtime_1.jsxs)(
|
|
99
|
+
} }) }), (0, jsx_runtime_1.jsxs)(fluent_1.PopoverSurface, { tabIndex: -1, style: { padding: 0 }, children: [!isSkipAuthCheck && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
88
100
|
display: 'flex',
|
|
89
101
|
gap: 8,
|
|
90
102
|
padding: 8,
|
|
@@ -99,7 +111,7 @@ const NavActions = () => {
|
|
|
99
111
|
flex: 1,
|
|
100
112
|
}, 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) => {
|
|
101
113
|
const Icon = item.icon;
|
|
102
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
114
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), onClick: async () => {
|
|
103
115
|
setAccountMenuOpen(false);
|
|
104
116
|
if (item.onClick) {
|
|
105
117
|
item.onClick();
|
|
@@ -108,7 +120,7 @@ const NavActions = () => {
|
|
|
108
120
|
await router.push(basePath + item.link);
|
|
109
121
|
}
|
|
110
122
|
}, children: item.localizedLabel?.[language] ?? item.label }, item.__key));
|
|
111
|
-
}), !isSkipAuthCheck && ((0, jsx_runtime_1.jsx)(
|
|
123
|
+
}), !isSkipAuthCheck && ((0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.SignOut, {}), onClick: () => logout(), children: strings.logout }))] })] })] }))] }));
|
|
112
124
|
};
|
|
113
125
|
const AppDesktopHeader = ({ onNavToggle }) => {
|
|
114
126
|
const isTablet = (0, hooks_2.useIsTablet)();
|
|
@@ -120,16 +132,21 @@ const AppDesktopHeader = ({ onNavToggle }) => {
|
|
|
120
132
|
}
|
|
121
133
|
return (0, color_1.isColorDark)(background) ? '#FFFFFF' : '#000000';
|
|
122
134
|
}, [background]);
|
|
123
|
-
return ((0, jsx_runtime_1.
|
|
124
|
-
display: 'flex',
|
|
125
|
-
alignItems: 'center',
|
|
126
|
-
height: 50,
|
|
127
|
-
minHeight: 50,
|
|
135
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
128
136
|
background,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, children:
|
|
137
|
+
paddingLeft: 'env(safe-area-inset-left)',
|
|
138
|
+
paddingRight: 'env(safe-area-inset-right)',
|
|
139
|
+
paddingTop: 'env(safe-area-inset-top)',
|
|
140
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
141
|
+
display: 'flex',
|
|
142
|
+
alignItems: 'center',
|
|
143
|
+
height: fluent_1.extendedTokens.appBarHeight,
|
|
144
|
+
minHeight: fluent_1.extendedTokens.appBarHeight,
|
|
145
|
+
background,
|
|
146
|
+
paddingInline: 8,
|
|
147
|
+
gap: 8,
|
|
148
|
+
color,
|
|
149
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flex: 1, alignItems: 'center', gap: 8 }, children: [isTablet && (0, jsx_runtime_1.jsx)(NavHamburger, { onNavToggle: onNavToggle }), (0, jsx_runtime_1.jsx)(NavTitle, {})] }), (0, jsx_runtime_1.jsx)(NavActions, {})] }) }));
|
|
133
150
|
};
|
|
134
151
|
const AppMobileHeader = ({ onNavToggle }) => {
|
|
135
152
|
const showCustomHeader = (0, mutable_1.useContextSelector)(header_1.HeaderContext, (state) => state.showBackButton.length > 0);
|
|
@@ -147,8 +164,8 @@ const AppMobileHeader = ({ onNavToggle }) => {
|
|
|
147
164
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
148
165
|
display: 'flex',
|
|
149
166
|
alignItems: 'center',
|
|
150
|
-
height:
|
|
151
|
-
minHeight:
|
|
167
|
+
height: fluent_1.extendedTokens.appBarHeight,
|
|
168
|
+
minHeight: fluent_1.extendedTokens.appBarHeight,
|
|
152
169
|
background,
|
|
153
170
|
paddingInline: 8,
|
|
154
171
|
gap: 8,
|
package/App/LayoutProvider.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PartialTheme } from '@fluentui/react-components';
|
|
2
2
|
import { LayoutProviderProps as LayoutProviderIntenralProps } from '@headless-adminapp/app/app/LayoutProvider';
|
|
3
3
|
import { FC, PropsWithChildren } from 'react';
|
|
4
|
+
import { ExtendedThemeProps } from '../components/fluent/FluentProvider';
|
|
4
5
|
export type LayoutProviderProps = Omit<LayoutProviderIntenralProps, 'containers'> & {
|
|
5
6
|
theme?: PartialTheme;
|
|
6
|
-
}
|
|
7
|
+
} & Partial<ExtendedThemeProps>;
|
|
7
8
|
export declare const LayoutProvider: FC<PropsWithChildren<LayoutProviderProps>>;
|
package/App/LayoutProvider.js
CHANGED
|
@@ -4,12 +4,13 @@ exports.LayoutProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const LayoutProvider_1 = require("@headless-adminapp/app/app/LayoutProvider");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const DialogContainer_1 = require("../DialogContainer");
|
|
8
9
|
const ProgressIndicatorContainer_1 = require("../ProgressIndicatorContainer");
|
|
9
10
|
const QuickCreateContainer_1 = require("../QuickCreateContainer");
|
|
10
11
|
const ToastNotificationContainer_1 = require("../ToastNotificationContainer");
|
|
11
|
-
const LayoutProvider = ({ children, theme, ...rest }) => {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
12
|
+
const LayoutProvider = ({ children, theme, corners, density, ...rest }) => {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.FluentProvider, { theme: theme ?? react_components_1.webLightTheme, corners: corners, density: density, children: (0, jsx_runtime_1.jsxs)(LayoutProvider_1.LayoutProvider, { ...rest, containers: {
|
|
13
14
|
DialogContainer: DialogContainer_1.DialogContainer,
|
|
14
15
|
ProgressIndicatorContainer: ProgressIndicatorContainer_1.ProgressIndicatorContainer,
|
|
15
16
|
ToastNotificationContainer: ToastNotificationContainer_1.ToastNotificationContainer,
|
|
@@ -4,6 +4,7 @@ exports.NavCategoryItemComponent = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const icons_1 = require("@headless-adminapp/icons");
|
|
7
|
+
const fluent_1 = require("../../components/fluent");
|
|
7
8
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
8
9
|
activeNavCategoryItem: {
|
|
9
10
|
'&[aria-expanded="false"]': {
|
|
@@ -14,6 +15,8 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
14
15
|
const NavCategoryItemComponent = ({ item, isActive, }) => {
|
|
15
16
|
const styles = useStyles();
|
|
16
17
|
const Icon = item.Icon ?? icons_1.IconPlaceholder;
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.NavCategoryItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { filled: isActive, color: isActive ? 'var(--colorNeutralForeground2BrandSelected)' : undefined }), className: isActive ? styles.activeNavCategoryItem : undefined,
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.NavCategoryItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { filled: isActive, color: isActive ? 'var(--colorNeutralForeground2BrandSelected)' : undefined, size: "1.4em" }), className: isActive ? styles.activeNavCategoryItem : undefined, style: {
|
|
19
|
+
paddingBlock: fluent_1.extendedTokens.navItempaddingVertical,
|
|
20
|
+
}, children: item.label }));
|
|
18
21
|
};
|
|
19
22
|
exports.NavCategoryItemComponent = NavCategoryItemComponent;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NavItemComponent = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const fluent_1 = require("../../components/fluent");
|
|
6
7
|
const usePrefetch_1 = require("./usePrefetch");
|
|
7
8
|
const NavItemComponent = ({ item, onClick, isMini, }) => {
|
|
8
9
|
(0, usePrefetch_1.usePrefetch)(item);
|
|
@@ -13,7 +14,9 @@ const NavItemComponent = ({ item, onClick, isMini, }) => {
|
|
|
13
14
|
backgroundColor: item.active
|
|
14
15
|
? react_components_1.tokens.colorNeutralBackground4Hover
|
|
15
16
|
: undefined,
|
|
16
|
-
|
|
17
|
+
borderRadius: fluent_1.extendedTokens.paperBorderRadius,
|
|
18
|
+
paddingBlock: fluent_1.extendedTokens.navItempaddingVertical,
|
|
19
|
+
}, icon: (0, jsx_runtime_1.jsx)(item.Icon, { size: "1.4em", filled: item.active, color: item.active
|
|
17
20
|
? 'var(--colorNeutralForeground2BrandSelected)'
|
|
18
21
|
: undefined }), value: item.active ? 'active' : '', children: !isMini && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [item.label, !!item.RightComponent && ((0, jsx_runtime_1.jsx)("span", { style: { flex: 1, justifyContent: 'flex-end', display: 'flex' }, children: (0, jsx_runtime_1.jsx)(item.RightComponent, {}) }))] })) }));
|
|
19
22
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NavMiniCategoryMenu = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const fluent_1 = require("../../components/fluent");
|
|
6
7
|
const NavItemComponent_1 = require("./NavItemComponent");
|
|
7
8
|
const usePrefetch_1 = require("./usePrefetch");
|
|
8
9
|
const NavMiniCategoryMenu = ({ item, isActive, onSelect, }) => {
|
|
@@ -15,10 +16,10 @@ const NavMiniCategoryMenu = ({ item, isActive, onSelect, }) => {
|
|
|
15
16
|
isExternal: false,
|
|
16
17
|
RightComponent: undefined,
|
|
17
18
|
type: 'item',
|
|
18
|
-
}, onClick: () => { }, isMini: true }, item.key) }) }), (0, jsx_runtime_1.jsx)(
|
|
19
|
+
}, onClick: () => { }, isMini: true }, item.key) }) }), (0, jsx_runtime_1.jsx)(fluent_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: item.items.map((subItem) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: subItem, onSelect: onSelect }, subItem.key))) }) })] }));
|
|
19
20
|
};
|
|
20
21
|
exports.NavMiniCategoryMenu = NavMiniCategoryMenu;
|
|
21
22
|
const NavMenuItem = ({ item, onSelect }) => {
|
|
22
23
|
(0, usePrefetch_1.usePrefetch)(item);
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(
|
|
24
|
+
return (0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { onClick: () => onSelect(item), children: item.label });
|
|
24
25
|
};
|
package/App/QuickActionItem.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.QuickActionItem = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const route_1 = require("@headless-adminapp/app/route");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
8
9
|
root: {
|
|
9
10
|
color: 'inherit !important',
|
|
@@ -28,14 +29,14 @@ const QuickActionItem = ({ label, Icon, onClick, link, badgeCount, badgeColor =
|
|
|
28
29
|
const router = (0, route_1.useRouter)();
|
|
29
30
|
const basePath = (0, route_1.useBasePath)();
|
|
30
31
|
const fullLink = link ? `${basePath}${link}` : undefined;
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Button, { icon: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Icon, { size: "inherit" }), !!badgeCount && ((0, jsx_runtime_1.jsx)(react_components_1.Badge, { style: { position: 'absolute', top: 0, right: 0 }, color: badgeColor, size: "small", children: badgeCount }))] }), appearance: "transparent", style: {
|
|
32
33
|
position: 'relative',
|
|
33
34
|
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
34
|
-
minWidth: 'unset',
|
|
35
|
-
}, as: "a", href: fullLink, title: label, "aria-label": label, className: styles.root, onClick: (event) => {
|
|
35
|
+
minWidth: type === 'button' ? 'unset' : undefined,
|
|
36
|
+
}, as: "a", href: fullLink, title: label, "aria-label": label, className: styles.root, onClick: async (event) => {
|
|
36
37
|
event.preventDefault();
|
|
37
38
|
if (fullLink) {
|
|
38
|
-
router.push(fullLink);
|
|
39
|
+
await router.push(fullLink);
|
|
39
40
|
}
|
|
40
41
|
else if (onClick) {
|
|
41
42
|
onClick();
|
package/CommandBar/Button.js
CHANGED
|
@@ -4,9 +4,9 @@ exports.CommandButton = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
8
9
|
root: {
|
|
9
|
-
fontWeight: 'normal',
|
|
10
10
|
minWidth: 'unset',
|
|
11
11
|
textWrap: 'nowrap',
|
|
12
12
|
flexShrink: 0,
|
|
@@ -48,9 +48,8 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
|
-
const ToolbarButtonInternal = react_components_1.ToolbarButton;
|
|
52
51
|
exports.CommandButton = (0, react_1.memo)((0, react_1.forwardRef)(function CommandButton({ Icon, text, danger, onClick, disabled, iconPosition = 'before', appearance, }, ref) {
|
|
53
52
|
const styles = useStyles();
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.ToolbarButton, { ref: ref, type: "button", icon: Icon ? (0, jsx_runtime_1.jsx)(Icon, { size: 20 }) : undefined, iconPosition: iconPosition, disabled: disabled, onClick: onClick, className: (0, react_components_1.mergeClasses)(styles.root, appearance === 'colored' && styles.colored, danger && styles.danger, appearance === 'colored' && danger && styles.dangerColored), children: text }));
|
|
55
54
|
}));
|
|
56
55
|
exports.CommandButton.displayName = 'CommandButton';
|
package/CommandBar/IconButton.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.CommandIconButton = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
8
9
|
root: {
|
|
9
10
|
flexShrink: 0,
|
|
@@ -27,6 +28,6 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
27
28
|
});
|
|
28
29
|
exports.CommandIconButton = (0, react_1.memo)((0, react_1.forwardRef)(function CommandIconButton({ Icon, disabled, onClick, danger }, ref) {
|
|
29
30
|
const styles = useStyles();
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.ToolbarButton, { ref: ref, icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), disabled: disabled, onClick: onClick, className: (0, react_components_1.mergeClasses)(styles.root, danger && styles.danger) }));
|
|
31
32
|
}));
|
|
32
33
|
exports.CommandIconButton.displayName = 'CommandIconButton';
|
package/CommandBar/Label.js
CHANGED
|
@@ -4,9 +4,9 @@ exports.CommandLabel = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
8
9
|
root: {
|
|
9
|
-
fontWeight: 'normal',
|
|
10
10
|
minWidth: 'unset',
|
|
11
11
|
textWrap: 'nowrap',
|
|
12
12
|
flexShrink: 0,
|
|
@@ -18,6 +18,6 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
18
18
|
});
|
|
19
19
|
exports.CommandLabel = (0, react_1.memo)((0, react_1.forwardRef)(function CommandLabel({ Icon, text }, ref) {
|
|
20
20
|
const styles = useStyles();
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(fluent_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 }));
|
|
22
22
|
}));
|
|
23
23
|
exports.CommandLabel.displayName = 'CommandLabel';
|
package/CommandBar/MenuButton.js
CHANGED
|
@@ -4,10 +4,12 @@ exports.CommandMenuButton = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
8
|
+
const MenuPopover_1 = require("../components/fluent/MenuPopover");
|
|
7
9
|
const MenuList_1 = require("./MenuList");
|
|
8
10
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
9
11
|
splitButton: {
|
|
10
|
-
borderRadius:
|
|
12
|
+
borderRadius: fluent_1.extendedTokens.buttonBorderRadius,
|
|
11
13
|
'& > button:first-child': {
|
|
12
14
|
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
13
15
|
paddingRight: 0,
|
|
@@ -23,6 +25,7 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
23
25
|
},
|
|
24
26
|
menuButton: {
|
|
25
27
|
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
28
|
+
borderRadius: fluent_1.extendedTokens.buttonBorderRadius,
|
|
26
29
|
},
|
|
27
30
|
splitButtonDanger: {
|
|
28
31
|
'&:hover:not(:has(:last-child:hover))': {
|
|
@@ -62,6 +65,6 @@ exports.CommandMenuButton = (0, react_1.memo)((0, react_1.forwardRef)(function C
|
|
|
62
65
|
const styles = useStyles();
|
|
63
66
|
return ((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, primaryActionButton: {
|
|
64
67
|
onClick,
|
|
65
|
-
}, 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)(
|
|
68
|
+
}, 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)(MenuPopover_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] }));
|
|
66
69
|
}));
|
|
67
70
|
exports.CommandMenuButton.displayName = 'CommandMenuButton';
|
package/CommandBar/MenuItem.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.MenuItem = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const MenuList_1 = require("./MenuList");
|
|
8
9
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
9
10
|
splitMenuRight: {
|
|
@@ -31,8 +32,8 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
31
32
|
exports.MenuItem = (0, react_1.memo)(({ Icon, text, disabled, danger, onClick, items }) => {
|
|
32
33
|
const styles = useStyles();
|
|
33
34
|
if (!items?.length) {
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(fluent_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
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)(
|
|
37
|
+
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)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), className: (0, react_components_1.mergeClasses)(danger && styles.danger), onClick: onClick, children: text }), (0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(fluent_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)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), children: text }) })), (0, jsx_runtime_1.jsx)(fluent_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] }));
|
|
37
38
|
});
|
|
38
39
|
exports.MenuItem.displayName = 'MenuItem';
|
package/CommandBar/MenuList.js
CHANGED
|
@@ -4,9 +4,10 @@ exports.MenuList = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../components/fluent");
|
|
7
8
|
const MenuItems_1 = require("./MenuItems");
|
|
8
9
|
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)(
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: !items?.length ? ((0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { style: {
|
|
10
11
|
color: react_components_1.tokens.colorNeutralForegroundDisabled,
|
|
11
12
|
fontStyle: 'italic',
|
|
12
13
|
}, children: "No items" })) : ((0, jsx_runtime_1.jsx)(MenuItems_1.MenuItems, { items: items })) }));
|
package/CommandBar/Wrapper.js
CHANGED
|
@@ -7,6 +7,8 @@ const datagrid_1 = require("@headless-adminapp/app/datagrid");
|
|
|
7
7
|
const icons_1 = require("@headless-adminapp/icons");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
10
|
+
const fluent_1 = require("../../components/fluent");
|
|
11
|
+
const Button_1 = require("../../components/fluent/Button");
|
|
10
12
|
const TextControl_1 = require("../../form/controls/TextControl");
|
|
11
13
|
const ConditionValueControl_1 = require("../GridColumnHeader/ConditionValueControl");
|
|
12
14
|
const OperatorSelect_1 = require("../GridColumnHeader/OperatorSelect");
|
|
@@ -38,9 +40,9 @@ const ColumnFilterItem = ({ condition, attribute, onChange, onRemove, }) => {
|
|
|
38
40
|
flexDirection: 'column',
|
|
39
41
|
gap: react_components_1.tokens.spacingVerticalM,
|
|
40
42
|
border: `1px solid ${react_components_1.tokens.colorNeutralStroke3}`,
|
|
41
|
-
borderRadius:
|
|
43
|
+
borderRadius: fluent_1.extendedTokens.paperBorderRadius,
|
|
42
44
|
padding: react_components_1.tokens.spacingVerticalM,
|
|
43
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: react_components_1.tokens.spacingHorizontalS }, children: [(0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { readOnly: true, value: attribute.label }), (0, jsx_runtime_1.jsx)(
|
|
45
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: react_components_1.tokens.spacingHorizontalS }, children: [(0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { readOnly: true, value: attribute.label }), (0, jsx_runtime_1.jsx)(Button_1.Button, { style: { alignSelf: 'flex-start' }, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Delete, { size: 20 }), appearance: "subtle", onClick: onRemove })] }), (0, jsx_runtime_1.jsx)(OperatorSelect_1.OperatorSelect, { attribute: attribute, onChange: (value) => handleChangeOperator(value), value: condition.operator }), selectedOption?.controls.map((x, i) => ((0, jsx_runtime_1.jsx)(ConditionValueControl_1.ConditionValueControl, { type: x, attribute: attribute, value: condition.value[i] ?? null, onChange: (value) => {
|
|
44
46
|
handleChangeValue(value, i);
|
|
45
47
|
} }, x + String(i))))] }));
|
|
46
48
|
};
|
|
@@ -11,6 +11,7 @@ const constants_1 = require("@headless-adminapp/app/datagrid/column-filter/const
|
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const DrawerFooter_1 = require("../../components/DrawerFooter");
|
|
13
13
|
const DrawerHeader_1 = require("../../components/DrawerHeader");
|
|
14
|
+
const fluent_1 = require("../../components/fluent");
|
|
14
15
|
const SectionControl_1 = require("../../DataForm/SectionControl");
|
|
15
16
|
const SelectControl_1 = __importDefault(require("../../form/controls/SelectControl"));
|
|
16
17
|
const utils_1 = require("../GridColumnHeader/utils");
|
|
@@ -135,5 +136,5 @@ const DrawerContent = ({ onClose }) => {
|
|
|
135
136
|
if (!value)
|
|
136
137
|
return;
|
|
137
138
|
handleAddFilter(value);
|
|
138
|
-
}, options: attributeOptions.filter((x) => !columnFiltersInternal[x.value]) }) })] }) }), (0, jsx_runtime_1.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(
|
|
139
|
+
}, options: attributeOptions.filter((x) => !columnFiltersInternal[x.value]) }) })] }) }), (0, jsx_runtime_1.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(fluent_1.Button, { appearance: "primary", disabled: !isValid, onClick: handleApply, children: "Apply" }), (0, jsx_runtime_1.jsx)(fluent_1.Button, { onClick: handleCancel, children: "Cancel" })] })] }));
|
|
139
140
|
};
|
|
@@ -13,6 +13,7 @@ const react_1 = require("react");
|
|
|
13
13
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
14
14
|
const DrawerFooter_1 = require("../../components/DrawerFooter");
|
|
15
15
|
const DrawerHeader_1 = require("../../components/DrawerHeader");
|
|
16
|
+
const fluent_1 = require("../../components/fluent");
|
|
16
17
|
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
17
18
|
function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, }) {
|
|
18
19
|
const schema = (0, hooks_1.useDataGridSchema)();
|
|
@@ -64,17 +65,16 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
|
|
|
64
65
|
}, {});
|
|
65
66
|
return ((0, jsx_runtime_1.jsxs)(react_components_1.Drawer, { separator: true, open: opened, position: "end", children: [(0, jsx_runtime_1.jsx)(DrawerHeader_1.DrawerHeader, { title: strings.addColumns, showCloseButton: true, onClose: onClose, bottomContent: (0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
66
67
|
display: 'flex',
|
|
67
|
-
flexDirection: 'column
|
|
68
|
+
flexDirection: 'column',
|
|
68
69
|
gap: 8,
|
|
69
70
|
marginBlock: react_components_1.tokens.spacingVerticalS,
|
|
70
71
|
paddingInline: react_components_1.tokens.spacingHorizontalS,
|
|
71
|
-
}, children: [(0, jsx_runtime_1.jsx)(
|
|
72
|
+
}, children: [(0, jsx_runtime_1.jsx)(fluent_1.Dropdown, { value: selectedGroupItem?.label ?? '', selectedOptions: selectedGroupItem ? [String(selectedGroupItem.key)] : [], onOptionSelect: (event, data) => {
|
|
72
73
|
setSelectedGroup(data.optionValue);
|
|
73
74
|
}, style: { flex: 1, minWidth: 'unset' }, positioning: {
|
|
74
75
|
align: 'bottom',
|
|
75
76
|
position: 'below',
|
|
76
|
-
}, children: tableItems.map((x) => ((0, jsx_runtime_1.jsx)(
|
|
77
|
-
fontWeight: react_components_1.tokens.fontSizeBase400,
|
|
77
|
+
}, children: tableItems.map((x) => ((0, jsx_runtime_1.jsx)(fluent_1.Option, { value: x.key, children: x.label }, x.key))) }), (0, jsx_runtime_1.jsx)(fluent_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.Divider, {})] }) }), (0, jsx_runtime_1.jsx)(react_components_1.DrawerBody, { style: { paddingInline: 0 }, children: filteredColumns.map((column) => ((0, jsx_runtime_1.jsx)(fluent_1.Button, { appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(fluent_1.Checkbox, { checked: includedColumnsObj[column.id] ?? false }), style: {
|
|
78
78
|
width: '100%',
|
|
79
79
|
justifyContent: 'flex-start',
|
|
80
80
|
paddingInline: react_components_1.tokens.spacingHorizontalS,
|
|
@@ -85,5 +85,5 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
|
|
|
85
85
|
else {
|
|
86
86
|
onColumnAdd(column);
|
|
87
87
|
}
|
|
88
|
-
}, children: column.label }, column.id))) }), (0, jsx_runtime_1.jsx)(DrawerFooter_1.DrawerFooter, { children: (0, jsx_runtime_1.jsx)(
|
|
88
|
+
}, children: column.label }, column.id))) }), (0, jsx_runtime_1.jsx)(DrawerFooter_1.DrawerFooter, { children: (0, jsx_runtime_1.jsx)(fluent_1.Button, { onClick: onClose, children: strings.close }) })] }));
|
|
89
89
|
}
|
|
@@ -6,6 +6,7 @@ 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
8
|
const DndProvider_1 = require("../../components/DndProvider");
|
|
9
|
+
const fluent_1 = require("../../components/fluent");
|
|
9
10
|
exports.ItemTypes = {
|
|
10
11
|
CARD: 'column',
|
|
11
12
|
};
|
|
@@ -75,13 +76,13 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
|
|
|
75
76
|
paddingLeft: react_components_1.tokens.spacingHorizontalS,
|
|
76
77
|
cursor: 'move',
|
|
77
78
|
opacity,
|
|
78
|
-
borderRadius:
|
|
79
|
+
borderRadius: fluent_1.extendedTokens.controlBorderRadius,
|
|
79
80
|
display: 'flex',
|
|
80
81
|
flexDirection: 'row',
|
|
81
82
|
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)(
|
|
83
|
+
}, "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)(fluent_1.Button, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.MoreVertical, {}), appearance: "transparent", size: "small" }) }), (0, jsx_runtime_1.jsx)(fluent_1.MenuPopover, { children: (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { children: [(0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Delete, {}), onClick: onRemove, children: stringSet.remove }), !isFirst && ((0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
|
|
83
84
|
moveItem(index, index - 1);
|
|
84
|
-
}, children: stringSet.moveUp })), !isLast && ((0, jsx_runtime_1.jsx)(
|
|
85
|
+
}, children: stringSet.moveUp })), !isLast && ((0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
|
|
85
86
|
moveItem(index, index + 1);
|
|
86
87
|
}, children: stringSet.moveDown }))] }) })] })] }));
|
|
87
88
|
};
|
|
@@ -17,6 +17,7 @@ const Wrapper_1 = require("../../CommandBar/Wrapper");
|
|
|
17
17
|
const DndProvider_1 = require("../../components/DndProvider");
|
|
18
18
|
const DrawerFooter_1 = require("../../components/DrawerFooter");
|
|
19
19
|
const DrawerHeader_1 = require("../../components/DrawerHeader");
|
|
20
|
+
const fluent_1 = require("../../components/fluent");
|
|
20
21
|
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
21
22
|
const AddColumns_1 = require("./AddColumns");
|
|
22
23
|
const ColumnItem_1 = require("./ColumnItem");
|
|
@@ -57,12 +58,12 @@ function CustomizeColumns({ onClose, opened }) {
|
|
|
57
58
|
gap: react_components_1.tokens.spacingVerticalS,
|
|
58
59
|
// padding: tokens.spacingHorizontalS,
|
|
59
60
|
paddingBlock: react_components_1.tokens.spacingVerticalS,
|
|
60
|
-
}, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(ColumnItem_1.ColumnItem, { index: index, item: item, moveItem: moveItem, isFirst: index === 0, isLast: index === items.length - 1, onRemove: () => onColumnRemove(item), stringSet: strings }, item.id))) }) })] }), (0, jsx_runtime_1.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(
|
|
61
|
+
}, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(ColumnItem_1.ColumnItem, { index: index, item: item, moveItem: moveItem, isFirst: index === 0, isLast: index === items.length - 1, onRemove: () => onColumnRemove(item), stringSet: strings }, item.id))) }) })] }), (0, jsx_runtime_1.jsxs)(DrawerFooter_1.DrawerFooter, { children: [(0, jsx_runtime_1.jsx)(fluent_1.Button, { onClick: () => {
|
|
61
62
|
setContextValue({
|
|
62
63
|
columns: items,
|
|
63
64
|
});
|
|
64
65
|
onClose();
|
|
65
|
-
}, appearance: "primary",
|
|
66
|
+
}, appearance: "primary", children: strings.apply }), (0, jsx_runtime_1.jsx)(fluent_1.Button, { onClick: () => {
|
|
66
67
|
onClose();
|
|
67
|
-
},
|
|
68
|
+
}, children: strings.cancel })] })] }));
|
|
68
69
|
}
|
|
@@ -8,6 +8,7 @@ const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
|
|
|
8
8
|
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
|
+
const fluent_1 = require("../components/fluent");
|
|
11
12
|
const FormSubgridViewSelector = () => {
|
|
12
13
|
const viewLookup = (0, hooks_1.useGridViewLookupData)();
|
|
13
14
|
const selectedView = (0, hooks_1.useSelectedView)();
|
|
@@ -28,10 +29,10 @@ const FormSubgridViewSelector = () => {
|
|
|
28
29
|
gap: 16,
|
|
29
30
|
justifyContent: 'space-between',
|
|
30
31
|
display: 'flex',
|
|
31
|
-
}, 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)(
|
|
32
|
+
}, 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)(fluent_1.Button, { appearance: "subtle", icon: allowViewSelection ? (0, jsx_runtime_1.jsx)(icons_1.Icons.ChevronDown, {}) : null, iconPosition: "after", style: {
|
|
32
33
|
paddingInline: 8,
|
|
33
34
|
paddingBlock: 4,
|
|
34
35
|
pointerEvents: allowViewSelection ? 'auto' : 'none',
|
|
35
|
-
}, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(
|
|
36
|
+
}, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(fluent_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: viewLookup.map((view) => ((0, jsx_runtime_1.jsx)(fluent_1.MenuItem, { onClick: () => changeView(view.id), children: view.localizedNames?.[language] ?? view.name }, view.id))) }) })] }) }) }));
|
|
36
37
|
};
|
|
37
38
|
exports.FormSubgridViewSelector = FormSubgridViewSelector;
|
|
@@ -6,6 +6,7 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
6
6
|
const column_filter_1 = require("@headless-adminapp/app/datagrid/column-filter");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
9
|
+
const fluent_1 = require("../../components/fluent");
|
|
9
10
|
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
10
11
|
const ConditionValueControl_1 = require("./ConditionValueControl");
|
|
11
12
|
const OperatorSelect_1 = require("./OperatorSelect");
|
|
@@ -44,7 +45,7 @@ const FilterForm = ({ defaultValue, attribute, onApply, onCancel, }) => {
|
|
|
44
45
|
gap: react_components_1.tokens.spacingVerticalS,
|
|
45
46
|
}, 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
47
|
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)(
|
|
48
|
+
} }, 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)(fluent_1.Button, { appearance: "secondary", onClick: onCancel, children: strings.cancel }) }), (0, jsx_runtime_1.jsx)(fluent_1.Button, { type: "submit", appearance: "primary", disabled: !isValid, onClick: () => {
|
|
48
49
|
onApply?.({
|
|
49
50
|
operator,
|
|
50
51
|
value: values,
|
|
@@ -7,6 +7,7 @@ const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
|
|
|
7
7
|
const hooks_2 = require("@headless-adminapp/app/metadata/hooks");
|
|
8
8
|
const icons_1 = require("@headless-adminapp/icons");
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
+
const fluent_1 = require("../../components/fluent");
|
|
10
11
|
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
11
12
|
const FilterForm_1 = require("./FilterForm");
|
|
12
13
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
@@ -89,8 +90,8 @@ const TableHeaderFilterCell = ({ children, sortDirection, onChangeSortDirection,
|
|
|
89
90
|
const onChangeFilterCondition = (condition) => {
|
|
90
91
|
setColumnFilters(column.id, condition);
|
|
91
92
|
};
|
|
92
|
-
const sortMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
93
|
-
const filterMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
93
|
+
const sortMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fluent_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)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ArrowDown, { size: 16 }), onClick: () => onChangeSortDirection?.('desc'), children: strings.sortByDescending })] }));
|
|
94
|
+
const filterMenuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fluent_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)(fluent_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.FilterDismiss, { size: 16 }), onClick: () => {
|
|
94
95
|
onChangeFilterCondition(undefined);
|
|
95
96
|
}, children: strings.clearFilter }))] }));
|
|
96
97
|
const menuItems = [];
|
|
@@ -143,7 +144,7 @@ const TableHeaderFilterCell = ({ children, sortDirection, onChangeSortDirection,
|
|
|
143
144
|
return headerCell;
|
|
144
145
|
}
|
|
145
146
|
const menuPosition = align === 'right' ? 'below-end' : 'below-start';
|
|
146
|
-
return ((0, jsx_runtime_1.jsxs)("th", { children: [(0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: menuPosition, children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: headerCell }), (0, jsx_runtime_1.jsx)(
|
|
147
|
+
return ((0, jsx_runtime_1.jsxs)("th", { children: [(0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: menuPosition, children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: headerCell }), (0, jsx_runtime_1.jsx)(fluent_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: menuItems.map((x, i) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [i > 0 && (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, {}), x] }, i))) }) })] }), (0, jsx_runtime_1.jsx)(react_components_1.Dialog, { open: visible, onOpenChange: () => setVisible(false), children: (0, jsx_runtime_1.jsx)(fluent_1.DialogSurface, { style: { maxWidth: 400 }, children: (0, jsx_runtime_1.jsxs)(react_components_1.DialogBody, { children: [(0, jsx_runtime_1.jsx)(react_components_1.DialogTitle, { children: strings.filterBy }), (0, jsx_runtime_1.jsx)(FilterForm_1.FilterForm, { attribute: attribute, defaultValue: filterCondition, onApply: (condition) => {
|
|
147
148
|
onChangeFilterCondition(condition);
|
|
148
149
|
setVisible(false);
|
|
149
150
|
}, onCancel: () => setVisible(false) })] }) }) })] }));
|
|
@@ -8,6 +8,7 @@ const locale_1 = require("@headless-adminapp/app/locale");
|
|
|
8
8
|
const icons_1 = require("@headless-adminapp/icons");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const AppStringContext_1 = require("../App/AppStringContext");
|
|
11
|
+
const fluent_1 = require("../components/fluent");
|
|
11
12
|
const PageEntityViewStringContext_1 = require("../PageEntityView/PageEntityViewStringContext");
|
|
12
13
|
const CustomizeColumns_1 = require("./CustomizeColumns");
|
|
13
14
|
const GridQuickFilterDesktop_1 = require("./GridQuickFilterDesktop");
|
|
@@ -35,9 +36,9 @@ const GridHeaderDesktop = (props) => {
|
|
|
35
36
|
gap: 16,
|
|
36
37
|
justifyContent: 'space-between',
|
|
37
38
|
display: 'flex',
|
|
38
|
-
}, 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)(
|
|
39
|
+
}, 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)(fluent_1.Button, { appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.ChevronDown, {}), iconPosition: "after", style: {
|
|
39
40
|
fontSize: react_components_1.tokens.fontSizeBase400,
|
|
40
41
|
fontWeight: react_components_1.tokens.fontWeightMedium,
|
|
41
|
-
}, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(
|
|
42
|
+
}, children: selectedView.localizedNames?.[language] ?? selectedView.name }) }), (0, jsx_runtime_1.jsx)(fluent_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: viewLookup.map((view) => ((0, jsx_runtime_1.jsx)(fluent_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)(fluent_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)(fluent_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" })] })] }), (0, jsx_runtime_1.jsx)(GridQuickFilterDesktop_1.GridQuickFilterDesktop, {})] }));
|
|
42
43
|
};
|
|
43
44
|
exports.GridHeaderDesktop = GridHeaderDesktop;
|