@boteteam/utils 0.0.25 → 0.0.27

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.
@@ -254,10 +254,27 @@ var formatFormProps = ({
254
254
  const optData = Array.isArray(parameters == null ? void 0 : parameters[optValArr == null ? void 0 : optValArr[0]]) ? parameters == null ? void 0 : parameters[optValArr == null ? void 0 : optValArr[0]] : [];
255
255
  const labelApiPath = optLabelArr == null ? void 0 : optLabelArr.slice(2);
256
256
  const valApiPath = optValArr == null ? void 0 : optValArr.slice(2);
257
- formItem.props = {
258
- ...formItem.props,
259
- options: formatOptionsRecursively(optData, labelApiPath, valApiPath)
257
+ const formatToTreeData = (optionsItems) => {
258
+ if (Array.isArray(optionsItems)) {
259
+ return optionsItems.map((optItem) => ({
260
+ title: (0, import_lodash.get)(optItem, labelApiPath),
261
+ value: (0, import_lodash.get)(optItem, valApiPath),
262
+ children: formatToTreeData(optItem == null ? void 0 : optItem.children)
263
+ }));
264
+ }
265
+ return [];
260
266
  };
267
+ if ((attrItem == null ? void 0 : attrItem.compType) === "treeSelect") {
268
+ formItem.props = {
269
+ ...formItem.props,
270
+ treeData: formatToTreeData(optData)
271
+ };
272
+ } else {
273
+ formItem.props = {
274
+ ...formItem.props,
275
+ options: formatOptionsRecursively(optData, labelApiPath, valApiPath)
276
+ };
277
+ }
261
278
  }
262
279
  }
263
280
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/formatModule/helpers/formatFormProps.ts"],
4
- "sourcesContent": ["import { get } from 'lodash';\r\nimport { stringScriptExecution } from './stringScriptExecution';\r\nimport { getDataArr, getParamsContentByParamKeys, replaceParamsValue } from '../../treeUtils';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\n\r\nexport type formatFormPropsType = {\r\n options?: {\r\n column?: number;\r\n children?: {[key:string]: any}[]\r\n }\r\n parameters: {[key:string]: any};\r\n staticCodeMap: {[key:string]: any};\r\n staticOptionsMap: {[key:string]: any};\r\n}\r\n\r\nconst formatOptionsRecursively = (data: any[], labelApiPath: string[], valApiPath: string[]): any[] => {\r\n return data.map((item) => {\r\n const option: any = {\r\n label: get(item, labelApiPath),\r\n value: get(item, valApiPath),\r\n };\r\n \r\n // 如果存在children属性,递归处理\r\n if (item.children && Array.isArray(item.children)) {\r\n option.children = formatOptionsRecursively(item.children, labelApiPath, valApiPath);\r\n }\r\n \r\n return option;\r\n });\r\n};\r\n\r\nconst formatFormProps = ({\r\n parameters,\r\n staticCodeMap,\r\n staticOptionsMap,\r\n options = {},\r\n}: formatFormPropsType):{[key:string]: any} => {\r\n const { children, column } = options;\r\n const res:{[key:string]: any} = {};\r\n const formItems: { [key: string]: any }[] = [];\r\n const initValues: { [key: string]: any } = {};\r\n if (Array.isArray(children) && children.length > 0) {\r\n children.forEach((attrItem) => {\r\n const {\r\n compProps: attrCompProps,\r\n formProps: attrFormProps,\r\n } = attrItem || {};\r\n const {\r\n required,\r\n extend,\r\n display: attrFormPropsDisplay,\r\n ...otherAttrFormProps\r\n } = attrFormProps || {};\r\n const {\r\n dataOptions,\r\n ...otherAttrCompProps\r\n } = attrCompProps || {};\r\n const formItem:{[key:string]: any} = {\r\n key: attrItem?.id,\r\n label: attrFormProps?.label,\r\n name: attrFormProps?.name,\r\n type: attrItem?.compType,\r\n props: otherAttrCompProps || {},\r\n formProps: otherAttrFormProps || {},\r\n originModule: attrItem, // 以下是组件配置属性,用于属性编辑\r\n };\r\n if (extend?.type === 'text' && extend?.text && typeof extend?.text === 'string') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n text: replaceParamsValue(extend?.text, parameters),\r\n },\r\n };\r\n } else if (extend?.type === 'controlBtns' && Array.isArray(extend?.controlBtns) && extend?.controlBtns?.length > 0) {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n controlBtns: extend?.controlBtns,\r\n },\r\n };\r\n } else {\r\n delete formItem.formProps.extend;\r\n }\r\n if (attrItem?.compType === 'table') {\r\n const tableProps = formatTableProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n });\r\n const rowKeys = getDataArr(attrItem?.compProps?.rowKey);\r\n formItem.props = {\r\n ...formItem.props,\r\n ...tableProps,\r\n rowKey: rowKeys?.length > 0 ? rowKeys?.[rowKeys?.length - 1] : 'key',\r\n hasSelectAll: (attrItem?.compProps?.rowSelection && attrItem?.compProps?.hasSelectAll) ? attrItem?.compProps?.hasSelectAll : null,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (['list', 'card'].includes(attrItem?.compType)) {\r\n const resProps = formatListProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n urlPrefix,\r\n });\r\n formItem.props = {\r\n ...resProps,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (attrItem?.compType === 'upload') {\r\n if (\r\n attrItem?.compProps?.data &&\r\n Object.keys(attrItem?.compProps?.data)?.length > 0\r\n ) {\r\n const uploadDataParams:{[key:string]: any} = {};\r\n Object.keys(attrItem?.compProps?.data).forEach(paramsName => {\r\n if (/\\$\\{(.+?)\\}/g.test(attrItem?.compProps?.data?.[paramsName])) {\r\n // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);\r\n uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem?.compProps?.data?.[paramsName], parameters);\r\n } else {\r\n uploadDataParams[paramsName] = attrItem?.compProps?.data?.[paramsName];\r\n }\r\n });\r\n formItem.props = {\r\n ...formItem.props,\r\n data: uploadDataParams,\r\n };\r\n }\r\n if (\r\n attrItem?.compProps?.action?.url &&\r\n typeof attrItem?.compProps?.action?.url === 'string'\r\n ) {\r\n formItem.props = {\r\n ...formItem.props,\r\n action: attrItem?.compProps?.action?.url,\r\n };\r\n }\r\n }\r\n let otherRules = Array.isArray(otherAttrFormProps?.rules) ? otherAttrFormProps?.rules?.filter((item: any) => !item?.required) : [];\r\n if (attrItem?.formProps?.defaultValue) {\r\n let attrDefVal:any = '';\r\n if (attrItem?.compType === 'upload') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n valuePropName: 'fileList',\r\n };\r\n attrDefVal = getParamsContentByParamKeys(attrItem?.formProps?.defaultValue, parameters) || [];\r\n } else {\r\n delete formItem.formProps.valuePropName;\r\n attrDefVal = replaceParamsValue(attrItem?.formProps?.defaultValue, parameters) || '';\r\n }\r\n initValues[otherAttrFormProps?.name] = attrDefVal;\r\n }\r\n otherRules = otherRules.map((item: {[key:string]: any}) => ({\r\n pattern: item?.type === 'custom' ? patternTransitionRegExp(item?.pattern) : (\r\n formRulsRegMap?.[item?.type] || ''\r\n ),\r\n message: item?.message,\r\n }));\r\n if (typeof attrFormPropsDisplay === 'boolean' || typeof attrFormPropsDisplay === 'string') {\r\n let formItemDisplay:boolean = true;\r\n if (typeof attrFormPropsDisplay === 'boolean') {\r\n formItemDisplay = attrFormPropsDisplay;\r\n } else if (typeof attrFormPropsDisplay === 'string' && attrFormPropsDisplay) {\r\n // const scriptCodeStr = stringPramarsValTransition(attrFormPropsDisplay, parameters);\r\n const codeExtendVal = stringScriptExecution(\r\n attrFormPropsDisplay,\r\n parameters,\r\n );\r\n formItemDisplay = codeExtendVal;\r\n }\r\n formItem.display = formItemDisplay;\r\n }\r\n if (typeof required === 'boolean' || typeof required === 'string') {\r\n let formItemRequired:boolean = false;\r\n if (typeof required === 'boolean') {\r\n formItemRequired = required;\r\n } else if (typeof required === 'string' && required) {\r\n // const scriptCodeStr = stringPramarsValTransition(required, parameters);\r\n const codeExtendVal = stringScriptExecution(required, parameters);\r\n formItemRequired = typeof codeExtendVal === 'boolean' ? codeExtendVal : false;\r\n }\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: formItemRequired ? [{ required: formItemRequired }, ...otherRules] : otherRules,\r\n };\r\n } else {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: otherRules,\r\n };\r\n }\r\n if (dataOptions) {\r\n const attrItemDataOptions = dataOptions || {};\r\n if (attrItemDataOptions?.staticCode) {\r\n if (\r\n attrItem?.defaultValue &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode] &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue]\r\n ) {\r\n initValues[attrItem?.attrCode] = staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue];\r\n }\r\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\r\n if (Array.isArray(optionsItems)) {\r\n return optionsItems.map(optItem => ({\r\n title: optItem?.label,\r\n value: optItem?.value,\r\n children: formatToTreeData(optItem?.children),\r\n }));\r\n }\r\n return [];\r\n };\r\n if (attrItem?.compType === 'treeSelect') {\r\n formItem.props = {\r\n ...formItem.props,\r\n treeData: formatToTreeData(staticOptionsMap?.[attrItemDataOptions?.staticCode]),\r\n };\r\n } else {\r\n formItem.props = {\r\n ...formItem.props,\r\n options: Array.isArray(staticOptionsMap?.[attrItemDataOptions?.staticCode]) ?\r\n staticOptionsMap?.[attrItemDataOptions?.staticCode] : [],\r\n };\r\n }\r\n } else if (attrItemDataOptions?.contextOptions && parameters) {\r\n const optLabelStr = attrItemDataOptions?.contextOptions?.label;\r\n const optValueStr = attrItemDataOptions?.contextOptions?.value;\r\n const splitParamsPath = (paramsPathStr: string) => {\r\n if (typeof paramsPathStr === 'string') {\r\n const paramsPathArr = paramsPathStr.replace(/\\$\\{|\\}/g, '').split('.');\r\n return paramsPathArr?.filter((item:string, idx:number) => !(idx === 0 && item === 'root'));\r\n }\r\n return [];\r\n };\r\n if (optValueStr) {\r\n const optValArr = splitParamsPath(optValueStr);\r\n const optLabelArr = splitParamsPath(optLabelStr);\r\n const optData: any[] = Array.isArray(parameters?.[optValArr?.[0]]) ? parameters?.[optValArr?.[0]] : [];\r\n const labelApiPath: string[] = optLabelArr?.slice(2);\r\n const valApiPath: string[] = optValArr?.slice(2);\r\n \r\n formItem.props = {\r\n ...formItem.props,\r\n options: formatOptionsRecursively(optData, labelApiPath, valApiPath),\r\n };\r\n }\r\n }\r\n }\r\n formItems.push(formItem);\r\n });\r\n }\r\n if (typeof column === 'number' && column > 1) {\r\n res.formMode = 'grid';\r\n res.span = 24 / column;\r\n } else {\r\n res.formMode = 'default';\r\n delete res.span;\r\n }\r\n res.formItems = formItems;\r\n res.initialValues = initValues;\r\n return res;\r\n};\r\n\r\nexport default formatFormProps;\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoB;AACpB,mCAAsC;AACtC,uBAA4E;AAC5E,8BAA6B;AAC7B,6BAA4B;AAC5B,4BAA2B;AAC3B,uBAAsB;AACtB,qCAAoC;AAYpC,IAAM,2BAA2B,CAAC,MAAa,cAAwB,eAAgC;AACrG,SAAO,KAAK,IAAI,CAAC,SAAS;AACxB,UAAM,SAAc;AAAA,MAClB,WAAO,mBAAI,MAAM,YAAY;AAAA,MAC7B,WAAO,mBAAI,MAAM,UAAU;AAAA,IAC7B;AAGA,QAAI,KAAK,YAAY,MAAM,QAAQ,KAAK,QAAQ,GAAG;AACjD,aAAO,WAAW,yBAAyB,KAAK,UAAU,cAAc,UAAU;AAAA,IACpF;AAEA,WAAO;AAAA,EACT,CAAC;AACH;AAEA,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AACb,MAA+C;AAC7C,QAAM,EAAE,UAAU,OAAO,IAAI;AAC7B,QAAM,MAA0B,CAAC;AACjC,QAAM,YAAsC,CAAC;AAC7C,QAAM,aAAqC,CAAC;AAC5C,MAAI,MAAM,QAAQ,QAAQ,KAA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O,0BAAQ;",
4
+ "sourcesContent": ["import { get } from 'lodash';\r\nimport { stringScriptExecution } from './stringScriptExecution';\r\nimport { getDataArr, getParamsContentByParamKeys, replaceParamsValue } from '../../treeUtils';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\n\r\nexport type formatFormPropsType = {\r\n options?: {\r\n column?: number;\r\n children?: {[key:string]: any}[]\r\n }\r\n parameters: {[key:string]: any};\r\n staticCodeMap: {[key:string]: any};\r\n staticOptionsMap: {[key:string]: any};\r\n}\r\n\r\nconst formatOptionsRecursively = (data: any[], labelApiPath: string[], valApiPath: string[]): any[] => {\r\n return data.map((item) => {\r\n const option: any = {\r\n label: get(item, labelApiPath),\r\n value: get(item, valApiPath),\r\n };\r\n \r\n // 如果存在children属性,递归处理\r\n if (item.children && Array.isArray(item.children)) {\r\n option.children = formatOptionsRecursively(item.children, labelApiPath, valApiPath);\r\n }\r\n \r\n return option;\r\n });\r\n};\r\n\r\nconst formatFormProps = ({\r\n parameters,\r\n staticCodeMap,\r\n staticOptionsMap,\r\n options = {},\r\n}: formatFormPropsType):{[key:string]: any} => {\r\n const { children, column } = options;\r\n const res:{[key:string]: any} = {};\r\n const formItems: { [key: string]: any }[] = [];\r\n const initValues: { [key: string]: any } = {};\r\n if (Array.isArray(children) && children.length > 0) {\r\n children.forEach((attrItem) => {\r\n const {\r\n compProps: attrCompProps,\r\n formProps: attrFormProps,\r\n } = attrItem || {};\r\n const {\r\n required,\r\n extend,\r\n display: attrFormPropsDisplay,\r\n ...otherAttrFormProps\r\n } = attrFormProps || {};\r\n const {\r\n dataOptions,\r\n ...otherAttrCompProps\r\n } = attrCompProps || {};\r\n const formItem:{[key:string]: any} = {\r\n key: attrItem?.id,\r\n label: attrFormProps?.label,\r\n name: attrFormProps?.name,\r\n type: attrItem?.compType,\r\n props: otherAttrCompProps || {},\r\n formProps: otherAttrFormProps || {},\r\n originModule: attrItem, // 以下是组件配置属性,用于属性编辑\r\n };\r\n if (extend?.type === 'text' && extend?.text && typeof extend?.text === 'string') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n text: replaceParamsValue(extend?.text, parameters),\r\n },\r\n };\r\n } else if (extend?.type === 'controlBtns' && Array.isArray(extend?.controlBtns) && extend?.controlBtns?.length > 0) {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n controlBtns: extend?.controlBtns,\r\n },\r\n };\r\n } else {\r\n delete formItem.formProps.extend;\r\n }\r\n if (attrItem?.compType === 'table') {\r\n const tableProps = formatTableProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n });\r\n const rowKeys = getDataArr(attrItem?.compProps?.rowKey);\r\n formItem.props = {\r\n ...formItem.props,\r\n ...tableProps,\r\n rowKey: rowKeys?.length > 0 ? rowKeys?.[rowKeys?.length - 1] : 'key',\r\n hasSelectAll: (attrItem?.compProps?.rowSelection && attrItem?.compProps?.hasSelectAll) ? attrItem?.compProps?.hasSelectAll : null,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (['list', 'card'].includes(attrItem?.compType)) {\r\n const resProps = formatListProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n urlPrefix,\r\n });\r\n formItem.props = {\r\n ...resProps,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (attrItem?.compType === 'upload') {\r\n if (\r\n attrItem?.compProps?.data &&\r\n Object.keys(attrItem?.compProps?.data)?.length > 0\r\n ) {\r\n const uploadDataParams:{[key:string]: any} = {};\r\n Object.keys(attrItem?.compProps?.data).forEach(paramsName => {\r\n if (/\\$\\{(.+?)\\}/g.test(attrItem?.compProps?.data?.[paramsName])) {\r\n // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);\r\n uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem?.compProps?.data?.[paramsName], parameters);\r\n } else {\r\n uploadDataParams[paramsName] = attrItem?.compProps?.data?.[paramsName];\r\n }\r\n });\r\n formItem.props = {\r\n ...formItem.props,\r\n data: uploadDataParams,\r\n };\r\n }\r\n if (\r\n attrItem?.compProps?.action?.url &&\r\n typeof attrItem?.compProps?.action?.url === 'string'\r\n ) {\r\n formItem.props = {\r\n ...formItem.props,\r\n action: attrItem?.compProps?.action?.url,\r\n };\r\n }\r\n }\r\n let otherRules = Array.isArray(otherAttrFormProps?.rules) ? otherAttrFormProps?.rules?.filter((item: any) => !item?.required) : [];\r\n if (attrItem?.formProps?.defaultValue) {\r\n let attrDefVal:any = '';\r\n if (attrItem?.compType === 'upload') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n valuePropName: 'fileList',\r\n };\r\n attrDefVal = getParamsContentByParamKeys(attrItem?.formProps?.defaultValue, parameters) || [];\r\n } else {\r\n delete formItem.formProps.valuePropName;\r\n attrDefVal = replaceParamsValue(attrItem?.formProps?.defaultValue, parameters) || '';\r\n }\r\n initValues[otherAttrFormProps?.name] = attrDefVal;\r\n }\r\n otherRules = otherRules.map((item: {[key:string]: any}) => ({\r\n pattern: item?.type === 'custom' ? patternTransitionRegExp(item?.pattern) : (\r\n formRulsRegMap?.[item?.type] || ''\r\n ),\r\n message: item?.message,\r\n }));\r\n if (typeof attrFormPropsDisplay === 'boolean' || typeof attrFormPropsDisplay === 'string') {\r\n let formItemDisplay:boolean = true;\r\n if (typeof attrFormPropsDisplay === 'boolean') {\r\n formItemDisplay = attrFormPropsDisplay;\r\n } else if (typeof attrFormPropsDisplay === 'string' && attrFormPropsDisplay) {\r\n // const scriptCodeStr = stringPramarsValTransition(attrFormPropsDisplay, parameters);\r\n const codeExtendVal = stringScriptExecution(\r\n attrFormPropsDisplay,\r\n parameters,\r\n );\r\n formItemDisplay = codeExtendVal;\r\n }\r\n formItem.display = formItemDisplay;\r\n }\r\n if (typeof required === 'boolean' || typeof required === 'string') {\r\n let formItemRequired:boolean = false;\r\n if (typeof required === 'boolean') {\r\n formItemRequired = required;\r\n } else if (typeof required === 'string' && required) {\r\n // const scriptCodeStr = stringPramarsValTransition(required, parameters);\r\n const codeExtendVal = stringScriptExecution(required, parameters);\r\n formItemRequired = typeof codeExtendVal === 'boolean' ? codeExtendVal : false;\r\n }\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: formItemRequired ? [{ required: formItemRequired }, ...otherRules] : otherRules,\r\n };\r\n } else {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: otherRules,\r\n };\r\n }\r\n if (dataOptions) {\r\n const attrItemDataOptions = dataOptions || {};\r\n if (attrItemDataOptions?.staticCode) {\r\n if (\r\n attrItem?.defaultValue &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode] &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue]\r\n ) {\r\n initValues[attrItem?.attrCode] = staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue];\r\n }\r\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\r\n if (Array.isArray(optionsItems)) {\r\n return optionsItems.map(optItem => ({\r\n title: optItem?.label,\r\n value: optItem?.value,\r\n children: formatToTreeData(optItem?.children),\r\n }));\r\n }\r\n return [];\r\n };\r\n if (attrItem?.compType === 'treeSelect') {\r\n formItem.props = {\r\n ...formItem.props,\r\n treeData: formatToTreeData(staticOptionsMap?.[attrItemDataOptions?.staticCode]),\r\n };\r\n } else {\r\n formItem.props = {\r\n ...formItem.props,\r\n options: Array.isArray(staticOptionsMap?.[attrItemDataOptions?.staticCode]) ?\r\n staticOptionsMap?.[attrItemDataOptions?.staticCode] : [],\r\n };\r\n }\r\n } else if (attrItemDataOptions?.contextOptions && parameters) {\r\n const optLabelStr = attrItemDataOptions?.contextOptions?.label;\r\n const optValueStr = attrItemDataOptions?.contextOptions?.value;\r\n const splitParamsPath = (paramsPathStr: string) => {\r\n if (typeof paramsPathStr === 'string') {\r\n const paramsPathArr = paramsPathStr.replace(/\\$\\{|\\}/g, '').split('.');\r\n return paramsPathArr?.filter((item:string, idx:number) => !(idx === 0 && item === 'root'));\r\n }\r\n return [];\r\n };\r\n if (optValueStr) {\r\n const optValArr = splitParamsPath(optValueStr);\r\n const optLabelArr = splitParamsPath(optLabelStr);\r\n const optData: any[] = Array.isArray(parameters?.[optValArr?.[0]]) ? parameters?.[optValArr?.[0]] : [];\r\n const labelApiPath: string[] = optLabelArr?.slice(2);\r\n const valApiPath: string[] = optValArr?.slice(2);\r\n\r\n \r\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\r\n if (Array.isArray(optionsItems)) {\r\n return optionsItems.map(optItem => ({\r\n title: get(optItem, labelApiPath),\r\n value: get(optItem, valApiPath),\r\n children: formatToTreeData(optItem?.children),\r\n }));\r\n }\r\n return [];\r\n };\r\n \r\n if (attrItem?.compType === 'treeSelect') {\r\n formItem.props = {\r\n ...formItem.props,\r\n treeData: formatToTreeData(optData),\r\n };\r\n } else {\r\n formItem.props = {\r\n ...formItem.props,\r\n options: formatOptionsRecursively(optData, labelApiPath, valApiPath),\r\n };\r\n }\r\n }\r\n }\r\n }\r\n formItems.push(formItem);\r\n });\r\n }\r\n if (typeof column === 'number' && column > 1) {\r\n res.formMode = 'grid';\r\n res.span = 24 / column;\r\n } else {\r\n res.formMode = 'default';\r\n delete res.span;\r\n }\r\n res.formItems = formItems;\r\n res.initialValues = initValues;\r\n return res;\r\n};\r\n\r\nexport default formatFormProps;\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoB;AACpB,mCAAsC;AACtC,uBAA4E;AAC5E,8BAA6B;AAC7B,6BAA4B;AAC5B,4BAA2B;AAC3B,uBAAsB;AACtB,qC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AgB,WAAW;AAC7C,kBAAM,cAAc,gBAAgB,WAAW;AAC/C,kBAAM,UAAiB,MAAM,QAAQ,yCAAa,uCAAY,GAAG,IAAI,yCAAa,uCAAY,MAAM,CAAC;AACrG,kBAAM,eAAyB,2CAAa,MAAM;AAClD,kBAAM,aAAuB,uCAAW,MAAM;AAG9C,kBAAM,mBAAmB,CAAC,iBAA8D;AACtF,kBAAI,MAAM,QAAQ,YAAY,GAAG;AAC/B,uBAAO,aAAa,IAAI,cAAY;AAAA,kBAClC,WAAO,mBAAI,SAAS,YAAY;AAAA,kBAChC,WAAO,mBAAI,SAAS,UAAU;AAAA,kBAC9B,UAAU,iBAAiB,mCAAS,QAAQ;AAAA,gBAC9C,EAAE;AAAA,cACJ;AACA,qBAAO,CAAC;AAAA,YACV;AAEA,iBAAI,qCAAU,cAAa,cAAc;AACvC,uBAAS,QAAQ;AAAA,gBACf,GAAG,SAAS;AAAA,gBACZ,UAAU,iBAAiB,OAAO;AAAA,cACpC;AAAA,YACF,OAAO;AACL,uBAAS,QAAQ;AAAA,gBACf,GAAG,SAAS;AAAA,gBACZ,SAAS,yBAAyB,SAAS,cAAc,UAAU;AAAA,cACrE;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AACA,gBAAU,KAAK,QAAQ;AAAA,IACzB,CAAC;AAAA,EACH;AACA,MAAI,OAAO,WAAW,YAAY,SAAS,GAAG;AAC5C,QAAI,WAAW;AACf,QAAI,OAAO,KAAK;AAAA,EAClB,OAAO;AACL,QAAI,WAAW;AACf,WAAO,IAAI;AAAA,EACb;AACA,MAAI,YAAY;AAChB,MAAI,gBAAgB;AACpB,SAAO;AACT;AAEA,IAAO,0BAAQ;",
6
6
  "names": ["formatTableProps", "formatListProps", "urlPrefix", "_a", "_b", "_c", "_d", "_e", "_f", "patternTransitionRegExp", "formRulsRegMap"]
7
7
  }
@@ -16,5 +16,5 @@ import formatStyleProps from './formatStyleProps';
16
16
  import formatStepsProps from './formatStepsProps';
17
17
  import formRulsRegMap from './formRulsRegMap';
18
18
  import urlPrefix from './urlPrefix';
19
- import { stringScriptExecution } from './stringScriptExecution';
20
- export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, };
19
+ import { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';
20
+ export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution, };
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/formatModule/helpers/index.ts
30
30
  var helpers_exports = {};
31
31
  __export(helpers_exports, {
32
+ createCompartmentExecution: () => import_stringScriptExecution.createCompartmentExecution,
32
33
  formRulsRegMap: () => import_formRulsRegMap.default,
33
34
  formatCarouselProps: () => import_formatCarouselProps.default,
34
35
  formatChartsProps: () => import_formatChartsProps.default,
@@ -71,6 +72,7 @@ var import_urlPrefix = __toESM(require("./urlPrefix"));
71
72
  var import_stringScriptExecution = require("./stringScriptExecution");
72
73
  // Annotate the CommonJS export names for ESM import in node:
73
74
  0 && (module.exports = {
75
+ createCompartmentExecution,
74
76
  formRulsRegMap,
75
77
  formatCarouselProps,
76
78
  formatChartsProps,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/formatModule/helpers/index.ts"],
4
- "sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\nimport staticCodeAssemble from './staticCodeAssemble';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formatImageProps from './formatImageProps';\r\nimport formatCarouselProps from './formatCarouselProps';\r\nimport formatDescriptionsProps from './formatDescriptionsProps';\r\nimport formatHighCodeProps from './formatHighCodeProps';\r\nimport formatFormProps from './formatFormProps';\r\nimport formatEchartLineProps from './formatEchartLineProps';\r\nimport formatEchartPieProps from './formatEchartPieProps';\r\nimport formatChartsProps from './formatChartsProps';\r\nimport formatLoopProps from './formatLoopProps';\r\nimport formatStyleProps from './formatStyleProps';\r\nimport formatStepsProps from './formatStepsProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport { stringScriptExecution } from './stringScriptExecution';\r\n\r\nexport {\r\n urlPrefix,\r\n formRulsRegMap,\r\n formatListProps,\r\n formatTableProps,\r\n formatCarouselProps,\r\n formatImageProps,\r\n formatDescriptionsProps,\r\n formatFormProps,\r\n formatHighCodeProps,\r\n formatEchartLineProps,\r\n formatEchartPieProps,\r\n formatChartsProps,\r\n formatLoopProps,\r\n formatStyleProps,\r\n formatStepsProps,\r\n staticCodeAssemble,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n};\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,sDAAAC;AAAA,EAAA,kDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,0DAAAC;AAAA,EAAA,wDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,sDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,oDAAAC;AAAA,EAAA,oEAAAC;AAAA,EAAA;AAAA,oCAAAC;AAAA;AAAA;AAAA,wCAAuC;AACvC,qCAAoC;AACpC,gCAA+B;AAC/B,8BAA6B;AAC7B,6BAA4B;AAC5B,8BAA6B;AAC7B,iCAAgC;AAChC,qCAAoC;AACpC,iCAAgC;AAChC,6BAA4B;AAC5B,mCAAkC;AAClC,kCAAiC;AACjC,+BAA8B;AAC9B,6BAA4B;AAC5B,8BAA6B;AAC7B,8BAA6B;AAC7B,4BAA2B;AAC3B,uBAAsB;AACtB,mCAAsC;",
4
+ "sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\nimport staticCodeAssemble from './staticCodeAssemble';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formatImageProps from './formatImageProps';\r\nimport formatCarouselProps from './formatCarouselProps';\r\nimport formatDescriptionsProps from './formatDescriptionsProps';\r\nimport formatHighCodeProps from './formatHighCodeProps';\r\nimport formatFormProps from './formatFormProps';\r\nimport formatEchartLineProps from './formatEchartLineProps';\r\nimport formatEchartPieProps from './formatEchartPieProps';\r\nimport formatChartsProps from './formatChartsProps';\r\nimport formatLoopProps from './formatLoopProps';\r\nimport formatStyleProps from './formatStyleProps';\r\nimport formatStepsProps from './formatStepsProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';\r\n\r\nexport {\r\n urlPrefix,\r\n formRulsRegMap,\r\n formatListProps,\r\n formatTableProps,\r\n formatCarouselProps,\r\n formatImageProps,\r\n formatDescriptionsProps,\r\n formatFormProps,\r\n formatHighCodeProps,\r\n formatEchartLineProps,\r\n formatEchartPieProps,\r\n formatChartsProps,\r\n formatLoopProps,\r\n formatStyleProps,\r\n formatStepsProps,\r\n staticCodeAssemble,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n createCompartmentExecution,\r\n};\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,sDAAAC;AAAA,EAAA,kDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,0DAAAC;AAAA,EAAA,wDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,sDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,8CAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA,8DAAAC;AAAA,EAAA,oDAAAC;AAAA,EAAA,oEAAAC;AAAA,EAAA;AAAA,oCAAAC;AAAA;AAAA;AAAA,wCAAuC;AACvC,qCAAoC;AACpC,gCAA+B;AAC/B,8BAA6B;AAC7B,6BAA4B;AAC5B,8BAA6B;AAC7B,iCAAgC;AAChC,qCAAoC;AACpC,iCAAgC;AAChC,6BAA4B;AAC5B,mCAAkC;AAClC,kCAAiC;AACjC,+BAA8B;AAC9B,6BAA4B;AAC5B,8BAA6B;AAC7B,8BAA6B;AAC7B,4BAA2B;AAC3B,uBAAsB;AACtB,mCAAkE;",
6
6
  "names": ["formRulsRegMap", "formatCarouselProps", "formatChartsProps", "formatDescriptionsProps", "formatEchartLineProps", "formatEchartPieProps", "formatFormProps", "formatHighCodeProps", "formatImageProps", "formatListProps", "formatLoopProps", "formatStepsProps", "formatStyleProps", "formatTableProps", "patternTransitionRegExp", "staticCodeAssemble", "stringPramarsValTransition", "urlPrefix"]
7
7
  }
@@ -1,2 +1,4 @@
1
1
  import 'ses';
2
+ import type { CompartmentOptions } from 'ses';
2
3
  export declare const stringScriptExecution: (scriptCode: string, root?: any) => any;
4
+ export declare const createCompartmentExecution: (globals?: CompartmentOptions) => Compartment;
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/formatModule/helpers/stringScriptExecution.ts
20
20
  var stringScriptExecution_exports = {};
21
21
  __export(stringScriptExecution_exports, {
22
+ createCompartmentExecution: () => createCompartmentExecution,
22
23
  stringScriptExecution: () => stringScriptExecution
23
24
  });
24
25
  module.exports = __toCommonJS(stringScriptExecution_exports);
@@ -32,8 +33,12 @@ var stringScriptExecution = (scriptCode, root = {}) => {
32
33
  return err;
33
34
  }
34
35
  };
36
+ var createCompartmentExecution = (globals) => {
37
+ return new Compartment(globals);
38
+ };
35
39
  // Annotate the CommonJS export names for ESM import in node:
36
40
  0 && (module.exports = {
41
+ createCompartmentExecution,
37
42
  stringScriptExecution
38
43
  });
39
44
  //# sourceMappingURL=stringScriptExecution.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/formatModule/helpers/stringScriptExecution.ts"],
4
- "sourcesContent": ["import 'ses';\r\n/* eslint-disable no-new-func */\r\n// export const stringScriptExecution = (scriptCode: string, root: any) => {\r\n// try {\r\n// if (scriptCode) {\r\n// // 将参数作为全局变量传递\r\n// const func = new Function('root', `return ${scriptCode}`);\r\n// const result = func(root);\r\n// console.log(result, root, scriptCode);\r\n// return result;\r\n// }\r\n// throw new Error('No script code provided');\r\n// } catch (err) {\r\n// console.error(err);\r\n// return null;\r\n// }\r\n// };\r\n\r\nexport const stringScriptExecution = (scriptCode: string, root: any = {}) => {\r\n const compartment = new Compartment({ root, window });\r\n try {\r\n return scriptCode ? compartment.evaluate(scriptCode) : null;\r\n } catch (err) {\r\n console.error(err);\r\n return err;\r\n }\r\n};\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAO;AAkBA,IAAM,wBAAwB,CAAC,YAAoB,OAAY,CAAC,MAAM;AAC3E,QAAM,cAAc,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AACpD,MAAI;AACF,WAAO,aAAa,YAAY,SAAS,UAAU,IAAI;AAAA,EACzD,SAAS,KAAP;AACA,YAAQ,MAAM,GAAG;AACjB,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["import 'ses';\r\nimport type { CompartmentOptions } from 'ses';\r\n/* eslint-disable no-new-func */\r\n// export const stringScriptExecution = (scriptCode: string, root: any) => {\r\n// try {\r\n// if (scriptCode) {\r\n// // 将参数作为全局变量传递\r\n// const func = new Function('root', `return ${scriptCode}`);\r\n// const result = func(root);\r\n// console.log(result, root, scriptCode);\r\n// return result;\r\n// }\r\n// throw new Error('No script code provided');\r\n// } catch (err) {\r\n// console.error(err);\r\n// return null;\r\n// }\r\n// };\r\n\r\nexport const stringScriptExecution = (scriptCode: string, root: any = {}) => {\r\n const compartment = new Compartment({ root, window });\r\n try {\r\n return scriptCode ? compartment.evaluate(scriptCode) : null;\r\n } catch (err) {\r\n console.error(err);\r\n return err;\r\n }\r\n};\r\n\r\nexport const createCompartmentExecution = (globals?: CompartmentOptions) => {\r\n return new Compartment(globals);\r\n};\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAO;AAmBA,IAAM,wBAAwB,CAAC,YAAoB,OAAY,CAAC,MAAM;AAC3E,QAAM,cAAc,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AACpD,MAAI;AACF,WAAO,aAAa,YAAY,SAAS,UAAU,IAAI;AAAA,EACzD,SAAS,KAAP;AACA,YAAQ,MAAM,GAAG;AACjB,WAAO;AAAA,EACT;AACF;AAEO,IAAM,6BAA6B,CAAC,YAAiC;AAC1E,SAAO,IAAI,YAAY,OAAO;AAChC;",
6
6
  "names": []
7
7
  }
@@ -5,7 +5,7 @@ import { asyncLocalStorage, asyncSessionStorage, type asyncLocalStorageType, typ
5
5
  import { camelToSnake, underscoreToCamelCase, generateRandom18Int } from './stringUtils';
6
6
  import { getDataArr, replaceParamsValue, getParamsContentByParamKeys, replaceParamsValueForEvent } from './treeUtils';
7
7
  import formatModuleData from './formatModule/formatModuleData';
8
- import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution } from './formatModule/helpers';
8
+ import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution } from './formatModule/helpers';
9
9
  import loopPageStaticCodeMap from './loopPageStaticCodeMap';
10
10
  import scriptExecution, { type scriptExecutionType } from './scriptExecution';
11
11
  import { getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById } from './file';
@@ -14,4 +14,4 @@ import { isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, g
14
14
  import watchMatchMedia, { type pageSizeType } from './watchMatchMedia';
15
15
  import { request, tenantIdSessionKey } from './http';
16
16
  export type { fileToBase64Type, asyncLocalStorageType, asyncSessionStorageType, scriptExecutionType, pageSizeType, };
17
- export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, getLocation, isMobile, watchMatchMedia, request, tenantIdSessionKey, };
17
+ export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, createCompartmentExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, getLocation, isMobile, watchMatchMedia, request, tenantIdSessionKey, };
package/dist/cjs/index.js CHANGED
@@ -35,6 +35,7 @@ __export(src_exports, {
35
35
  asyncLocalStorage: () => import_asyncStorage.asyncLocalStorage,
36
36
  asyncSessionStorage: () => import_asyncStorage.asyncSessionStorage,
37
37
  camelToSnake: () => import_stringUtils.camelToSnake,
38
+ createCompartmentExecution: () => import_helpers.createCompartmentExecution,
38
39
  fileToBase64: () => import_fileToBase64.default,
39
40
  formatModuleData: () => import_formatModuleData.default,
40
41
  generateRandom18Int: () => import_stringUtils.generateRandom18Int,
@@ -95,6 +96,7 @@ _.noConflict();
95
96
  asyncLocalStorage,
96
97
  asyncSessionStorage,
97
98
  camelToSnake,
99
+ createCompartmentExecution,
98
100
  fileToBase64,
99
101
  formatModuleData,
100
102
  generateRandom18Int,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["import fileToBase64, { type fileToBase64Type } from './fileToBase64';\r\nimport CookieUtils from './CookieUtils';\r\nimport { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';\r\nimport {\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n type asyncLocalStorageType,\r\n type asyncSessionStorageType,\r\n} from './asyncStorage';\r\nimport {\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n} from './stringUtils';\r\nimport {\r\n getDataArr,\r\n replaceParamsValue,\r\n getParamsContentByParamKeys,\r\n replaceParamsValueForEvent,\r\n} from './treeUtils';\r\nimport formatModuleData from './formatModule/formatModuleData';\r\nimport {\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n} from './formatModule/helpers';\r\nimport loopPageStaticCodeMap from './loopPageStaticCodeMap';\r\nimport scriptExecution, { type scriptExecutionType } from './scriptExecution';\r\nimport {\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n} from './file';\r\nimport {\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n} from './securityUtils';\r\nimport {\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n} from './environment';\r\n\r\nimport watchMatchMedia, { type pageSizeType } from './watchMatchMedia';\r\n\r\nimport { request, tenantIdSessionKey } from './http';\r\n\r\n// 避免 _对象 和其他库冲突\r\nconst _ = require('lodash');\r\n\r\n_.noConflict();\r\n\r\nexport type {\r\n fileToBase64Type,\r\n asyncLocalStorageType,\r\n asyncSessionStorageType,\r\n scriptExecutionType,\r\n pageSizeType,\r\n};\r\n\r\nexport {\r\n fileToBase64,\r\n CookieUtils,\r\n argsToString,\r\n argsToObject,\r\n getSearchObj,\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n formatModuleData,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n loopPageStaticCodeMap,\r\n getDataArr,\r\n replaceParamsValue,\r\n replaceParamsValueForEvent,\r\n getParamsContentByParamKeys,\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n stringScriptExecution,\r\n scriptExecution,\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n watchMatchMedia,\r\n request,\r\n tenantIdSessionKey,\r\n};\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wCAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0CAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4DAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gDAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,gDAAAC;AAAA;AAAA;AAAA,0BAAoD;AACpD,yBAAwB;AACxB,2BAAyD;AACzD,0BAKO;AACP,yBAIO;AACP,uBAKO;AACP,8BAA6B;AAC7B,qBAIO;AACP,mCAAkC;AAClC,6BAA0D;AAC1D,kBAKO;AACP,2BAKO;AACP,yBASO;AAEP,6BAAmD;AAEnD,kBAA4C;AAG5C,IAAM,IAAI,QAAQ,QAAQ;AAE1B,EAAE,WAAW;",
4
+ "sourcesContent": ["import fileToBase64, { type fileToBase64Type } from './fileToBase64';\r\nimport CookieUtils from './CookieUtils';\r\nimport { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';\r\nimport {\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n type asyncLocalStorageType,\r\n type asyncSessionStorageType,\r\n} from './asyncStorage';\r\nimport {\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n} from './stringUtils';\r\nimport {\r\n getDataArr,\r\n replaceParamsValue,\r\n getParamsContentByParamKeys,\r\n replaceParamsValueForEvent,\r\n} from './treeUtils';\r\nimport formatModuleData from './formatModule/formatModuleData';\r\nimport {\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n createCompartmentExecution,\r\n} from './formatModule/helpers';\r\nimport loopPageStaticCodeMap from './loopPageStaticCodeMap';\r\nimport scriptExecution, { type scriptExecutionType } from './scriptExecution';\r\nimport {\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n} from './file';\r\nimport {\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n} from './securityUtils';\r\nimport {\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n} from './environment';\r\n\r\nimport watchMatchMedia, { type pageSizeType } from './watchMatchMedia';\r\n\r\nimport { request, tenantIdSessionKey } from './http';\r\n\r\n// 避免 _对象 和其他库冲突\r\nconst _ = require('lodash');\r\n\r\n_.noConflict();\r\n\r\nexport type {\r\n fileToBase64Type,\r\n asyncLocalStorageType,\r\n asyncSessionStorageType,\r\n scriptExecutionType,\r\n pageSizeType,\r\n};\r\n\r\nexport {\r\n fileToBase64,\r\n CookieUtils,\r\n argsToString,\r\n argsToObject,\r\n getSearchObj,\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n formatModuleData,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n loopPageStaticCodeMap,\r\n getDataArr,\r\n replaceParamsValue,\r\n replaceParamsValueForEvent,\r\n getParamsContentByParamKeys,\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n stringScriptExecution,\r\n createCompartmentExecution,\r\n scriptExecution,\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n watchMatchMedia,\r\n request,\r\n tenantIdSessionKey,\r\n};\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wCAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0CAAAC;AAAA,EAAA,gDAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4DAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gDAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,gDAAAC;AAAA;AAAA;AAAA,0BAAoD;AACpD,yBAAwB;AACxB,2BAAyD;AACzD,0BAKO;AACP,yBAIO;AACP,uBAKO;AACP,8BAA6B;AAC7B,qBAKO;AACP,mCAAkC;AAClC,6BAA0D;AAC1D,kBAKO;AACP,2BAKO;AACP,yBASO;AAEP,6BAAmD;AAEnD,kBAA4C;AAG5C,IAAM,IAAI,QAAQ,QAAQ;AAE1B,EAAE,WAAW;",
6
6
  "names": ["CookieUtils", "fileToBase64", "formatModuleData", "loopPageStaticCodeMap", "scriptExecution", "watchMatchMedia"]
7
7
  }
@@ -244,9 +244,27 @@ var formatFormProps = function formatFormProps(_ref) {
244
244
  var optData = Array.isArray(parameters === null || parameters === void 0 ? void 0 : parameters[optValArr === null || optValArr === void 0 ? void 0 : optValArr[0]]) ? parameters === null || parameters === void 0 ? void 0 : parameters[optValArr === null || optValArr === void 0 ? void 0 : optValArr[0]] : [];
245
245
  var labelApiPath = optLabelArr === null || optLabelArr === void 0 ? void 0 : optLabelArr.slice(2);
246
246
  var valApiPath = optValArr === null || optValArr === void 0 ? void 0 : optValArr.slice(2);
247
- formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
248
- options: formatOptionsRecursively(optData, labelApiPath, valApiPath)
249
- });
247
+ var _formatToTreeData = function _formatToTreeData(optionsItems) {
248
+ if (Array.isArray(optionsItems)) {
249
+ return optionsItems.map(function (optItem) {
250
+ return {
251
+ title: get(optItem, labelApiPath),
252
+ value: get(optItem, valApiPath),
253
+ children: _formatToTreeData(optItem === null || optItem === void 0 ? void 0 : optItem.children)
254
+ };
255
+ });
256
+ }
257
+ return [];
258
+ };
259
+ if ((attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType) === 'treeSelect') {
260
+ formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
261
+ treeData: _formatToTreeData(optData)
262
+ });
263
+ } else {
264
+ formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
265
+ options: formatOptionsRecursively(optData, labelApiPath, valApiPath)
266
+ });
267
+ }
250
268
  }
