beca-ui 2.1.6 → 2.1.8

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.
Files changed (37) hide show
  1. package/dist/DynamicWorkflowScript.js +1968 -363
  2. package/dist/beca-ui.js +127882 -94217
  3. package/dist/components/DebounceSelect/DebounceSelect.d.ts +9 -0
  4. package/dist/components/DebounceSelect/index.d.ts +1 -0
  5. package/dist/components/DynamicForm/AttachIcon.d.ts +6 -0
  6. package/dist/components/DynamicForm/AvatarItem.d.ts +6 -0
  7. package/dist/components/DynamicForm/DynamicForm.d.ts +4 -0
  8. package/dist/components/DynamicForm/DynamicFormInfo.d.ts +13 -0
  9. package/dist/components/DynamicForm/DynamicFormSidebar.d.ts +21 -0
  10. package/dist/components/DynamicForm/DynamicWorkflowForm.d.ts +19 -0
  11. package/dist/components/DynamicForm/MasterDetail/EditableCell.d.ts +24 -0
  12. package/dist/components/DynamicForm/MasterDetail/MasterDetail.d.ts +24 -0
  13. package/dist/components/DynamicForm/MasterDetail/MasterDetails.d.ts +3 -0
  14. package/dist/components/DynamicForm/MasterDetail/index.d.ts +4 -0
  15. package/dist/components/DynamicForm/MasterDetail/types.d.ts +93 -0
  16. package/dist/components/DynamicForm/PropertyFileUpload.d.ts +27 -0
  17. package/dist/components/DynamicForm/PropertyImageList.d.ts +8 -0
  18. package/dist/components/DynamicForm/WorkflowForm.d.ts +30 -0
  19. package/dist/components/DynamicForm/context.d.ts +30 -0
  20. package/dist/components/DynamicForm/index.d.ts +15 -0
  21. package/dist/components/DynamicForm/layout.d.ts +9 -0
  22. package/dist/components/DynamicForm/scriptEngine/index.d.ts +3 -0
  23. package/dist/components/DynamicForm/scriptEngine/types.d.ts +67 -0
  24. package/dist/components/DynamicForm/scriptEngine/useWorkflowScriptEngine.d.ts +2 -0
  25. package/dist/components/DynamicForm/scriptEngine/workflowScriptEngine.d.ts +20 -0
  26. package/dist/components/DynamicForm/types.d.ts +266 -0
  27. package/dist/components/DynamicForm/utils.d.ts +59 -0
  28. package/dist/components/FormEditor/FormEditor.d.ts +25 -0
  29. package/dist/components/FormEditor/index.d.ts +2 -0
  30. package/dist/components/QrBarCodeScanField/QrBarCodeScanField.d.ts +24 -0
  31. package/dist/components/QrBarCodeScanField/index.d.ts +1 -0
  32. package/dist/components/index.d.ts +4 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/main.css +1 -1
  35. package/package.json +16 -33
  36. package/README.md +0 -115
  37. package/dist/styles/components/layout/test.d.ts +0 -0
