mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-09 21:30:54 +00:00
add new type
This commit is contained in:
@@ -1,17 +1,10 @@
|
|||||||
import {
|
import { ActionIcon, Divider, Drawer, Group, Stack, Text } from '@mantine/core';
|
||||||
ActionIcon,
|
|
||||||
Divider,
|
|
||||||
Drawer,
|
|
||||||
Group,
|
|
||||||
MantineSize,
|
|
||||||
Stack,
|
|
||||||
Text
|
|
||||||
} from '@mantine/core';
|
|
||||||
import { IconChevronLeft } from '@tabler/icons-react';
|
import { IconChevronLeft } from '@tabler/icons-react';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import { Link, Route, Routes, useNavigate, useParams } from 'react-router-dom';
|
import { Link, Route, Routes, useNavigate, useParams } from 'react-router-dom';
|
||||||
import type { To } from 'react-router-dom';
|
import type { To } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { UiSizeType } from '../../defaults/formatters';
|
||||||
import { useLocalState } from '../../states/LocalState';
|
import { useLocalState } from '../../states/LocalState';
|
||||||
import * as classes from './DetailDrawer.css';
|
import * as classes from './DetailDrawer.css';
|
||||||
|
|
||||||
@@ -26,7 +19,7 @@ export interface DrawerProps {
|
|||||||
position?: 'right' | 'left';
|
position?: 'right' | 'left';
|
||||||
renderContent: (id?: string) => React.ReactNode;
|
renderContent: (id?: string) => React.ReactNode;
|
||||||
urlPrefix?: string;
|
urlPrefix?: string;
|
||||||
size?: MantineSize | (string & {}) | number;
|
size?: UiSizeType;
|
||||||
closeOnEscape?: boolean;
|
closeOnEscape?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import { MantineSize } from '@mantine/core';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -151,3 +152,5 @@ export function renderDate(date: string, options: renderDateOptionsType = {}) {
|
|||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type UiSizeType = MantineSize | (string & {}) | number;
|
||||||
|
@@ -4,6 +4,7 @@ import { useId } from '@mantine/hooks';
|
|||||||
import { useEffect, useMemo, useRef } from 'react';
|
import { useEffect, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
import { ApiFormProps, OptionsApiForm } from '../components/forms/ApiForm';
|
import { ApiFormProps, OptionsApiForm } from '../components/forms/ApiForm';
|
||||||
|
import { UiSizeType } from '../defaults/formatters';
|
||||||
import { useModal } from './UseModal';
|
import { useModal } from './UseModal';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +21,7 @@ export interface ApiFormModalProps extends ApiFormProps {
|
|||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
onOpen?: () => void;
|
onOpen?: () => void;
|
||||||
closeOnClickOutside?: boolean;
|
closeOnClickOutside?: boolean;
|
||||||
size?: MantineSize | (string & {}) | number;
|
size?: UiSizeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
import { MantineSize, Modal } from '@mantine/core';
|
import { Modal } from '@mantine/core';
|
||||||
import { useDisclosure } from '@mantine/hooks';
|
import { useDisclosure } from '@mantine/hooks';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
|
||||||
import { StylishText } from '../components/items/StylishText';
|
import { StylishText } from '../components/items/StylishText';
|
||||||
|
import { UiSizeType } from '../defaults/formatters';
|
||||||
|
|
||||||
export interface UseModalProps {
|
export interface UseModalProps {
|
||||||
title: string;
|
title: string;
|
||||||
children: React.ReactElement;
|
children: React.ReactElement;
|
||||||
size?: MantineSize | (string & {}) | number;
|
size?: UiSizeType;
|
||||||
onOpen?: () => void;
|
onOpen?: () => void;
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
closeOnClickOutside?: boolean;
|
closeOnClickOutside?: boolean;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { MantineSize } from '@mantine/core';
|
|
||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
|
|
||||||
|
import { UiSizeType } from '../defaults/formatters';
|
||||||
import { HostList } from './states';
|
import { HostList } from './states';
|
||||||
|
|
||||||
interface LocalStateProps {
|
interface LocalStateProps {
|
||||||
@@ -18,7 +18,7 @@ interface LocalStateProps {
|
|||||||
primaryColor: string;
|
primaryColor: string;
|
||||||
whiteColor: string;
|
whiteColor: string;
|
||||||
blackColor: string;
|
blackColor: string;
|
||||||
radius: MantineSize | (string & {}) | number;
|
radius: UiSizeType;
|
||||||
loader: string;
|
loader: string;
|
||||||
setLoader: (value: string) => void;
|
setLoader: (value: string) => void;
|
||||||
lastUsedPanels: Record<string, string>;
|
lastUsedPanels: Record<string, string>;
|
||||||
|
Reference in New Issue
Block a user