251
269
  }
252
270
  }
@@ -1 +1 @@
1
- {"version":3,"names":["get","stringScriptExecution","getDataArr","getParamsContentByParamKeys","replaceParamsValue","formatTableProps","formatListProps","formRulsRegMap","urlPrefix","patternTransitionRegExp","formatOptionsRecursively","data","labelApiPath","valApiPath","map","item","option","label","value","children","Array","isArray","formatFormProps","_ref","parameters","staticCodeMap","staticOptionsMap","_ref$options","options","column","res","formItems","initValues","length","forEach","attrItem","_extend$controlBtns","_otherAttrFormProps$r","_attrItem$formProps","_ref2","attrCompProps","compProps","attrFormProps","formProps","_ref3","required","extend","attrFormPropsDisplay","display","otherAttrFormProps","_objectWithoutProperties","_excluded","_ref4","dataOptions","otherAttrCompProps","_excluded2","formItem","key","id","name","type","compType","props","originModule","text","_objectSpread","controlBtns","_attrItem$compProps","_attrItem$compProps2","_attrItem$compProps3","_attrItem$compProps4","_attrItem$compProps5","tableProps","rowKeys","rowKey","hasSelectAll","rowSelection","includes","_attrItem$compProps6","resProps","_attrItem$compProps7","_Object$keys","_attrItem$compProps8","_attrItem$compProps13","_attrItem$compProps14","Object","keys","_attrItem$compProps9","uploadDataParams","paramsName","_attrItem$compProps10","test","_attrItem$compProps11","_attrItem$compProps12","action","url","_attrItem$compProps15","otherRules","rules","filter","defaultValue","attrDefVal","_attrItem$formProps2","valuePropName","_attrItem$formProps3","pattern","message","formItemDisplay","codeExtendVal","formItemRequired","concat","_toConsumableArray","attrItemDataOptions","staticCode","_staticCodeMap$attrIt","_staticCodeMap$attrIt2","attrCode","formatToTreeData","optionsItems","optItem","title","treeData","contextOptions","_attrItemDataOptions$","_attrItemDataOptions$2","optLabelStr","optValueStr","splitParamsPath","paramsPathStr","paramsPathArr","replace","split","idx","optValArr","optLabelArr","optData","slice","push","formMode","span","initialValues"],"sources":["../../../../src/formatModule/helpers/formatFormProps.ts"],"sourcesContent":["import { get } from 'lodash';\r\nimport { stringScriptExecution } from './stringScriptExecution';\r\nimport { getDataArr, getParamsContentByParamKeys, replaceParamsValue } from '../../treeUtils';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\n\r\nexport type formatFormPropsType = {\r\n options?: {\r\n column?: number;\r\n children?: {[key:string]: any}[]\r\n }\r\n parameters: {[key:string]: any};\r\n staticCodeMap: {[key:string]: any};\r\n staticOptionsMap: {[key:string]: any};\r\n}\r\n\r\nconst formatOptionsRecursively = (data: any[], labelApiPath: string[], valApiPath: string[]): any[] => {\r\n return data.map((item) => {\r\n const option: any = {\r\n label: get(item, labelApiPath),\r\n value: get(item, valApiPath),\r\n };\r\n \r\n // 如果存在children属性,递归处理\r\n if (item.children && Array.isArray(item.children)) {\r\n option.children = formatOptionsRecursively(item.children, labelApiPath, valApiPath);\r\n }\r\n \r\n return option;\r\n });\r\n};\r\n\r\nconst formatFormProps = ({\r\n parameters,\r\n staticCodeMap,\r\n staticOptionsMap,\r\n options = {},\r\n}: formatFormPropsType):{[key:string]: any} => {\r\n const { children, column } = options;\r\n const res:{[key:string]: any} = {};\r\n const formItems: { [key: string]: any }[] = [];\r\n const initValues: { [key: string]: any } = {};\r\n if (Array.isArray(children) && children.length > 0) {\r\n children.forEach((attrItem) => {\r\n const {\r\n compProps: attrCompProps,\r\n formProps: attrFormProps,\r\n } = attrItem || {};\r\n const {\r\n required,\r\n extend,\r\n display: attrFormPropsDisplay,\r\n ...otherAttrFormProps\r\n } = attrFormProps || {};\r\n const {\r\n dataOptions,\r\n ...otherAttrCompProps\r\n } = attrCompProps || {};\r\n const formItem:{[key:string]: any} = {\r\n key: attrItem?.id,\r\n label: attrFormProps?.label,\r\n name: attrFormProps?.name,\r\n type: attrItem?.compType,\r\n props: otherAttrCompProps || {},\r\n formProps: otherAttrFormProps || {},\r\n originModule: attrItem, // 以下是组件配置属性,用于属性编辑\r\n };\r\n if (extend?.type === 'text' && extend?.text && typeof extend?.text === 'string') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n text: replaceParamsValue(extend?.text, parameters),\r\n },\r\n };\r\n } else if (extend?.type === 'controlBtns' && Array.isArray(extend?.controlBtns) && extend?.controlBtns?.length > 0) {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n controlBtns: extend?.controlBtns,\r\n },\r\n };\r\n } else {\r\n delete formItem.formProps.extend;\r\n }\r\n if (attrItem?.compType === 'table') {\r\n const tableProps = formatTableProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n });\r\n const rowKeys = getDataArr(attrItem?.compProps?.rowKey);\r\n formItem.props = {\r\n ...formItem.props,\r\n ...tableProps,\r\n rowKey: rowKeys?.length > 0 ? rowKeys?.[rowKeys?.length - 1] : 'key',\r\n hasSelectAll: (attrItem?.compProps?.rowSelection && attrItem?.compProps?.hasSelectAll) ? attrItem?.compProps?.hasSelectAll : null,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (['list', 'card'].includes(attrItem?.compType)) {\r\n const resProps = formatListProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n urlPrefix,\r\n });\r\n formItem.props = {\r\n ...resProps,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (attrItem?.compType === 'upload') {\r\n if (\r\n attrItem?.compProps?.data &&\r\n Object.keys(attrItem?.compProps?.data)?.length > 0\r\n ) {\r\n const uploadDataParams:{[key:string]: any} = {};\r\n Object.keys(attrItem?.compProps?.data).forEach(paramsName => {\r\n if (/\\$\\{(.+?)\\}/g.test(attrItem?.compProps?.data?.[paramsName])) {\r\n // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);\r\n uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem?.compProps?.data?.[paramsName], parameters);\r\n } else {\r\n uploadDataParams[paramsName] = attrItem?.compProps?.data?.[paramsName];\r\n }\r\n });\r\n formItem.props = {\r\n ...formItem.props,\r\n data: uploadDataParams,\r\n };\r\n }\r\n if (\r\n attrItem?.compProps?.action?.url &&\r\n typeof attrItem?.compProps?.action?.url === 'string'\r\n ) {\r\n formItem.props = {\r\n ...formItem.props,\r\n action: attrItem?.compProps?.action?.url,\r\n };\r\n }\r\n }\r\n let otherRules = Array.isArray(otherAttrFormProps?.rules) ? otherAttrFormProps?.rules?.filter((item: any) => !item?.required) : [];\r\n if (attrItem?.formProps?.defaultValue) {\r\n let attrDefVal:any = '';\r\n if (attrItem?.compType === 'upload') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n valuePropName: 'fileList',\r\n };\r\n attrDefVal = getParamsContentByParamKeys(attrItem?.formProps?.defaultValue, parameters) || [];\r\n } else {\r\n delete formItem.formProps.valuePropName;\r\n attrDefVal = replaceParamsValue(attrItem?.formProps?.defaultValue, parameters) || '';\r\n }\r\n initValues[otherAttrFormProps?.name] = attrDefVal;\r\n }\r\n otherRules = otherRules.map((item: {[key:string]: any}) => ({\r\n pattern: item?.type === 'custom' ? patternTransitionRegExp(item?.pattern) : (\r\n formRulsRegMap?.[item?.type] || ''\r\n ),\r\n message: item?.message,\r\n }));\r\n if (typeof attrFormPropsDisplay === 'boolean' || typeof attrFormPropsDisplay === 'string') {\r\n let formItemDisplay:boolean = true;\r\n if (typeof attrFormPropsDisplay === 'boolean') {\r\n formItemDisplay = attrFormPropsDisplay;\r\n } else if (typeof attrFormPropsDisplay === 'string' && attrFormPropsDisplay) {\r\n // const scriptCodeStr = stringPramarsValTransition(attrFormPropsDisplay, parameters);\r\n const codeExtendVal = stringScriptExecution(\r\n attrFormPropsDisplay,\r\n parameters,\r\n );\r\n formItemDisplay = codeExtendVal;\r\n }\r\n formItem.display = formItemDisplay;\r\n }\r\n if (typeof required === 'boolean' || typeof required === 'string') {\r\n let formItemRequired:boolean = false;\r\n if (typeof required === 'boolean') {\r\n formItemRequired = required;\r\n } else if (typeof required === 'string' && required) {\r\n // const scriptCodeStr = stringPramarsValTransition(required, parameters);\r\n const codeExtendVal = stringScriptExecution(required, parameters);\r\n formItemRequired = typeof codeExtendVal === 'boolean' ? codeExtendVal : false;\r\n }\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: formItemRequired ? [{ required: formItemRequired }, ...otherRules] : otherRules,\r\n };\r\n } else {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: otherRules,\r\n };\r\n }\r\n if (dataOptions) {\r\n const attrItemDataOptions = dataOptions || {};\r\n if (attrItemDataOptions?.staticCode) {\r\n if (\r\n attrItem?.defaultValue &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode] &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue]\r\n ) {\r\n initValues[attrItem?.attrCode] = staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue];\r\n }\r\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\r\n if (Array.isArray(optionsItems)) {\r\n return optionsItems.map(optItem => ({\r\n title: optItem?.label,\r\n value: optItem?.value,\r\n children: formatToTreeData(optItem?.children),\r\n }));\r\n }\r\n return [];\r\n };\r\n if (attrItem?.compType === 'treeSelect') {\r\n formItem.props = {\r\n ...formItem.props,\r\n treeData: formatToTreeData(staticOptionsMap?.[attrItemDataOptions?.staticCode]),\r\n };\r\n } else {\r\n formItem.props = {\r\n ...formItem.props,\r\n options: Array.isArray(staticOptionsMap?.[attrItemDataOptions?.staticCode]) ?\r\n staticOptionsMap?.[attrItemDataOptions?.staticCode] : [],\r\n };\r\n }\r\n } else if (attrItemDataOptions?.contextOptions && parameters) {\r\n const optLabelStr = attrItemDataOptions?.contextOptions?.label;\r\n const optValueStr = attrItemDataOptions?.contextOptions?.value;\r\n const splitParamsPath = (paramsPathStr: string) => {\r\n if (typeof paramsPathStr === 'string') {\r\n const paramsPathArr = paramsPathStr.replace(/\\$\\{|\\}/g, '').split('.');\r\n return paramsPathArr?.filter((item:string, idx:number) => !(idx === 0 && item === 'root'));\r\n }\r\n return [];\r\n };\r\n if (optValueStr) {\r\n const optValArr = splitParamsPath(optValueStr);\r\n const optLabelArr = splitParamsPath(optLabelStr);\r\n const optData: any[] = Array.isArray(parameters?.[optValArr?.[0]]) ? parameters?.[optValArr?.[0]] : [];\r\n const labelApiPath: string[] = optLabelArr?.slice(2);\r\n const valApiPath: string[] = optValArr?.slice(2);\r\n \r\n formItem.props = {\r\n ...formItem.props,\r\n options: formatOptionsRecursively(optData, labelApiPath, valApiPath),\r\n };\r\n }\r\n }\r\n }\r\n formItems.push(formItem);\r\n });\r\n }\r\n if (typeof column === 'number' && column > 1) {\r\n res.formMode = 'grid';\r\n res.span = 24 / column;\r\n } else {\r\n res.formMode = 'default';\r\n delete res.span;\r\n }\r\n res.formItems = formItems;\r\n res.initialValues = initValues;\r\n return res;\r\n};\r\n\r\nexport default formatFormProps;\r\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,UAAU,EAAEC,2BAA2B,EAAEC,kBAAkB;AACpE,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,OAAOC,uBAAuB;AAY9B,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,IAAW,EAAEC,YAAsB,EAAEC,UAAoB,EAAY;EACrG,OAAOF,IAAI,CAACG,GAAG,CAAC,UAACC,IAAI,EAAK;IACxB,IAAMC,MAAW,GAAG;MAClBC,KAAK,EAAEjB,G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,CAAC;YAChD,IAAMU,OAAc,GAAGnH,KAAK,CAACC,OAAO,CAACG,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAG6G,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAG,CAAC,CAAC,CAAC,CAAC,GAAG7G,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAG6G,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAG,CAAC,CAAC,CAAC,GAAG,EAAE;YACtG,IAAMzH,YAAsB,GAAG0H,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEE,KAAK,CAAC,CAAC,CAAC;YACpD,IAAM3H,UAAoB,GAAGwH,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEG,KAAK,CAAC,CAAC,CAAC;YAEhDhF,QAAQ,CAACM,KAAK,GAAAG,aAAA,CAAAA,aAAA,KACTT,QAAQ,CAACM,KAAK;cACjBlC,OAAO,EAAElB,wBAAwB,CAAC6H,OAAO,EAAE3H,YAAY,EAAEC,UAAU;YAAC,EACrE;UACH;QACF;MACF;MACAkB,SAAS,CAAC0G,IAAI,CAACjF,QAAQ,CAAC;IAC1B,CAAC,CAAC;EACJ;EACA,IAAI,OAAO3B,MAAM,KAAK,QAAQ,IAAIA,MAAM,GAAG,CAAC,EAAE;IAC5CC,GAAG,CAAC4G,QAAQ,GAAG,MAAM;IACrB5G,GAAG,CAAC6G,IAAI,GAAG,EAAE,GAAG9G,MAAM;EACxB,CAAC,MAAM;IACLC,GAAG,CAAC4G,QAAQ,GAAG,SAAS;IACxB,OAAO5G,GAAG,CAAC6G,IAAI;EACjB;EACA7G,GAAG,CAACC,SAAS,GAAGA,SAAS;EACzBD,GAAG,CAAC8G,aAAa,GAAG5G,UAAU;EAC9B,OAAOF,GAAG;AACZ,CAAC;AAED,eAAeR,eAAe"}
1
+ {"version":3,"names":["get","stringScriptExecution","getDataArr","getParamsContentByParamKeys","replaceParamsValue","formatTableProps","formatListProps","formRulsRegMap","urlPrefix","patternTransitionRegExp","formatOptionsRecursively","data","labelApiPath","valApiPath","map","item","option","label","value","children","Array","isArray","formatFormProps","_ref","parameters","staticCodeMap","staticOptionsMap","_ref$options","options","column","res","formItems","initValues","length","forEach","attrItem","_extend$controlBtns","_otherAttrFormProps$r","_attrItem$formProps","_ref2","attrCompProps","compProps","attrFormProps","formProps","_ref3","required","extend","attrFormPropsDisplay","display","otherAttrFormProps","_objectWithoutProperties","_excluded","_ref4","dataOptions","otherAttrCompProps","_excluded2","formItem","key","id","name","type","compType","props","originModule","text","_objectSpread","controlBtns","_attrItem$compProps","_attrItem$compProps2","_attrItem$compProps3","_attrItem$compProps4","_attrItem$compProps5","tableProps","rowKeys","rowKey","hasSelectAll","rowSelection","includes","_attrItem$compProps6","resProps","_attrItem$compProps7","_Object$keys","_attrItem$compProps8","_attrItem$compProps13","_attrItem$compProps14","Object","keys","_attrItem$compProps9","uploadDataParams","paramsName","_attrItem$compProps10","test","_attrItem$compProps11","_attrItem$compProps12","action","url","_attrItem$compProps15","otherRules","rules","filter","defaultValue","attrDefVal","_attrItem$formProps2","valuePropName","_attrItem$formProps3","pattern","message","formItemDisplay","codeExtendVal","formItemRequired","concat","_toConsumableArray","attrItemDataOptions","staticCode","_staticCodeMap$attrIt","_staticCodeMap$attrIt2","attrCode","formatToTreeData","optionsItems","optItem","title","treeData","contextOptions","_attrItemDataOptions$","_attrItemDataOptions$2","optLabelStr","optValueStr","splitParamsPath","paramsPathStr","paramsPathArr","replace","split","idx","optValArr","optLabelArr","optData","slice","push","formMode","span","initialValues"],"sources":["../../../../src/formatModule/helpers/formatFormProps.ts"],"sourcesContent":["import { get } from 'lodash';\r\nimport { stringScriptExecution } from './stringScriptExecution';\r\nimport { getDataArr, getParamsContentByParamKeys, replaceParamsValue } from '../../treeUtils';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\n\r\nexport type formatFormPropsType = {\r\n options?: {\r\n column?: number;\r\n children?: {[key:string]: any}[]\r\n }\r\n parameters: {[key:string]: any};\r\n staticCodeMap: {[key:string]: any};\r\n staticOptionsMap: {[key:string]: any};\r\n}\r\n\r\nconst formatOptionsRecursively = (data: any[], labelApiPath: string[], valApiPath: string[]): any[] => {\r\n return data.map((item) => {\r\n const option: any = {\r\n label: get(item, labelApiPath),\r\n value: get(item, valApiPath),\r\n };\r\n \r\n // 如果存在children属性,递归处理\r\n if (item.children && Array.isArray(item.children)) {\r\n option.children = formatOptionsRecursively(item.children, labelApiPath, valApiPath);\r\n }\r\n \r\n return option;\r\n });\r\n};\r\n\r\nconst formatFormProps = ({\r\n parameters,\r\n staticCodeMap,\r\n staticOptionsMap,\r\n options = {},\r\n}: formatFormPropsType):{[key:string]: any} => {\r\n const { children, column } = options;\r\n const res:{[key:string]: any} = {};\r\n const formItems: { [key: string]: any }[] = [];\r\n const initValues: { [key: string]: any } = {};\r\n if (Array.isArray(children) && children.length > 0) {\r\n children.forEach((attrItem) => {\r\n const {\r\n compProps: attrCompProps,\r\n formProps: attrFormProps,\r\n } = attrItem || {};\r\n const {\r\n required,\r\n extend,\r\n display: attrFormPropsDisplay,\r\n ...otherAttrFormProps\r\n } = attrFormProps || {};\r\n const {\r\n dataOptions,\r\n ...otherAttrCompProps\r\n } = attrCompProps || {};\r\n const formItem:{[key:string]: any} = {\r\n key: attrItem?.id,\r\n label: attrFormProps?.label,\r\n name: attrFormProps?.name,\r\n type: attrItem?.compType,\r\n props: otherAttrCompProps || {},\r\n formProps: otherAttrFormProps || {},\r\n originModule: attrItem, // 以下是组件配置属性,用于属性编辑\r\n };\r\n if (extend?.type === 'text' && extend?.text && typeof extend?.text === 'string') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n text: replaceParamsValue(extend?.text, parameters),\r\n },\r\n };\r\n } else if (extend?.type === 'controlBtns' && Array.isArray(extend?.controlBtns) && extend?.controlBtns?.length > 0) {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n extend: {\r\n ...extend,\r\n controlBtns: extend?.controlBtns,\r\n },\r\n };\r\n } else {\r\n delete formItem.formProps.extend;\r\n }\r\n if (attrItem?.compType === 'table') {\r\n const tableProps = formatTableProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n });\r\n const rowKeys = getDataArr(attrItem?.compProps?.rowKey);\r\n formItem.props = {\r\n ...formItem.props,\r\n ...tableProps,\r\n rowKey: rowKeys?.length > 0 ? rowKeys?.[rowKeys?.length - 1] : 'key',\r\n hasSelectAll: (attrItem?.compProps?.rowSelection && attrItem?.compProps?.hasSelectAll) ? attrItem?.compProps?.hasSelectAll : null,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (['list', 'card'].includes(attrItem?.compType)) {\r\n const resProps = formatListProps({\r\n options: attrItem?.compProps,\r\n staticCodeMap,\r\n parameters,\r\n urlPrefix,\r\n });\r\n formItem.props = {\r\n ...resProps,\r\n rowSelection: attrItem?.compProps?.rowSelection || { type: 'radio' },\r\n };\r\n }\r\n if (attrItem?.compType === 'upload') {\r\n if (\r\n attrItem?.compProps?.data &&\r\n Object.keys(attrItem?.compProps?.data)?.length > 0\r\n ) {\r\n const uploadDataParams:{[key:string]: any} = {};\r\n Object.keys(attrItem?.compProps?.data).forEach(paramsName => {\r\n if (/\\$\\{(.+?)\\}/g.test(attrItem?.compProps?.data?.[paramsName])) {\r\n // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);\r\n uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem?.compProps?.data?.[paramsName], parameters);\r\n } else {\r\n uploadDataParams[paramsName] = attrItem?.compProps?.data?.[paramsName];\r\n }\r\n });\r\n formItem.props = {\r\n ...formItem.props,\r\n data: uploadDataParams,\r\n };\r\n }\r\n if (\r\n attrItem?.compProps?.action?.url &&\r\n typeof attrItem?.compProps?.action?.url === 'string'\r\n ) {\r\n formItem.props = {\r\n ...formItem.props,\r\n action: attrItem?.compProps?.action?.url,\r\n };\r\n }\r\n }\r\n let otherRules = Array.isArray(otherAttrFormProps?.rules) ? otherAttrFormProps?.rules?.filter((item: any) => !item?.required) : [];\r\n if (attrItem?.formProps?.defaultValue) {\r\n let attrDefVal:any = '';\r\n if (attrItem?.compType === 'upload') {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n valuePropName: 'fileList',\r\n };\r\n attrDefVal = getParamsContentByParamKeys(attrItem?.formProps?.defaultValue, parameters) || [];\r\n } else {\r\n delete formItem.formProps.valuePropName;\r\n attrDefVal = replaceParamsValue(attrItem?.formProps?.defaultValue, parameters) || '';\r\n }\r\n initValues[otherAttrFormProps?.name] = attrDefVal;\r\n }\r\n otherRules = otherRules.map((item: {[key:string]: any}) => ({\r\n pattern: item?.type === 'custom' ? patternTransitionRegExp(item?.pattern) : (\r\n formRulsRegMap?.[item?.type] || ''\r\n ),\r\n message: item?.message,\r\n }));\r\n if (typeof attrFormPropsDisplay === 'boolean' || typeof attrFormPropsDisplay === 'string') {\r\n let formItemDisplay:boolean = true;\r\n if (typeof attrFormPropsDisplay === 'boolean') {\r\n formItemDisplay = attrFormPropsDisplay;\r\n } else if (typeof attrFormPropsDisplay === 'string' && attrFormPropsDisplay) {\r\n // const scriptCodeStr = stringPramarsValTransition(attrFormPropsDisplay, parameters);\r\n const codeExtendVal = stringScriptExecution(\r\n attrFormPropsDisplay,\r\n parameters,\r\n );\r\n formItemDisplay = codeExtendVal;\r\n }\r\n formItem.display = formItemDisplay;\r\n }\r\n if (typeof required === 'boolean' || typeof required === 'string') {\r\n let formItemRequired:boolean = false;\r\n if (typeof required === 'boolean') {\r\n formItemRequired = required;\r\n } else if (typeof required === 'string' && required) {\r\n // const scriptCodeStr = stringPramarsValTransition(required, parameters);\r\n const codeExtendVal = stringScriptExecution(required, parameters);\r\n formItemRequired = typeof codeExtendVal === 'boolean' ? codeExtendVal : false;\r\n }\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: formItemRequired ? [{ required: formItemRequired }, ...otherRules] : otherRules,\r\n };\r\n } else {\r\n formItem.formProps = {\r\n ...formItem.formProps,\r\n rules: otherRules,\r\n };\r\n }\r\n if (dataOptions) {\r\n const attrItemDataOptions = dataOptions || {};\r\n if (attrItemDataOptions?.staticCode) {\r\n if (\r\n attrItem?.defaultValue &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode] &&\r\n staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue]\r\n ) {\r\n initValues[attrItem?.attrCode] = staticCodeMap?.[attrItemDataOptions?.staticCode]?.[attrItem?.defaultValue];\r\n }\r\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\r\n if (Array.isArray(optionsItems)) {\r\n return optionsItems.map(optItem => ({\r\n title: optItem?.label,\r\n value: optItem?.value,\r\n children: formatToTreeData(optItem?.children),\r\n }));\r\n }\r\n return [];\r\n };\r\n if (attrItem?.compType === 'treeSelect') {\r\n formItem.props = {\r\n ...formItem.props,\r\n treeData: formatToTreeData(staticOptionsMap?.[attrItemDataOptions?.staticCode]),\r\n };\r\n } else {\r\n formItem.props = {\r\n ...formItem.props,\r\n options: Array.isArray(staticOptionsMap?.[attrItemDataOptions?.staticCode]) ?\r\n staticOptionsMap?.[attrItemDataOptions?.staticCode] : [],\r\n };\r\n }\r\n } else if (attrItemDataOptions?.contextOptions && parameters) {\r\n const optLabelStr = attrItemDataOptions?.contextOptions?.label;\r\n const optValueStr = attrItemDataOptions?.contextOptions?.value;\r\n const splitParamsPath = (paramsPathStr: string) => {\r\n if (typeof paramsPathStr === 'string') {\r\n const paramsPathArr = paramsPathStr.replace(/\\$\\{|\\}/g, '').split('.');\r\n return paramsPathArr?.filter((item:string, idx:number) => !(idx === 0 && item === 'root'));\r\n }\r\n return [];\r\n };\r\n if (optValueStr) {\r\n const optValArr = splitParamsPath(optValueStr);\r\n const optLabelArr = splitParamsPath(optLabelStr);\r\n const optData: any[] = Array.isArray(parameters?.[optValArr?.[0]]) ? parameters?.[optValArr?.[0]] : [];\r\n const labelApiPath: string[] = optLabelArr?.slice(2);\r\n const valApiPath: string[] = optValArr?.slice(2);\r\n\r\n \r\n const formatToTreeData = (optionsItems: {[key:string]: any}[]):{[key:string]: any}[] => {\r\n if (Array.isArray(optionsItems)) {\r\n return optionsItems.map(optItem => ({\r\n title: get(optItem, labelApiPath),\r\n value: get(optItem, valApiPath),\r\n children: formatToTreeData(optItem?.children),\r\n }));\r\n }\r\n return [];\r\n };\r\n \r\n if (attrItem?.compType === 'treeSelect') {\r\n formItem.props = {\r\n ...formItem.props,\r\n treeData: formatToTreeData(optData),\r\n };\r\n } else {\r\n formItem.props = {\r\n ...formItem.props,\r\n options: formatOptionsRecursively(optData, labelApiPath, valApiPath),\r\n };\r\n }\r\n }\r\n }\r\n }\r\n formItems.push(formItem);\r\n });\r\n }\r\n if (typeof column === 'number' && column > 1) {\r\n res.formMode = 'grid';\r\n res.span = 24 / column;\r\n } else {\r\n res.formMode = 'default';\r\n delete res.span;\r\n }\r\n res.formItems = formItems;\r\n res.initialValues = initValues;\r\n return res;\r\n};\r\n\r\nexport default formatFormProps;\r\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,UAAU,EAAEC,2BAA2B,EAAEC,kBAAkB;AACpE,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,OAAOC,uBAAuB;AAY9B,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,IAAW,EAAEC,YAAsB,EAAEC,UAAoB,EAAY;EACrG,OAAOF,IAAI,CAACG,GAAG,CAAC,UAACC,IAAI,EAAK;IACxB,IAAMC,MAAW,GAAG;MAClBC,KAAK,EAAEjB,GAAG,CAACe,IAAI,EAAEH,YAAY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;gBACjBlC,OAAO,EAAElB,wBAAwB,CAAC6H,OAAO,EAAE3H,YAAY,EAAEC,UAAU;cAAC,EACrE;YACH;UACF;QACF;MACF;MACAkB,SAAS,CAAC0G,IAAI,CAACjF,QAAQ,CAAC;IAC1B,CAAC,CAAC;EACJ;EACA,IAAI,OAAO3B,MAAM,KAAK,QAAQ,IAAIA,MAAM,GAAG,CAAC,EAAE;IAC5CC,GAAG,CAAC4G,QAAQ,GAAG,MAAM;IACrB5G,GAAG,CAAC6G,IAAI,GAAG,EAAE,GAAG9G,MAAM;EACxB,CAAC,MAAM;IACLC,GAAG,CAAC4G,QAAQ,GAAG,SAAS;IACxB,OAAO5G,GAAG,CAAC6G,IAAI;EACjB;EACA7G,GAAG,CAACC,SAAS,GAAGA,SAAS;EACzBD,GAAG,CAAC8G,aAAa,GAAG5G,UAAU;EAC9B,OAAOF,GAAG;AACZ,CAAC;AAED,eAAeR,eAAe"}
@@ -16,5 +16,5 @@ import formatStyleProps from './formatStyleProps';
16
16
  import formatStepsProps from './formatStepsProps';
17
17
  import formRulsRegMap from './formRulsRegMap';
18
18
  import urlPrefix from './urlPrefix';
19
- import { stringScriptExecution } from './stringScriptExecution';
20
- export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, };
19
+ import { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';
20
+ export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution, };
@@ -16,6 +16,6 @@ import formatStyleProps from "./formatStyleProps";
16
16
  import formatStepsProps from "./formatStepsProps";
17
17
  import formRulsRegMap from "./formRulsRegMap";
18
18
  import urlPrefix from "./urlPrefix";
19
- import { stringScriptExecution } from "./stringScriptExecution";
20
- export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution };
19
+ import { stringScriptExecution, createCompartmentExecution } from "./stringScriptExecution";
20
+ export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatChartsProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution };
21
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stringPramarsValTransition","patternTransitionRegExp","staticCodeAssemble","formatTableProps","formatListProps","formatImageProps","formatCarouselProps","formatDescriptionsProps","formatHighCodeProps","formatFormProps","formatEchartLineProps","formatEchartPieProps","formatChartsProps","formatLoopProps","formatStyleProps","formatStepsProps","formRulsRegMap","urlPrefix","stringScriptExecution"],"sources":["../../../../src/formatModule/helpers/index.ts"],"sourcesContent":["import stringPramarsValTransition from './stringPramarsValTransition';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\nimport staticCodeAssemble from './staticCodeAssemble';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formatImageProps from './formatImageProps';\r\nimport formatCarouselProps from './formatCarouselProps';\r\nimport formatDescriptionsProps from './formatDescriptionsProps';\r\nimport formatHighCodeProps from './formatHighCodeProps';\r\nimport formatFormProps from './formatFormProps';\r\nimport formatEchartLineProps from './formatEchartLineProps';\r\nimport formatEchartPieProps from './formatEchartPieProps';\r\nimport formatChartsProps from './formatChartsProps';\r\nimport formatLoopProps from './formatLoopProps';\r\nimport formatStyleProps from './formatStyleProps';\r\nimport formatStepsProps from './formatStepsProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport { stringScriptExecution } from './stringScriptExecution';\r\n\r\nexport {\r\n urlPrefix,\r\n formRulsRegMap,\r\n formatListProps,\r\n formatTableProps,\r\n formatCarouselProps,\r\n formatImageProps,\r\n formatDescriptionsProps,\r\n formatFormProps,\r\n formatHighCodeProps,\r\n formatEchartLineProps,\r\n formatEchartPieProps,\r\n formatChartsProps,\r\n formatLoopProps,\r\n formatStyleProps,\r\n formatStepsProps,\r\n staticCodeAssemble,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n};\r\n"],"mappings":"AAAA,OAAOA,0BAA0B;AACjC,OAAOC,uBAAuB;AAC9B,OAAOC,kBAAkB;AACzB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,mBAAmB;AAC1B,OAAOC,uBAAuB;AAC9B,OAAOC,mBAAmB;AAC1B,OAAOC,eAAe;AACtB,OAAOC,qBAAqB;AAC5B,OAAOC,oBAAoB;AAC3B,OAAOC,iBAAiB;AACxB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,SAASC,qBAAqB;AAE9B,SACED,SAAS,EACTD,cAAc,EACdZ,eAAe,EACfD,gBAAgB,EAChBG,mBAAmB,EACnBD,gBAAgB,EAChBE,uBAAuB,EACvBE,eAAe,EACfD,mBAAmB,EACnBE,qBAAqB,EACrBC,oBAAoB,EACpBC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBb,kBAAkB,EAClBD,uBAAuB,EACvBD,0BAA0B,EAC1BkB,qBAAqB"}
1
+ {"version":3,"names":["stringPramarsValTransition","patternTransitionRegExp","staticCodeAssemble","formatTableProps","formatListProps","formatImageProps","formatCarouselProps","formatDescriptionsProps","formatHighCodeProps","formatFormProps","formatEchartLineProps","formatEchartPieProps","formatChartsProps","formatLoopProps","formatStyleProps","formatStepsProps","formRulsRegMap","urlPrefix","stringScriptExecution","createCompartmentExecution"],"sources":["../../../../src/formatModule/helpers/index.ts"],"sourcesContent":["import stringPramarsValTransition from './stringPramarsValTransition';\r\nimport patternTransitionRegExp from './patternTransitionRegExp';\r\nimport staticCodeAssemble from './staticCodeAssemble';\r\nimport formatTableProps from './formatTableProps';\r\nimport formatListProps from './formatListProps';\r\nimport formatImageProps from './formatImageProps';\r\nimport formatCarouselProps from './formatCarouselProps';\r\nimport formatDescriptionsProps from './formatDescriptionsProps';\r\nimport formatHighCodeProps from './formatHighCodeProps';\r\nimport formatFormProps from './formatFormProps';\r\nimport formatEchartLineProps from './formatEchartLineProps';\r\nimport formatEchartPieProps from './formatEchartPieProps';\r\nimport formatChartsProps from './formatChartsProps';\r\nimport formatLoopProps from './formatLoopProps';\r\nimport formatStyleProps from './formatStyleProps';\r\nimport formatStepsProps from './formatStepsProps';\r\nimport formRulsRegMap from './formRulsRegMap';\r\nimport urlPrefix from './urlPrefix';\r\nimport { stringScriptExecution, createCompartmentExecution } from './stringScriptExecution';\r\n\r\nexport {\r\n urlPrefix,\r\n formRulsRegMap,\r\n formatListProps,\r\n formatTableProps,\r\n formatCarouselProps,\r\n formatImageProps,\r\n formatDescriptionsProps,\r\n formatFormProps,\r\n formatHighCodeProps,\r\n formatEchartLineProps,\r\n formatEchartPieProps,\r\n formatChartsProps,\r\n formatLoopProps,\r\n formatStyleProps,\r\n formatStepsProps,\r\n staticCodeAssemble,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n createCompartmentExecution,\r\n};\r\n"],"mappings":"AAAA,OAAOA,0BAA0B;AACjC,OAAOC,uBAAuB;AAC9B,OAAOC,kBAAkB;AACzB,OAAOC,gBAAgB;AACvB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,mBAAmB;AAC1B,OAAOC,uBAAuB;AAC9B,OAAOC,mBAAmB;AAC1B,OAAOC,eAAe;AACtB,OAAOC,qBAAqB;AAC5B,OAAOC,oBAAoB;AAC3B,OAAOC,iBAAiB;AACxB,OAAOC,eAAe;AACtB,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,SAASC,qBAAqB,EAAEC,0BAA0B;AAE1D,SACEF,SAAS,EACTD,cAAc,EACdZ,eAAe,EACfD,gBAAgB,EAChBG,mBAAmB,EACnBD,gBAAgB,EAChBE,uBAAuB,EACvBE,eAAe,EACfD,mBAAmB,EACnBE,qBAAqB,EACrBC,oBAAoB,EACpBC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBb,kBAAkB,EAClBD,uBAAuB,EACvBD,0BAA0B,EAC1BkB,qBAAqB,EACrBC,0BAA0B"}
@@ -1,2 +1,4 @@
1
1
  import 'ses';
