refine-mantine 1.7.0-dev.2 → 1.7.0-dev.3
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/dist/index.d.ts +3 -28
- package/dist/index.js +4 -141
- package/package.json +1 -1
- package/src/index.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionIconProps, AnchorProps,
|
|
2
|
-
import { AuthProvider, AutoSaveIndicatorProps as AutoSaveIndicatorProps$1, BaseRecord, HttpError, LoginFormTypes, NotificationProvider, OAuthProvider, RegisterFormTypes, TitleProps, UpdatePasswordFormTypes, UseFormProps as UseFormProps$1, UseFormReturnType as UseFormReturnType$1, UseImportInputPropsType,
|
|
1
|
+
import { ActionIconProps, AnchorProps, BadgeProps, BoxProps, BreadcrumbsProps, ButtonProps, CardProps, GroupProps, LoadingOverlayProps, MenuItemProps, NotificationProps, PinInputProps, PolymorphicComponentProps, PopoverProps, ScrollAreaProps, StackProps, TableProps, TextInputProps, TextProps, ThemeIconProps } from "@mantine/core";
|
|
2
|
+
import { AuthProvider, AutoSaveIndicatorProps as AutoSaveIndicatorProps$1, BaseRecord, HttpError, LoginFormTypes, NotificationProvider, OAuthProvider, RegisterFormTypes, TitleProps, UpdatePasswordFormTypes, UseFormProps as UseFormProps$1, UseFormReturnType as UseFormReturnType$1, UseImportInputPropsType, useTranslate } from "@refinedev/core";
|
|
3
3
|
import { IconProps, ReactNode } from "@tabler/icons-react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
import React$1, { ReactNode as ReactNode$1 } from "react";
|
|
@@ -193,31 +193,6 @@ declare const FileField: React.FC<UrlFieldProps>;
|
|
|
193
193
|
//#region src/components/fields/PhoneField.d.ts
|
|
194
194
|
declare const PhoneField: React.FC<UrlFieldProps>;
|
|
195
195
|
//#endregion
|
|
196
|
-
//#region src/components/layout/Layout.d.ts
|
|
197
|
-
interface LayoutProps {
|
|
198
|
-
children: ReactNode$1;
|
|
199
|
-
shellProps?: AppShellProps;
|
|
200
|
-
headerProps?: AppShellHeaderProps;
|
|
201
|
-
navbarProps?: AppShellNavbarProps;
|
|
202
|
-
navbarConfiguration?: Partial<AppShellNavbarConfiguration>;
|
|
203
|
-
navbarMenuProps?: AppShellSectionProps;
|
|
204
|
-
navbarFooterProps?: AppShellSectionProps;
|
|
205
|
-
mainProps?: AppShellMainProps;
|
|
206
|
-
hideNavbar?: boolean;
|
|
207
|
-
footer?: ReactNode$1;
|
|
208
|
-
footerProps?: AppShellFooterProps;
|
|
209
|
-
locales?: LayoutLocale[];
|
|
210
|
-
renderHeader?: (toggle: () => void) => ReactNode$1;
|
|
211
|
-
renderMenu?: (params: ReturnType<typeof useMenu>) => ReactNode$1;
|
|
212
|
-
renderIdentity?: <T extends BaseRecord>(identity: T, logout: () => void) => ReactNode$1;
|
|
213
|
-
}
|
|
214
|
-
interface LayoutLocale {
|
|
215
|
-
lang: string;
|
|
216
|
-
label: string;
|
|
217
|
-
icon?: ReactNode$1;
|
|
218
|
-
}
|
|
219
|
-
declare const Layout: React.FC<LayoutProps>;
|
|
220
|
-
//#endregion
|
|
221
196
|
//#region src/components/notification/AutoSaveIndicator.d.ts
|
|
222
197
|
interface AutoSaveIndicatorProps {
|
|
223
198
|
status: AutoSaveIndicatorProps$1["status"];
|
|
@@ -423,4 +398,4 @@ declare const authProvider: AuthProvider;
|
|
|
423
398
|
//#region src/providers/notificationProvider.d.ts
|
|
424
399
|
declare const notificationProvider: () => NotificationProvider;
|
|
425
400
|
//#endregion
|
|
426
|
-
export { AutoSaveIndicator, AutoSaveIndicatorProps, BooleanField, BooleanFieldProps, Breadcrumb, BreadcrumbProps, CloneButton, CloneButtonProps, ColorSchemeToggle, ColumnFilter, ColumnSorter, Create, CreateButton, CreateButtonProps, CreateProps, DateField, DateFieldProps, DeleteButton, DeleteButtonProps, Edit, EditButton, EditButtonProps, EditProps, EmailField, Empty, ExportButton, ExportButtonProps, FileField, ForgotPasswordForm, ForgotPasswordPage, ForgotPasswordPageProps, ImportButton, ImportButtonProps,
|
|
401
|
+
export { AutoSaveIndicator, AutoSaveIndicatorProps, BooleanField, BooleanFieldProps, Breadcrumb, BreadcrumbProps, CloneButton, CloneButtonProps, ColorSchemeToggle, ColumnFilter, ColumnSorter, Create, CreateButton, CreateButtonProps, CreateProps, DateField, DateFieldProps, DeleteButton, DeleteButtonProps, Edit, EditButton, EditButtonProps, EditProps, EmailField, Empty, ExportButton, ExportButtonProps, FileField, ForgotPasswordForm, ForgotPasswordPage, ForgotPasswordPageProps, ImportButton, ImportButtonProps, List, ListButton, ListButtonProps, ListProps, LoginArgs, LoginPage, LoginPageProps, Message, MessageProps, NotFound, OAuthProviderMantine, OtpHandler, PhoneField, RefreshButton, RefreshButtonProps, RegisterForm, RegisterPage, RegisterPageProps, RegistrationVerificationPage, RegistrationVerificationPageProps, SaveButton, SaveButtonProps, Show, ShowButton, ShowButtonProps, ShowProps, Table, TranslateFn, UpdatePasswordPage, UpdatePasswordPageProps, UrlField, UrlFieldProps, UseFormProps, UseFormReturnType, authProvider, notificationProvider, useForm, useOtp };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ActionIcon, Anchor,
|
|
2
|
-
import {
|
|
3
|
-
import { IconArrowBackUp, IconArrowLeft, IconAt, IconCheck, IconChevronUp, IconCircleCheck, IconCircleCheckFilled, IconCircleXFilled, IconDeviceFloppy, IconDots, IconExclamationCircle, IconExternalLink, IconEye, IconFileDownloadFilled, IconFileExport, IconFileImport, IconFilter, IconGhost3Filled, IconHome,
|
|
1
|
+
import { ActionIcon, Anchor, Badge, Box, Breadcrumbs, Button, ButtonGroup, Card, Center, Collapse, Container, Divider, Group, Input, Loader, LoadingOverlay, Menu, Notification, Pagination, PinInput, Popover, RingProgress, ScrollArea, Stack, Table as Table$1, Text, TextInput, ThemeIcon, Title, Tooltip, useMantineColorScheme } from "@mantine/core";
|
|
2
|
+
import { Link, flattenObjectKeys, matchResourceFromRoute, useBack, useBreadcrumb, useCloneButton, useCreateButton, useDeleteButton, useEditButton, useExportButton, useForgotPassword, useForm as useForm$1, useGo, useImportButton, useLink, useListButton, useLogin, useMutationMode, useParsed, useRefineContext, useRefineOptions, useRefreshButton, useRegister, useResourceParams, useSaveButton, useShowButton, useToPath, useTranslate, useUpdatePassword, useUserFriendlyName, useWarnAboutChange } from "@refinedev/core";
|
|
3
|
+
import { IconArrowBackUp, IconArrowLeft, IconAt, IconCheck, IconChevronUp, IconCircleCheck, IconCircleCheckFilled, IconCircleXFilled, IconDeviceFloppy, IconDots, IconExclamationCircle, IconExternalLink, IconEye, IconFileDownloadFilled, IconFileExport, IconFileImport, IconFilter, IconGhost3Filled, IconHome, IconLibraryPlus, IconList, IconLockPassword, IconMailShare, IconPencil, IconPhoneOutgoing, IconRefresh, IconSelector, IconSquarePlus, IconTrash, IconX } from "@tabler/icons-react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
6
6
|
import { useDebouncedCallback, useDisclosure } from "@mantine/hooks";
|
|
@@ -1059,143 +1059,6 @@ const PhoneField = (props) => /* @__PURE__ */ jsx(UrlField, {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
});
|
|
1061
1061
|
|
|
1062
|
-
//#endregion
|
|
1063
|
-
//#region src/components/layout/Layout.tsx
|
|
1064
|
-
const Layout = (p) => {
|
|
1065
|
-
const [opened, { toggle, close }] = useDisclosure();
|
|
1066
|
-
const { title: { icon: defaultIcon, text: defaultText } = {} } = useRefineOptions();
|
|
1067
|
-
const { data: identity } = useGetIdentity();
|
|
1068
|
-
const menu = useMenu();
|
|
1069
|
-
const { mutate: logout } = useLogout();
|
|
1070
|
-
const { setColorScheme } = useMantineColorScheme();
|
|
1071
|
-
const computedColorScheme = useComputedColorScheme("light", { getInitialValueInEffect: true });
|
|
1072
|
-
const translate = useTranslate();
|
|
1073
|
-
const handleLogout = useCallback(() => {
|
|
1074
|
-
logout();
|
|
1075
|
-
}, [logout]);
|
|
1076
|
-
return /* @__PURE__ */ jsxs(AppShell, {
|
|
1077
|
-
header: { height: 60 },
|
|
1078
|
-
navbar: {
|
|
1079
|
-
width: 300,
|
|
1080
|
-
breakpoint: "sm",
|
|
1081
|
-
collapsed: {
|
|
1082
|
-
mobile: !opened || p.hideNavbar,
|
|
1083
|
-
desktop: p.hideNavbar
|
|
1084
|
-
},
|
|
1085
|
-
...p.navbarConfiguration
|
|
1086
|
-
},
|
|
1087
|
-
padding: "md",
|
|
1088
|
-
...p.shellProps,
|
|
1089
|
-
children: [
|
|
1090
|
-
/* @__PURE__ */ jsx(AppShell.Header, {
|
|
1091
|
-
p: "md",
|
|
1092
|
-
...p.headerProps,
|
|
1093
|
-
children: p.renderHeader ? p.renderHeader(toggle) : /* @__PURE__ */ jsxs(Group, {
|
|
1094
|
-
justify: "space-between",
|
|
1095
|
-
children: [/* @__PURE__ */ jsxs(Group, { children: [/* @__PURE__ */ jsx(Burger, {
|
|
1096
|
-
opened,
|
|
1097
|
-
onClick: toggle,
|
|
1098
|
-
size: "sm",
|
|
1099
|
-
hiddenFrom: "sm",
|
|
1100
|
-
hidden: p.hideNavbar
|
|
1101
|
-
}), /* @__PURE__ */ jsx(Anchor, {
|
|
1102
|
-
component: Link,
|
|
1103
|
-
to: "/",
|
|
1104
|
-
style: { all: "unset" },
|
|
1105
|
-
children: /* @__PURE__ */ jsxs(Group, { children: [defaultIcon, /* @__PURE__ */ jsx(Text, { children: defaultText })] })
|
|
1106
|
-
})] }), /* @__PURE__ */ jsxs(Group, { children: [p.locales && /* @__PURE__ */ jsx(Locales, { locales: p.locales }), /* @__PURE__ */ jsx(Tooltip, {
|
|
1107
|
-
label: computedColorScheme === "dark" ? translate("layout.header.lightMode", "Light mode") : translate("layout.header.darkMode", "Dark mode"),
|
|
1108
|
-
children: /* @__PURE__ */ jsx(ActionIcon, {
|
|
1109
|
-
onClick: () => setColorScheme(computedColorScheme === "light" ? "dark" : "light"),
|
|
1110
|
-
"aria-label": translate("layout.header.toggleColorScheme", "Toggle color scheme"),
|
|
1111
|
-
variant: "default",
|
|
1112
|
-
children: computedColorScheme === "light" ? /* @__PURE__ */ jsx(IconSun, {
|
|
1113
|
-
stroke: 1.5,
|
|
1114
|
-
size: 22
|
|
1115
|
-
}) : /* @__PURE__ */ jsx(IconMoon, {
|
|
1116
|
-
stroke: 1.5,
|
|
1117
|
-
size: 22
|
|
1118
|
-
})
|
|
1119
|
-
})
|
|
1120
|
-
})] })]
|
|
1121
|
-
})
|
|
1122
|
-
}),
|
|
1123
|
-
/* @__PURE__ */ jsxs(AppShell.Navbar, {
|
|
1124
|
-
...p.navbarProps,
|
|
1125
|
-
children: [/* @__PURE__ */ jsx(AppShell.Section, {
|
|
1126
|
-
component: ScrollArea,
|
|
1127
|
-
grow: true,
|
|
1128
|
-
mt: "xs",
|
|
1129
|
-
...p.navbarMenuProps,
|
|
1130
|
-
children: p.renderMenu ? p.renderMenu(menu) : menu.menuItems.map((item) => /* @__PURE__ */ jsx(MenuItem, {
|
|
1131
|
-
item,
|
|
1132
|
-
defaultOpenKeys: menu.defaultOpenKeys,
|
|
1133
|
-
selectedKey: menu.selectedKey,
|
|
1134
|
-
onClickLeaf: close
|
|
1135
|
-
}, item.key))
|
|
1136
|
-
}), /* @__PURE__ */ jsx(AppShell.Section, {
|
|
1137
|
-
...p.navbarFooterProps,
|
|
1138
|
-
children: p.renderIdentity ? p.renderIdentity(identity, handleLogout) : /* @__PURE__ */ jsx(NavLink, {
|
|
1139
|
-
onClick: handleLogout,
|
|
1140
|
-
leftSection: identity?.avatar ? /* @__PURE__ */ jsx(Avatar, { src: identity.avatar }) : void 0,
|
|
1141
|
-
rightSection: /* @__PURE__ */ jsx(IconLogout, {}),
|
|
1142
|
-
label: translate("layout.navbar.signOutLabel", "Sign out"),
|
|
1143
|
-
variant: "filled",
|
|
1144
|
-
description: identity?.email ? translate("layout.navbar.signOutDescription", { email: identity.email }, `Signed in as ${identity.email}`) : void 0,
|
|
1145
|
-
active: true
|
|
1146
|
-
})
|
|
1147
|
-
})]
|
|
1148
|
-
}),
|
|
1149
|
-
/* @__PURE__ */ jsx(AppShell.Main, {
|
|
1150
|
-
...p.mainProps,
|
|
1151
|
-
children: p.children
|
|
1152
|
-
}),
|
|
1153
|
-
/* @__PURE__ */ jsx(AppShell.Footer, {
|
|
1154
|
-
...p.footerProps,
|
|
1155
|
-
children: p.footer
|
|
1156
|
-
})
|
|
1157
|
-
]
|
|
1158
|
-
});
|
|
1159
|
-
};
|
|
1160
|
-
const MenuItem = (p) => {
|
|
1161
|
-
const { listUrl } = useNavigation();
|
|
1162
|
-
const isSelected = p.item.key === p.selectedKey;
|
|
1163
|
-
return /* @__PURE__ */ jsx(CanAccess, {
|
|
1164
|
-
resource: p.item.name,
|
|
1165
|
-
action: "list",
|
|
1166
|
-
params: { resource: p.item },
|
|
1167
|
-
children: /* @__PURE__ */ jsx(NavLink, {
|
|
1168
|
-
label: p.item.meta?.label,
|
|
1169
|
-
leftSection: p.item.meta?.icon ?? /* @__PURE__ */ jsx(IconList, { size: 20 }),
|
|
1170
|
-
active: isSelected,
|
|
1171
|
-
defaultOpened: p.defaultOpenKeys.includes(p.item.key ?? ""),
|
|
1172
|
-
component: Link,
|
|
1173
|
-
to: listUrl(p.item.name),
|
|
1174
|
-
onClick: p.item.children.length > 0 ? void 0 : p.onClickLeaf,
|
|
1175
|
-
children: p.item.children.length > 0 ? p.item.children.map((child) => /* @__PURE__ */ jsx(MenuItem, {
|
|
1176
|
-
item: child,
|
|
1177
|
-
defaultOpenKeys: p.defaultOpenKeys,
|
|
1178
|
-
selectedKey: p.selectedKey,
|
|
1179
|
-
onClickLeaf: p.onClickLeaf
|
|
1180
|
-
}, child.key)) : null
|
|
1181
|
-
}, p.item.key)
|
|
1182
|
-
}, p.item.key);
|
|
1183
|
-
};
|
|
1184
|
-
const Locales = (p) => {
|
|
1185
|
-
const { changeLocale, getLocale } = useTranslation();
|
|
1186
|
-
const locale = getLocale();
|
|
1187
|
-
return /* @__PURE__ */ jsxs(Menu, {
|
|
1188
|
-
shadow: "md",
|
|
1189
|
-
width: 200,
|
|
1190
|
-
children: [/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(ActionIcon, { children: /* @__PURE__ */ jsx(IconLanguage, {}) }) }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: p.locales.map(({ label, lang, icon }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Menu.Item, {
|
|
1191
|
-
leftSection: icon,
|
|
1192
|
-
onClick: () => changeLocale(lang),
|
|
1193
|
-
rightSection: lang === locale ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : void 0,
|
|
1194
|
-
children: label
|
|
1195
|
-
}) })) })]
|
|
1196
|
-
});
|
|
1197
|
-
};
|
|
1198
|
-
|
|
1199
1062
|
//#endregion
|
|
1200
1063
|
//#region src/components/notification/Message.tsx
|
|
1201
1064
|
const Message = ({ message, description, undoLabel, undoableTime = 5, undoableTimeout = 0, notificationProps, actioniconProps, buttonProps, onUndo }) => /* @__PURE__ */ jsx(Notification, {
|
|
@@ -2140,4 +2003,4 @@ const notificationProvider = () => {
|
|
|
2140
2003
|
};
|
|
2141
2004
|
|
|
2142
2005
|
//#endregion
|
|
2143
|
-
export { AutoSaveIndicator, BooleanField, Breadcrumb, CloneButton, ColorSchemeToggle, ColumnFilter, ColumnSorter, Create, CreateButton, DateField, DeleteButton, Edit, EditButton, EmailField, Empty, ExportButton, FileField, ForgotPasswordPage, ImportButton,
|
|
2006
|
+
export { AutoSaveIndicator, BooleanField, Breadcrumb, CloneButton, ColorSchemeToggle, ColumnFilter, ColumnSorter, Create, CreateButton, DateField, DeleteButton, Edit, EditButton, EmailField, Empty, ExportButton, FileField, ForgotPasswordPage, ImportButton, List, ListButton, LoginPage, Message, NotFound, PhoneField, RefreshButton, RegisterPage, RegistrationVerificationPage, SaveButton, Show, ShowButton, Table, UpdatePasswordPage, UrlField, notificationProvider, useForm, useOtp };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from "@/components/fields/PhoneField";
|
|
|
28
28
|
export * from "@/components/fields/UrlField";
|
|
29
29
|
// layout
|
|
30
30
|
export * from "@/components/layout/Layout";
|
|
31
|
+
export * from "@/components/layout/LayoutMinimal";
|
|
31
32
|
// notification
|
|
32
33
|
export * from "@/components/notification/AutoSaveIndicator";
|
|
33
34
|
export * from "@/components/notification/Message";
|