import { EditorProperties, Infer, EditorProperty } from '@iplusplus/y-model'; import { AlertColor, IconButtonProps, PaperProps } from '@mui/material'; import { GridColDef, GridRenderCellParams, GridRowId } from '@mui/x-data-grid'; import * as React$1 from 'react'; import React__default from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; type UserInputValueInfo = { title?: string; defaultValue?: string; isPassword?: boolean; multiline?: boolean; }; type MessageInfo = { color?: AlertColor; content: string; duration?: number; }; type ConfirmInfo = { title?: string; content: string; }; type GetUserDataFunction = (title: string, props: T, initialData?: Infer) => Promise | undefined>; declare const userInteractions: { getUserDataFromDialog: GetUserDataFunction; showMessage: (info: MessageInfo | string) => void; showErrorMessage: (msg: string) => void; getUserInputValue: (info: UserInputValueInfo | string) => Promise; getUserConfirm: (info: ConfirmInfo | string) => Promise; }; type Curry any, P extends any[]> = (...args: DropParameters, P>) => ReturnType; type DropParameters = T extends [...U, ...infer R] ? R : never; declare function curry$1 any, P extends any[]>(fn: T, ...args: P): Curry; declare function removeUndefined(x: T | undefined): x is NonNullable; /** * 根据一个联合string类型K, 创建一个Record, 参数里keys的每个值都将对应一个{} */ declare function createEmptyRecord(keys: ReadonlyArray): Record; /** * 在一个Record里找到指定key, 找到则返回对应的值, 找不到则创建一个{},并将其赋值给Record对应的key,并返回 */ declare function getOrInitEmpty(r: Record, key: K): V; declare function getOrInitEmptyArray(r: Record, key: K): V[]; declare function checkHasKey(t: T, s: string): s is keyof T; declare function list2dict(list: ReadonlyArray, key: K & (T[K] extends string | number | symbol ? K : never)): Record; declare function limitValue(v: number, min: number, max: number): number; declare function removeUndefine(t: T | undefined): t is T; declare function intRange(start: number, count: number): number[]; declare const index_checkHasKey: typeof checkHasKey; declare const index_createEmptyRecord: typeof createEmptyRecord; declare const index_getOrInitEmpty: typeof getOrInitEmpty; declare const index_getOrInitEmptyArray: typeof getOrInitEmptyArray; declare const index_intRange: typeof intRange; declare const index_limitValue: typeof limitValue; declare const index_list2dict: typeof list2dict; declare const index_removeUndefine: typeof removeUndefine; declare const index_removeUndefined: typeof removeUndefined; declare namespace index { export { index_checkHasKey as checkHasKey, index_createEmptyRecord as createEmptyRecord, curry$1 as curry, index_getOrInitEmpty as getOrInitEmpty, index_getOrInitEmptyArray as getOrInitEmptyArray, index_intRange as intRange, index_limitValue as limitValue, index_list2dict as list2dict, index_removeUndefine as removeUndefine, index_removeUndefined as removeUndefined, }; } /** * 一个函数, 接收一个参数,这个参数附带了单元格以及所在行的各种数据 * 通过这个参数返回一个可渲染的组件, 可以是ReactNode, string 或其他 */ type CellRender = GridColDef["renderCell"]; /** * CellRender的参数 */ type CellRenderParam = Parameters>[0]; /** * 通过EditorProperty来创建CellRender * 如果EditorProperty的类型满足要求, 则返回特定的EditCellRender, 否则返回undefined */ type CellRenderBuilder = (property: EditorProperty) => CellRender | undefined; /** * 通过EditorProperty来创建EditCellRender * 如果EditorProperty的类型满足要求, 则返回特定的EditCellRender, 否则返回undefined * 这个版本可以针对EditorProperty分别返回显示时和编辑时的EditCellRender */ type CellRenderBuilder2 = (property: EditorProperty) => { editorCellRender?: CellRender; cellRender?: CellRender; } | undefined; type EditorContextProps = { editCellRenderBuilder: CellRenderBuilder; cellRenderBuilder: CellRenderBuilder; }; declare const EditorContext: React$1.Context; type KeyValueItem = [string, string]; declare function renderEnumSelectCell(items: KeyValueItem[]): CellRender; declare function renderEnumCell(items: KeyValueItem[]): CellRender; declare const enumRenderBuilder: CellRenderBuilder2; declare function CellEnumSelectList({ items, params }: { items: KeyValueItem[]; params: CellRenderParam; }): react_jsx_runtime.JSX.Element; type TreeCellNode = { nodeId: string; title: string; canBeChoosed: boolean; children?: TreeCellNode[]; disableAutoSelect?: boolean; value?: unknown; }; declare function renderTreeSelectCell(rootNodes: TreeCellNode[]): CellRender; declare const TreeSelectCell: React__default.MemoExoticComponent<({ cellParams, rootNodes, isLoading, refreshHandler, enableClear, }: { cellParams: GridRenderCellParams[]>; rootNodes: TreeCellNode[]; isLoading?: boolean; refreshHandler?: () => void; enableClear?: boolean; }) => react_jsx_runtime.JSX.Element>; declare function ColorSelectCell({ cellParams, property }: { cellParams: CellRenderParam; property: EditorProperty; }): react_jsx_runtime.JSX.Element; declare const colorRenderBuilder: CellRenderBuilder2; declare const enableRenderBuilder: CellRenderBuilder2; declare const objectRenderBuilder: CellRenderBuilder2; declare const objectArrayRenderBuilder: CellRenderBuilder2; declare const timestampRenderBuilder: CellRenderBuilder2; type UIKitConfig = { editorCellBuilders?: CellRenderBuilder2[]; }; declare const UIKitProvider: React__default.NamedExoticComponent<{ config: UIKitConfig; children: React__default.ReactNode; }>; type PropertyGridValues = { property: EditorProperty; value: unknown; }[]; declare function getPropertyGridValues(data: Record, props: EditorProperties): PropertyGridValues; type PropertyGridProps = { values: PropertyGridValues; onNewValueSubmit: (prop: EditorProperty, newValue: unknown) => void; onEditStateNotify?: (isInEdit: boolean) => void; disableEditFields?: string[]; }; declare const PropertyGrid: React__default.NamedExoticComponent; declare const PropertyGridDialog: React__default.NamedExoticComponent<{ open: boolean; onClose: (value?: Record) => void; data: Record; props: EditorProperties; disableEditFields?: string[]; title?: string; }>; declare const undefined_number: number; declare function checkCanEdit(p: EditorProperty, isInAdd?: boolean): boolean; type CheckResult = { value: unknown; isValid: boolean; }; declare const CanBeUndefined = "CanBeUndefined"; declare const undefinedNumberValueType: { defaultValue: number; dataTypeName: "number"; validate(value: number): boolean; getDefaultValue(): number; _descr: string | undefined; _attach: Record; description: (d: string | undefined) => /*elided*/ any; getDescription: () => string | undefined; attach: (key: string, payload: any) => /*elided*/ any; getAttach: (key: string) => any; }; declare const createUndefineNumberValueType: () => { defaultValue: number; dataTypeName: "number"; validate(value: number): boolean; getDefaultValue(): number; _descr: string | undefined; _attach: Record; description: (d: string | undefined) => /*elided*/ any; getDescription: () => string | undefined; attach: (key: string, payload: any) => /*elided*/ any; getAttach: (key: string) => any; }; declare function ignoreUndefined(v: T | undefined): T; declare function checkValidValue(p: EditorProperty, value: unknown): CheckResult; type CustomIconApi = { setWorking: (isWorking: boolean) => void; }; declare function CustomIcon({ tooltip: tooptip, icon, color, handler, }: { tooltip?: string; icon: React.ReactNode; color?: IconButtonProps["color"]; handler?: (api: CustomIconApi) => void; }): react_jsx_runtime.JSX.Element; declare function DraggablePaperComponent(props: PaperProps): react_jsx_runtime.JSX.Element; type ExtraButtonInfo = { handler: () => void; title: string; }; declare function DraggableDialog({ title, onCancel, onOk, children, initialWidth, extraButton, }: { title?: string | JSX.Element; onCancel: () => void; onOk?: () => void; children: JSX.Element; initialWidth?: string; extraButton?: ExtraButtonInfo[]; }): react_jsx_runtime.JSX.Element; declare function timestampToTimeString(timestamp: number): string; declare function getDayName(timestamp: number): string; declare function formatToMin(timestamp: number): string; declare function formatToDaytime(timestamp: number): string; declare function formatTime(timestamp: number, formatString: string): string; declare function getDayNameList(start: number, days: number): string[]; declare function getTodayStart(dayOffset?: number): number; declare function getDayStart(timestamp: number): number; declare const timeUtils: { readonly getDayName: typeof getDayName; readonly getDayNameList: typeof getDayNameList; readonly getTodayStart: typeof getTodayStart; readonly getDayStart: typeof getDayStart; readonly timestampToTimeString: typeof timestampToTimeString; readonly formatToMin: typeof formatToMin; readonly formatTime: typeof formatTime; readonly formatToDaytime: typeof formatToDaytime; readonly dayLength: number; }; type ObjectArrayEditorHandler = { getData(): Record[]; }; type ObjectArrayEditorDetail = { disableAdd?: boolean; disableDelete?: boolean; }; type ObjectArrayEditorProps = { properties: EditorProperties; data: Record[]; newRowProvider?: (currentRows: Record[]) => Promise[]>; onlyEdit?: boolean; refreshByData?: boolean; details?: ObjectArrayEditorDetail; }; declare const ObjectArrayEditor: React$1.ForwardRefExoticComponent>; declare function ObjectArrayEditor2({ properties, data, onValueChange, onDelete, needFilter, }: { properties: EditorProperties; needFilter?: boolean; data: Record[]; onValueChange: (ids: GridRowId[], filedName: string, value: unknown) => void; onDelete?: (ids: GridRowId[]) => void; }): react_jsx_runtime.JSX.Element; type EditorProperty2 = EditorProperty & { flex?: number; }; type EditorProperties2 = ReadonlyArray; declare function ObjectArrayEditor3({ properties, data, onValueChange, extraIcons, onSelectedChanged, selectedIds }: { properties: EditorProperties2; data: Record[]; onValueChange: (id: GridRowId, filedName: string, value: any) => void; extraIcons?: JSX.Element[]; onSelectedChanged: (ids: readonly GridRowId[]) => void; selectedIds: GridRowId[]; }): react_jsx_runtime.JSX.Element; type ObjectArrayEditorDialogProps = Omit & { onClose: (value?: Record[]) => void; title?: string; }; declare function ObjectArrayEditorDialog(props: ObjectArrayEditorDialogProps): react_jsx_runtime.JSX.Element; declare function CollapsiblePanel({ title, children }: { title?: string; children: JSX.Element; }): react_jsx_runtime.JSX.Element; declare const LeftNavLayout: React$1.MemoExoticComponent<({ children }: { children: [JSX.Element, JSX.Element]; }) => react_jsx_runtime.JSX.Element>; declare const flexDirectionDict: { readonly bottom: "column-reverse"; readonly top: "column"; readonly left: "row"; readonly right: "row-reverse"; }; declare function LockedSplitLayout({ lockedSide, lockedSize, children, }: { lockedSide: keyof typeof flexDirectionDict; lockedSize?: string; children: [JSX.Element, JSX.Element]; }): react_jsx_runtime.JSX.Element; type ManagedDialogDefine = Record any>; type ArgOf = F extends (arg: infer A) => any ? A : never; type WithoutCancel = Omit; type TransShowParam any>> = { [K in keyof T]: { type: K; props: WithoutCancel>; }; }[keyof T]; type TransCloseParam any>> = keyof T; type UserInterface any>> = { showDialog: (info: TransShowParam) => void; closeDialog: (dialogType: TransCloseParam) => void; }; declare function initDialogManager(dialogDefine: T): UserInterface; declare const curry: typeof curry$1; declare const yui_CanBeUndefined: typeof CanBeUndefined; declare const yui_CellEnumSelectList: typeof CellEnumSelectList; type yui_CellRender = CellRender; type yui_CellRenderBuilder = CellRenderBuilder; type yui_CellRenderBuilder2 = CellRenderBuilder2; type yui_CellRenderParam = CellRenderParam; declare const yui_CollapsiblePanel: typeof CollapsiblePanel; declare const yui_ColorSelectCell: typeof ColorSelectCell; declare const yui_CustomIcon: typeof CustomIcon; type yui_CustomIconApi = CustomIconApi; declare const yui_DraggableDialog: typeof DraggableDialog; declare const yui_DraggablePaperComponent: typeof DraggablePaperComponent; declare const yui_EditorContext: typeof EditorContext; type yui_EditorContextProps = EditorContextProps; type yui_KeyValueItem = KeyValueItem; declare const yui_LeftNavLayout: typeof LeftNavLayout; declare const yui_LockedSplitLayout: typeof LockedSplitLayout; declare const yui_ObjectArrayEditor: typeof ObjectArrayEditor; declare const yui_ObjectArrayEditor2: typeof ObjectArrayEditor2; declare const yui_ObjectArrayEditor3: typeof ObjectArrayEditor3; type yui_ObjectArrayEditorDetail = ObjectArrayEditorDetail; declare const yui_ObjectArrayEditorDialog: typeof ObjectArrayEditorDialog; type yui_ObjectArrayEditorHandler = ObjectArrayEditorHandler; type yui_ObjectArrayEditorProps = ObjectArrayEditorProps; declare const yui_PropertyGrid: typeof PropertyGrid; declare const yui_PropertyGridDialog: typeof PropertyGridDialog; type yui_PropertyGridProps = PropertyGridProps; type yui_PropertyGridValues = PropertyGridValues; type yui_TreeCellNode = TreeCellNode; declare const yui_TreeSelectCell: typeof TreeSelectCell; type yui_UIKitConfig = UIKitConfig; declare const yui_UIKitProvider: typeof UIKitProvider; declare const yui_checkCanEdit: typeof checkCanEdit; declare const yui_checkValidValue: typeof checkValidValue; declare const yui_colorRenderBuilder: typeof colorRenderBuilder; declare const yui_createUndefineNumberValueType: typeof createUndefineNumberValueType; declare const yui_curry: typeof curry; declare const yui_enableRenderBuilder: typeof enableRenderBuilder; declare const yui_enumRenderBuilder: typeof enumRenderBuilder; declare const yui_getPropertyGridValues: typeof getPropertyGridValues; declare const yui_ignoreUndefined: typeof ignoreUndefined; declare const yui_initDialogManager: typeof initDialogManager; declare const yui_objectArrayRenderBuilder: typeof objectArrayRenderBuilder; declare const yui_objectRenderBuilder: typeof objectRenderBuilder; declare const yui_renderEnumCell: typeof renderEnumCell; declare const yui_renderEnumSelectCell: typeof renderEnumSelectCell; declare const yui_renderTreeSelectCell: typeof renderTreeSelectCell; declare const yui_timeUtils: typeof timeUtils; declare const yui_timestampRenderBuilder: typeof timestampRenderBuilder; declare const yui_undefinedNumberValueType: typeof undefinedNumberValueType; declare const yui_undefined_number: typeof undefined_number; declare const yui_userInteractions: typeof userInteractions; declare namespace yui { export { yui_CanBeUndefined as CanBeUndefined, yui_CellEnumSelectList as CellEnumSelectList, yui_CollapsiblePanel as CollapsiblePanel, yui_ColorSelectCell as ColorSelectCell, yui_CustomIcon as CustomIcon, yui_DraggableDialog as DraggableDialog, yui_DraggablePaperComponent as DraggablePaperComponent, yui_EditorContext as EditorContext, yui_LeftNavLayout as LeftNavLayout, yui_LockedSplitLayout as LockedSplitLayout, yui_ObjectArrayEditor as ObjectArrayEditor, yui_ObjectArrayEditor2 as ObjectArrayEditor2, yui_ObjectArrayEditor3 as ObjectArrayEditor3, yui_ObjectArrayEditorDialog as ObjectArrayEditorDialog, yui_PropertyGrid as PropertyGrid, yui_PropertyGridDialog as PropertyGridDialog, yui_TreeSelectCell as TreeSelectCell, yui_UIKitProvider as UIKitProvider, yui_checkCanEdit as checkCanEdit, yui_checkValidValue as checkValidValue, yui_colorRenderBuilder as colorRenderBuilder, yui_createUndefineNumberValueType as createUndefineNumberValueType, yui_curry as curry, yui_enableRenderBuilder as enableRenderBuilder, yui_enumRenderBuilder as enumRenderBuilder, yui_getPropertyGridValues as getPropertyGridValues, yui_ignoreUndefined as ignoreUndefined, yui_initDialogManager as initDialogManager, yui_objectArrayRenderBuilder as objectArrayRenderBuilder, yui_objectRenderBuilder as objectRenderBuilder, yui_renderEnumCell as renderEnumCell, yui_renderEnumSelectCell as renderEnumSelectCell, yui_renderTreeSelectCell as renderTreeSelectCell, yui_timeUtils as timeUtils, yui_timestampRenderBuilder as timestampRenderBuilder, yui_undefinedNumberValueType as undefinedNumberValueType, yui_undefined_number as undefined_number, yui_userInteractions as userInteractions, index as yutil }; export type { yui_CellRender as CellRender, yui_CellRenderBuilder as CellRenderBuilder, yui_CellRenderBuilder2 as CellRenderBuilder2, yui_CellRenderParam as CellRenderParam, yui_CustomIconApi as CustomIconApi, yui_EditorContextProps as EditorContextProps, yui_KeyValueItem as KeyValueItem, yui_ObjectArrayEditorDetail as ObjectArrayEditorDetail, yui_ObjectArrayEditorHandler as ObjectArrayEditorHandler, yui_ObjectArrayEditorProps as ObjectArrayEditorProps, yui_PropertyGridProps as PropertyGridProps, yui_PropertyGridValues as PropertyGridValues, yui_TreeCellNode as TreeCellNode, yui_UIKitConfig as UIKitConfig }; } export { CanBeUndefined, CellEnumSelectList, CollapsiblePanel, ColorSelectCell, CustomIcon, DraggableDialog, DraggablePaperComponent, EditorContext, LeftNavLayout, LockedSplitLayout, ObjectArrayEditor, ObjectArrayEditor2, ObjectArrayEditor3, ObjectArrayEditorDialog, PropertyGrid, PropertyGridDialog, TreeSelectCell, UIKitProvider, checkCanEdit, checkValidValue, colorRenderBuilder, createUndefineNumberValueType, curry, yui as default, enableRenderBuilder, enumRenderBuilder, getPropertyGridValues, ignoreUndefined, initDialogManager, objectArrayRenderBuilder, objectRenderBuilder, renderEnumCell, renderEnumSelectCell, renderTreeSelectCell, timeUtils, timestampRenderBuilder, undefinedNumberValueType, undefined_number, userInteractions, yui, index as yutil }; export type { CellRender, CellRenderBuilder, CellRenderBuilder2, CellRenderParam, CustomIconApi, EditorContextProps, KeyValueItem, ObjectArrayEditorDetail, ObjectArrayEditorHandler, ObjectArrayEditorProps, PropertyGridProps, PropertyGridValues, TreeCellNode, UIKitConfig };