2
+ import type { CompartmentOptions } from 'ses';
2
3
  export declare const stringScriptExecution: (scriptCode: string, root?: any) => any;
4
+ export declare const createCompartmentExecution: (globals?: CompartmentOptions) => Compartment;
@@ -29,4 +29,7 @@ export var stringScriptExecution = function stringScriptExecution(scriptCode) {
29
29
  return err;
30
30
  }
31
31
  };
32
+ export var createCompartmentExecution = function createCompartmentExecution(globals) {
33
+ return new Compartment(globals);
34
+ };
32
35
  //# sourceMappingURL=stringScriptExecution.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stringScriptExecution","scriptCode","root","arguments","length","undefined","compartment","Compartment","window","evaluate","err","console","error"],"sources":["../../../../src/formatModule/helpers/stringScriptExecution.ts"],"sourcesContent":["import 'ses';\r\n/* eslint-disable no-new-func */\r\n// export const stringScriptExecution = (scriptCode: string, root: any) => {\r\n// try {\r\n// if (scriptCode) {\r\n// // 将参数作为全局变量传递\r\n// const func = new Function('root', `return ${scriptCode}`);\r\n// const result = func(root);\r\n// console.log(result, root, scriptCode);\r\n// return result;\r\n// }\r\n// throw new Error('No script code provided');\r\n// } catch (err) {\r\n// console.error(err);\r\n// return null;\r\n// }\r\n// };\r\n\r\nexport const stringScriptExecution = (scriptCode: string, root: any = {}) => {\r\n const compartment = new Compartment({ root, window });\r\n try {\r\n return scriptCode ? compartment.evaluate(scriptCode) : null;\r\n } catch (err) {\r\n console.error(err);\r\n return err;\r\n }\r\n};\r\n"],"mappings":"AAAA,OAAO,KAAK;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,UAAkB,EAAqB;EAAA,IAAnBC,IAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACtE,IAAMG,WAAW,GAAG,IAAIC,WAAW,CAAC;IAAEL,IAAI,EAAJA,IAAI;IAAEM,MAAM,EAANA;EAAO,CAAC,CAAC;EACrD,IAAI;IACF,OAAOP,UAAU,GAAGK,WAAW,CAACG,QAAQ,CAACR,UAAU,CAAC,GAAG,IAAI;EAC7D,CAAC,CAAC,OAAOS,GAAG,EAAE;IACZC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;IAClB,OAAOA,GAAG;EACZ;AACF,CAAC"}
