wcz-test 6.20.0 → 6.22.0
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/{DialogsHooks-Bi8dZoyu.js → DialogsContext-DMZRefiY.js} +3 -35
- package/dist/DialogsContext-DMZRefiY.js.map +1 -0
- package/dist/DialogsHooks-DBK6rBoU.js +37 -0
- package/dist/DialogsHooks-DBK6rBoU.js.map +1 -0
- package/dist/{FileHooks-hWKTwLCr.js → FileHooks-BM2Oyvh6.js} +2 -3
- package/dist/FileHooks-BM2Oyvh6.js.map +1 -0
- package/dist/{RouterListItemButton-CHS7rofI.js → RouterListItemButton-Vj6OoqkV.js} +2 -2
- package/dist/{RouterListItemButton-CHS7rofI.js.map → RouterListItemButton-Vj6OoqkV.js.map} +1 -1
- package/dist/UseHook-DB7btKDE.js +11 -0
- package/dist/UseHook-DB7btKDE.js.map +1 -0
- package/dist/client.d.ts +0 -705
- package/dist/client.js +2 -4
- package/dist/client.js.map +1 -1
- package/dist/components.js +4 -3
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +15 -0
- package/dist/hooks.js +5 -3
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +145 -54
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +0 -9
- package/dist/queries.js +2 -3
- package/dist/queries.js.map +1 -1
- package/dist/server.d.ts +0 -36
- package/dist/server.js +1 -8732
- package/dist/server.js.map +1 -1
- package/dist/{utils-DKyKGba7.js → utils-CKW5pi6k.js} +21 -2
- package/dist/utils-CKW5pi6k.js.map +1 -0
- package/dist/utils.js +1 -1
- package/package.json +117 -120
- package/dist/DialogsHooks-Bi8dZoyu.js.map +0 -1
- package/dist/FileHooks-hWKTwLCr.js.map +0 -1
- package/dist/auth-client-B6cIXYDV.js +0 -1417
- package/dist/auth-client-B6cIXYDV.js.map +0 -1
- package/dist/env-CoxTjaDr.js +0 -27
- package/dist/env-CoxTjaDr.js.map +0 -1
- package/dist/error-BhAKg8LX-X0sdNXNa.js +0 -195
- package/dist/error-BhAKg8LX-X0sdNXNa.js.map +0 -1
- package/dist/server-mxQ3s5dx-CC81W42s.js +0 -644
- package/dist/server-mxQ3s5dx-CC81W42s.js.map +0 -1
- package/dist/utils-DKyKGba7.js.map +0 -1
package/dist/client.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { W, b, a } from "./auth-client-B6cIXYDV.js";
|
|
2
1
|
import { t } from "i18next";
|
|
3
2
|
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { P } from "./utils-
|
|
3
|
+
import { P, W, a } from "./utils-CKW5pi6k.js";
|
|
5
4
|
export {
|
|
6
5
|
P as Platform,
|
|
7
6
|
W as WISTRON_PRIMARY_COLOR,
|
|
8
|
-
|
|
9
|
-
a as authClient,
|
|
7
|
+
a as WISTRON_SECONDARY_COLOR,
|
|
10
8
|
t,
|
|
11
9
|
useTranslation
|
|
12
10
|
};
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports
|
|
1
|
+
import { j as jsxRuntimeExports } from "./DialogsContext-DMZRefiY.js";
|
|
2
2
|
import { Typography, Stack, Box, useTheme, Paper, Menu, List, ListItemButton, ListItemIcon, ListItemText, ImageListItem, ImageListItemBar, IconButton, Tooltip, Dialog, Fab, Chip, Button, Link, Tab, Divider } from "@mui/material";
|
|
3
3
|
import React, { useRef, useState, useEffectEvent, useEffect, createContext, useContext, Fragment } from "react";
|
|
4
4
|
import CloudUpload from "@mui/icons-material/CloudUpload";
|
|
@@ -9,7 +9,8 @@ import { grey } from "@mui/material/colors";
|
|
|
9
9
|
import { useInView } from "react-intersection-observer";
|
|
10
10
|
import Delete from "@mui/icons-material/Delete";
|
|
11
11
|
import FileDownload from "@mui/icons-material/FileDownload";
|
|
12
|
-
import {
|
|
12
|
+
import { u as useDialogs } from "./DialogsHooks-DBK6rBoU.js";
|
|
13
|
+
import { c as useDownloadFile, f as useDeleteFile, a as useGetFileThumbnail, d as useOpenFile, b as useGetFile, u as useGetFileMetas } from "./FileHooks-BM2Oyvh6.js";
|
|
13
14
|
import AttachFile from "@mui/icons-material/AttachFile";
|
|
14
15
|
import Image from "@mui/icons-material/Image";
|
|
15
16
|
import SmartDisplay from "@mui/icons-material/SmartDisplay";
|
|
@@ -17,7 +18,7 @@ import Close from "@mui/icons-material/Close";
|
|
|
17
18
|
import Edit from "@mui/icons-material/Edit";
|
|
18
19
|
import { createLink } from "@tanstack/react-router";
|
|
19
20
|
import { GridActionsCellItem } from "@mui/x-data-grid-premium";
|
|
20
|
-
import { R } from "./RouterListItemButton-
|
|
21
|
+
import { R } from "./RouterListItemButton-Vj6OoqkV.js";
|
|
21
22
|
const TypographyWithIcon = ({ startIcon, endIcon, children, sx, ...props }) => {
|
|
22
23
|
const iconSx = {
|
|
23
24
|
display: "inline-flex",
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../src/components/core/TypographyWithIcon.tsx","../src/components/core/Fullscreen.tsx","../src/components/file/Dropzone.tsx","../src/contexts/FileContext.ts","../src/components/file/fileViewer/common/ActionsMenu.tsx","../src/components/file/fileViewer/FileViewerGrid.tsx","../src/components/file/fileViewer/FileViewerList.tsx","../src/components/file/fileViewer/ImageViewer.tsx","../src/components/file/FileViewer.tsx","../src/components/data-grid/ChipInputCell.tsx","../src/components/data-grid/EditableColumnHeader.tsx","../src/components/router/RouterButton.tsx","../src/components/router/RouterGridActionsCellItem.tsx","../src/components/router/RouterIconButton.tsx","../src/components/router/RouterLink.tsx","../src/components/router/RouterTab.tsx","../src/components/router/RouterNotFound.tsx","../src/components/router/RouterError.tsx"],"sourcesContent":["import { Stack, Typography } from \"@mui/material\";\nimport type { SxProps, Theme, TypographyProps } from \"@mui/material\";\n\ninterface TypographyWithIconProps extends TypographyProps {\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n}\n\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, ...props }) => {\n const iconSx: SxProps<Theme> = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n lineHeight: 0,\n \"& > svg\": {\n display: \"block\",\n },\n };\n\n return (\n <Typography\n component=\"span\"\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n verticalAlign: \"middle\",\n ...sx,\n }}\n gap={1}\n {...props}\n >\n {startIcon && (\n <Stack component=\"span\" sx={iconSx}>\n {startIcon}\n </Stack>\n )}\n <Stack component=\"span\" sx={{ display: \"inline\", lineHeight: \"inherit\" }}>\n {children}\n </Stack>\n {endIcon && (\n <Stack component=\"span\" sx={iconSx}>\n {endIcon}\n </Stack>\n )}\n </Typography>\n );\n};","import { Box } from \"@mui/material\";\nimport { useEffect, useEffectEvent, useRef, useState } from \"react\";\nimport type { BoxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\n\nexport const Fullscreen: FC<BoxProps> = ({ children, sx, ...props }) => {\n const reference = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number>();\n\n const recompute = useEffectEvent(() => {\n if (!reference.current) return;\n const top = Math.ceil(reference.current.getBoundingClientRect().top);\n const avail = Math.max(0, window.innerHeight - top);\n setHeight(avail);\n });\n\n useEffect(() => {\n const element = reference.current;\n if (!element) return;\n\n recompute();\n\n window.addEventListener(\"resize\", recompute);\n\n const ro = new ResizeObserver(recompute);\n ro.observe(document.documentElement);\n ro.observe(document.body);\n ro.observe(element);\n\n return () => {\n window.removeEventListener(\"resize\", recompute);\n ro.disconnect();\n };\n }, []);\n\n return (\n <Box\n ref={reference}\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: 0,\n width: \"100%\",\n overflow: \"auto\",\n ...sx,\n }}\n height={height}\n {...props}\n >\n {children}\n </Box>\n );\n};","import CloudUpload from \"@mui/icons-material/CloudUpload\";\nimport { Paper, Typography, useTheme } from \"@mui/material\";\nimport { useDropzone } from \"react-dropzone\";\nimport { useTranslation } from \"react-i18next\";\nimport type { SxProps, Theme} from \"@mui/material\";\nimport type { CSSProperties, FC } from \"react\";\nimport type { DropzoneOptions} from \"react-dropzone\";\n\nconst baseStyle: CSSProperties = {\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n padding: \"20px\",\n borderWidth: 2,\n borderRadius: 2,\n borderStyle: \"dashed\",\n outline: \"none\",\n transition: \"border .24s ease-in-out\",\n cursor: \"pointer\",\n};\n\ninterface DropzoneProps extends DropzoneOptions {\n sx?: SxProps<Theme>;\n}\n\nexport const Dropzone: FC<DropzoneProps> = ({ sx, ...props }) => {\n const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject, } = useDropzone(props);\n const { t } = useTranslation();\n const theme = useTheme();\n\n const style = {\n ...baseStyle,\n ...(isFocused ? { borderColor: theme.palette.primary.main } : {}),\n ...(isDragAccept ? { borderColor: theme.palette.success.main } : {}),\n ...(isDragReject ? { borderColor: theme.palette.error.main } : {})\n };\n\n return (\n <Paper variant=\"outlined\" {...getRootProps({ style })} sx={sx}>\n <input {...getInputProps()} style={{ display: \"none\" }} />\n <CloudUpload />\n <Typography>{t(\"Layout.File.DragSomeFilesHereOrClickToSelectThem\")}</Typography>\n </Paper>\n );\n};","import { createContext, useContext } from \"react\";\nimport type { FileMeta } from \"../models/file/FileMeta\";\nimport type { FileActions } from \"~/models/file/FileActions\";\n\nexport interface FileContextValue {\n fileMetas: Array<FileMeta>;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n setImageId: (imageId: string) => void;\n};\n\nexport const FileContext = createContext<FileContextValue | null>(null);\n\nexport const useFile = () => {\n const context = useContext(FileContext);\n if (!context) {\n throw new Error(\"FileViewer components must be used within FileViewer\");\n }\n return context;\n};","import Delete from \"@mui/icons-material/Delete\";\nimport FileDownload from \"@mui/icons-material/FileDownload\";\nimport { List, ListItemButton, ListItemIcon, ListItemText, Menu } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\nimport type { FC } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDialogs } from \"~/hooks/DialogsHooks\";\nimport { useDeleteFile, useDownloadFile } from \"~/queries/FileHooks\";\n\ninterface ActionsMenuProps {\n meta: FileMeta;\n menu: { mouseX: number; mouseY: number } | null;\n setMenu: (menu: { mouseX: number; mouseY: number } | null) => void;\n}\n\nexport const ActionsMenu: FC<ActionsMenuProps> = ({ meta, menu, setMenu }) => {\n const { t } = useTranslation();\n const { fileMetas, onDelete, actions } = useFile();\n const { confirm } = useDialogs();\n\n const handleMenuClose = () => { setMenu(null); };\n\n const { mutate: download, isPending: isDownloading } = useDownloadFile();\n const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();\n\n const handleOnDownload = () => {\n handleMenuClose();\n download(meta);\n };\n\n const handleOnDelete = async () => {\n if (!await confirm(t(\"Layout.File.AreYouSureYouWantToDelete\", { fileName: meta.fileName })))\n return;\n\n deleteFile(meta);\n handleMenuClose();\n\n if (onDelete) {\n const remainingFileMetas: Array<FileMeta> = fileMetas.filter(m => m.id !== meta.id);\n onDelete({ remainingFileMetas, deletedFileMeta: meta });\n }\n };\n\n return (\n <Menu open={menu !== null} onClose={handleMenuClose} anchorReference=\"anchorPosition\" variant=\"menu\"\n anchorPosition={menu === null ? undefined : { top: menu.mouseY, left: menu.mouseX }}>\n <List disablePadding>\n {actions?.download !== false &&\n <ListItemButton onClick={handleOnDownload} disabled={isDownloading}>\n <ListItemIcon>\n <FileDownload />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Download\")}</ListItemText>\n </ListItemButton>\n }\n {actions?.delete !== false &&\n <ListItemButton onClick={handleOnDelete} disabled={isDeleting}>\n <ListItemIcon>\n <Delete />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Delete\")}</ListItemText>\n </ListItemButton>\n }\n </List>\n </Menu>\n );\n};\n","import MoreVert from \"@mui/icons-material/MoreVert\";\nimport { Box, IconButton, ImageListItem, ImageListItemBar, Stack, Tooltip } from \"@mui/material\";\nimport { grey } from \"@mui/material/colors\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useInView } from \"react-intersection-observer\";\nimport { ActionsMenu } from \"./common/ActionsMenu\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDownloadFile, useGetFileThumbnail, useOpenFile } from \"~/queries/FileHooks\";\n\nconst IMAGE_SIZE = 150;\n\ntype FileViewerGridItemBar = \"hidden\" | \"always\" | \"onMouseEnter\";\n\nexport interface FileViewerGridProps {\n size?: number;\n itemBar?: FileViewerGridItemBar;\n sx?: SxProps<Theme>;\n}\n\nexport const FileViewerGrid: React.FC<FileViewerGridProps> = ({ sx, size, itemBar }) => {\n const { fileMetas } = useFile();\n\n return (\n <Stack direction=\"row\" spacing={1} sx={{ overflow: \"auto\", ...sx }}>\n {fileMetas.map(fileMeta => (\n <GridFileViewerItem\n key={fileMeta.id}\n meta={fileMeta}\n size={size}\n itemBar={itemBar}\n />\n ))}\n </Stack>\n );\n};\n\ninterface GridFileViewerItemProps {\n meta: FileMeta;\n size?: number;\n itemBar?: FileViewerGridItemBar;\n}\n\nexport const GridFileViewerItem: React.FC<GridFileViewerItemProps> = ({ meta, size, itemBar }) => {\n const { setImageId, actions } = useFile();\n const [showItemBar, setShowItemBar] = useState<boolean>(itemBar === \"always\");\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\n const { ref, inView } = useInView();\n\n useEffect(() => {\n setShowItemBar(itemBar === \"always\");\n }, [itemBar]);\n\n const { data: source } = useGetFileThumbnail({ meta }, { enabled: inView });\n\n const handleOnMouseEnter = () => setShowItemBar(true);\n const handleOnMouseLeave = () => itemBar !== \"always\" && setShowItemBar(false);\n\n const openMenu = (event: React.MouseEvent) => {\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\n setTimeout(() => setShowItemBar(true));\n };\n\n const { mutate: openFile } = useOpenFile();\n const { mutate: download } = useDownloadFile();\n\n const onClick = () => {\n switch (meta.mediaType) {\n case \"image\": { return setImageId(meta.id); }\n case \"application\": { return openFile(meta); }\n case \"video\": { return openFile(meta); }\n default: { return download(meta); }\n }\n };\n\n return (\n <Fragment>\n <ImageListItem sx={{ width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }} onMouseEnter={handleOnMouseEnter} onMouseLeave={handleOnMouseLeave} ref={ref}>\n <Box\n component=\"img\"\n src={source}\n loading=\"lazy\"\n alt={\"thumbnail-\" + meta.id}\n onClick={onClick}\n sx={{ cursor: \"pointer\", objectFit: \"contain\", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }}\n />\n {(itemBar !== \"hidden\" && showItemBar) &&\n <ImageListItemBar\n title={\n <Tooltip title={meta.fileName}>\n <Box>\n {meta.fileName}\n </Box>\n </Tooltip>\n }\n actionIcon={\n (actions?.download !== false || actions.delete !== false) &&\n <IconButton sx={{ color: grey[100] }} onClick={openMenu}>\n <MoreVert />\n </IconButton>\n }\n />\n }\n </ImageListItem>\n\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\n </Fragment>\n );\n};\n","import AttachFile from \"@mui/icons-material/AttachFile\";\nimport Image from \"@mui/icons-material/Image\";\nimport MoreVert from \"@mui/icons-material/MoreVert\";\nimport SmartDisplay from \"@mui/icons-material/SmartDisplay\";\nimport { IconButton, List, ListItemButton, ListItemIcon, ListItemText } from \"@mui/material\";\nimport { Fragment, useState } from \"react\";\nimport { ActionsMenu } from \"./common/ActionsMenu\";\nimport type { FC } from \"react\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDownloadFile, useOpenFile } from \"~/queries/FileHooks\";\n\nexport interface FileViewerListProps {\n sx?: SxProps<Theme>;\n}\n\nexport const FileViewerList: FC<FileViewerListProps> = ({ sx }) => {\n const { fileMetas } = useFile();\n\n return (\n <List dense sx={sx}>\n {fileMetas.map(fileMeta =>\n <ListFileViewerItem\n key={fileMeta.id}\n meta={fileMeta}\n />\n )}\n </List>\n );\n};\n\ninterface ListFileViewerItemProps {\n meta: FileMeta;\n}\n\nexport const ListFileViewerItem: React.FC<ListFileViewerItemProps> = ({ meta }) => {\n const { setImageId, actions } = useFile();\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\n\n const openMenu = (event: React.MouseEvent) => {\n event.stopPropagation();\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\n };\n\n const { mutate: openFile } = useOpenFile();\n const { mutate: download } = useDownloadFile();\n\n const onClick = () => {\n switch (meta.mediaType) {\n case \"image\": { return setImageId(meta.id); }\n case \"application\": { return openFile(meta); }\n case \"video\": { return openFile(meta); }\n default: { return download(meta); }\n }\n };\n\n const icon = () => {\n switch (meta.mediaType) {\n case \"image\": {\n return <Image />;\n }\n case \"video\": {\n return <SmartDisplay />;\n }\n default: {\n return <AttachFile />;\n }\n }\n };\n\n return (\n <Fragment>\n <ListItemButton key={meta.id} onClick={onClick}>\n <ListItemIcon>\n {icon()}\n </ListItemIcon>\n <ListItemText primary={`${meta.fileName}.${meta.fileExtension}`} />\n {(actions?.download !== false || actions.delete !== false) &&\n <IconButton edge=\"end\" onClick={openMenu}>\n <MoreVert />\n </IconButton>\n }\n </ListItemButton>\n\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\n </Fragment>\n );\n};\n","import Close from \"@mui/icons-material/Close\";\nimport { Box, Dialog, Fab } from \"@mui/material\";\nimport React, { useEffect } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useGetFile } from \"~/queries/FileHooks\";\n\ninterface ImageViewerProps {\n metaId: string;\n}\n\nexport const ImageViewer: React.FC<ImageViewerProps> = ({ metaId }) => {\n const { fileMetas, setImageId } = useFile();\n\n const meta = fileMetas.find(m => m.id === metaId)!;\n\n const { data: source } = useGetFile({ meta });\n\n useEffect(() => {\n if (metaId)\n globalThis.addEventListener(\"keydown\", handleOnKeydown);\n\n return () => { globalThis.removeEventListener(\"keydown\", handleOnKeydown); };\n }, [metaId]);\n\n const handleOnKeydown = (event: KeyboardEvent) => {\n const images: Array<FileMeta> = fileMetas.filter(m => m.mediaType === \"image\");\n const imageIndex: number = images.findIndex(m => m.id === metaId);\n\n switch (event.key) {\n case \"ArrowLeft\": {\n return handleOnArrowLeft(images, imageIndex);\n }\n case \"ArrowRight\": {\n return handleOnArrowRight(images, imageIndex);\n }\n case \"Backspace\":\n case \"Escape\": {\n event.preventDefault();\n return onClose();\n }\n }\n };\n\n const handleOnArrowLeft = (images: Array<FileMeta>, index: number) => {\n if (index > 0) {\n const previousFile: FileMeta = images[index - 1];\n setImageId(previousFile.id);\n }\n };\n\n const handleOnArrowRight = (images: Array<FileMeta>, index: number) => {\n if (index < images.length - 1) {\n const nextFile: FileMeta = images[index + 1];\n setImageId(nextFile.id);\n }\n };\n\n const onClose = () => setImageId(\"\");\n\n if (!metaId) return null;\n\n return (\n <Dialog open onClose={onClose} maxWidth=\"xl\">\n <Box component=\"img\" src={source} alt={metaId} sx={{ maxWidth: \"100vw\", maxHeight: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" } }} />\n\n <Fab size=\"medium\" onClick={onClose} sx={{ position: \"fixed\", top: 8, right: 8 }}>\n <Close />\n </Fab>\n </Dialog>\n );\n};\n","import { useState } from \"react\";\nimport { FileViewerGrid } from \"./fileViewer/FileViewerGrid\";\nimport { FileViewerList } from \"./fileViewer/FileViewerList\";\nimport { ImageViewer } from \"./fileViewer/ImageViewer\";\nimport type { FileViewerGridProps } from \"./fileViewer/FileViewerGrid\";\nimport type { ComponentType, FC, ReactNode } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport type { FileActions } from \"~/models/file/FileActions\";\nimport type { FileViewerListProps } from \"./fileViewer/FileViewerList\";\nimport { FileContext } from \"~/contexts/FileContext\";\nimport { useGetFileMetas } from \"~/queries/FileHooks\";\n\ninterface FileViewerComponent {\n Grid: ComponentType<FileViewerGridProps>;\n List: ComponentType<FileViewerListProps>;\n}\n\ninterface FileViewerProps {\n subId: string;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n children: (component: FileViewerComponent) => ReactNode;\n}\n\nexport const FileViewer: FC<FileViewerProps> = ({ subId, onDelete, actions, children }) => {\n const { data: fileMetas = [] } = useGetFileMetas({ subId }, { enabled: !!subId });\n const [imageId, setImageId] = useState<string>(\"\");\n\n const components: FileViewerComponent = { Grid: FileViewerGrid, List: FileViewerList };\n\n if (fileMetas.length === 0) return null;\n\n return (\n <FileContext.Provider value={{ fileMetas, onDelete, actions, setImageId }}>\n {children(components)}\n <ImageViewer metaId={imageId} />\n </FileContext.Provider>\n );\n};\n","import { Chip, Stack } from \"@mui/material\";\nimport type { ChipProps} from \"@mui/material\";\nimport type { GridRenderCellParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\n\nconst isArray = (value: any) => Array.isArray(value);\n\ninterface ChipInputCellProps<T extends GridValidRowModel> {\n params: GridRenderCellParams<T>;\n slotProps?: ChipProps;\n getLabel?: (object: T) => string | number;\n}\n\nexport const ChipInputCell = <T extends GridValidRowModel>({ params, slotProps, getLabel }: ChipInputCellProps<T>) => {\n if (!params.value) return null;\n\n const getLabelValue = (value: any) => {\n if (getLabel) return getLabel(value);\n return value;\n };\n\n if (isArray(params.value))\n return (\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={{ overflowX: \"auto\", height: \"100%\", width: params.colDef.computedWidth }}>\n {params.value.map((value: any, index) =>\n <Chip key={`${index + 1}-chip-input-cell`} label={getLabelValue(value)} {...slotProps} />\n )}\n </Stack>\n );\n\n return <Chip label={getLabelValue(params.value)} {...slotProps} />;\n};","import Edit from \"@mui/icons-material/Edit\";\nimport { TypographyWithIcon } from \"../core/TypographyWithIcon\";\nimport type { GridColumnHeaderParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\n\nexport const EditableColumnHeader = <T extends GridValidRowModel>({ colDef }: GridColumnHeaderParams<T>) => {\n return <TypographyWithIcon endIcon={<Edit color=\"disabled\" fontSize=\"small\" />} variant=\"body2\" className=\"MuiDataGrid-columnHeaderTitle\">{colDef.headerName}</TypographyWithIcon>;\n};","import { Button } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ButtonProps<\"a\">>(function ButtonComponent(props, reference) {\n return <Button ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { GridActionsCellItem } from \"@mui/x-data-grid-premium\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { GridActionsCellItemProps } from \"@mui/x-data-grid-premium\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLButtonElement, GridActionsCellItemProps>(\n function GridActionsCellItemComponent(props, reference) {\n return <GridActionsCellItem ref={reference} component=\"a\" {...props} />;\n }\n) as React.ForwardRefExoticComponent<GridActionsCellItemProps & React.RefAttributes<HTMLButtonElement>>;\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterGridActionsCellItem: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { IconButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { IconButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, IconButtonProps<\"a\">>(function IconButtonComponent(props, reference) {\n return <IconButton ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterIconButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { Link } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { LinkProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(function LinkComponent(props, reference) {\n return <Link ref={reference} {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { Tab } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { TabProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, TabProps<\"a\">>(function TabComponent(props, reference) {\n return <Tab ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterTab: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { Box, Divider, Typography } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\n\nexport function RouterNotFound() {\n const { t } = useTranslation();\n\n return (\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>404</Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">{t(\"Layout.ThisPageCouldNotBeFound\")}</Typography>\n </Box>\n </Box>\n );\n}\n","import { Box, Divider, Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\n\ninterface RouterErrorProps {\n error: ErrorComponentProps[\"error\"];\n}\n\nexport const RouterError: FC<RouterErrorProps> = ({ error }) => {\n\n return (\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>{error.name || \"500\"}</Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">{error.message}</Typography>\n </Box>\n </Box>\n );\n};\n"],"names":["jsxs","jsx","Component","CreatedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQO,MAAM,qBAAwD,CAAC,EAAE,WAAW,SAAS,UAAU,IAAI,GAAG,YAAY;AACrH,QAAM,SAAyB;AAAA,IAC3B,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EACb;AAGJ,SACIA,kCAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,IAAI;AAAA,QACA,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,GAAG;AAAA,MAAA;AAAA,MAEP,KAAK;AAAA,MACJ,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,mDACI,OAAA,EAAM,WAAU,QAAO,IAAI,QACvB,UAAA,WAC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GAC3H,UAAAD,kCAAAA,KAAC,KAAA,EAAI,SAAQ,QAAO,YAAW,UAAS,IAAI,GAC1C,UAAA;AAAA,IAAAC,kCAAAA,IAAC,YAAA,EAAW,SAAQ,MAAK,WAAU,QAAO,YAAY,KAAK,IAAI,EAAE,YAAY,EAAA,GAAK,UAAA,OAAG;AAAA,IACrFA,kCAAAA,IAAC,SAAA,EAAQ,aAAY,YAAW,UAAQ,MAAC,IAAI,EAAE,IAAI,EAAA,EAAE,CAAG;AAAA,IACxDA,sCAAC,cAAW,SAAQ,MAAK,WAAU,QAAQ,UAAA,EAAE,gCAAgC,EAAA,CAAE;AAAA,EAAA,EAAA,CACjF,EAAA,CACF;AAEJ;ACPO,MAAM,cAAoC,CAAC,EAAE,YAAY;AAE9D,SACEA,kCAAAA,IAAC,OAAI,QAAO,SAAQ,SAAQ,QAAO,eAAc,UAAS,YAAW,UAAS,gBAAe,UAAS,WAAU,UAAS,IAAI,GAC3H,UAAAD,kCAAAA,KAAC,KAAA,EAAI,SAAQ,QAAO,YAAW,UAAS,IAAI,GAC1C,UAAA;AAAA,IAAAC,kCAAAA,IAAC,YAAA,EAAW,SAAQ,MAAK,WAAU,QAAO,YAAY,KAAK,IAAI,EAAE,YAAY,EAAA,GAAM,UAAA,MAAM,QAAQ,OAAM;AAAA,IACvGA,kCAAAA,IAAC,SAAA,EAAQ,aAAY,YAAW,UAAQ,MAAC,IAAI,EAAE,IAAI,EAAA,EAAE,CAAG;AAAA,0CACvD,YAAA,EAAW,SAAQ,MAAK,WAAU,QAAQ,gBAAM,QAAA,CAAQ;AAAA,EAAA,EAAA,CAC3D,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components/core/TypographyWithIcon.tsx","../src/components/core/Fullscreen.tsx","../src/components/file/Dropzone.tsx","../src/contexts/FileContext.ts","../src/components/file/fileViewer/common/ActionsMenu.tsx","../src/components/file/fileViewer/FileViewerGrid.tsx","../src/components/file/fileViewer/FileViewerList.tsx","../src/components/file/fileViewer/ImageViewer.tsx","../src/components/file/FileViewer.tsx","../src/components/data-grid/ChipInputCell.tsx","../src/components/data-grid/EditableColumnHeader.tsx","../src/components/router/RouterButton.tsx","../src/components/router/RouterGridActionsCellItem.tsx","../src/components/router/RouterIconButton.tsx","../src/components/router/RouterLink.tsx","../src/components/router/RouterTab.tsx","../src/components/router/RouterNotFound.tsx","../src/components/router/RouterError.tsx"],"sourcesContent":["import { Stack, Typography } from \"@mui/material\";\nimport type { SxProps, Theme, TypographyProps } from \"@mui/material\";\n\ninterface TypographyWithIconProps extends TypographyProps {\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n}\n\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, ...props }) => {\n const iconSx: SxProps<Theme> = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n lineHeight: 0,\n \"& > svg\": {\n display: \"block\",\n },\n };\n\n return (\n <Typography\n component=\"span\"\n sx={{\n display: \"inline-flex\",\n alignItems: \"center\",\n verticalAlign: \"middle\",\n ...sx,\n }}\n gap={1}\n {...props}\n >\n {startIcon && (\n <Stack component=\"span\" sx={iconSx}>\n {startIcon}\n </Stack>\n )}\n <Stack component=\"span\" sx={{ display: \"inline\", lineHeight: \"inherit\" }}>\n {children}\n </Stack>\n {endIcon && (\n <Stack component=\"span\" sx={iconSx}>\n {endIcon}\n </Stack>\n )}\n </Typography>\n );\n};","import { Box } from \"@mui/material\";\nimport { useEffect, useEffectEvent, useRef, useState } from \"react\";\nimport type { BoxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\n\nexport const Fullscreen: FC<BoxProps> = ({ children, sx, ...props }) => {\n const reference = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number>();\n\n const recompute = useEffectEvent(() => {\n if (!reference.current) return;\n const top = Math.ceil(reference.current.getBoundingClientRect().top);\n const avail = Math.max(0, window.innerHeight - top);\n setHeight(avail);\n });\n\n useEffect(() => {\n const element = reference.current;\n if (!element) return;\n\n recompute();\n\n window.addEventListener(\"resize\", recompute);\n\n const ro = new ResizeObserver(recompute);\n ro.observe(document.documentElement);\n ro.observe(document.body);\n ro.observe(element);\n\n return () => {\n window.removeEventListener(\"resize\", recompute);\n ro.disconnect();\n };\n }, []);\n\n return (\n <Box\n ref={reference}\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: 0,\n width: \"100%\",\n overflow: \"auto\",\n ...sx,\n }}\n height={height}\n {...props}\n >\n {children}\n </Box>\n );\n};","import CloudUpload from \"@mui/icons-material/CloudUpload\";\nimport { Paper, Typography, useTheme } from \"@mui/material\";\nimport { useDropzone } from \"react-dropzone\";\nimport { useTranslation } from \"react-i18next\";\nimport type { SxProps, Theme} from \"@mui/material\";\nimport type { CSSProperties, FC } from \"react\";\nimport type { DropzoneOptions} from \"react-dropzone\";\n\nconst baseStyle: CSSProperties = {\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n padding: \"20px\",\n borderWidth: 2,\n borderRadius: 2,\n borderStyle: \"dashed\",\n outline: \"none\",\n transition: \"border .24s ease-in-out\",\n cursor: \"pointer\",\n};\n\ninterface DropzoneProps extends DropzoneOptions {\n sx?: SxProps<Theme>;\n}\n\nexport const Dropzone: FC<DropzoneProps> = ({ sx, ...props }) => {\n const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject, } = useDropzone(props);\n const { t } = useTranslation();\n const theme = useTheme();\n\n const style = {\n ...baseStyle,\n ...(isFocused ? { borderColor: theme.palette.primary.main } : {}),\n ...(isDragAccept ? { borderColor: theme.palette.success.main } : {}),\n ...(isDragReject ? { borderColor: theme.palette.error.main } : {})\n };\n\n return (\n <Paper variant=\"outlined\" {...getRootProps({ style })} sx={sx}>\n <input {...getInputProps()} style={{ display: \"none\" }} />\n <CloudUpload />\n <Typography>{t(\"Layout.File.DragSomeFilesHereOrClickToSelectThem\")}</Typography>\n </Paper>\n );\n};","import { createContext, useContext } from \"react\";\nimport type { FileMeta } from \"../models/file/FileMeta\";\nimport type { FileActions } from \"~/models/file/FileActions\";\n\nexport interface FileContextValue {\n fileMetas: Array<FileMeta>;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n setImageId: (imageId: string) => void;\n};\n\nexport const FileContext = createContext<FileContextValue | null>(null);\n\nexport const useFile = () => {\n const context = useContext(FileContext);\n if (!context) {\n throw new Error(\"FileViewer components must be used within FileViewer\");\n }\n return context;\n};","import Delete from \"@mui/icons-material/Delete\";\nimport FileDownload from \"@mui/icons-material/FileDownload\";\nimport { List, ListItemButton, ListItemIcon, ListItemText, Menu } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\nimport type { FC } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDialogs } from \"~/hooks/DialogsHooks\";\nimport { useDeleteFile, useDownloadFile } from \"~/queries/FileHooks\";\n\ninterface ActionsMenuProps {\n meta: FileMeta;\n menu: { mouseX: number; mouseY: number } | null;\n setMenu: (menu: { mouseX: number; mouseY: number } | null) => void;\n}\n\nexport const ActionsMenu: FC<ActionsMenuProps> = ({ meta, menu, setMenu }) => {\n const { t } = useTranslation();\n const { fileMetas, onDelete, actions } = useFile();\n const { confirm } = useDialogs();\n\n const handleMenuClose = () => { setMenu(null); };\n\n const { mutate: download, isPending: isDownloading } = useDownloadFile();\n const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();\n\n const handleOnDownload = () => {\n handleMenuClose();\n download(meta);\n };\n\n const handleOnDelete = async () => {\n if (!await confirm(t(\"Layout.File.AreYouSureYouWantToDelete\", { fileName: meta.fileName })))\n return;\n\n deleteFile(meta);\n handleMenuClose();\n\n if (onDelete) {\n const remainingFileMetas: Array<FileMeta> = fileMetas.filter(m => m.id !== meta.id);\n onDelete({ remainingFileMetas, deletedFileMeta: meta });\n }\n };\n\n return (\n <Menu open={menu !== null} onClose={handleMenuClose} anchorReference=\"anchorPosition\" variant=\"menu\"\n anchorPosition={menu === null ? undefined : { top: menu.mouseY, left: menu.mouseX }}>\n <List disablePadding>\n {actions?.download !== false &&\n <ListItemButton onClick={handleOnDownload} disabled={isDownloading}>\n <ListItemIcon>\n <FileDownload />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Download\")}</ListItemText>\n </ListItemButton>\n }\n {actions?.delete !== false &&\n <ListItemButton onClick={handleOnDelete} disabled={isDeleting}>\n <ListItemIcon>\n <Delete />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Delete\")}</ListItemText>\n </ListItemButton>\n }\n </List>\n </Menu>\n );\n};\n","import MoreVert from \"@mui/icons-material/MoreVert\";\nimport { Box, IconButton, ImageListItem, ImageListItemBar, Stack, Tooltip } from \"@mui/material\";\nimport { grey } from \"@mui/material/colors\";\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useInView } from \"react-intersection-observer\";\nimport { ActionsMenu } from \"./common/ActionsMenu\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDownloadFile, useGetFileThumbnail, useOpenFile } from \"~/queries/FileHooks\";\n\nconst IMAGE_SIZE = 150;\n\ntype FileViewerGridItemBar = \"hidden\" | \"always\" | \"onMouseEnter\";\n\nexport interface FileViewerGridProps {\n size?: number;\n itemBar?: FileViewerGridItemBar;\n sx?: SxProps<Theme>;\n}\n\nexport const FileViewerGrid: React.FC<FileViewerGridProps> = ({ sx, size, itemBar }) => {\n const { fileMetas } = useFile();\n\n return (\n <Stack direction=\"row\" spacing={1} sx={{ overflow: \"auto\", ...sx }}>\n {fileMetas.map(fileMeta => (\n <GridFileViewerItem\n key={fileMeta.id}\n meta={fileMeta}\n size={size}\n itemBar={itemBar}\n />\n ))}\n </Stack>\n );\n};\n\ninterface GridFileViewerItemProps {\n meta: FileMeta;\n size?: number;\n itemBar?: FileViewerGridItemBar;\n}\n\nexport const GridFileViewerItem: React.FC<GridFileViewerItemProps> = ({ meta, size, itemBar }) => {\n const { setImageId, actions } = useFile();\n const [showItemBar, setShowItemBar] = useState<boolean>(itemBar === \"always\");\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\n const { ref, inView } = useInView();\n\n useEffect(() => {\n setShowItemBar(itemBar === \"always\");\n }, [itemBar]);\n\n const { data: source } = useGetFileThumbnail({ meta }, { enabled: inView });\n\n const handleOnMouseEnter = () => setShowItemBar(true);\n const handleOnMouseLeave = () => itemBar !== \"always\" && setShowItemBar(false);\n\n const openMenu = (event: React.MouseEvent) => {\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\n setTimeout(() => setShowItemBar(true));\n };\n\n const { mutate: openFile } = useOpenFile();\n const { mutate: download } = useDownloadFile();\n\n const onClick = () => {\n switch (meta.mediaType) {\n case \"image\": { return setImageId(meta.id); }\n case \"application\": { return openFile(meta); }\n case \"video\": { return openFile(meta); }\n default: { return download(meta); }\n }\n };\n\n return (\n <Fragment>\n <ImageListItem sx={{ width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }} onMouseEnter={handleOnMouseEnter} onMouseLeave={handleOnMouseLeave} ref={ref}>\n <Box\n component=\"img\"\n src={source}\n loading=\"lazy\"\n alt={\"thumbnail-\" + meta.id}\n onClick={onClick}\n sx={{ cursor: \"pointer\", objectFit: \"contain\", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }}\n />\n {(itemBar !== \"hidden\" && showItemBar) &&\n <ImageListItemBar\n title={\n <Tooltip title={meta.fileName}>\n <Box>\n {meta.fileName}\n </Box>\n </Tooltip>\n }\n actionIcon={\n (actions?.download !== false || actions.delete !== false) &&\n <IconButton sx={{ color: grey[100] }} onClick={openMenu}>\n <MoreVert />\n </IconButton>\n }\n />\n }\n </ImageListItem>\n\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\n </Fragment>\n );\n};\n","import AttachFile from \"@mui/icons-material/AttachFile\";\nimport Image from \"@mui/icons-material/Image\";\nimport MoreVert from \"@mui/icons-material/MoreVert\";\nimport SmartDisplay from \"@mui/icons-material/SmartDisplay\";\nimport { IconButton, List, ListItemButton, ListItemIcon, ListItemText } from \"@mui/material\";\nimport { Fragment, useState } from \"react\";\nimport { ActionsMenu } from \"./common/ActionsMenu\";\nimport type { FC } from \"react\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDownloadFile, useOpenFile } from \"~/queries/FileHooks\";\n\nexport interface FileViewerListProps {\n sx?: SxProps<Theme>;\n}\n\nexport const FileViewerList: FC<FileViewerListProps> = ({ sx }) => {\n const { fileMetas } = useFile();\n\n return (\n <List dense sx={sx}>\n {fileMetas.map(fileMeta =>\n <ListFileViewerItem\n key={fileMeta.id}\n meta={fileMeta}\n />\n )}\n </List>\n );\n};\n\ninterface ListFileViewerItemProps {\n meta: FileMeta;\n}\n\nexport const ListFileViewerItem: React.FC<ListFileViewerItemProps> = ({ meta }) => {\n const { setImageId, actions } = useFile();\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\n\n const openMenu = (event: React.MouseEvent) => {\n event.stopPropagation();\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\n };\n\n const { mutate: openFile } = useOpenFile();\n const { mutate: download } = useDownloadFile();\n\n const onClick = () => {\n switch (meta.mediaType) {\n case \"image\": { return setImageId(meta.id); }\n case \"application\": { return openFile(meta); }\n case \"video\": { return openFile(meta); }\n default: { return download(meta); }\n }\n };\n\n const icon = () => {\n switch (meta.mediaType) {\n case \"image\": {\n return <Image />;\n }\n case \"video\": {\n return <SmartDisplay />;\n }\n default: {\n return <AttachFile />;\n }\n }\n };\n\n return (\n <Fragment>\n <ListItemButton key={meta.id} onClick={onClick}>\n <ListItemIcon>\n {icon()}\n </ListItemIcon>\n <ListItemText primary={`${meta.fileName}.${meta.fileExtension}`} />\n {(actions?.download !== false || actions.delete !== false) &&\n <IconButton edge=\"end\" onClick={openMenu}>\n <MoreVert />\n </IconButton>\n }\n </ListItemButton>\n\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\n </Fragment>\n );\n};\n","import Close from \"@mui/icons-material/Close\";\nimport { Box, Dialog, Fab } from \"@mui/material\";\nimport React, { useEffect } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useGetFile } from \"~/queries/FileHooks\";\n\ninterface ImageViewerProps {\n metaId: string;\n}\n\nexport const ImageViewer: React.FC<ImageViewerProps> = ({ metaId }) => {\n const { fileMetas, setImageId } = useFile();\n\n const meta = fileMetas.find(m => m.id === metaId)!;\n\n const { data: source } = useGetFile({ meta });\n\n useEffect(() => {\n if (metaId)\n globalThis.addEventListener(\"keydown\", handleOnKeydown);\n\n return () => { globalThis.removeEventListener(\"keydown\", handleOnKeydown); };\n }, [metaId]);\n\n const handleOnKeydown = (event: KeyboardEvent) => {\n const images: Array<FileMeta> = fileMetas.filter(m => m.mediaType === \"image\");\n const imageIndex: number = images.findIndex(m => m.id === metaId);\n\n switch (event.key) {\n case \"ArrowLeft\": {\n return handleOnArrowLeft(images, imageIndex);\n }\n case \"ArrowRight\": {\n return handleOnArrowRight(images, imageIndex);\n }\n case \"Backspace\":\n case \"Escape\": {\n event.preventDefault();\n return onClose();\n }\n }\n };\n\n const handleOnArrowLeft = (images: Array<FileMeta>, index: number) => {\n if (index > 0) {\n const previousFile: FileMeta = images[index - 1];\n setImageId(previousFile.id);\n }\n };\n\n const handleOnArrowRight = (images: Array<FileMeta>, index: number) => {\n if (index < images.length - 1) {\n const nextFile: FileMeta = images[index + 1];\n setImageId(nextFile.id);\n }\n };\n\n const onClose = () => setImageId(\"\");\n\n if (!metaId) return null;\n\n return (\n <Dialog open onClose={onClose} maxWidth=\"xl\">\n <Box component=\"img\" src={source} alt={metaId} sx={{ maxWidth: \"100vw\", maxHeight: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" } }} />\n\n <Fab size=\"medium\" onClick={onClose} sx={{ position: \"fixed\", top: 8, right: 8 }}>\n <Close />\n </Fab>\n </Dialog>\n );\n};\n","import { useState } from \"react\";\nimport { FileViewerGrid } from \"./fileViewer/FileViewerGrid\";\nimport { FileViewerList } from \"./fileViewer/FileViewerList\";\nimport { ImageViewer } from \"./fileViewer/ImageViewer\";\nimport type { FileViewerGridProps } from \"./fileViewer/FileViewerGrid\";\nimport type { ComponentType, FC, ReactNode } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport type { FileActions } from \"~/models/file/FileActions\";\nimport type { FileViewerListProps } from \"./fileViewer/FileViewerList\";\nimport { FileContext } from \"~/contexts/FileContext\";\nimport { useGetFileMetas } from \"~/queries/FileHooks\";\n\ninterface FileViewerComponent {\n Grid: ComponentType<FileViewerGridProps>;\n List: ComponentType<FileViewerListProps>;\n}\n\ninterface FileViewerProps {\n subId: string;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n children: (component: FileViewerComponent) => ReactNode;\n}\n\nexport const FileViewer: FC<FileViewerProps> = ({ subId, onDelete, actions, children }) => {\n const { data: fileMetas = [] } = useGetFileMetas({ subId }, { enabled: !!subId });\n const [imageId, setImageId] = useState<string>(\"\");\n\n const components: FileViewerComponent = { Grid: FileViewerGrid, List: FileViewerList };\n\n if (fileMetas.length === 0) return null;\n\n return (\n <FileContext.Provider value={{ fileMetas, onDelete, actions, setImageId }}>\n {children(components)}\n <ImageViewer metaId={imageId} />\n </FileContext.Provider>\n );\n};\n","import { Chip, Stack } from \"@mui/material\";\nimport type { ChipProps} from \"@mui/material\";\nimport type { GridRenderCellParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\n\nconst isArray = (value: any) => Array.isArray(value);\n\ninterface ChipInputCellProps<T extends GridValidRowModel> {\n params: GridRenderCellParams<T>;\n slotProps?: ChipProps;\n getLabel?: (object: T) => string | number;\n}\n\nexport const ChipInputCell = <T extends GridValidRowModel>({ params, slotProps, getLabel }: ChipInputCellProps<T>) => {\n if (!params.value) return null;\n\n const getLabelValue = (value: any) => {\n if (getLabel) return getLabel(value);\n return value;\n };\n\n if (isArray(params.value))\n return (\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={{ overflowX: \"auto\", height: \"100%\", width: params.colDef.computedWidth }}>\n {params.value.map((value: any, index) =>\n <Chip key={`${index + 1}-chip-input-cell`} label={getLabelValue(value)} {...slotProps} />\n )}\n </Stack>\n );\n\n return <Chip label={getLabelValue(params.value)} {...slotProps} />;\n};","import Edit from \"@mui/icons-material/Edit\";\nimport { TypographyWithIcon } from \"../core/TypographyWithIcon\";\nimport type { GridColumnHeaderParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\n\nexport const EditableColumnHeader = <T extends GridValidRowModel>({ colDef }: GridColumnHeaderParams<T>) => {\n return <TypographyWithIcon endIcon={<Edit color=\"disabled\" fontSize=\"small\" />} variant=\"body2\" className=\"MuiDataGrid-columnHeaderTitle\">{colDef.headerName}</TypographyWithIcon>;\n};","import { Button } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ButtonProps<\"a\">>(function ButtonComponent(props, reference) {\n return <Button ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { GridActionsCellItem } from \"@mui/x-data-grid-premium\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { GridActionsCellItemProps } from \"@mui/x-data-grid-premium\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLButtonElement, GridActionsCellItemProps>(\n function GridActionsCellItemComponent(props, reference) {\n return <GridActionsCellItem ref={reference} component=\"a\" {...props} />;\n }\n) as React.ForwardRefExoticComponent<GridActionsCellItemProps & React.RefAttributes<HTMLButtonElement>>;\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterGridActionsCellItem: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { IconButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { IconButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, IconButtonProps<\"a\">>(function IconButtonComponent(props, reference) {\n return <IconButton ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterIconButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { Link } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { LinkProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(function LinkComponent(props, reference) {\n return <Link ref={reference} {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { Tab } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { TabProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, TabProps<\"a\">>(function TabComponent(props, reference) {\n return <Tab ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterTab: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};","import { Box, Divider, Typography } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\n\nexport function RouterNotFound() {\n const { t } = useTranslation();\n\n return (\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>404</Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">{t(\"Layout.ThisPageCouldNotBeFound\")}</Typography>\n </Box>\n </Box>\n );\n}\n","import { Box, Divider, Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\n\ninterface RouterErrorProps {\n error: ErrorComponentProps[\"error\"];\n}\n\nexport const RouterError: FC<RouterErrorProps> = ({ error }) => {\n\n return (\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>{error.name || \"500\"}</Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">{error.message}</Typography>\n </Box>\n </Box>\n );\n};\n"],"names":["jsxs","jsx","Component","CreatedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQO,MAAM,qBAAwD,CAAC,EAAE,WAAW,SAAS,UAAU,IAAI,GAAG,YAAY;AACrH,QAAM,SAAyB;AAAA,IAC3B,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EACb;AAGJ,SACIA,kCAAAA;AAAA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AAA,EAAA,EAAA,CAC3D,EAAA,CACF;AAEJ;"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { TimePickerProps } from '@mui/x-date-pickers-pro';
|
|
|
25
25
|
import { TimeRangePickerProps } from '@mui/x-date-pickers-pro';
|
|
26
26
|
import { useInView } from 'react-intersection-observer';
|
|
27
27
|
import { WithFormProps } from '@tanstack/react-form';
|
|
28
|
+
import * as z from 'zod';
|
|
28
29
|
|
|
29
30
|
declare interface AlertOptions {
|
|
30
31
|
title?: ReactNode;
|
|
@@ -154,6 +155,20 @@ readonly DateTimeRangePicker: FC<FormDateTimeRangePickerProps>;
|
|
|
154
155
|
readonly SubmitButton: FC<FormSubmitButtonProps>;
|
|
155
156
|
}>;
|
|
156
157
|
|
|
158
|
+
declare type User = z.infer<typeof UserSchema>;
|
|
159
|
+
|
|
160
|
+
declare const UserSchema: z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
name: z.ZodString;
|
|
163
|
+
jobTitle: z.ZodString;
|
|
164
|
+
email: z.ZodEmail;
|
|
165
|
+
mobilePhone: z.ZodString;
|
|
166
|
+
photo: z.ZodNullable<z.ZodString>;
|
|
167
|
+
groups: z.ZodArray<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
|
|
170
|
+
export declare function useUser(): User;
|
|
171
|
+
|
|
157
172
|
export declare const withLayoutForm: <TFormData, TOnMount extends FormValidateOrFn<TFormData> | undefined, TOnChange extends FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
158
173
|
readonly TextField: FC<FormTextFieldProps>;
|
|
159
174
|
readonly NumberField: FC<FormNumberFieldProps>;
|
package/dist/hooks.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createFormHookContexts, createFormHook } from "@tanstack/react-form";
|
|
2
|
-
import { j as jsxRuntimeExports } from "./
|
|
3
|
-
import { u } from "./DialogsHooks-Bi8dZoyu.js";
|
|
2
|
+
import { j as jsxRuntimeExports } from "./DialogsContext-DMZRefiY.js";
|
|
4
3
|
import { Autocomplete, TextField, FormControl, FormControlLabel, Checkbox, FormHelperText, FormLabel, RadioGroup, Radio, Slider, Button, Switch } from "@mui/material";
|
|
5
|
-
import { g as getFieldStatus } from "./utils-
|
|
4
|
+
import { g as getFieldStatus } from "./utils-CKW5pi6k.js";
|
|
6
5
|
import { DatePicker, DateRangePicker, TimePicker, TimeRangePicker, DateTimePicker, DateTimeRangePicker } from "@mui/x-date-pickers-pro";
|
|
7
6
|
import { NumericFormat } from "react-number-format";
|
|
7
|
+
import { u } from "./DialogsHooks-DBK6rBoU.js";
|
|
8
|
+
import { u as u2 } from "./UseHook-DB7btKDE.js";
|
|
8
9
|
import { useInView } from "react-intersection-observer";
|
|
9
10
|
const FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
|
|
10
11
|
const field = useFieldContext();
|
|
@@ -348,6 +349,7 @@ export {
|
|
|
348
349
|
useFormContext,
|
|
349
350
|
useInView,
|
|
350
351
|
useLayoutForm,
|
|
352
|
+
u2 as useUser,
|
|
351
353
|
withLayoutForm
|
|
352
354
|
};
|
|
353
355
|
//# sourceMappingURL=hooks.js.map
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":["../src/components/form/FormAutocomplete.tsx","../src/components/form/FormCheckbox.tsx","../src/components/form/FormDatePicker.tsx","../src/components/form/FormDateRangePicker.tsx","../src/components/form/FormTimePicker.tsx","../src/components/form/FormTimeRangePicker.tsx","../src/components/form/FormDateTimePicker.tsx","../src/components/form/FormDateTimeRangePicker.tsx","../src/components/form/FormNumberField.tsx","../src/components/form/FormRadioGroup.tsx","../src/components/form/FormSlider.tsx","../src/components/form/FormSubmitButton.tsx","../src/components/form/FormSwitch.tsx","../src/components/form/FormTextField.tsx","../src/hooks/FormHooks.ts"],"sourcesContent":["import { Autocomplete, TextField } from \"@mui/material\";\nimport type { AutocompleteProps, TextFieldProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormAutocompleteProps extends Omit<AutocompleteProps<any, boolean, boolean, boolean>, FormOmittedProps> {\n textFieldProps?: Omit<TextFieldProps, FormOmittedProps>;\n}\n\nexport const FormAutocomplete: FC<FormAutocompleteProps> = ({ textFieldProps, ...autocompleteProps }) => {\n const field = useFieldContext();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <Autocomplete\n value={field.state.value}\n onChange={(_, value) => !autocompleteProps.freeSolo && field.handleChange(value)}\n onInputChange={(_, value, reason) => reason !== \"reset\" && autocompleteProps.freeSolo && field.handleChange(value)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...autocompleteProps}\n renderInput={(parameters) =>\n <TextField\n {...parameters}\n name={field.name}\n error={isTouched && hasError}\n helperText={isTouched && helperText}\n {...textFieldProps}\n />\n }\n />\n );\n};","import { Checkbox, FormControl, FormControlLabel, FormHelperText } from \"@mui/material\";\nimport type { CheckboxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormCheckboxProps extends Omit<CheckboxProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormCheckbox: FC<FormCheckboxProps> = (props) => {\n const field = useFieldContext<boolean | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n <FormControlLabel\n control={\n <Checkbox\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n />\n }\n label={props.label ?? \"\"}\n />\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};","import { DatePicker } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DatePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDatePickerProps extends Omit<DatePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDatePicker: FC<FormDatePickerProps> = (props) => {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DatePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { DateRangePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DateRangePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDateRangePickerProps extends Omit<DateRangePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDateRangePicker: FC<FormDateRangePickerProps> = (props) => {\n const field = useFieldContext<[Dayjs | null, Dayjs | null] | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DateRangePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { TimePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { TimePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTimePickerProps extends Omit<TimePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormTimePicker: FC<FormTimePickerProps> = (props) => {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <TimePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { TimeRangePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { TimeRangePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTimeRangePickerProps extends Omit<TimeRangePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormTimeRangePicker: FC<FormTimeRangePickerProps> = (props) => {\n const field = useFieldContext<[Dayjs | null, Dayjs | null] | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <TimeRangePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { DateTimePicker } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DateTimePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDateTimePickerProps extends Omit<DateTimePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDateTimePicker: FC<FormDateTimePickerProps> = (props) => {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DateTimePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps,\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { DateTimeRangePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DateTimeRangePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDateTimeRangePickerProps extends Omit<DateTimeRangePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDateTimeRangePicker: FC<FormDateTimeRangePickerProps> = (props) => {\n const field = useFieldContext<[Dayjs | null, Dayjs | null] | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DateTimeRangePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { TextField } from \"@mui/material\";\nimport { NumericFormat } from \"react-number-format\";\nimport type { InputAttributes, NumericFormatProps } from \"react-number-format/types/types\";\nimport type { FC } from \"react\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormNumberFieldProps extends Omit<TextFieldProps, FormOmittedProps> {\n\tdefaultValue?: number | null;\n\toptions?: Omit<NumericFormatProps<InputAttributes>, \"customInput\" | \"onValueChange\" | keyof InputAttributes>;\n}\n\nexport const FormNumberField: FC<FormNumberFieldProps> = ({ options, ...props }) => {\n\tconst field = useFieldContext<number | null | undefined>();\n\tconst { isTouched, hasError, helperText } = getFieldStatus(field);\n\n\treturn (\n\t\t<NumericFormat\n\t\t\tcustomInput={TextField}\n\t\t\tname={field.name}\n\t\t\tvalue={field.state.value ?? \"\"}\n\t\t\tonValueChange={({ floatValue }) => field.handleChange(floatValue)}\n\t\t\tonBlur={field.handleBlur}\n\t\t\terror={isTouched && hasError}\n\t\t\thelperText={isTouched && helperText}\n\t\t\taria-label={field.name}\n\t\t\t{...props}\n\t\t\t{...options}\n\t\t/>\n\t);\n};\n","import { FormControl, FormControlLabel, FormHelperText, FormLabel, Radio, RadioGroup } from \"@mui/material\";\nimport type { RadioGroupProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\ninterface Option {\n label: string;\n value: string | number;\n}\n\nexport interface FormRadioGroupProps extends Omit<RadioGroupProps, FormOmittedProps> {\n label?: string;\n options: Array<Option>;\n}\n\nexport const FormRadioGroup: FC<FormRadioGroupProps> = ({ label, options, ...props }) => {\n const field = useFieldContext<string | number | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n {label && <FormLabel component=\"legend\">{label}</FormLabel>}\n <RadioGroup\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n >\n {options.map((option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n ))}\n </RadioGroup>\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { FormControl, FormHelperText, FormLabel, Slider } from \"@mui/material\";\nimport type { SliderProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormSliderProps extends Omit<SliderProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormSlider: FC<FormSliderProps> = ({ label, ...props }) => {\n const field = useFieldContext<number | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n {label && <FormLabel>{label}</FormLabel>}\n <Slider\n name={field.name}\n value={field.state.value ?? 0}\n onChange={(_, value) => field.handleChange(Array.isArray(value) ? value[0] : value)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n />\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { Button } from \"@mui/material\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useFormContext } from \"~/hooks/FormHooks\";\n\nexport type FormSubmitButtonProps = Omit<ButtonProps, \"loading\" | \"disabled\" | \"onClick\" | \"type\">;\n\nexport const FormSubmitButton: FC<FormSubmitButtonProps> = (props) => {\n const form = useFormContext();\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n form.handleSubmit();\n };\n\n return (\n <form.Subscribe selector={(state) => [state.canSubmit, state.isSubmitting]}>\n {([canSubmit, isSubmitting]) => (\n <Button\n loading={isSubmitting}\n disabled={!canSubmit}\n onClick={handleClick}\n type=\"submit\"\n aria-label=\"submit\"\n {...props}\n />\n )}\n </form.Subscribe>\n );\n};","import { FormControl, FormControlLabel, FormHelperText, Switch } from \"@mui/material\";\nimport type { SwitchProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormSwitchProps extends Omit<SwitchProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormSwitch: FC<FormSwitchProps> = (props) => {\n const field = useFieldContext<boolean | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n <FormControlLabel\n control={\n <Switch\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n />\n }\n label={props.label ?? \"\"}\n />\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { TextField } from \"@mui/material\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTextFieldProps extends Omit<TextFieldProps, FormOmittedProps> {\n type?: \"color\" | \"email\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\"\n}\n\nexport const FormTextField: FC<FormTextFieldProps> = (props) => {\n const field = useFieldContext<string | number | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <TextField\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={event => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n error={isTouched && hasError}\n helperText={isTouched && helperText}\n aria-label={field.name}\n {...props}\n />\n );\n};","import { createFormHook, createFormHookContexts } from \"@tanstack/react-form\";\nimport { FormAutocomplete as Autocomplete } from \"~/components/form/FormAutocomplete\";\nimport { FormCheckbox as Checkbox } from \"~/components/form/FormCheckbox\";\nimport { FormDatePicker as DatePicker } from \"~/components/form/FormDatePicker\";\nimport { FormDateRangePicker as DateRangePicker } from \"~/components/form/FormDateRangePicker\";\nimport { FormTimePicker as TimePicker } from \"~/components/form/FormTimePicker\";\nimport { FormTimeRangePicker as TimeRangePicker } from \"~/components/form/FormTimeRangePicker\";\nimport { FormDateTimePicker as DateTimePicker } from \"~/components/form/FormDateTimePicker\";\nimport { FormDateTimeRangePicker as DateTimeRangePicker } from \"~/components/form/FormDateTimeRangePicker\";\nimport { FormNumberField as NumberField } from \"~/components/form/FormNumberField\";\nimport { FormRadioGroup as RadioGroup } from \"~/components/form/FormRadioGroup\";\nimport { FormSlider as Slider } from \"~/components/form/FormSlider\";\nimport { FormSubmitButton as SubmitButton } from \"~/components/form/FormSubmitButton\";\nimport { FormSwitch as Switch } from \"~/components/form/FormSwitch\";\nimport { FormTextField as TextField } from \"~/components/form/FormTextField\";\n\nexport const { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts();\n\nexport const { useAppForm: useLayoutForm, withForm: withLayoutForm } =\n createFormHook({\n fieldComponents: {\n TextField,\n NumberField,\n Autocomplete,\n Checkbox,\n Switch,\n RadioGroup,\n Slider,\n DatePicker,\n DateRangePicker,\n TimePicker,\n TimeRangePicker,\n DateTimePicker,\n DateTimeRangePicker,\n },\n formComponents: {\n SubmitButton,\n },\n fieldContext,\n formContext,\n });\n"],"names":["jsx","jsxs","TextField","NumberField","Autocomplete","Checkbox","Switch","RadioGroup","Slider","DatePicker","DateRangePicker","TimePicker","TimeRangePicker","DateTimePicker","DateTimeRangePicker","SubmitButton"],"mappings":";;;;;;;;AAWO,MAAM,mBAA8C,CAAC,EAAE,gBAAgB,GAAG,wBAAwB;AACrG,QAAM,QAAQ,gBAAA;AACd,QAAM,EAAE,WAAW,UAAU,WAAA,IAAe,eAAe,KAAK;AAEhE,SACIA,kCAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG,OAAO,MAAM,MAAM;AAAA,MACnB,UAAU,CAAC,GAAG,UAAU,CAAC,kBAAkB,YAAY,MAAM,aAAa,KAAK;AAAA,MAC/E,eAAe,CAAC,GAAG,OAAO,WAAW,WAAW,WAAW,kBAAkB,YAAY,MAAM,aAAa,KAAK;AAAA,MACjH,QAAQ,MAAM;AAAA,MACd,cAAY,MAAM;AAAA,MACjB,GAAG;AAAA,MACJ,aAAa,CAAC,eACVA,kCAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACI,GAAG;AAAA,UACJ,MAAM,MAAM;AAAA,UACZ,OAAO,aAAa;AAAA,UACpB,YAAY,aAAa;AAAA,UACxB,GAAG;AAAA,QAAA;AAAA,MAAA;AAA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AA,IAAA,aACAC;AAAAA,IAAA,cACAC;AAAAA,IAAA,UACAC;AAAAA,IAAA,QACAC;AAAAA,IAAA,YACAC;AAAAA,IAAA,QACAC;AAAAA,IAAA,YACAC;AAAAA,IAAA,iBACAC;AAAAA,IAAA,YACAC;AAAAA,IAAA,iBACAC;AAAAA,IAAA,gBACAC;AAAAA,IAAA,qBACAC;AAAAA,EAAA;AAAA,EAEJ,gBAAgB;AAAA,IAAA,cACZC;AAAAA,EAAA;AAAA,EAEJ;AAAA,EACA;AACJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":["../src/components/form/FormAutocomplete.tsx","../src/components/form/FormCheckbox.tsx","../src/components/form/FormDatePicker.tsx","../src/components/form/FormDateRangePicker.tsx","../src/components/form/FormTimePicker.tsx","../src/components/form/FormTimeRangePicker.tsx","../src/components/form/FormDateTimePicker.tsx","../src/components/form/FormDateTimeRangePicker.tsx","../src/components/form/FormNumberField.tsx","../src/components/form/FormRadioGroup.tsx","../src/components/form/FormSlider.tsx","../src/components/form/FormSubmitButton.tsx","../src/components/form/FormSwitch.tsx","../src/components/form/FormTextField.tsx","../src/hooks/FormHooks.ts"],"sourcesContent":["import { Autocomplete, TextField } from \"@mui/material\";\nimport type { AutocompleteProps, TextFieldProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormAutocompleteProps extends Omit<AutocompleteProps<any, boolean, boolean, boolean>, FormOmittedProps> {\n textFieldProps?: Omit<TextFieldProps, FormOmittedProps>;\n}\n\nexport const FormAutocomplete: FC<FormAutocompleteProps> = ({ textFieldProps, ...autocompleteProps }) => {\n const field = useFieldContext();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <Autocomplete\n value={field.state.value}\n onChange={(_, value) => !autocompleteProps.freeSolo && field.handleChange(value)}\n onInputChange={(_, value, reason) => reason !== \"reset\" && autocompleteProps.freeSolo && field.handleChange(value)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...autocompleteProps}\n renderInput={(parameters) =>\n <TextField\n {...parameters}\n name={field.name}\n error={isTouched && hasError}\n helperText={isTouched && helperText}\n {...textFieldProps}\n />\n }\n />\n );\n};","import { Checkbox, FormControl, FormControlLabel, FormHelperText } from \"@mui/material\";\nimport type { CheckboxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormCheckboxProps extends Omit<CheckboxProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormCheckbox: FC<FormCheckboxProps> = (props) => {\n const field = useFieldContext<boolean | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n <FormControlLabel\n control={\n <Checkbox\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n />\n }\n label={props.label ?? \"\"}\n />\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};","import { DatePicker } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DatePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDatePickerProps extends Omit<DatePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDatePicker: FC<FormDatePickerProps> = (props) => {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DatePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { DateRangePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DateRangePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDateRangePickerProps extends Omit<DateRangePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDateRangePicker: FC<FormDateRangePickerProps> = (props) => {\n const field = useFieldContext<[Dayjs | null, Dayjs | null] | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DateRangePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { TimePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { TimePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTimePickerProps extends Omit<TimePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormTimePicker: FC<FormTimePickerProps> = (props) => {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <TimePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { TimeRangePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { TimeRangePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTimeRangePickerProps extends Omit<TimeRangePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormTimeRangePicker: FC<FormTimeRangePickerProps> = (props) => {\n const field = useFieldContext<[Dayjs | null, Dayjs | null] | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <TimeRangePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { DateTimePicker } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DateTimePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDateTimePickerProps extends Omit<DateTimePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDateTimePicker: FC<FormDateTimePickerProps> = (props) => {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DateTimePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps,\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { DateTimeRangePicker } from \"@mui/x-date-pickers-pro\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { DateTimeRangePickerProps } from \"@mui/x-date-pickers-pro\";\nimport type { Dayjs } from \"dayjs\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormDateTimeRangePickerProps extends Omit<DateTimeRangePickerProps, FormOmittedProps> {\n textFieldProps?: TextFieldProps;\n}\n\nexport const FormDateTimeRangePicker: FC<FormDateTimeRangePickerProps> = (props) => {\n const field = useFieldContext<[Dayjs | null, Dayjs | null] | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <DateTimeRangePicker\n name={field.name}\n value={field.state.value}\n onChange={(value) => field.handleChange(value)}\n slotProps={{\n textField: {\n onBlur: field.handleBlur,\n error: isTouched && hasError,\n helperText: isTouched && helperText,\n ...props.textFieldProps\n },\n ...props.slotProps\n }}\n aria-label={field.name}\n {...props}\n />\n );\n};\n","import { TextField } from \"@mui/material\";\nimport { NumericFormat } from \"react-number-format\";\nimport type { InputAttributes, NumericFormatProps } from \"react-number-format/types/types\";\nimport type { FC } from \"react\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormNumberFieldProps extends Omit<TextFieldProps, FormOmittedProps> {\n\tdefaultValue?: number | null;\n\toptions?: Omit<NumericFormatProps<InputAttributes>, \"customInput\" | \"onValueChange\" | keyof InputAttributes>;\n}\n\nexport const FormNumberField: FC<FormNumberFieldProps> = ({ options, ...props }) => {\n\tconst field = useFieldContext<number | null | undefined>();\n\tconst { isTouched, hasError, helperText } = getFieldStatus(field);\n\n\treturn (\n\t\t<NumericFormat\n\t\t\tcustomInput={TextField}\n\t\t\tname={field.name}\n\t\t\tvalue={field.state.value ?? \"\"}\n\t\t\tonValueChange={({ floatValue }) => field.handleChange(floatValue)}\n\t\t\tonBlur={field.handleBlur}\n\t\t\terror={isTouched && hasError}\n\t\t\thelperText={isTouched && helperText}\n\t\t\taria-label={field.name}\n\t\t\t{...props}\n\t\t\t{...options}\n\t\t/>\n\t);\n};\n","import { FormControl, FormControlLabel, FormHelperText, FormLabel, Radio, RadioGroup } from \"@mui/material\";\nimport type { RadioGroupProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\ninterface Option {\n label: string;\n value: string | number;\n}\n\nexport interface FormRadioGroupProps extends Omit<RadioGroupProps, FormOmittedProps> {\n label?: string;\n options: Array<Option>;\n}\n\nexport const FormRadioGroup: FC<FormRadioGroupProps> = ({ label, options, ...props }) => {\n const field = useFieldContext<string | number | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n {label && <FormLabel component=\"legend\">{label}</FormLabel>}\n <RadioGroup\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n >\n {options.map((option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n ))}\n </RadioGroup>\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { FormControl, FormHelperText, FormLabel, Slider } from \"@mui/material\";\nimport type { SliderProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormSliderProps extends Omit<SliderProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormSlider: FC<FormSliderProps> = ({ label, ...props }) => {\n const field = useFieldContext<number | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n {label && <FormLabel>{label}</FormLabel>}\n <Slider\n name={field.name}\n value={field.state.value ?? 0}\n onChange={(_, value) => field.handleChange(Array.isArray(value) ? value[0] : value)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n />\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { Button } from \"@mui/material\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useFormContext } from \"~/hooks/FormHooks\";\n\nexport type FormSubmitButtonProps = Omit<ButtonProps, \"loading\" | \"disabled\" | \"onClick\" | \"type\">;\n\nexport const FormSubmitButton: FC<FormSubmitButtonProps> = (props) => {\n const form = useFormContext();\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n form.handleSubmit();\n };\n\n return (\n <form.Subscribe selector={(state) => [state.canSubmit, state.isSubmitting]}>\n {([canSubmit, isSubmitting]) => (\n <Button\n loading={isSubmitting}\n disabled={!canSubmit}\n onClick={handleClick}\n type=\"submit\"\n aria-label=\"submit\"\n {...props}\n />\n )}\n </form.Subscribe>\n );\n};","import { FormControl, FormControlLabel, FormHelperText, Switch } from \"@mui/material\";\nimport type { SwitchProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormSwitchProps extends Omit<SwitchProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormSwitch: FC<FormSwitchProps> = (props) => {\n const field = useFieldContext<boolean | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <FormControl component=\"fieldset\">\n <FormControlLabel\n control={\n <Switch\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n aria-label={field.name}\n {...props}\n />\n }\n label={props.label ?? \"\"}\n />\n {isTouched && hasError && <FormHelperText error={hasError}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { TextField } from \"@mui/material\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/FormHooks\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTextFieldProps extends Omit<TextFieldProps, FormOmittedProps> {\n type?: \"color\" | \"email\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\"\n}\n\nexport const FormTextField: FC<FormTextFieldProps> = (props) => {\n const field = useFieldContext<string | number | null | undefined>();\n const { isTouched, hasError, helperText } = getFieldStatus(field);\n\n return (\n <TextField\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={event => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n error={isTouched && hasError}\n helperText={isTouched && helperText}\n aria-label={field.name}\n {...props}\n />\n );\n};","import { createFormHook, createFormHookContexts } from \"@tanstack/react-form\";\nimport { FormAutocomplete as Autocomplete } from \"~/components/form/FormAutocomplete\";\nimport { FormCheckbox as Checkbox } from \"~/components/form/FormCheckbox\";\nimport { FormDatePicker as DatePicker } from \"~/components/form/FormDatePicker\";\nimport { FormDateRangePicker as DateRangePicker } from \"~/components/form/FormDateRangePicker\";\nimport { FormTimePicker as TimePicker } from \"~/components/form/FormTimePicker\";\nimport { FormTimeRangePicker as TimeRangePicker } from \"~/components/form/FormTimeRangePicker\";\nimport { FormDateTimePicker as DateTimePicker } from \"~/components/form/FormDateTimePicker\";\nimport { FormDateTimeRangePicker as DateTimeRangePicker } from \"~/components/form/FormDateTimeRangePicker\";\nimport { FormNumberField as NumberField } from \"~/components/form/FormNumberField\";\nimport { FormRadioGroup as RadioGroup } from \"~/components/form/FormRadioGroup\";\nimport { FormSlider as Slider } from \"~/components/form/FormSlider\";\nimport { FormSubmitButton as SubmitButton } from \"~/components/form/FormSubmitButton\";\nimport { FormSwitch as Switch } from \"~/components/form/FormSwitch\";\nimport { FormTextField as TextField } from \"~/components/form/FormTextField\";\n\nexport const { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts();\n\nexport const { useAppForm: useLayoutForm, withForm: withLayoutForm } =\n createFormHook({\n fieldComponents: {\n TextField,\n NumberField,\n Autocomplete,\n Checkbox,\n Switch,\n RadioGroup,\n Slider,\n DatePicker,\n DateRangePicker,\n TimePicker,\n TimeRangePicker,\n DateTimePicker,\n DateTimeRangePicker,\n },\n formComponents: {\n SubmitButton,\n },\n fieldContext,\n formContext,\n });\n"],"names":["jsx","jsxs","TextField","NumberField","Autocomplete","Checkbox","Switch","RadioGroup","Slider","DatePicker","DateRangePicker","TimePicker","TimeRangePicker","DateTimePicker","DateTimeRangePicker","SubmitButton"],"mappings":";;;;;;;;;AAWO,MAAM,mBAA8C,CAAC,EAAE,gBAAgB,GAAG,wBAAwB;AACrG,QAAM,QAAQ,gBAAA;AACd,QAAM,EAAE,WAAW,UAAU,WAAA,IAAe,eAAe,KAAK;AAEhE,SACIA,kCAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG,OAAO,MAAM,MAAM;AAAA,MACnB,UAAU,CAAC,GAAG,UAAU,CAAC,kBAAkB,YAAY,MAAM,aAAa,KAAK;AAAA,MAC/E,eAAe,CAAC,GA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aAAa,MAAM,OAAO,KAAK;AAAA,MACxD,QAAQ,MAAM;AAAA,MACd,OAAO,aAAa;AAAA,MACpB,YAAY,aAAa;AAAA,MACzB,cAAY,MAAM;AAAA,MACjB,GAAG;AAAA,IAAA;AAAA,EAAA;AAGhB;ACXO,MAAM,EAAE,cAAc,iBAAiB,aAAa,eAAA,IAAmB,uBAAA;AAEvE,MAAM,EAAE,YAAY,eAAe,UAAU,eAAA,IAChD,eAAe;AAAA,EACX,iBAAiB;AAAA,IAAA,WACbE;AAAAA,IAAA,aACAC;AAAAA,IAAA,cACAC;AAAAA,IAAA,UACAC;AAAAA,IAAA,QACAC;AAAAA,IAAA,YACAC;AAAAA,IAAA,QACAC;AAAAA,IAAA,YACAC;AAAAA,IAAA,iBACAC;AAAAA,IAAA,YACAC;AAAAA,IAAA,iBACAC;AAAAA,IAAA,gBACAC;AAAAA,IAAA,qBACAC;AAAAA,EAAA;AAAA,EAEJ,gBAAgB;AAAA,IAAA,cACZC;AAAAA,EAAA;AAAA,EAEJ;AAAA,EACA;AACJ,CAAC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CssVarsThemeOptions } from '@mui/material';
|
|
2
1
|
import { FC } from 'react';
|
|
3
2
|
import { LinkOptions } from '@tanstack/react-router';
|
|
4
3
|
import { OptionalFetcher } from '@tanstack/start-client-core';
|
|
5
4
|
import { ReactNode } from 'react';
|
|
5
|
+
import { Theme } from '@mui/material';
|
|
6
6
|
|
|
7
7
|
export declare const LayoutProvider: FC<ProvidersProps>;
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@ declare interface NavigationPageItem extends Partial<Pick<LinkOptions, "to" | "h
|
|
|
30
30
|
|
|
31
31
|
declare interface ProvidersProps {
|
|
32
32
|
navigation?: Navigation;
|
|
33
|
-
theme
|
|
33
|
+
theme: Theme;
|
|
34
34
|
children: ReactNode;
|
|
35
35
|
}
|
|
36
36
|
|