@@ -0,0 +1,9 @@
1
+ import { SelectProps, FormItemProps } from "..";
2
+ export interface DebounceSelectProps<ValueType = any> extends Omit<SelectProps<ValueType>, "children"> {
3
+ fetchOptions: (search: string) => Promise<ValueType[]>;
4
+ debounceTimeout?: number;
5
+ showSearch?: boolean;
6
+ isMobile?: boolean;
7
+ formItemProps?: FormItemProps;
8
+ }
9
+ export declare function DebounceSelect({ fetchOptions, debounceTimeout, isMobile, formItemProps, ...props }: DebounceSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./DebounceSelect";
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface AttachIconProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
3
+ type?: string;
4
+ extension?: string;
5
+ }
6
+ export declare function AttachIcon(props: AttachIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { ColType } from "./types";
2
+ interface AvatarGroupProps {
3
+ item?: ColType;
4
+ }
5
+ export declare const AvatarItem: ({ item: avatarItem }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { DynamicFormProps, DynamicFormRef } from "./types";
3
+ export declare const GENERAL_GROUP_KEY = "general";
4
+ export declare const DynamicForm: React.ForwardRefExoticComponent<DynamicFormProps & React.RefAttributes<DynamicFormRef>>;
@@ -0,0 +1,13 @@
1
+ import type { ColType } from "./types";
2
+ import { ColProps, FormInstance } from "..";
3
+ export interface DynamicFormInfoProps {
4
+ rowLength: number;
5
+ item: ColType;
6
+ form?: FormInstance<any>;
7
+ isPrint?: boolean;
8
+ labelCol?: ColProps;
9
+ wrapperCol?: ColProps;
10
+ isMobileApp?: boolean;
11
+ formVertical?: boolean;
12
+ }
13
+ export declare const DynamicFormInfo: (props: DynamicFormInfoProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import type { DataNode } from "..";
3
+ export interface DynamicFormSidebarProps {
4
+ treeData: DataNode[];
5
+ selectedTreeKey: string;
6
+ onSelectGroup: (key: string) => void;
7
+ expandedKeys: string[];
8
+ onExpand: (keys: string[]) => void;
9
+ isAllExpanded: boolean;
10
+ onToggleExpandAll?: () => void;
11
+ onExpandAll?: () => void;
12
+ onCollapseAll?: () => void;
13
+ searchValue: string;
14
+ onSearchChange: (value: string) => void;
15
+ totalLeafCount: number;
16
+ totalErrorCount?: number;
17
+ hasParentKeys: boolean;
18
+ isCollapsed: boolean;
19
+ onToggleCollapse: (collapsed: boolean) => void;
20
+ }
21
+ export declare const DynamicFormSidebar: React.FC<DynamicFormSidebarProps>;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import type { ColType } from "./types";
3
+ import { ColProps, FormInstance } from "..";
4
+ export interface DynamicWorkflowFormProps {
5
+ key?: React.Key;
6
+ form?: FormInstance<any>;
7
+ rowLength: number;
8
+ col: ColType;
9
+ labelVisible?: boolean;
10
+ value?: any;
11
+ onChange?: (value: any) => void;
12
+ changeOptionOfCol?: (id?: number, options?: any) => void;
13
+ isMobileApp?: boolean;
14
+ labelCol?: ColProps;
15
+ wrapperCol?: ColProps;
16
+ hiddenColumns?: string[];
17
+ hasSidebar?: boolean;
18
+ }
19
+ export declare const DynamicWorkflowForm: (props: DynamicWorkflowFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { ColumnType } from "../..";
3
+ import type { ColType } from "../types";
4
+ export declare const useDebounce: <T = any>(value: T, delay?: number) => T;
5
+ export declare function fetchItemsInLookupItems(searchTerm: string, id?: number, onSearchLookupDebounce?: (id?: number, searchTerm?: string) => Promise<any[]>): Promise<any[]>;
6
+ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
7
+ editing: boolean;
8
+ dataIndex: string;
9
+ title: any;
10
+ inputType: "number" | "input" | "select" | "textarea" | "text" | "checkbox" | "radio" | "editor" | "lookup" | "dateTime" | "yesno" | "currency" | "file";
11
+ record: any;
12
+ index: number;
13
+ selectData: any[];
14
+ required?: boolean;
15
+ children: any;
16
+ col?: ColumnType<any> & ColType;
17
+ value?: any;
18
+ mode?: string;
19
+ onChange?: (value: any) => void;
20
+ changeOptionOfCol: (id?: number, options?: any) => void;
21
+ onEdit: (id: string) => void;
22
+ isMobileApp?: boolean;
23
+ }
24
+ export declare const EditableCell: React.FC<EditableCellProps>;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import type { MasterDetailRefs, MasterDetailTableProps } from "./types";
3
+ export declare class ErrorBoundary extends React.Component<{
4
+ FallbackComponent?: React.ComponentType<any>;
5
+ onError?: (error: any, info: any) => void;
6
+ children: React.ReactNode;
7
+ }, {
8
+ hasError: boolean;
9
+ error: any;
10
+ }> {
11
+ constructor(props: any);
12
+ static getDerivedStateFromError(error: any): {
13
+ hasError: boolean;
14
+ error: any;
15
+ };
16
+ componentDidCatch(error: any, errorInfo: any): void;
17
+ render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
18
+ }
19
+ export declare const ErrorFallback: ({ error }: {
20
+ error?: any;
21
+ }) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const getMasterDetailRowData: (masterDetailRowId: string) => any;
23
+ export declare const formatFormData: (data: any) => any;
24
+ export declare const MasterDetail: React.ForwardRefExoticComponent<MasterDetailTableProps & React.RefAttributes<MasterDetailRefs>>;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { MasterDetailsProps } from "./types";
3
+ export declare const MasterDetails: React.FC<MasterDetailsProps>;
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./EditableCell";
3
+ export * from "./MasterDetail";
4
+ export * from "./MasterDetails";
@@ -0,0 +1,93 @@
1
+ import type { ColumnType } from "../../Table";
2
+ import type { ColType, FieldType, FormInstance, MasterDetailType, RowsType, UserWorkflowActionsModel } from "../types";
3
+ export interface CustomColumnType<T = any> extends ColumnType<T> {
4
+ columnSearchDataIndex?: string | number;
5
+ filterBy?: any;
6
+ inputType?: string;
7
+ label?: string;
8
+ name?: string;
9
+ selectData?: any;
10
+ editable?: boolean;
11
+ executeJs?: string;
12
+ lookupItems?: any[];
13
+ selectItems?: any[];
14
+ isHide?: boolean;
15
+ id?: number;
16
+ realType?: FieldType | string;
17
+ }
18
+ export interface MasterDetailRefs {
19
+ addRow: () => void;
20
+ validate: () => boolean;
21
+ editingKey: number | undefined;
22
+ }
23
+ export interface WorkflowsCheckListModel {
24
+ createdBy?: string;
25
+ createdTime?: Date | string;
26
+ documentTypeTitle?: string;
27
+ id: number;
28
+ isDeleted?: boolean;
29
+ isQRCode?: boolean;
30
+ isReplaceText?: boolean;
31
+ isReplaceSignature?: boolean;
32
+ isReplaceFlashSignature?: boolean;
33
+ isPublicForEveryone?: boolean;
34
+ isAutoWatermarkEmbedWhenDownload?: boolean;
35
+ isSignaturedManually?: boolean;
36
+ isOnlyAllowedAttachedAfterApproving?: boolean;
37
+ permission?: string;
38
+ permissionArray?: string[];
39
+ isRequired?: boolean;
40
+ isSignature?: boolean;
41
+ lastModified?: Date | string;
42
+ modifiedBy?: string;
43
+ title?: string;
44
+ typeId?: number;
45
+ workflowStepId?: number;
46
+ workflowStepTitle?: string;
47
+ [key: string]: any;
48
+ }
49
+ export interface MasterDetailTableProps {
50
+ name: string;
51
+ colTypes: ColType[];
52
+ dataSource: any;
53
+ workflowStepId?: number;
54
+ title?: string;
55
+ step?: number;
56
+ allowEdit: boolean;
57
+ allowSave: boolean;
58
+ autoGenerateNewRow: boolean;
59
+ onChangeValues: (values: any[]) => void;
60
+ isRequired?: boolean;
61
+ masterDetailIndex?: number;
62
+ changeOptionOfCol: (id: number, options: any) => void;
63
+ onRunScript?: (changedFields?: any) => void;
64
+ isColumnResizable?: boolean;
65
+ userWorkflowForm: FormInstance<any>;
66
+ userWorkflowRows: RowsType[];
67
+ onAdd: () => void;
68
+ masterDetail: MasterDetailType;
69
+ fitContent?: boolean;
70
+ workflowScripts?: string[];
71
+ mode?: "workflow" | "new" | "draft" | "detail" | "edit" | string;
72
+ userWorkflowId?: number;
73
+ workflow?: any;
74
+ isPrint?: boolean;
75
+ hidden?: boolean;
76
+ isMobileApp?: boolean;
77
+ }
78
+ export interface MasterDetailsProps {
79
+ userWorkflowId?: number;
80
+ masterDetailFormats: MasterDetailType[];
81
+ actions?: UserWorkflowActionsModel;
82
+ onChangeMDValues?: (values: any) => void;
83
+ workflowScripts?: string[];
84
+ masterDetailsRef?: React.MutableRefObject<MasterDetailRefs[]>;
85
+ masterDetailValues?: any;
86
+ form: FormInstance<any>;
87
+ rows: RowsType[];
88
+ workflow?: any;
89
+ mode?: "workflow" | "new" | "draft" | "detail" | "edit" | string;
90
+ changeOptionOfColMasterDetail?: (masterDetailName: string, id: number, options: any) => void;
91
+ hiddenMasterDetailNames?: string[];
92
+ isMobileApp?: boolean;
93
+ }
@@ -0,0 +1,27 @@
1
+ import { FormInstance } from "..";
2
+ import type { ColType, MasterDetailType, PropertyFileItem, PropertyFileUploadValue, PropertyUploadFile, RowsType } from "./types";
3
+ export declare const parsePropertyFiles: (value: unknown) => PropertyFileItem[];
4
+ export declare const normalizePropertyFileValue: (value: unknown) => PropertyFileUploadValue;
5
+ export type UploadFileHandler = (colId: number, userWorkflowId: number, file: any) => Promise<{
6
+ success: boolean;
7
+ value: string | number;
8
+ message?: string;
9
+ }>;
10
+ export declare const uploadFilesForColumns: (values: any, columns: ColType[], userWorkflowId: number, form?: FormInstance<any>, uploadHandler?: UploadFileHandler) => Promise<any>;
11
+ export declare const uploadFilesInMasterDetails: (masterDetailValues: Record<string, any[]>, masterDetailFormats: MasterDetailType[], userWorkflowId: number, uploadHandler?: UploadFileHandler) => Promise<{
12
+ [x: string]: any[];
13
+ }>;
14
+ export declare const uploadFilesInProperties: (values: any, rows: RowsType[], userWorkflowId: number, form: FormInstance<any>, uploadHandler?: UploadFileHandler) => Promise<any>;
15
+ export interface PropertyFileUploadProps {
16
+ value?: unknown;
17
+ onChange?: (value?: PropertyFileUploadValue) => void;
18
+ accept?: string;
19
+ disabled?: boolean;
20
+ }
21
+ export interface PropertyFileListProps {
22
+ value?: unknown;
23
+ files?: PropertyUploadFile[];
24
+ onRemove?: (file: PropertyUploadFile) => void;
25
+ }
26
+ export declare const PropertyFileList: ({ value, files, onRemove, }: PropertyFileListProps) => import("react/jsx-runtime").JSX.Element | null;
27
+ export declare const PropertyFileUpload: ({ value, onChange, accept, disabled, }: PropertyFileUploadProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { PropertyUploadFile } from "./types";
2
+ export declare const isPropertyImage: (file: PropertyUploadFile) => boolean;
3
+ export declare const canPreviewPropertyImage: (file: PropertyUploadFile) => boolean;
4
+ export interface PropertyImageListProps {
5
+ files: PropertyUploadFile[];
6
+ onRemove?: (file: PropertyUploadFile) => void;
7
+ }
8
+ export declare const PropertyImageList: ({ files, onRemove, }: PropertyImageListProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import type { ColType, DynamicFormRequiredCondition, RowsType, UserWorkflowActionsModel } from "./types";
3
+ import { FormInstance } from "..";
4
+ export interface WorkflowRowsProps {
5
+ rows: RowsType[];
6
+ hiddenNames?: string[];
7
+ actions?: UserWorkflowActionsModel;
8
+ isMobileApp?: boolean;
9
+ hasSidebar?: boolean;
10
+ changeOptionOfCol?: (id: number, options: any) => void;
11
+ checkFilterFromLookupItems?: (col: ColType, value: any) => void;
12
+ form: FormInstance<any>;
13
+ }
14
+ export declare const WorkflowRows: React.FC<WorkflowRowsProps>;
15
+ export interface WorkflowFormProps {
16
+ form: FormInstance<any>;
17
+ rows?: RowsType[];
18
+ children?: React.ReactNode;
19
+ onFinish?: (values: any) => void;
20
+ onFinishFailed?: (errorFields: any) => void;
21
+ onChangeFields?: (changedFields: any) => void;
22
+ actions?: UserWorkflowActionsModel;
23
+ isMobileApp?: boolean;
24
+ changeOptionOfCol?: (id: number, options: any) => void;
25
+ checkFilterFromLookupItems?: (col: ColType, value: any) => void;
26
+ onRequiredConditionsChange?: (conditions: DynamicFormRequiredCondition[]) => void;
27
+ hiddenNames?: string[];
28
+ hasSidebar?: boolean;
29
+ }
30
+ export declare const WorkflowForm: ({ form, rows, children, onChangeFields, onFinish, onFinishFailed, actions, isMobileApp, changeOptionOfCol, checkFilterFromLookupItems, onRequiredConditionsChange, hiddenNames, hasSidebar, }: WorkflowFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import type { DynamicFormLocale, DynamicFormTranslations } from "./types";
3
+ export declare const defaultTranslations: Record<DynamicFormLocale, Record<string, string>>;
4
+ export interface DynamicFormContextType {
5
+ locale: DynamicFormLocale;
6
+ t: (key: string, params?: Record<string, any>) => string;
7
+ getLocalText: (viText?: string, enText?: string) => string;
8
+ userType?: string;
9
+ onSearchLookupDebounce?: (id?: number, searchTerm?: string) => Promise<any[]>;
10
+ onUploadPropertyFile?: (colId: number, file: any) => Promise<{
11
+ success: boolean;
12
+ value: string | number;
13
+ message?: string;
14
+ }>;
15
+ }
16
+ export declare const DynamicFormContext: React.Context<DynamicFormContextType>;
17
+ export declare const useDynamicForm: () => DynamicFormContextType;
18
+ export interface DynamicFormProviderProps {
19
+ children: React.ReactNode;
20
+ locale?: DynamicFormLocale;
21
+ translations?: DynamicFormTranslations;
22
+ userType?: string;
23
+ onSearchLookupDebounce?: (id?: number, searchTerm?: string) => Promise<any[]>;
24
+ onUploadPropertyFile?: (colId: number, file: any) => Promise<{
25
+ success: boolean;
26
+ value: string | number;
27
+ message?: string;
28
+ }>;
29
+ }
30
+ export declare const DynamicFormProvider: React.FC<DynamicFormProviderProps>;
@@ -0,0 +1,15 @@
1
+ export * from "./DynamicForm";
2
+ export * from "./DynamicFormSidebar";
3
+ export * from "./WorkflowForm";
4
+ export * from "./DynamicWorkflowForm";
5
+ export * from "./DynamicFormInfo";
6
+ export * from "./PropertyFileUpload";
7
+ export * from "./PropertyImageList";
8
+ export * from "./AvatarItem";
9
+ export * from "./AttachIcon";
10
+ export * from "./types";
11
+ export * from "./utils";
12
+ export * from "./layout";
13
+ export * from "./context";
14
+ export * from "./scriptEngine";
15
+ export * from "./MasterDetail";
@@ -0,0 +1,9 @@
1
+ import type { ColProps } from "..";
2
+ export declare class DynamicFormLayout {
3
+ static getLabelCol(length: number, isMobileApp?: boolean): ColProps;
4
+ static getWrapperCol(length: number, isMobileApp?: boolean): ColProps;
5
+ static getPrintLabelCol(length: number): ColProps;
6
+ static getPrintWrapperCol(length: number): ColProps;
7
+ static getGutter(_length?: number): number;
8
+ }
9
+ export declare const DynamicFormColumn: (rowLength: number) => ColProps;
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./workflowScriptEngine";
3
+ export * from "./useWorkflowScriptEngine";
@@ -0,0 +1,67 @@
1
+ import type { FormInstance } from "../..";
2
+ import type { ColType, RowsType } from "../types";
3
+ export type WorkflowScriptMode = "new" | "draft" | "detail" | "edit";
4
+ export interface DynamicWorkflowScriptWindow {
5
+ isDetail: boolean;
6
+ isMasterDetail: boolean;
7
+ colName?: string;
8
+ mdCellId?: string;
9
+ userWorkflowId?: number;
10
+ masterDetailId?: string;
11
+ currentForm?: FormInstance<any>;
12
+ currentMDForm?: FormInstance<any>;
13
+ currentColumns?: Record<string, ColType>;
14
+ currentMDColumns?: Record<string, any>;
15
+ handleActionButtons?: (valid: boolean, elementIds?: string[], masterDetailId?: string | boolean, error?: string | {
16
+ message: string;
17
+ errorId: string;
18
+ }) => void;
19
+ validateDatesRange?: (startDateName: string, endDateName: string, unit: "minute" | "hour" | "day" | "month" | "year", count: number) => void;
20
+ validatePhoneNumber?: (name: string) => void;
21
+ validateEmail?: (name: string) => void;
22
+ getFieldValue?: (name: string, masterDetailId?: any) => any;
23
+ getFieldContent?: (name: string, masterDetailId?: any) => any;
24
+ setFieldValue?: (name: string, val: any, masterDetailId?: string) => void;
25
+ setFormValue?: (name: string, value: any) => void;
26
+ runCellScript?: (value: any, col: any, id: number) => void;
27
+ getMasterDetailRowData?: (masterDetailRowId: string) => any;
28
+ scanAndRegisterMasterDetailOptionMappings?: (workflow: any) => void;
29
+ [key: string]: any;
30
+ }
31
+ export interface ExecuteWorkflowScriptsOptions {
32
+ userWorkflowId?: number;
33
+ workflow?: any;
34
+ rows: RowsType[];
35
+ form: FormInstance<any>;
36
+ isFieldsChanged?: boolean;
37
+ fieldName?: string;
38
+ isNew?: boolean;
39
+ mode?: WorkflowScriptMode;
40
+ t?: (key: string, params?: Record<string, any>) => string;
41
+ getLocalText?: (viText?: string, enText?: string) => string;
42
+ }
43
+ export interface ChangeFieldsValueOptions {
44
+ userWorkflowId?: number;
45
+ fields: any[];
46
+ allScripts?: string;
47
+ workflow?: any;
48
+ rows: RowsType[];
49
+ form: FormInstance<any>;
50
+ mode?: WorkflowScriptMode;
51
+ t?: (key: string, params?: Record<string, any>) => string;
52
+ getLocalText?: (viText?: string, enText?: string) => string;
53
+ }
54
+ export interface ScriptEngineRef {
55
+ allScripts: string;
56
+ executeScripts: (fieldName?: string, isNewOverride?: boolean) => Promise<void>;
57
+ handleChangeFields: (fields: any[]) => void;
58
+ }
59
+ export interface UseWorkflowScriptEngineProps {
60
+ form: FormInstance<any>;
61
+ rows: RowsType[];
62
+ workflow?: any;
63
+ userWorkflowId?: number;
64
+ mode?: WorkflowScriptMode;
65
+ autoRun?: boolean;
66
+ onChangeFields?: (fields: any[]) => void;
67
+ }
@@ -0,0 +1,2 @@
1
+ import type { UseWorkflowScriptEngineProps, ScriptEngineRef } from "./types";
2
+ export declare const useWorkflowScriptEngine: ({ form, rows, workflow, userWorkflowId, mode, autoRun, onChangeFields, }: UseWorkflowScriptEngineProps) => ScriptEngineRef;
@@ -0,0 +1,20 @@
1
+ import type { FormInstance } from "../..";
2
+ import type { ColType, RowsType } from "../types";
3
+ import type { ExecuteWorkflowScriptsOptions, ChangeFieldsValueOptions } from "./types";
4
+ export declare const minifyScript: (script?: string) => string;
5
+ export declare const extractAllWorkflowScripts: (rows: RowsType[], workflow?: any) => string;
6
+ export declare const getHiddenColumnNames: (rows: RowsType[], workflow?: any) => string[];
7
+ export declare const isFormularScript: (script: string) => boolean;
8
+ export declare const isDataScript: (script: string) => boolean;
9
+ export interface MountScriptGlobalsContext {
10
+ form: FormInstance<any>;
11
+ rows: RowsType[];
12
+ t?: (key: string, params?: Record<string, any>) => string;
13
+ getLocalText?: (viText?: string, enText?: string) => string;
14
+ }
15
+ export declare const mountWorkflowScriptGlobals: (context: MountScriptGlobalsContext) => (() => void);
16
+ export declare const executeWorkflowScripts: (options: ExecuteWorkflowScriptsOptions) => Promise<void>;
17
+ export declare const changeFieldsValue: (options: ChangeFieldsValueOptions) => void;
18
+ export declare const isMMDScript: (scriptString?: string) => boolean;
19
+ export declare const handleMasterDetailScripts: (col: ColType) => string;
20
+ export declare const executeWorkflowJSMasterDetail: (col: ColType, userWorkflowForm: FormInstance<any>, userWorkflowCols: any, form: FormInstance<any>, fieldValue: any, masterDetailIndex: number, id: any, isEdit?: boolean, cols?: any[]) => void;