1
+ {"version":3,"names":["stringScriptExecution","scriptCode","root","arguments","length","undefined","compartment","Compartment","window","evaluate","err","console","error","createCompartmentExecution","globals"],"sources":["../../../../src/formatModule/helpers/stringScriptExecution.ts"],"sourcesContent":["import 'ses';\r\nimport type { CompartmentOptions } from 'ses';\r\n/* eslint-disable no-new-func */\r\n// export const stringScriptExecution = (scriptCode: string, root: any) => {\r\n// try {\r\n// if (scriptCode) {\r\n// // 将参数作为全局变量传递\r\n// const func = new Function('root', `return ${scriptCode}`);\r\n// const result = func(root);\r\n// console.log(result, root, scriptCode);\r\n// return result;\r\n// }\r\n// throw new Error('No script code provided');\r\n// } catch (err) {\r\n// console.error(err);\r\n// return null;\r\n// }\r\n// };\r\n\r\nexport const stringScriptExecution = (scriptCode: string, root: any = {}) => {\r\n const compartment = new Compartment({ root, window });\r\n try {\r\n return scriptCode ? compartment.evaluate(scriptCode) : null;\r\n } catch (err) {\r\n console.error(err);\r\n return err;\r\n }\r\n};\r\n\r\nexport const createCompartmentExecution = (globals?: CompartmentOptions) => {\r\n return new Compartment(globals);\r\n};\r\n"],"mappings":"AAAA,OAAO,KAAK;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,UAAkB,EAAqB;EAAA,IAAnBC,IAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACtE,IAAMG,WAAW,GAAG,IAAIC,WAAW,CAAC;IAAEL,IAAI,EAAJA,IAAI;IAAEM,MAAM,EAANA;EAAO,CAAC,CAAC;EACrD,IAAI;IACF,OAAOP,UAAU,GAAGK,WAAW,CAACG,QAAQ,CAACR,UAAU,CAAC,GAAG,IAAI;EAC7D,CAAC,CAAC,OAAOS,GAAG,EAAE;IACZC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;IAClB,OAAOA,GAAG;EACZ;AACF,CAAC;AAED,OAAO,IAAMG,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAIC,OAA4B,EAAK;EAC1E,OAAO,IAAIP,WAAW,CAACO,OAAO,CAAC;AACjC,CAAC"}
@@ -5,7 +5,7 @@ import { asyncLocalStorage, asyncSessionStorage, type asyncLocalStorageType, typ
5
5
  import { camelToSnake, underscoreToCamelCase, generateRandom18Int } from './stringUtils';
6
6
  import { getDataArr, replaceParamsValue, getParamsContentByParamKeys, replaceParamsValueForEvent } from './treeUtils';
7
7
  import formatModuleData from './formatModule/formatModuleData';
8
- import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution } from './formatModule/helpers';
8
+ import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution } from './formatModule/helpers';
9
9
  import loopPageStaticCodeMap from './loopPageStaticCodeMap';
