UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

119 lines (118 loc) 3.21 kB
import { DialogProps } from '@mui/material/Dialog'; import { IFileModel, IOption, IPartData } from './models'; import { ICropDimensions } from '../ImageCropDialog/model'; /** * The props type of [[`PartDialog`]]. */ export interface IPartDialog extends DialogProps { /** * If `true`, a loading overlay is displayed on save button. * Should be set to `true` while saving to disable user interactions. */ isLoading?: boolean; /** * Data of part form. * * ``` * export interface IPartData { * id: string; * name: string; * description?: string; * externalName?: string; * material?: string; * customer?: string; * designMaterial?: string; * customerReference?: string; * materialForm?: number | string; * } * ``` */ formData?: IPartData; /** * Source for the currently part thumbnail. */ thumbnailSrc?: string; /** * The dimensions use for the crop and part thumbnail. * * ``` * export interface ICropDimensions { * width: number; * height: number; * border: number; * } * ``` */ cropDimensions?: ICropDimensions; /** * Options for material. * * ``` * export interface IOption { * id: string | number; * name: string; * } * ``` */ materials: ReadonlyArray<IOption>; /** * Options for customer. * * ``` * export interface IOption { * id: string | number; * name: string; * } * ``` */ customers: ReadonlyArray<IOption>; /** * Options for materialForm. * * ``` * export interface IOption { * id: string | number; * name: string; * } * ``` */ materialForms: ReadonlyArray<IOption>; /** * Callback function called when the save button is clicked. * * ``` * export interface IPartData { * id: string; * name: string; * description?: string; * externalName?: string; * material?: string; * customer?: string; * designMaterial?: string; * customerReference?: string; * materialForm?: number | string; * } * ``` * * ``` * export interface IFileModel { * sourceData?: string; * isChanged?: boolean; * } * ``` * @param {IPartData} part With all properties from [[IPartData]]. * @param {IFileModel} thumbnail Returns a thumbnail model, sourceData was DataURL base 64. if thumbnail has been changed, then the isChanged will return true. * @return {void}. */ onSave: (part: IPartData, thumbnail?: IFileModel) => void; /** * Callback function called when the cancel button is clicked. * Set open property to `false` to close the dialog. */ onCancel: () => void; } /** * @param {IPartDialog} props - provides the properties fo React component * @return {ReactNode} - provides the react component to be ingested **/ export declare const PartDialog: (props: IPartDialog) => import("react/jsx-runtime").JSX.Element | null;