@boteteam/utils 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cjs/formatModule/formatModuleData.js +19 -1
  2. package/dist/cjs/formatModule/formatModuleData.js.map +2 -2
  3. package/dist/cjs/formatModule/helpers/formatFormProps.js +20 -27
  4. package/dist/cjs/formatModule/helpers/formatFormProps.js.map +2 -2
  5. package/dist/cjs/formatModule/helpers/formatStepsProps.d.ts +23 -0
  6. package/dist/cjs/formatModule/helpers/formatStepsProps.js +88 -0
  7. package/dist/cjs/formatModule/helpers/formatStepsProps.js.map +7 -0
  8. package/dist/cjs/formatModule/helpers/formatTableProps.d.ts +11 -0
  9. package/dist/cjs/formatModule/helpers/formatTableProps.js +76 -6
  10. package/dist/cjs/formatModule/helpers/formatTableProps.js.map +2 -2
  11. package/dist/cjs/formatModule/helpers/index.d.ts +2 -1
  12. package/dist/cjs/formatModule/helpers/index.js +3 -0
  13. package/dist/cjs/formatModule/helpers/index.js.map +3 -3
  14. package/dist/cjs/index.d.ts +2 -1
  15. package/dist/cjs/index.js +9 -0
  16. package/dist/cjs/index.js.map +2 -2
  17. package/dist/cjs/securityUtils.d.ts +28 -0
  18. package/dist/cjs/securityUtils.js +103 -0
  19. package/dist/cjs/securityUtils.js.map +7 -0
  20. package/dist/esm/formatModule/formatModuleData.js +18 -5
  21. package/dist/esm/formatModule/formatModuleData.js.map +1 -1
  22. package/dist/esm/formatModule/helpers/formatFormProps.js +25 -32
  23. package/dist/esm/formatModule/helpers/formatFormProps.js.map +1 -1
  24. package/dist/esm/formatModule/helpers/formatStepsProps.d.ts +23 -0
  25. package/dist/esm/formatModule/helpers/formatStepsProps.js +58 -0
  26. package/dist/esm/formatModule/helpers/formatStepsProps.js.map +1 -0
  27. package/dist/esm/formatModule/helpers/formatTableProps.d.ts +11 -0
  28. package/dist/esm/formatModule/helpers/formatTableProps.js +73 -6
  29. package/dist/esm/formatModule/helpers/formatTableProps.js.map +1 -1
  30. package/dist/esm/formatModule/helpers/index.d.ts +2 -1
  31. package/dist/esm/formatModule/helpers/index.js +2 -1
  32. package/dist/esm/formatModule/helpers/index.js.map +1 -1
  33. package/dist/esm/index.d.ts +2 -1
  34. package/dist/esm/index.js +2 -1
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/securityUtils.d.ts +28 -0
  37. package/dist/esm/securityUtils.js +101 -0
  38. package/dist/esm/securityUtils.js.map +1 -0
  39. package/dist/umd/index.min.js +1 -1
  40. package/dist/umd/index.min.js.map +1 -1
  41. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/formatModule/helpers/formatTableProps.ts"],