10
10
  import scriptExecution, { type scriptExecutionType } from './scriptExecution';
11
11
  import { getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById } from './file';
@@ -14,4 +14,4 @@ import { isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, g
14
14
  import watchMatchMedia, { type pageSizeType } from './watchMatchMedia';
15
15
  import { request, tenantIdSessionKey } from './http';
16
16
  export type { fileToBase64Type, asyncLocalStorageType, asyncSessionStorageType, scriptExecutionType, pageSizeType, };
17
- export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, getLocation, isMobile, watchMatchMedia, request, tenantIdSessionKey, };
17
+ export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, createCompartmentExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, getLocation, isMobile, watchMatchMedia, request, tenantIdSessionKey, };
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ import { asyncLocalStorage, asyncSessionStorage } from "./asyncStorage";
5
5
  import { camelToSnake, underscoreToCamelCase, generateRandom18Int } from "./stringUtils";
6
6
  import { getDataArr, replaceParamsValue, getParamsContentByParamKeys, replaceParamsValueForEvent } from "./treeUtils";
7
7
  import formatModuleData from "./formatModule/formatModuleData";
8
- import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution } from "./formatModule/helpers";
8
+ import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, createCompartmentExecution } from "./formatModule/helpers";
9
9
  import loopPageStaticCodeMap from "./loopPageStaticCodeMap";