4
- "sourcesContent": ["import { getDataArr } from '../../treeUtils';\nimport { stringScriptExecution } from './stringScriptExecution';\n// import stringPramarsValTransition from './stringPramarsValTransition';\nimport { get } from 'lodash';\n\nexport type formatTablePropsType = {\n options?: {\n attrs?: {[key:string]: any}[];\n dataSource?: string;\n }\n staticCodeMap?: {[key:string]: any};\n parameters?: {[key:string]: any};\n}\n\nexport type formatTablePropsExportType = {\n columns: {[key: string]: any}[]\n dataSource: {[key: string]: any}[]\n}\n\nconst formatTableProps = ({\n staticCodeMap,\n parameters,\n options = {},\n}: formatTablePropsType): formatTablePropsExportType => {\n const {\n attrs,\n dataSource,\n } = options;\n const columns: {[key: string]: any}[] = [];\n let dataList: {[key: string]: any}[] = [];\n if (Array.isArray(attrs) && attrs.length > 0) {\n attrs.forEach((attrItem) => {\n let attrsDisplay: boolean = true;\n if (typeof attrItem?.display === 'boolean' || typeof attrItem?.display === 'string') {\n if (typeof attrItem?.display === 'boolean') {\n attrsDisplay = attrItem?.display;\n } else if (typeof attrItem?.display === 'string' && attrItem?.display) {\n // const scriptCodeStr = stringPramarsValTransition(attrItem?.display, parameters || {});\n const codeExtendVal = stringScriptExecution(\n attrItem?.display,\n parameters || {},\n );\n attrsDisplay = codeExtendVal;\n }\n }\n\n if (attrsDisplay) {\n const colObj: { [key: string]: any } = {\n key: attrItem?.attrCode,\n title: attrItem?.attrName,\n };\n if (typeof attrItem?.attrWidth === 'string') {\n colObj.width = attrItem?.attrWidth;\n }\n const dataIndexArr = getDataArr(attrItem?.defaultValue);\n if (Array.isArray(dataIndexArr) && dataIndexArr.length > 0) {\n colObj.dataIndex = dataIndexArr.slice(-1)?.[0];\n }\n if (\n attrItem?.staticCode &&\n staticCodeMap?.[attrItem?.staticCode]\n ) {\n colObj.render = (val: string) => {\n return staticCodeMap?.[attrItem?.staticCode]?.[val] || val;\n };\n }\n columns.push(colObj);\n }\n });\n }\n if (dataSource) {\n const dataSourceArr = getDataArr(dataSource);\n if (parameters) {\n const dataSourceList = get(\n parameters,\n dataSourceArr,\n );\n if (Array.isArray(dataSourceList)) {\n dataList = dataSourceList;\n }\n }\n }\n return {\n columns,\n dataSource: dataList,\n };\n};\n\nexport default formatTableProps;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA2B;AAC3B,mCAAsC;AAEtC,oBAAoB;AAgBpB,IAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AACb,MAAwD;AACtD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,UAAkC,CAAC;AACzC,MAAI,WAAmC,CAAC;AACxC,MAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,GAAG;AAC5C,UAAM,QAAQ,CAAC,aAAa;AA/BhC;AAgCM,UAAI,eAAwB;AAC5B,UAAI,QAAO,qCAAU,aAAY,aAAa,QAAO,qCAAU,aAAY,UAAU;AACnF,YAAI,QAAO,qCAAU,aAAY,WAAW;AAC1C,yBAAe,qCAAU;AAAA,QAC3B,WAAW,QAAO,qCAAU,aAAY,aAAY,qCAAU,UAAS;AAErE,gBAAM,oBAAgB;AAAA,YACpB,qCAAU;AAAA,YACV,cAAc,CAAC;AAAA,UACjB;AACA,yBAAe;AAAA,QACjB;AAAA,MACF;AAEA,UAAI,cAAc;AAChB,cAAM,SAAiC;AAAA,UACrC,KAAK,qCAAU;AAAA,UACf,OAAO,qCAAU;AAAA,QACnB;AACA,YAAI,QAAO,qCAAU,eAAc,UAAU;AAC3C,iBAAO,QAAQ,qCAAU;AAAA,QAC3B;AACA,cAAM,mBAAe,6BAAW,qCAAU,YAAY;AACtD,YAAI,MAAM,QAAQ,YAAY,KAAK,aAAa,SAAS,GAAG;AAC1D,iBAAO,aAAY,kBAAa,MAAM,EAAE,MAArB,mBAAyB;AAAA,QAC9C;AACA,aACE,qCAAU,gBACJ,+CAAgB,qCAAU,cAChC;AACA,iBAAO,SAAS,CAAC,QAAgB;AA9D3C,gBAAAA;AA+DY,qBAAOA,MAAA,+CAAgB,qCAAU,gBAA1B,gBAAAA,IAAwC,SAAQ;AAAA,UACzD;AAAA,QACF;AACA,gBAAQ,KAAK,MAAM;AAAA,MACrB;AAAA,IACF,CAAC;AAAA,EACH;AACA,MAAI,YAAY;AACd,UAAM,oBAAgB,6BAAW,UAAU;AAC3C,QAAI,YAAY;AACd,YAAM,qBAAiB;AAAA,QACrB;AAAA,QACA;AAAA,MACF;AACA,UAAI,MAAM,QAAQ,cAAc,GAAG;AACjC,mBAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAEA,IAAO,2BAAQ;",
4
+ "sourcesContent": ["import { getDataArr } from '../../treeUtils';\nimport { stringScriptExecution } from './stringScriptExecution';\n// import stringPramarsValTransition from './stringPramarsValTransition';\nimport { get } from 'lodash';\n\nexport type formatTablePropsType = {\n options?: {\n attrs?: {[key:string]: any}[];\n columns?: {[key: string]: any}[];\n dataSource?: string;\n columnWidth?: string;\n columnMinWidth?: string;\n columnMaxWidth?: string;\n tableBodyHeight?: string;\n }\n staticCodeMap?: {[key:string]: any};\n parameters?: {[key:string]: any};\n}\n\nexport type formatTablePropsExportType = {\n columns: {[key: string]: any}[]\n dataSource: {[key: string]: any}[]\n scroll?: { y?: string, x?: string };\n}\n\nconst formatTableProps = ({\n staticCodeMap,\n parameters,\n options = {},\n}: formatTablePropsType): formatTablePropsExportType => {\n const {\n attrs,\n dataSource,\n columns,\n columnWidth,\n columnMinWidth,\n columnMaxWidth,\n tableBodyHeight,\n } = options;\n const _columns: {[key: string]: any}[] = [];\n let dataList: {[key: string]: any}[] = [];\n let scroll: { y?: string, x?: string } = {};\n\n if (typeof columns === 'string' && columns) {\n const columnsArr = getDataArr(columns);\n const columnsList = get(\n parameters,\n columnsArr,\n );\n if (Array.isArray(columnsList)) {\n columnsList.forEach((colItem) => {\n const colObj: { [key: string]: any } = {\n key: colItem?.dataIndex,\n title: colItem?.title,\n dataIndex: colItem?.dataIndex,\n };\n const colWidth = colItem?.width || columnWidth;\n const colMinWidth = colItem?.minWidth || columnMinWidth;\n const colMaxWidth = colItem?.maxWidth || columnMaxWidth;\n if (colWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n width: colWidth,\n };\n }\n if (colMinWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n minWidth: colMinWidth,\n };\n }\n if (colMaxWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n maxWidth: colMaxWidth,\n };\n }\n _columns.push(colObj);\n });\n }\n } else if (Array.isArray(attrs) && attrs.length > 0) {\n attrs.forEach((attrItem) => {\n let attrsDisplay: boolean = true;\n if (typeof attrItem?.display === 'boolean' || typeof attrItem?.display === 'string') {\n if (typeof attrItem?.display === 'boolean') {\n attrsDisplay = attrItem?.display;\n } else if (typeof attrItem?.display === 'string' && attrItem?.display) {\n // const scriptCodeStr = stringPramarsValTransition(attrItem?.display, parameters || {});\n const codeExtendVal = stringScriptExecution(\n attrItem?.display,\n parameters || {},\n );\n attrsDisplay = codeExtendVal;\n }\n }\n\n if (attrsDisplay) {\n const colObj: { [key: string]: any } = {\n key: attrItem?.attrCode,\n title: attrItem?.attrName,\n };\n const colWidth = attrItem?.attrWidth || columnWidth;\n const colMinWidth = attrItem?.attrMinWidth || columnMinWidth;\n const colMaxWidth = attrItem?.attrMaxWidth || columnMaxWidth;\n if (typeof attrItem?.attrWidth === 'string') {\n colObj.width = attrItem?.attrWidth;\n }\n if (colWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n width: colWidth,\n };\n }\n if (colMinWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n minWidth: colMinWidth,\n };\n }\n if (colMaxWidth) {\n colObj.style = {\n ...(colObj.style || {}),\n maxWidth: colMaxWidth,\n };\n }\n const dataIndexArr = getDataArr(attrItem?.defaultValue);\n if (Array.isArray(dataIndexArr) && dataIndexArr.length > 0) {\n colObj.dataIndex = dataIndexArr.slice(-1)?.[0];\n }\n if (\n attrItem?.staticCode &&\n staticCodeMap?.[attrItem?.staticCode]\n ) {\n colObj.render = (val: string) => {\n return staticCodeMap?.[attrItem?.staticCode]?.[val] || val;\n };\n }\n _columns.push(colObj);\n }\n });\n }\n if (dataSource) {\n const dataSourceArr = getDataArr(dataSource);\n if (parameters) {\n const dataSourceList = get(\n parameters,\n dataSourceArr,\n );\n if (Array.isArray(dataSourceList)) {\n dataList = dataSourceList;\n }\n }\n }\n if (typeof tableBodyHeight === 'string' && tableBodyHeight) {\n scroll = {\n y: tableBodyHeight,\n };\n }\n return {\n columns: _columns,\n dataSource: dataList,\n scroll,\n };\n};\n\nexport default formatTableProps;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA2B;AAC3B,mCAAsC;AAEtC,oBAAoB;AAsBpB,IAAM,mBAAmB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AACb,MAAwD;AACtD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,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mBAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACA,MAAI,OAAO,oBAAoB,YAAY,iBAAiB;AAC1D,aAAS;AAAA,MACP,GAAG;AAAA,IACL;AAAA,EACF;AACA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAO,2BAAQ;",
6
6
  "names": ["_a"]
7
7
  }
@@ -12,7 +12,8 @@ import formatEchartLineProps from './formatEchartLineProps';
12
12
  import formatEchartPieProps from './formatEchartPieProps';
13
13
  import formatLoopProps from './formatLoopProps';
14
14
  import formatStyleProps from './formatStyleProps';
15
+ import formatStepsProps from './formatStepsProps';
15
16
  import formRulsRegMap from './formRulsRegMap';
16
17
  import urlPrefix from './urlPrefix';
17
18
  import { stringScriptExecution } from './stringScriptExecution';
18
- export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatLoopProps, formatStyleProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, };
19
+ export { urlPrefix, formRulsRegMap, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatDescriptionsProps, formatFormProps, formatHighCodeProps, formatEchartLineProps, formatEchartPieProps, formatLoopProps, formatStyleProps, formatStepsProps, staticCodeAssemble, patternTransitionRegExp, stringPramarsValTransition, stringScriptExecution, };
@@ -39,6 +39,7 @@ __export(helpers_exports, {
39
39
  formatImageProps: () => import_formatImageProps.default,
40
40
  formatListProps: () => import_formatListProps.default,
41
41
  formatLoopProps: () => import_formatLoopProps.default,
42
+ formatStepsProps: () => import_formatStepsProps.default,
42
43
  formatStyleProps: () => import_formatStyleProps.default,
43
44
  formatTableProps: () => import_formatTableProps.default,
44
45
  patternTransitionRegExp: () => import_patternTransitionRegExp.default,
@@ -62,6 +63,7 @@ var import_formatEchartLineProps = __toESM(require("./formatEchartLineProps"));
62
63
  var import_formatEchartPieProps = __toESM(require("./formatEchartPieProps"));
63
64
  var import_formatLoopProps = __toESM(require("./formatLoopProps"));
64
65
  var import_formatStyleProps = __toESM(require("./formatStyleProps"));
66
+ var import_formatStepsProps = __toESM(require("./formatStepsProps"));
65
67
  var import_formRulsRegMap = __toESM(require("./formRulsRegMap"));
66
68
  var import_urlPrefix = __toESM(require("./urlPrefix"));
67
69
  var import_stringScriptExecution = require("./stringScriptExecution");
@@ -77,6 +79,7 @@ var import_stringScriptExecution = require("./stringScriptExecution");
77
79
  formatImageProps,
78
80
  formatListProps,
79
81
  formatLoopProps,
82
+ formatStepsProps,
80
83
  formatStyleProps,
81
84
  formatTableProps,
82
85
  patternTransitionRegExp,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/formatModule/helpers/index.ts"],
4
- "sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\nimport patternTransitionRegExp from './patternTransitionRegExp';\nimport staticCodeAssemble from './staticCodeAssemble';\nimport formatTableProps from './formatTableProps';\nimport formatListProps from './formatListProps';\nimport formatImageProps from './formatImageProps';\nimport formatCarouselProps from './formatCarouselProps';\nimport formatDescriptionsProps from './formatDescriptionsProps';\nimport formatHighCodeProps from './formatHighCodeProps';\nimport formatFormProps from './formatFormProps';\nimport formatEchartLineProps from './formatEchartLineProps';\nimport formatEchartPieProps from './formatEchartPieProps';\nimport formatLoopProps from './formatLoopProps';\nimport formatStyleProps from './formatStyleProps';\nimport formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport { stringScriptExecution } from './stringScriptExecution';\n\nexport {\n urlPrefix,\n formRulsRegMap,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatDescriptionsProps,\n formatFormProps,\n formatHighCodeProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatLoopProps,\n formatStyleProps,\n staticCodeAssemble,\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,sDAAAC;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,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,6BAA4B;AAC5B,8BAA6B;AAC7B,4BAA2B;AAC3B,uBAAsB;AACtB,mCAAsC;",
6
- "names": ["formRulsRegMap", "formatCarouselProps", "formatDescriptionsProps", "formatEchartLineProps", "formatEchartPieProps", "formatFormProps", "formatHighCodeProps", "formatImageProps", "formatListProps", "formatLoopProps", "formatStyleProps", "formatTableProps", "patternTransitionRegExp", "staticCodeAssemble", "stringPramarsValTransition", "urlPrefix"]
4
+ "sourcesContent": ["import stringPramarsValTransition from './stringPramarsValTransition';\nimport patternTransitionRegExp from './patternTransitionRegExp';\nimport staticCodeAssemble from './staticCodeAssemble';\nimport formatTableProps from './formatTableProps';\nimport formatListProps from './formatListProps';\nimport formatImageProps from './formatImageProps';\nimport formatCarouselProps from './formatCarouselProps';\nimport formatDescriptionsProps from './formatDescriptionsProps';\nimport formatHighCodeProps from './formatHighCodeProps';\nimport formatFormProps from './formatFormProps';\nimport formatEchartLineProps from './formatEchartLineProps';\nimport formatEchartPieProps from './formatEchartPieProps';\nimport formatLoopProps from './formatLoopProps';\nimport formatStyleProps from './formatStyleProps';\nimport formatStepsProps from './formatStepsProps';\nimport formRulsRegMap from './formRulsRegMap';\nimport urlPrefix from './urlPrefix';\nimport { stringScriptExecution } from './stringScriptExecution';\n\nexport {\n urlPrefix,\n formRulsRegMap,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatDescriptionsProps,\n formatFormProps,\n formatHighCodeProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatLoopProps,\n formatStyleProps,\n formatStepsProps,\n staticCodeAssemble,\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8CAAAA;AAAA,EAAA,sDAAAC;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,6BAA4B;AAC5B,8BAA6B;AAC7B,8BAA6B;AAC7B,4BAA2B;AAC3B,uBAAsB;AACtB,mCAAsC;",
6
+ "names": ["formRulsRegMap", "formatCarouselProps", "formatDescriptionsProps", "formatEchartLineProps", "formatEchartPieProps", "formatFormProps", "formatHighCodeProps", "formatImageProps", "formatListProps", "formatLoopProps", "formatStepsProps", "formatStyleProps", "formatTableProps", "patternTransitionRegExp", "staticCodeAssemble", "stringPramarsValTransition", "urlPrefix"]
7
7
  }
@@ -9,5 +9,6 @@ import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecut
9
9
  import loopPageStaticCodeMap from './loopPageStaticCodeMap';
10
10
  import scriptExecution, { type scriptExecutionType } from './scriptExecution';
11
11
  import { getFileUrlById, getRemoteComponentUrlByCode, getRemoteComponentUrlById } from './file';
12
+ import { isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler } from './securityUtils';
12
13
  export type { fileToBase64Type, asyncLocalStorageType, asyncSessionStorageType, scriptExecutionType, };
13
- export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, scriptExecution, };
14
+ export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, scriptExecution, isValidUrl, sanitizeRedirectUrl, safeRedirect, sanitizeEventHandler, };
package/dist/cjs/index.js CHANGED
@@ -44,10 +44,14 @@ __export(src_exports, {
44
44
  getRemoteComponentUrlByCode: () => import_file.getRemoteComponentUrlByCode,
45
45
  getRemoteComponentUrlById: () => import_file.getRemoteComponentUrlById,
46
46
  getSearchObj: () => import_pathArgsUtils.getSearchObj,
47
+ isValidUrl: () => import_securityUtils.isValidUrl,
47
48
  loopPageStaticCodeMap: () => import_loopPageStaticCodeMap.default,
48
49
  patternTransitionRegExp: () => import_helpers.patternTransitionRegExp,
49
50
  replaceParamsValue: () => import_treeUtils.replaceParamsValue,
50
51
  replaceParamsValueForEvent: () => import_treeUtils.replaceParamsValueForEvent,
52
+ safeRedirect: () => import_securityUtils.safeRedirect,
53
+ sanitizeEventHandler: () => import_securityUtils.sanitizeEventHandler,
54
+ sanitizeRedirectUrl: () => import_securityUtils.sanitizeRedirectUrl,
51
55
  scriptExecution: () => import_scriptExecution.default,
52
56
  stringPramarsValTransition: () => import_helpers.stringPramarsValTransition,
53
57
  stringScriptExecution: () => import_helpers.stringScriptExecution,
@@ -65,6 +69,7 @@ var import_helpers = require("./formatModule/helpers");
65
69
  var import_loopPageStaticCodeMap = __toESM(require("./loopPageStaticCodeMap"));
66
70
  var import_scriptExecution = __toESM(require("./scriptExecution"));
67
71
  var import_file = require("./file");
72
+ var import_securityUtils = require("./securityUtils");
68
73
  var _ = require("lodash");
69
74
  _.noConflict();
70
75
  // Annotate the CommonJS export names for ESM import in node:
@@ -84,10 +89,14 @@ _.noConflict();
84
89
  getRemoteComponentUrlByCode,
85
90
  getRemoteComponentUrlById,
86
91
  getSearchObj,
92
+ isValidUrl,
87
93
  loopPageStaticCodeMap,
88
94
  patternTransitionRegExp,
89
95
  replaceParamsValue,
90
96
  replaceParamsValueForEvent,
97
+ safeRedirect,
98
+ sanitizeEventHandler,
99
+ sanitizeRedirectUrl,
91
100
  scriptExecution,
92
101
  stringPramarsValTransition,
93
102
  stringScriptExecution,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["import fileToBase64, { type fileToBase64Type } from './fileToBase64';\nimport CookieUtils from './CookieUtils';\nimport { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';\nimport {\n asyncLocalStorage,\n asyncSessionStorage,\n type asyncLocalStorageType,\n type asyncSessionStorageType,\n} from './asyncStorage';\nimport {\n camelToSnake,\n underscoreToCamelCase,\n generateRandom18Int,\n} from './stringUtils';\nimport {\n getDataArr,\n replaceParamsValue,\n getParamsContentByParamKeys,\n replaceParamsValueForEvent,\n} from './treeUtils';\nimport formatModuleData from './formatModule/formatModuleData';\nimport {\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n} from './formatModule/helpers';\nimport loopPageStaticCodeMap from './loopPageStaticCodeMap';\nimport scriptExecution, { type scriptExecutionType } from './scriptExecution';\nimport {\n getFileUrlById,\n getRemoteComponentUrlByCode,\n getRemoteComponentUrlById,\n} from './file';\n\n\n// 避免 _对象 和其他库冲突\nconst _ = require('lodash');\n\n_.noConflict();\n\nexport type {\n fileToBase64Type,\n asyncLocalStorageType,\n asyncSessionStorageType,\n scriptExecutionType,\n};\n\nexport {\n fileToBase64,\n CookieUtils,\n argsToString,\n argsToObject,\n getSearchObj,\n asyncLocalStorage,\n asyncSessionStorage,\n camelToSnake,\n underscoreToCamelCase,\n generateRandom18Int,\n formatModuleData,\n patternTransitionRegExp,\n stringPramarsValTransition,\n loopPageStaticCodeMap,\n getDataArr,\n replaceParamsValue,\n replaceParamsValueForEvent,\n getParamsContentByParamKeys,\n getFileUrlById,\n getRemoteComponentUrlByCode,\n getRemoteComponentUrlById,\n stringScriptExecution,\n scriptExecution,\n};\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,4DAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,gDAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoD;AACpD,yBAAwB;AACxB,2BAAyD;AACzD,0BAKO;AACP,yBAIO;AACP,uBAKO;AACP,8BAA6B;AAC7B,qBAIO;AACP,mCAAkC;AAClC,6BAA0D;AAC1D,kBAIO;AAIP,IAAM,IAAI,QAAQ,QAAQ;AAE1B,EAAE,WAAW;",
4
+ "sourcesContent": ["import fileToBase64, { type fileToBase64Type } from './fileToBase64';\nimport CookieUtils from './CookieUtils';\nimport { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';\nimport {\n asyncLocalStorage,\n asyncSessionStorage,\n type asyncLocalStorageType,\n type asyncSessionStorageType,\n} from './asyncStorage';\nimport {\n camelToSnake,\n underscoreToCamelCase,\n generateRandom18Int,\n} from './stringUtils';\nimport {\n getDataArr,\n replaceParamsValue,\n getParamsContentByParamKeys,\n replaceParamsValueForEvent,\n} from './treeUtils';\nimport formatModuleData from './formatModule/formatModuleData';\nimport {\n patternTransitionRegExp,\n stringPramarsValTransition,\n stringScriptExecution,\n} from './formatModule/helpers';\nimport loopPageStaticCodeMap from './loopPageStaticCodeMap';\nimport scriptExecution, { type scriptExecutionType } from './scriptExecution';\nimport {\n getFileUrlById,\n getRemoteComponentUrlByCode,\n getRemoteComponentUrlById,\n} from './file';\nimport {\n isValidUrl,\n sanitizeRedirectUrl,\n safeRedirect,\n sanitizeEventHandler,\n} from './securityUtils';\n\n// 避免 _对象 和其他库冲突\nconst _ = require('lodash');\n\n_.noConflict();\n\nexport type {\n fileToBase64Type,\n asyncLocalStorageType,\n asyncSessionStorageType,\n scriptExecutionType,\n};\n\nexport {\n fileToBase64,\n CookieUtils,\n argsToString,\n argsToObject,\n getSearchObj,\n asyncLocalStorage,\n asyncSessionStorage,\n camelToSnake,\n underscoreToCamelCase,\n generateRandom18Int,\n formatModuleData,\n patternTransitionRegExp,\n stringPramarsValTransition,\n loopPageStaticCodeMap,\n getDataArr,\n replaceParamsValue,\n replaceParamsValueForEvent,\n getParamsContentByParamKeys,\n getFileUrlById,\n getRemoteComponentUrlByCode,\n getRemoteComponentUrlById,\n stringScriptExecution,\n scriptExecution,\n isValidUrl,\n sanitizeRedirectUrl,\n safeRedirect,\n sanitizeEventHandler,\n};\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,4DAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gDAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoD;AACpD,yBAAwB;AACxB,2BAAyD;AACzD,0BAKO;AACP,yBAIO;AACP,uBAKO;AACP,8BAA6B;AAC7B,qBAIO;AACP,mCAAkC;AAClC,6BAA0D;AAC1D,kBAIO;AACP,2BAKO;AAGP,IAAM,IAAI,QAAQ,QAAQ;AAE1B,EAAE,WAAW;",
6
6
  "names": ["CookieUtils", "fileToBase64", "formatModuleData", "loopPageStaticCodeMap", "scriptExecution"]
7
7
  }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 安全工具函数,用于防止XSS等安全漏洞
3
+ */
4
+ /**
5
+ * 验证URL是否安全,防止XSS攻击
6
+ * @param url 待验证的URL
7
+ * @returns 是否为安全的URL
8
+ */
9
+ export declare const isValidUrl: (url: string) => boolean;
10
+ /**
11
+ * 清理和验证重定向URL,确保安全
12
+ * @param url 待清理的URL
13
+ * @param allowedDomains 允许的域名列表,为空时允许同源URL
14
+ * @returns 清理后的安全URL,如果不安全则返回默认URL
15
+ */
16
+ export declare const sanitizeRedirectUrl: (url: string, allowedDomains?: string[], defaultUrl?: string) => string;
17
+ /**
18
+ * 安全地设置window.location.href,防止XSS攻击
19
+ * @param url 目标URL
20
+ * @param allowedDomains 允许的域名列表
21
+ */
22
+ export declare const safeRedirect: (url: string, allowedDomains?: string[]) => void;
23
+ /**
24
+ * 验证和清理事件处理器,防止恶意代码注入
25
+ * @param handler 事件处理函数
26
+ * @returns 安全的事件处理函数
27
+ */
28
+ export declare const sanitizeEventHandler: (handler: Function) => Function;
@@ -0,0 +1,103 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/securityUtils.ts
20
+ var securityUtils_exports = {};
21
+ __export(securityUtils_exports, {
22
+ isValidUrl: () => isValidUrl,
23
+ safeRedirect: () => safeRedirect,
24
+ sanitizeEventHandler: () => sanitizeEventHandler,
25
+ sanitizeRedirectUrl: () => sanitizeRedirectUrl
26
+ });
27
+ module.exports = __toCommonJS(securityUtils_exports);
28
+ var isValidUrl = (url) => {
29
+ if (!url || typeof url !== "string") {
30
+ return false;
31
+ }
32
+ try {
33
+ const urlObj = new URL(url, window.location.origin);
34
+ if (!["http:", "https:"].includes(urlObj.protocol)) {
35
+ return false;
36
+ }
37
+ const dangerousPatterns = [
38
+ /javascript:/i,
39
+ /vbscript:/i,
40
+ /data:/i,
41
+ /file:/i,
42
+ /<script/i,
43
+ /onload=/i,
44
+ /onerror=/i,
45
+ /onclick=/i
46
+ ];
47
+ return !dangerousPatterns.some((pattern) => pattern.test(url));
48
+ } catch {
49
+ return false;
50
+ }
51
+ };
52
+ var sanitizeRedirectUrl = (url, allowedDomains = [], defaultUrl = "/") => {
53
+ if (!url || typeof url !== "string") {
54
+ return defaultUrl;
55
+ }
56
+ if (!isValidUrl(url)) {
57
+ return defaultUrl;
58
+ }
59
+ try {
60
+ const urlObj = new URL(url, window.location.origin);
61
+ const currentHost = window.location.hostname;
62
+ if (allowedDomains.length === 0) {
63
+ if (urlObj.hostname !== currentHost) {
64
+ return defaultUrl;
65
+ }
66
+ } else {
67
+ const isAllowedDomain = allowedDomains.some(
68
+ (domain) => urlObj.hostname === domain || urlObj.hostname.endsWith(`.${domain}`)
69
+ );
70
+ if (!isAllowedDomain && urlObj.hostname !== currentHost) {
71
+ return defaultUrl;
72
+ }
73
+ }
74
+ return urlObj.toString();
75
+ } catch {
76
+ return defaultUrl;
77
+ }
78
+ };
79
+ var safeRedirect = (url, allowedDomains = []) => {
80
+ const safeUrl = sanitizeRedirectUrl(url, allowedDomains);
81
+ window.location.href = safeUrl;
82
+ };
83
+ var sanitizeEventHandler = (handler) => {
84
+ if (typeof handler !== "function") {
85
+ return () => {
86
+ };
87
+ }
88
+ return (...args) => {
89
+ try {
90
+ handler(...args);
91
+ } catch (error) {
92
+ console.error("Event handler error:", error);
93
+ }
94
+ };
95
+ };
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ isValidUrl,
99
+ safeRedirect,
100
+ sanitizeEventHandler,
101
+ sanitizeRedirectUrl
102
+ });
103
+ //# sourceMappingURL=securityUtils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/securityUtils.ts"],
4
+ "sourcesContent": ["/**\n * 安全工具函数,用于防止XSS等安全漏洞\n */\n\n/**\n * 验证URL是否安全,防止XSS攻击\n * @param url 待验证的URL\n * @returns 是否为安全的URL\n */\nexport const isValidUrl = (url: string): boolean => {\n if (!url || typeof url !== 'string') {\n return false;\n }\n\n try {\n const urlObj = new URL(url, window.location.origin);\n \n // 只允许http和https协议,防止javascript:等危险协议\n if (!['http:', 'https:'].includes(urlObj.protocol)) {\n return false;\n }\n\n // 检查是否包含危险字符\n const dangerousPatterns = [\n /javascript:/i,\n /vbscript:/i,\n /data:/i,\n /file:/i,\n /<script/i,\n /onload=/i,\n /onerror=/i,\n /onclick=/i,\n ];\n\n return !dangerousPatterns.some(pattern => pattern.test(url));\n } catch {\n return false;\n }\n};\n\n/**\n * 清理和验证重定向URL,确保安全\n * @param url 待清理的URL\n * @param allowedDomains 允许的域名列表,为空时允许同源URL\n * @returns 清理后的安全URL,如果不安全则返回默认URL\n */\nexport const sanitizeRedirectUrl = (\n url: string,\n allowedDomains: string[] = [],\n defaultUrl: string = '/'\n): string => {\n if (!url || typeof url !== 'string') {\n return defaultUrl;\n }\n\n // 基本URL验证\n if (!isValidUrl(url)) {\n return defaultUrl;\n }\n\n try {\n const urlObj = new URL(url, window.location.origin);\n const currentHost = window.location.hostname;\n\n // 如果没有指定允许的域名,只允许同源URL\n if (allowedDomains.length === 0) {\n if (urlObj.hostname !== currentHost) {\n return defaultUrl;\n }\n } else {\n // 检查是否在允许的域名列表中\n const isAllowedDomain = allowedDomains.some(domain =>\n urlObj.hostname === domain || urlObj.hostname.endsWith(`.${domain}`)\n );\n \n if (!isAllowedDomain && urlObj.hostname !== currentHost) {\n return defaultUrl;\n }\n }\n\n return urlObj.toString();\n } catch {\n return defaultUrl;\n }\n};\n\n/**\n * 安全地设置window.location.href,防止XSS攻击\n * @param url 目标URL\n * @param allowedDomains 允许的域名列表\n */\nexport const safeRedirect = (url: string, allowedDomains: string[] = []): void => {\n const safeUrl = sanitizeRedirectUrl(url, allowedDomains);\n window.location.href = safeUrl;\n};\n\n/**\n * 验证和清理事件处理器,防止恶意代码注入\n * @param handler 事件处理函数\n * @returns 安全的事件处理函数\n */\nexport const sanitizeEventHandler = (handler: Function): Function => {\n if (typeof handler !== 'function') {\n return () => {};\n }\n \n return (...args: any[]) => {\n try {\n handler(...args);\n } catch (error) {\n console.error('Event handler error:', error);\n }\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,aAAa,CAAC,QAAyB;AAClD,MA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AgC;AACnE,MAAI,OAAO,YAAY,YAAY;AACjC,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AAEA,SAAO,IAAI,SAAgB;AACzB,QAAI;AACF,cAAQ,GAAG,IAAI;AAAA,IACjB,SAAS,OAAP;AACA,cAAQ,MAAM,wBAAwB,KAAK;AAAA,IAC7C;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- var _excluded = ["itemLabel", "itemContent", "itemDescribe", "dataSource", "fileProps", "attrs", "rowSelection", "hasSelectAll", "rowKey", "fieldName", "column", "articleContent", "eventFlag"];
1
+ var _excluded = ["itemLabel", "itemContent", "itemDescribe", "dataSource", "columns", "tableBodyHeight", "fileProps", "attrs", "rowSelection", "hasSelectAll", "rowKey", "fieldName", "column", "articleContent", "eventFlag"];
2
2
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
9
9
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  import 'ses';
11
11
  import { getDataArr } from "../treeUtils";
12
- import { urlPrefix, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatFormProps, formatHighCodeProps, formatDescriptionsProps, formatLoopProps, formatStyleProps, formatEchartLineProps, formatEchartPieProps, staticCodeAssemble, stringPramarsValTransition } from "./helpers";
12
+ import { urlPrefix, formatListProps, formatTableProps, formatCarouselProps, formatImageProps, formatFormProps, formatHighCodeProps, formatDescriptionsProps, formatLoopProps, formatStyleProps, formatEchartLineProps, formatEchartPieProps, formatStepsProps, staticCodeAssemble, stringPramarsValTransition } from "./helpers";
13
13
  var formatModuleData = function formatModuleData(_ref) {
14
14
  var moduleData = _ref.moduleData,
15
15
  parentModuleData = _ref.parentModuleData,
@@ -45,6 +45,8 @@ var formatModuleData = function formatModuleData(_ref) {
45
45
  listItemContent = _ref2.itemContent,
46
46
  listItemDescribe = _ref2.itemDescribe,
47
47
  compDataSource = _ref2.dataSource,
48
+ compColumns = _ref2.columns,
49
+ tableBodyHeight = _ref2.tableBodyHeight,
48
50
  fileProps = _ref2.fileProps,
49
51
  attrs = _ref2.attrs,
50
52
  rowSelection = _ref2.rowSelection,
@@ -146,10 +148,12 @@ var formatModuleData = function formatModuleData(_ref) {
146
148
  if (compType === 'table') {
147
149
  var _moduleDataRes4;
148
150
  var tableProps = formatTableProps({
149
- options: {
151
+ options: _objectSpread(_objectSpread({}, otherCompProps), {}, {
152
+ columns: compColumns,
153
+ dataSource: compDataSource,
150
154
  attrs: attrs,
151
- dataSource: compDataSource
152
- },
155
+ tableBodyHeight: tableBodyHeight
156
+ }),
153
157
  staticCodeMap: staticCodeMap,
154
158
  parameters: allParametrs
155
159
  });
@@ -278,6 +282,15 @@ var formatModuleData = function formatModuleData(_ref) {
278
282
  moduleDataRes.compProps = _objectSpread(_objectSpread({}, moduleDataRes.compProps || {}), _echartProps);
279
283
  }
280
284
  }
285
+ if (compType === 'steps') {
286
+ var stepsProps = formatStepsProps({
287
+ options: _objectSpread({
288
+ dataSource: compDataSource
289
+ }, otherCompProps),
290
+ parameters: allParametrs
291
+ });
292
+ moduleDataRes.compProps = _objectSpread(_objectSpread({}, moduleDataRes.compProps || {}), stepsProps);
293
+ }
281
294
  moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);
282
295
  // 所有的模版 拼一个组装数据的key值
283
296
  if (moduleData !== null && moduleData !== void 0 && moduleData.compProps && fieldName) {
@@ -1 +1 @@
1
- {"version":3,"names":["getDataArr","urlPrefix","formatListProps","formatTableProps","formatCarouselProps","formatImageProps","formatFormProps","formatHighCodeProps","formatDescriptionsProps","formatLoopProps","formatStyleProps","formatEchartLineProps","formatEchartPieProps","staticCodeAssemble","stringPramarsValTransition","formatModuleData","_ref","moduleData","parentModuleData","parameters","loopItemData","staticCodeList","disabled","pageData","moduleDataRes","allParametrs","_objectSpread","loopItem","_staticCodeAssemble","staticCodeMap","staticOptionsMap","compProps","compType","children","moduleTitle","moduleDescribe","id","key","originModule","_ref2","listItemLabel","itemLabel","listItemContent","itemContent","listItemDescribe","itemDescribe","compDataSource","dataSource","fileProps","attrs","rowSelection","hasSelectAll","rowKey","fieldName","column","articleContent","eventFlag","otherCompProps","_objectWithoutProperties","_excluded","title","checked","parentCompProps","indexOf","Array","isArray","length","childs","map","item","_Object$keys","Object","keys","forEach","compPropKey","type","rowKeyIndexArr","_rowKeyIndexArr$slice","slice","url","dataType","_moduleDataRes","carouselProps","options","_moduleDataRes2","imageProps","_moduleDataRes3","highCodeCompProps","_moduleDataRes4","tableProps","_moduleDataRes5","formProps","_moduleDataRes6","descriptionsProps","_loopProps$dataSource","_moduleDataRes10","loopProps","loopChilds","dataItem","_moduleDataRes7","_moduleDataRes8","_moduleDataRes9","dataItemKey","push","originItem","loopChildInfo","_typeof","includes","resProps","echartProps","style"],"sources":["../../../src/formatModule/formatModuleData.ts"],"sourcesContent":["import 'ses';\nimport { getDataArr } from '../treeUtils';\nimport {\n urlPrefix,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatFormProps,\n formatHighCodeProps,\n formatDescriptionsProps,\n formatLoopProps,\n formatStyleProps,\n formatEchartLineProps,\n formatEchartPieProps,\n staticCodeAssemble,\n stringPramarsValTransition,\n} from './helpers';\n\ntype formatModuleProps = {\n moduleData: { [key: string]: any } | null; // 页面配置数据\n parentModuleData?: { [key: string]: any } | null; // 父级配置数据\n pageData?: { [key: string]: any } | null; // 页面组件数据\n parameters?: any; // 入参上下文\n loopItemData?: any; // 循环体数据\n staticCodeList?: { [key: string]: any } | null; // 静态资源数据\n disabled?: boolean;\n};\n\nconst formatModuleData = ({\n moduleData,\n parentModuleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n}: formatModuleProps): { [key: string]: any } | null => {\n let moduleDataRes: { [key: string]: any } = { };\n const allParametrs:{ [key: string]: any } = {\n ...(parameters || {}),\n pageData: pageData || {},\n loopItem: loopItemData || {},\n }; // 把页面数据与入参组装到一起\n const {\n staticCodeMap,\n staticOptionsMap,\n } = staticCodeAssemble(staticCodeList);\n\n if (moduleData) {\n const {\n compProps,\n compType,\n children,\n moduleTitle,\n moduleDescribe,\n id,\n } = moduleData;\n // 组装静态数据映射\n moduleDataRes = {\n ...moduleData,\n key: id,\n disabled,\n compProps: {},\n originModule: moduleData, // 配置moduled的信息\n };\n const {\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n fileProps,\n attrs,\n rowSelection,\n hasSelectAll,\n rowKey,\n fieldName,\n column,\n articleContent,\n eventFlag,\n ...otherCompProps // 无需处理的属性\n } = compProps || {};\n if (moduleTitle) {\n moduleDataRes.moduleTitle = stringPramarsValTransition(moduleTitle, allParametrs);\n }\n if (moduleDescribe) {\n moduleDataRes.moduleDescribe = stringPramarsValTransition(moduleDescribe, allParametrs);\n }\n if (otherCompProps?.title) {\n moduleDataRes.compProps.title = stringPramarsValTransition(otherCompProps?.title, allParametrs);\n }\n if (eventFlag) {\n moduleDataRes.compProps.eventFlag = { checked: true };\n }\n \n moduleDataRes.parentCompProps = parentModuleData?.compProps || {};\n if (\n ['panel', 'div', 'page'].indexOf(compType) >= 0 &&\n Array.isArray(children) &&\n children.length > 0\n ) {\n const childs = children.map((item) => {\n return formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n });\n });\n moduleDataRes.children = childs;\n } else {\n if (otherCompProps && Object?.keys(otherCompProps)?.length > 0) {\n Object?.keys(otherCompProps).forEach(compPropKey => {\n if (otherCompProps?.[compPropKey] || typeof otherCompProps?.[compPropKey] === 'number') {\n moduleDataRes.compProps[compPropKey] = otherCompProps?.[compPropKey];\n }\n });\n }\n if (rowSelection) {\n moduleDataRes.compProps.rowSelection = rowSelection;\n if (hasSelectAll && rowSelection?.type === 'checkbox') {\n moduleDataRes.compProps.hasSelectAll = hasSelectAll;\n } else {\n delete moduleDataRes.compProps.hasSelectAll;\n }\n }\n const rowKeyIndexArr = getDataArr(rowKey);\n\n if (Array.isArray(rowKeyIndexArr) && rowKeyIndexArr.length > 0) {\n moduleDataRes.compProps.rowKey = rowKeyIndexArr.slice(-1)?.[0];\n }\n\n if (compType === 'typography') {\n if (articleContent) {\n moduleDataRes.compProps.articleContent = stringPramarsValTransition(articleContent, allParametrs);\n }\n }\n if (compType === 'iframe') {\n moduleDataRes.compProps.url = stringPramarsValTransition(\n otherCompProps?.url,\n allParametrs,\n );\n }\n\n if (compType === 'carousel' && compDataSource && compDataSource?.dataType) {\n const carouselProps = formatCarouselProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...carouselProps,\n };\n }\n if (compType === 'image' && compDataSource && compDataSource?.dataType) {\n const imageProps = formatImageProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...imageProps,\n };\n }\n\n if (compType === 'highCodeComp') {\n const highCodeCompProps = formatHighCodeProps({\n options: { fileProps },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...highCodeCompProps,\n };\n }\n\n if (compType === 'table') {\n const tableProps = formatTableProps({\n options: {\n attrs,\n dataSource: compDataSource,\n },\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...tableProps,\n };\n }\n if (compType === 'form') {\n const formProps = formatFormProps({\n options: {\n column,\n children,\n },\n parameters: allParametrs,\n staticCodeMap,\n staticOptionsMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...formProps,\n };\n }\n if (compType === 'descriptions') {\n const descriptionsProps = formatDescriptionsProps({\n options: {\n column,\n attrs,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...descriptionsProps,\n };\n }\n if (compType === 'loop') {\n const loopProps = formatLoopProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n const loopChilds:({[key:string]:any}|null)[] = [];\n if (\n Array.isArray(loopProps?.dataSource) && loopProps?.dataSource?.length > 0 &&\n Array.isArray(children) && children.length > 0\n ) {\n loopProps?.dataSource.forEach((dataItem) => {\n const dataItemKey = moduleDataRes?.compProps?.rowKey && dataItem?.[moduleDataRes?.compProps?.rowKey] ?\n dataItem?.[moduleDataRes?.compProps?.rowKey] : '';\n loopChilds.push({\n id: dataItemKey,\n key: dataItemKey,\n compType: 'loopItem',\n compProps: {},\n originItem: dataItem,\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: typeof dataItem === 'object' ? dataItem : { item: dataItem },\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n });\n } else if (Array.isArray(children) && children.length > 0) {\n loopChilds.push({\n id: '1',\n key: '1',\n compType: 'loopItem',\n compProps: {},\n originItem: {},\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: {},\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n }\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...loopProps,\n column,\n children: loopChilds,\n };\n }\n if (['list', 'card', 'recommendList'].includes(compType)) {\n const resProps = formatListProps({\n options: {\n ...otherCompProps,\n rowKey,\n rowSelection,\n attrs,\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n },\n urlPrefix,\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...resProps,\n };\n }\n if (['echartBar', 'echartLine'].includes(compType)) {\n const echartProps = formatEchartLineProps({\n options: { ...otherCompProps, dataSource: compDataSource },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n if (compType === 'echartPie') {\n const echartProps = formatEchartPieProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n }\n moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);\n // 所有的模版 拼一个组装数据的key值\n if (moduleData?.compProps && fieldName) {\n moduleDataRes.compProps.fieldName = fieldName;\n }\n }\n \n // console.log('moduleDataRes', moduleDataRes);\n return moduleDataRes;\n};\n\nexport default formatModuleData;\n"],"mappings":";;;;;;;;;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AK,WAAW,EAAE;QAC5B,IAAM6E,YAAW,GAAGjG,oBAAoB,CAAC;UACvCuE,OAAO,EAAAzD,aAAA;YACLqB,UAAU,EAAED;UAAc,GACvBW,cAAc,CAClB;UACDtC,UAAU,EAAEM;QACd,CAAC,CAAC;QAEFD,aAAa,CAACO,SAAS,GAAAL,aAAA,CAAAA,aAAA,KACjBF,aAAa,CAACO,SAAS,IAAI,CAAC,CAAC,GAC9B8E,YAAW,CACf;MACH;IACF;IACArF,aAAa,CAACO,SAAS,CAAC+E,KAAK,GAAGpG,gBAAgB,CAACO,UAAU,EAAEC,gBAAgB,CAAC;IAC9E;IACA,IAAID,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEc,SAAS,IAAIsB,SAAS,EAAE;MACtC7B,aAAa,CAACO,SAAS,CAACsB,SAAS,GAAGA,SAAS;IAC/C;EACF;;EAEA;EACA,OAAO7B,aAAa;AACtB,CAAC;AAED,eAAeT,gBAAgB"}
1
+ {"version":3,"names":["getDataArr","urlPrefix","formatListProps","formatTableProps","formatCarouselProps","formatImageProps","formatFormProps","formatHighCodeProps","formatDescriptionsProps","formatLoopProps","formatStyleProps","formatEchartLineProps","formatEchartPieProps","formatStepsProps","staticCodeAssemble","stringPramarsValTransition","formatModuleData","_ref","moduleData","parentModuleData","parameters","loopItemData","staticCodeList","disabled","pageData","moduleDataRes","allParametrs","_objectSpread","loopItem","_staticCodeAssemble","staticCodeMap","staticOptionsMap","compProps","compType","children","moduleTitle","moduleDescribe","id","key","originModule","_ref2","listItemLabel","itemLabel","listItemContent","itemContent","listItemDescribe","itemDescribe","compDataSource","dataSource","compColumns","columns","tableBodyHeight","fileProps","attrs","rowSelection","hasSelectAll","rowKey","fieldName","column","articleContent","eventFlag","otherCompProps","_objectWithoutProperties","_excluded","title","checked","parentCompProps","indexOf","Array","isArray","length","childs","map","item","_Object$keys","Object","keys","forEach","compPropKey","type","rowKeyIndexArr","_rowKeyIndexArr$slice","slice","url","dataType","_moduleDataRes","carouselProps","options","_moduleDataRes2","imageProps","_moduleDataRes3","highCodeCompProps","_moduleDataRes4","tableProps","_moduleDataRes5","formProps","_moduleDataRes6","descriptionsProps","_loopProps$dataSource","_moduleDataRes10","loopProps","loopChilds","dataItem","_moduleDataRes7","_moduleDataRes8","_moduleDataRes9","dataItemKey","push","originItem","loopChildInfo","_typeof","includes","resProps","echartProps","stepsProps","style"],"sources":["../../../src/formatModule/formatModuleData.ts"],"sourcesContent":["import 'ses';\nimport { getDataArr } from '../treeUtils';\nimport {\n urlPrefix,\n formatListProps,\n formatTableProps,\n formatCarouselProps,\n formatImageProps,\n formatFormProps,\n formatHighCodeProps,\n formatDescriptionsProps,\n formatLoopProps,\n formatStyleProps,\n formatEchartLineProps,\n formatEchartPieProps,\n formatStepsProps,\n staticCodeAssemble,\n stringPramarsValTransition,\n} from './helpers';\n\ntype formatModuleProps = {\n moduleData: { [key: string]: any } | null; // 页面配置数据\n parentModuleData?: { [key: string]: any } | null; // 父级配置数据\n pageData?: { [key: string]: any } | null; // 页面组件数据\n parameters?: any; // 入参上下文\n loopItemData?: any; // 循环体数据\n staticCodeList?: { [key: string]: any } | null; // 静态资源数据\n disabled?: boolean;\n};\n\nconst formatModuleData = ({\n moduleData,\n parentModuleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n}: formatModuleProps): { [key: string]: any } | null => {\n let moduleDataRes: { [key: string]: any } = { };\n const allParametrs:{ [key: string]: any } = {\n ...(parameters || {}),\n pageData: pageData || {},\n loopItem: loopItemData || {},\n }; // 把页面数据与入参组装到一起\n const {\n staticCodeMap,\n staticOptionsMap,\n } = staticCodeAssemble(staticCodeList);\n\n if (moduleData) {\n const {\n compProps,\n compType,\n children,\n moduleTitle,\n moduleDescribe,\n id,\n } = moduleData;\n // 组装静态数据映射\n moduleDataRes = {\n ...moduleData,\n key: id,\n disabled,\n compProps: {},\n originModule: moduleData, // 配置moduled的信息\n };\n const {\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n columns: compColumns,\n tableBodyHeight,\n fileProps,\n attrs,\n rowSelection,\n hasSelectAll,\n rowKey,\n fieldName,\n column,\n articleContent,\n eventFlag,\n ...otherCompProps // 无需处理的属性\n } = compProps || {};\n if (moduleTitle) {\n moduleDataRes.moduleTitle = stringPramarsValTransition(moduleTitle, allParametrs);\n }\n if (moduleDescribe) {\n moduleDataRes.moduleDescribe = stringPramarsValTransition(moduleDescribe, allParametrs);\n }\n if (otherCompProps?.title) {\n moduleDataRes.compProps.title = stringPramarsValTransition(otherCompProps?.title, allParametrs);\n }\n if (eventFlag) {\n moduleDataRes.compProps.eventFlag = { checked: true };\n }\n \n moduleDataRes.parentCompProps = parentModuleData?.compProps || {};\n if (\n ['panel', 'div', 'page'].indexOf(compType) >= 0 &&\n Array.isArray(children) &&\n children.length > 0\n ) {\n const childs = children.map((item) => {\n return formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n parameters,\n loopItemData,\n staticCodeList,\n disabled,\n pageData,\n });\n });\n moduleDataRes.children = childs;\n } else {\n if (otherCompProps && Object?.keys(otherCompProps)?.length > 0) {\n Object?.keys(otherCompProps).forEach(compPropKey => {\n if (otherCompProps?.[compPropKey] || typeof otherCompProps?.[compPropKey] === 'number') {\n moduleDataRes.compProps[compPropKey] = otherCompProps?.[compPropKey];\n }\n });\n }\n if (rowSelection) {\n moduleDataRes.compProps.rowSelection = rowSelection;\n if (hasSelectAll && rowSelection?.type === 'checkbox') {\n moduleDataRes.compProps.hasSelectAll = hasSelectAll;\n } else {\n delete moduleDataRes.compProps.hasSelectAll;\n }\n }\n const rowKeyIndexArr = getDataArr(rowKey);\n\n if (Array.isArray(rowKeyIndexArr) && rowKeyIndexArr.length > 0) {\n moduleDataRes.compProps.rowKey = rowKeyIndexArr.slice(-1)?.[0];\n }\n\n if (compType === 'typography') {\n if (articleContent) {\n moduleDataRes.compProps.articleContent = stringPramarsValTransition(articleContent, allParametrs);\n }\n }\n if (compType === 'iframe') {\n moduleDataRes.compProps.url = stringPramarsValTransition(\n otherCompProps?.url,\n allParametrs,\n );\n }\n\n if (compType === 'carousel' && compDataSource && compDataSource?.dataType) {\n const carouselProps = formatCarouselProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...carouselProps,\n };\n }\n if (compType === 'image' && compDataSource && compDataSource?.dataType) {\n const imageProps = formatImageProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...imageProps,\n };\n }\n\n if (compType === 'highCodeComp') {\n const highCodeCompProps = formatHighCodeProps({\n options: { fileProps },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...highCodeCompProps,\n };\n }\n\n if (compType === 'table') {\n const tableProps = formatTableProps({\n options: {\n ...otherCompProps,\n columns: compColumns,\n dataSource: compDataSource,\n attrs,\n tableBodyHeight,\n },\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...tableProps,\n };\n }\n if (compType === 'form') {\n const formProps = formatFormProps({\n options: {\n column,\n children,\n },\n parameters: allParametrs,\n staticCodeMap,\n staticOptionsMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...formProps,\n };\n }\n if (compType === 'descriptions') {\n const descriptionsProps = formatDescriptionsProps({\n options: {\n column,\n attrs,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...descriptionsProps,\n };\n }\n if (compType === 'loop') {\n const loopProps = formatLoopProps({\n options: {\n dataSource: compDataSource,\n },\n parameters: allParametrs,\n staticCodeMap,\n });\n const loopChilds:({[key:string]:any}|null)[] = [];\n if (\n Array.isArray(loopProps?.dataSource) && loopProps?.dataSource?.length > 0 &&\n Array.isArray(children) && children.length > 0\n ) {\n loopProps?.dataSource.forEach((dataItem) => {\n const dataItemKey = moduleDataRes?.compProps?.rowKey && dataItem?.[moduleDataRes?.compProps?.rowKey] ?\n dataItem?.[moduleDataRes?.compProps?.rowKey] : '';\n loopChilds.push({\n id: dataItemKey,\n key: dataItemKey,\n compType: 'loopItem',\n compProps: {},\n originItem: dataItem,\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: typeof dataItem === 'object' ? dataItem : { item: dataItem },\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n });\n } else if (Array.isArray(children) && children.length > 0) {\n loopChilds.push({\n id: '1',\n key: '1',\n compType: 'loopItem',\n compProps: {},\n originItem: {},\n children: children.map((item:{[key:string]:any}) => {\n const loopChildInfo = formatModuleData({\n moduleData: item,\n parentModuleData: moduleData,\n loopItemData: {},\n parameters,\n staticCodeList,\n disabled,\n pageData,\n });\n return loopChildInfo;\n }),\n });\n }\n moduleDataRes.compProps = {\n ...(moduleDataRes?.compProps || {}),\n ...loopProps,\n column,\n children: loopChilds,\n };\n }\n if (['list', 'card', 'recommendList'].includes(compType)) {\n const resProps = formatListProps({\n options: {\n ...otherCompProps,\n rowKey,\n rowSelection,\n attrs,\n itemLabel: listItemLabel,\n itemContent: listItemContent,\n itemDescribe: listItemDescribe,\n dataSource: compDataSource,\n },\n urlPrefix,\n staticCodeMap,\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...resProps,\n };\n }\n if (['echartBar', 'echartLine'].includes(compType)) {\n const echartProps = formatEchartLineProps({\n options: { ...otherCompProps, dataSource: compDataSource },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n if (compType === 'echartPie') {\n const echartProps = formatEchartPieProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...echartProps,\n };\n }\n }\n if (compType === 'steps') {\n const stepsProps = formatStepsProps({\n options: {\n dataSource: compDataSource,\n ...otherCompProps,\n },\n parameters: allParametrs,\n });\n moduleDataRes.compProps = {\n ...(moduleDataRes.compProps || {}),\n ...stepsProps,\n };\n }\n moduleDataRes.compProps.style = formatStyleProps(moduleData, parentModuleData);\n // 所有的模版 拼一个组装数据的key值\n if (moduleData?.compProps && fieldName) {\n moduleDataRes.compProps.fieldName = fieldName;\n }\n }\n \n // console.log('moduleDataRes', moduleDataRes);\n return moduleDataRes;\n};\n\nexport default formatModuleData;\n"],"mappings":";;;;;;;;;AAAA,OAAO,KAAK;AACZ,SAASA,UAAU;AACnB,SACEC,SAAS,EACTC,eAAe,EACfC,gBAAgB,EAChBC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,mBAAmB,EACnBC,uBAAuB,EACvBC,eAAe,EACfC,gBAAgB,EAChBC,qBAAqB,EACrBC,oBAAoB,EACpBC,gBAAgB,EAChBC,kBAAkB,EAClBC,0BAA0B;AAa5B,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAQkC;EAAA,IAPtDC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,gBAAgB,GAAAF,IAAA,CAAhBE,gBAAgB;IAChBC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,cAAc,GAAAL,IAAA,CAAdK,cAAc;IACdC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;EAER,IAAIC,aAAqC,GAAG,CAAE,CAAC;EAC/C,IAAMC,YAAmC,GAAAC,aAAA,CAAAA,aAAA,KACnCP,UAAU,IAAI,CAAC,CAAC;IACpBI,QAAQ,EAAEA,QAAQ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CAAC,CAAC,GAC9BkF,UAAU,CACd;IACH;IACAzF,aAAa,CAACO,SAAS,CAACmF,KAAK,GAAGzG,gBAAgB,CAACQ,UAAU,EAAEC,gBAAgB,CAAC;IAC9E;IACA,IAAID,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEc,SAAS,IAAIyB,SAAS,EAAE;MACtChC,aAAa,CAACO,SAAS,CAACyB,SAAS,GAAGA,SAAS;IAC/C;EACF;;EAEA;EACA,OAAOhC,aAAa;AACtB,CAAC;AAED,eAAeT,gBAAgB"}
@@ -86,30 +86,23 @@ var formatFormProps = function formatFormProps(_ref) {
86
86
  delete formItem.formProps.extend;
87
87
  }
88
88
  if ((attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType) === 'table') {
89
- var _attrItem$compProps, _attrItem$compProps2, _attrItem$compProps3, _attrItem$compProps4, _attrItem$compProps5, _attrItem$compProps6, _attrItem$compProps7;
90
- var _formatTableProps = formatTableProps({
91
- options: {
92
- attrs: attrItem === null || attrItem === void 0 || (_attrItem$compProps = attrItem.compProps) === null || _attrItem$compProps === void 0 ? void 0 : _attrItem$compProps.attrs,
93
- dataSource: attrItem === null || attrItem === void 0 || (_attrItem$compProps2 = attrItem.compProps) === null || _attrItem$compProps2 === void 0 ? void 0 : _attrItem$compProps2.dataSource
94
- },
95
- staticCodeMap: staticCodeMap,
96
- parameters: parameters
97
- }),
98
- columns = _formatTableProps.columns,
99
- dataSource = _formatTableProps.dataSource;
100
- var rowKeys = getDataArr(attrItem === null || attrItem === void 0 || (_attrItem$compProps3 = attrItem.compProps) === null || _attrItem$compProps3 === void 0 ? void 0 : _attrItem$compProps3.rowKey);
101
- formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
102
- columns: columns,
103
- dataSource: dataSource,
89
+ var _attrItem$compProps, _attrItem$compProps2, _attrItem$compProps3, _attrItem$compProps4, _attrItem$compProps5;
90
+ var tableProps = formatTableProps({
91
+ options: attrItem === null || attrItem === void 0 ? void 0 : attrItem.compProps,
92
+ staticCodeMap: staticCodeMap,
93
+ parameters: parameters
94
+ });
95
+ var rowKeys = getDataArr(attrItem === null || attrItem === void 0 || (_attrItem$compProps = attrItem.compProps) === null || _attrItem$compProps === void 0 ? void 0 : _attrItem$compProps.rowKey);
96
+ formItem.props = _objectSpread(_objectSpread(_objectSpread({}, formItem.props), tableProps), {}, {
104
97
  rowKey: (rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys.length) > 0 ? rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys[(rowKeys === null || rowKeys === void 0 ? void 0 : rowKeys.length) - 1] : 'key',
105
- hasSelectAll: attrItem !== null && attrItem !== void 0 && (_attrItem$compProps4 = attrItem.compProps) !== null && _attrItem$compProps4 !== void 0 && _attrItem$compProps4.rowSelection && attrItem !== null && attrItem !== void 0 && (_attrItem$compProps5 = attrItem.compProps) !== null && _attrItem$compProps5 !== void 0 && _attrItem$compProps5.hasSelectAll ? attrItem === null || attrItem === void 0 || (_attrItem$compProps6 = attrItem.compProps) === null || _attrItem$compProps6 === void 0 ? void 0 : _attrItem$compProps6.hasSelectAll : null,
106
- rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$compProps7 = attrItem.compProps) === null || _attrItem$compProps7 === void 0 ? void 0 : _attrItem$compProps7.rowSelection) || {
98
+ hasSelectAll: attrItem !== null && attrItem !== void 0 && (_attrItem$compProps2 = attrItem.compProps) !== null && _attrItem$compProps2 !== void 0 && _attrItem$compProps2.rowSelection && attrItem !== null && attrItem !== void 0 && (_attrItem$compProps3 = attrItem.compProps) !== null && _attrItem$compProps3 !== void 0 && _attrItem$compProps3.hasSelectAll ? attrItem === null || attrItem === void 0 || (_attrItem$compProps4 = attrItem.compProps) === null || _attrItem$compProps4 === void 0 ? void 0 : _attrItem$compProps4.hasSelectAll : null,
99
+ rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$compProps5 = attrItem.compProps) === null || _attrItem$compProps5 === void 0 ? void 0 : _attrItem$compProps5.rowSelection) || {
107
100
  type: 'radio'
108
101
  }
109
102
  });
110
103
  }
111
104
  if (['list', 'card'].includes(attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType)) {
112
- var _attrItem$compProps8;
105
+ var _attrItem$compProps6;
113
106
  var resProps = formatListProps({
114
107
  options: attrItem === null || attrItem === void 0 ? void 0 : attrItem.compProps,
115
108
  staticCodeMap: staticCodeMap,
@@ -117,35 +110,35 @@ var formatFormProps = function formatFormProps(_ref) {
117
110
  urlPrefix: urlPrefix
118
111
  });
119
112
  formItem.props = _objectSpread(_objectSpread({}, resProps), {}, {
120
- rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$compProps8 = attrItem.compProps) === null || _attrItem$compProps8 === void 0 ? void 0 : _attrItem$compProps8.rowSelection) || {
113
+ rowSelection: (attrItem === null || attrItem === void 0 || (_attrItem$compProps6 = attrItem.compProps) === null || _attrItem$compProps6 === void 0 ? void 0 : _attrItem$compProps6.rowSelection) || {
121
114
  type: 'radio'
122
115
  }
123
116
  });
124
117
  }
125
118
  if ((attrItem === null || attrItem === void 0 ? void 0 : attrItem.compType) === 'upload') {
126
- var _attrItem$compProps9, _Object$keys, _attrItem$compProps10, _attrItem$compProps15, _attrItem$compProps16;
127
- if (attrItem !== null && attrItem !== void 0 && (_attrItem$compProps9 = attrItem.compProps) !== null && _attrItem$compProps9 !== void 0 && _attrItem$compProps9.data && ((_Object$keys = Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$compProps10 = attrItem.compProps) === null || _attrItem$compProps10 === void 0 ? void 0 : _attrItem$compProps10.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
128
- var _attrItem$compProps11;
119
+ var _attrItem$compProps7, _Object$keys, _attrItem$compProps8, _attrItem$compProps13, _attrItem$compProps14;
120
+ if (attrItem !== null && attrItem !== void 0 && (_attrItem$compProps7 = attrItem.compProps) !== null && _attrItem$compProps7 !== void 0 && _attrItem$compProps7.data && ((_Object$keys = Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$compProps8 = attrItem.compProps) === null || _attrItem$compProps8 === void 0 ? void 0 : _attrItem$compProps8.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
121
+ var _attrItem$compProps9;
129
122
  var uploadDataParams = {};
130
- Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$compProps11 = attrItem.compProps) === null || _attrItem$compProps11 === void 0 ? void 0 : _attrItem$compProps11.data).forEach(function (paramsName) {
131
- var _attrItem$compProps12;
132
- if (/\$\{(.+?)\}/g.test(attrItem === null || attrItem === void 0 || (_attrItem$compProps12 = attrItem.compProps) === null || _attrItem$compProps12 === void 0 || (_attrItem$compProps12 = _attrItem$compProps12.data) === null || _attrItem$compProps12 === void 0 ? void 0 : _attrItem$compProps12[paramsName])) {
133
- var _attrItem$compProps13;
123
+ Object.keys(attrItem === null || attrItem === void 0 || (_attrItem$compProps9 = attrItem.compProps) === null || _attrItem$compProps9 === void 0 ? void 0 : _attrItem$compProps9.data).forEach(function (paramsName) {
124
+ var _attrItem$compProps10;
125
+ if (/\$\{(.+?)\}/g.test(attrItem === null || attrItem === void 0 || (_attrItem$compProps10 = attrItem.compProps) === null || _attrItem$compProps10 === void 0 || (_attrItem$compProps10 = _attrItem$compProps10.data) === null || _attrItem$compProps10 === void 0 ? void 0 : _attrItem$compProps10[paramsName])) {
126
+ var _attrItem$compProps11;
134
127
  // const valParamArr = getDataArr(attrItem?.compProps?.data?.[paramsName]);
135
- uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem === null || attrItem === void 0 || (_attrItem$compProps13 = attrItem.compProps) === null || _attrItem$compProps13 === void 0 || (_attrItem$compProps13 = _attrItem$compProps13.data) === null || _attrItem$compProps13 === void 0 ? void 0 : _attrItem$compProps13[paramsName], parameters);
128
+ uploadDataParams[paramsName] = getParamsContentByParamKeys(attrItem === null || attrItem === void 0 || (_attrItem$compProps11 = attrItem.compProps) === null || _attrItem$compProps11 === void 0 || (_attrItem$compProps11 = _attrItem$compProps11.data) === null || _attrItem$compProps11 === void 0 ? void 0 : _attrItem$compProps11[paramsName], parameters);
136
129
  } else {
137
- var _attrItem$compProps14;
138
- uploadDataParams[paramsName] = attrItem === null || attrItem === void 0 || (_attrItem$compProps14 = attrItem.compProps) === null || _attrItem$compProps14 === void 0 || (_attrItem$compProps14 = _attrItem$compProps14.data) === null || _attrItem$compProps14 === void 0 ? void 0 : _attrItem$compProps14[paramsName];
130
+ var _attrItem$compProps12;
131
+ uploadDataParams[paramsName] = attrItem === null || attrItem === void 0 || (_attrItem$compProps12 = attrItem.compProps) === null || _attrItem$compProps12 === void 0 || (_attrItem$compProps12 = _attrItem$compProps12.data) === null || _attrItem$compProps12 === void 0 ? void 0 : _attrItem$compProps12[paramsName];
139
132
  }
140
133
  });
141
134
  formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
142
135
  data: uploadDataParams
143
136
  });
144
137
  }
145
- if (attrItem !== null && attrItem !== void 0 && (_attrItem$compProps15 = attrItem.compProps) !== null && _attrItem$compProps15 !== void 0 && (_attrItem$compProps15 = _attrItem$compProps15.action) !== null && _attrItem$compProps15 !== void 0 && _attrItem$compProps15.url && typeof (attrItem === null || attrItem === void 0 || (_attrItem$compProps16 = attrItem.compProps) === null || _attrItem$compProps16 === void 0 || (_attrItem$compProps16 = _attrItem$compProps16.action) === null || _attrItem$compProps16 === void 0 ? void 0 : _attrItem$compProps16.url) === 'string') {
146
- var _attrItem$compProps17;
138
+ if (attrItem !== null && attrItem !== void 0 && (_attrItem$compProps13 = attrItem.compProps) !== null && _attrItem$compProps13 !== void 0 && (_attrItem$compProps13 = _attrItem$compProps13.action) !== null && _attrItem$compProps13 !== void 0 && _attrItem$compProps13.url && typeof (attrItem === null || attrItem === void 0 || (_attrItem$compProps14 = attrItem.compProps) === null || _attrItem$compProps14 === void 0 || (_attrItem$compProps14 = _attrItem$compProps14.action) === null || _attrItem$compProps14 === void 0 ? void 0 : _attrItem$compProps14.url) === 'string') {
139
+ var _attrItem$compProps15;
147
140
  formItem.props = _objectSpread(_objectSpread({}, formItem.props), {}, {
148
- action: attrItem === null || attrItem === void 0 || (_attrItem$compProps17 = attrItem.compProps) === null || _attrItem$compProps17 === void 0 || (_attrItem$compProps17 = _attrItem$compProps17.action) === null || _attrItem$compProps17 === void 0 ? void 0 : _attrItem$compProps17.url
141
+ action: attrItem === null || attrItem === void 0 || (_attrItem$compProps15 = attrItem.compProps) === null || _attrItem$compProps15 === void 0 || (_attrItem$compProps15 = _attrItem$compProps15.action) === null || _attrItem$compProps15 === void 0 ? void 0 : _attrItem$compProps15.url
149
142
  });
150
143
  }
151
144
  }