10
10
  import scriptExecution from "./scriptExecution";
11
11
  import { getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById } from "./file";
@@ -17,5 +17,5 @@ import { request, tenantIdSessionKey } from "./http";
17
17
  // 避免 _对象 和其他库冲突
18
18
  var _ = require('lodash');
19
19
  _.noConflict();
20
- export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, getLocation, isMobile, watchMatchMedia, request, tenantIdSessionKey };
20
+ export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getFileUrlByFileInfoId, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, createCompartmentExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, isReactNative, isWeb, isNode, getEnvironment, getWindow, getDocument, getLocation, isMobile, watchMatchMedia, request, tenantIdSessionKey };
21
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["fileToBase64","CookieUtils","argsToString","argsToObject","getSearchObj","asyncLocalStorage","asyncSessionStorage","camelToSnake","underscoreToCamelCase","generateRandom18Int","getDataArr","replaceParamsValue","getParamsContentByParamKeys","replaceParamsValueForEvent","formatModuleData","patternTransitionRegExp","stringPramarsValTransition","stringScriptExecution","loopPageStaticCodeMap","scriptExecution","getFileUrlById","getFileUrlByFileInfoId","getRemoteComponentUrlByCode","getRemoteComponentUrlById","isValidUrl","sanitizeRedirectUrl","safeRedirect","sanitizeEventHandler","isReactNative","isWeb","isNode","getEnvironment","getWindow","getDocument","getLocation","isMobile","watchMatchMedia","request","tenantIdSessionKey","_","require","noConflict"],"sources":["../../src/index.ts"],"sourcesContent":["import fileToBase64, { type fileToBase64Type } from './fileToBase64';\r\nimport CookieUtils from './CookieUtils';\r\nimport { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';\r\nimport {\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n type asyncLocalStorageType,\r\n type asyncSessionStorageType,\r\n} from './asyncStorage';\r\nimport {\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n} from './stringUtils';\r\nimport {\r\n getDataArr,\r\n replaceParamsValue,\r\n getParamsContentByParamKeys,\r\n replaceParamsValueForEvent,\r\n} from './treeUtils';\r\nimport formatModuleData from './formatModule/formatModuleData';\r\nimport {\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n} from './formatModule/helpers';\r\nimport loopPageStaticCodeMap from './loopPageStaticCodeMap';\r\nimport scriptExecution, { type scriptExecutionType } from './scriptExecution';\r\nimport {\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n} from './file';\r\nimport {\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n} from './securityUtils';\r\nimport {\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n} from './environment';\r\n\r\nimport watchMatchMedia, { type pageSizeType } from './watchMatchMedia';\r\n\r\nimport { request, tenantIdSessionKey } from './http';\r\n\r\n// 避免 _对象 和其他库冲突\r\nconst _ = require('lodash');\r\n\r\n_.noConflict();\r\n\r\nexport type {\r\n fileToBase64Type,\r\n asyncLocalStorageType,\r\n asyncSessionStorageType,\r\n scriptExecutionType,\r\n pageSizeType,\r\n};\r\n\r\nexport {\r\n fileToBase64,\r\n CookieUtils,\r\n argsToString,\r\n argsToObject,\r\n getSearchObj,\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n formatModuleData,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n loopPageStaticCodeMap,\r\n getDataArr,\r\n replaceParamsValue,\r\n replaceParamsValueForEvent,\r\n getParamsContentByParamKeys,\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n stringScriptExecution,\r\n scriptExecution,\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n watchMatchMedia,\r\n request,\r\n tenantIdSessionKey,\r\n};\r\n"],"mappings":"AAAA,OAAOA,YAAY;AACnB,OAAOC,WAAW;AAClB,SAASC,YAAY,EAAEC,YAAY,EAAEC,YAAY;AACjD,SACEC,iBAAiB,EACjBC,mBAAmB;AAIrB,SACEC,YAAY,EACZC,qBAAqB,EACrBC,mBAAmB;AAErB,SACEC,UAAU,EACVC,kBAAkB,EAClBC,2BAA2B,EAC3BC,0BAA0B;AAE5B,OAAOC,gBAAgB;AACvB,SACEC,uBAAuB,EACvBC,0BAA0B,EAC1BC,qBAAqB;AAEvB,OAAOC,qBAAqB;AAC5B,OAAOC,eAAe;AACtB,SACEC,cAAc,EACdC,sBAAsB,EACtBC,2BAA2B,EAC3BC,yBAAyB;AAE3B,SACEC,UAAU,EACVC,mBAAmB,EACnBC,YAAY,EACZC,oBAAoB;AAEtB,SACEC,aAAa,EACbC,KAAK,EACLC,MAAM,EACNC,cAAc,EACdC,SAAS,EACTC,WAAW,EACXC,WAAW,EACXC,QAAQ;AAGV,OAAOC,eAAe;AAEtB,SAASC,OAAO,EAAEC,kBAAkB;;AAEpC;AACA,IAAMC,CAAC,GAAGC,OAAO,CAAC,QAAQ,CAAC;AAE3BD,CAAC,CAACE,UAAU,CAAC,CAAC;AAUd,SACEzC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,iBAAiB,EACjBC,mBAAmB,EACnBC,YAAY,EACZC,qBAAqB,EACrBC,mBAAmB,EACnBK,gBAAgB,EAChBC,uBAAuB,EACvBC,0BAA0B,EAC1BE,qBAAqB,EACrBR,UAAU,EACVC,kBAAkB,EAClBE,0BAA0B,EAC1BD,2BAA2B,EAC3BQ,cAAc,EACdC,sBAAsB,EACtBC,2BAA2B,EAC3BC,yBAAyB,EACzBN,qBAAqB,EACrBE,eAAe,EACfK,UAAU,EACVC,mBAAmB,EACnBC,YAAY,EACZC,oBAAoB,EACpBC,aAAa,EACbC,KAAK,EACLC,MAAM,EACNC,cAAc,EACdC,SAAS,EACTC,WAAW,EACXC,WAAW,EACXC,QAAQ,EACRC,eAAe,EACfC,OAAO,EACPC,kBAAkB"}
1
+ {"version":3,"names":["fileToBase64","CookieUtils","argsToString","argsToObject","getSearchObj","asyncLocalStorage","asyncSessionStorage","camelToSnake","underscoreToCamelCase","generateRandom18Int","getDataArr","replaceParamsValue","getParamsContentByParamKeys","replaceParamsValueForEvent","formatModuleData","patternTransitionRegExp","stringPramarsValTransition","stringScriptExecution","createCompartmentExecution","loopPageStaticCodeMap","scriptExecution","getFileUrlById","getFileUrlByFileInfoId","getRemoteComponentUrlByCode","getRemoteComponentUrlById","isValidUrl","sanitizeRedirectUrl","safeRedirect","sanitizeEventHandler","isReactNative","isWeb","isNode","getEnvironment","getWindow","getDocument","getLocation","isMobile","watchMatchMedia","request","tenantIdSessionKey","_","require","noConflict"],"sources":["../../src/index.ts"],"sourcesContent":["import fileToBase64, { type fileToBase64Type } from './fileToBase64';\r\nimport CookieUtils from './CookieUtils';\r\nimport { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';\r\nimport {\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n type asyncLocalStorageType,\r\n type asyncSessionStorageType,\r\n} from './asyncStorage';\r\nimport {\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n} from './stringUtils';\r\nimport {\r\n getDataArr,\r\n replaceParamsValue,\r\n getParamsContentByParamKeys,\r\n replaceParamsValueForEvent,\r\n} from './treeUtils';\r\nimport formatModuleData from './formatModule/formatModuleData';\r\nimport {\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n stringScriptExecution,\r\n createCompartmentExecution,\r\n} from './formatModule/helpers';\r\nimport loopPageStaticCodeMap from './loopPageStaticCodeMap';\r\nimport scriptExecution, { type scriptExecutionType } from './scriptExecution';\r\nimport {\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n} from './file';\r\nimport {\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n} from './securityUtils';\r\nimport {\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n} from './environment';\r\n\r\nimport watchMatchMedia, { type pageSizeType } from './watchMatchMedia';\r\n\r\nimport { request, tenantIdSessionKey } from './http';\r\n\r\n// 避免 _对象 和其他库冲突\r\nconst _ = require('lodash');\r\n\r\n_.noConflict();\r\n\r\nexport type {\r\n fileToBase64Type,\r\n asyncLocalStorageType,\r\n asyncSessionStorageType,\r\n scriptExecutionType,\r\n pageSizeType,\r\n};\r\n\r\nexport {\r\n fileToBase64,\r\n CookieUtils,\r\n argsToString,\r\n argsToObject,\r\n getSearchObj,\r\n asyncLocalStorage,\r\n asyncSessionStorage,\r\n camelToSnake,\r\n underscoreToCamelCase,\r\n generateRandom18Int,\r\n formatModuleData,\r\n patternTransitionRegExp,\r\n stringPramarsValTransition,\r\n loopPageStaticCodeMap,\r\n getDataArr,\r\n replaceParamsValue,\r\n replaceParamsValueForEvent,\r\n getParamsContentByParamKeys,\r\n getFileUrlById,\r\n getFileUrlByFileInfoId,\r\n getRemoteComponentUrlByCode,\r\n getRemoteComponentUrlById,\r\n stringScriptExecution,\r\n createCompartmentExecution,\r\n scriptExecution,\r\n isValidUrl,\r\n sanitizeRedirectUrl,\r\n safeRedirect,\r\n sanitizeEventHandler,\r\n isReactNative,\r\n isWeb,\r\n isNode,\r\n getEnvironment,\r\n getWindow,\r\n getDocument,\r\n getLocation,\r\n isMobile,\r\n watchMatchMedia,\r\n request,\r\n tenantIdSessionKey,\r\n};\r\n"],"mappings":"AAAA,OAAOA,YAAY;AACn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