@boteteam/utils 0.0.8 → 0.0.12
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.
- package/dist/cjs/index.d.ts +2 -3
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/file.js +6 -1
- package/dist/esm/file.js.map +1 -1
- package/dist/esm/formatModule/formatModuleData.js +8 -3
- package/dist/esm/formatModule/formatModuleData.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatEchartCommonProps.js +8 -2
- package/dist/esm/formatModule/helpers/formatEchartCommonProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatFormProps.js +14 -3
- package/dist/esm/formatModule/helpers/formatFormProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatHighCodeProps.js +6 -1
- package/dist/esm/formatModule/helpers/formatHighCodeProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatListProps.js +6 -1
- package/dist/esm/formatModule/helpers/formatListProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/formatStyleProps.js +6 -2
- package/dist/esm/formatModule/helpers/formatStyleProps.js.map +1 -1
- package/dist/esm/formatModule/helpers/staticCodeAssemble.js +6 -2
- package/dist/esm/formatModule/helpers/staticCodeAssemble.js.map +1 -1
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pathArgsUtils.js +7 -2
- package/dist/esm/pathArgsUtils.js.map +1 -1
- package/dist/esm/treeUtils.js +3 -1
- package/dist/esm/treeUtils.js.map +1 -1
- package/dist/umd/index.min.js +1 -1
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +2 -4
- package/dist/cjs/sseFetch.d.ts +0 -12
- package/dist/cjs/sseFetch.js +0 -41
- package/dist/cjs/sseFetch.js.map +0 -7
- package/dist/esm/sseFetch.d.ts +0 -12
- package/dist/esm/sseFetch.js +0 -34
- package/dist/esm/sseFetch.js.map +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
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); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
3
7
|
import { cloneDeep } from 'lodash';
|
|
4
8
|
var formatStyleProps = function formatStyleProps(props, parentModuleProps) {
|
|
5
9
|
var _Object$keys, _parentModuleProps$co, _compProps$style6, _compProps$style7;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cloneDeep","formatStyleProps","props","parentModuleProps","_Object$keys","_parentModuleProps$co","_compProps$style6","_compProps$style7","cloneProps","_cloneProps$compProps","compProps","_ref","_ref$style","style","alignKey1","includes","alignKey2","alignStyleMap","leftTop","_defineProperty","topCenter","rightTop","leftCenter","center","rightCenter","leftBottom","bottomCenter","rightBottom","styleObj","Object","keys","length","forEach","styleKey","_compProps$style","_compProps$style2","_compProps$style3","_compProps$style4","Array","isArray","join","_compProps$style5","display","width","flex","_compProps$style8","_gridColumns","children","col","_col$compProps","push","gridColumns","_compProps$style9","concat","Math","ceil","_objectSpread","alignMode"],"sources":["../../../../src/formatModule/helpers/formatStyleProps.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\n\nconst formatStyleProps = (props: {[key:string]: any}, parentModuleProps?: {[key:string]: any}|null):{[key:string]: any} => {\n const cloneProps: {[key:string]: any} = props ? cloneDeep(props) : {};\n const { compProps = {} } = cloneProps;\n const { style = {} } = compProps || {};\n\n const alignKey1 = ['column', 'column-reverse'].includes(style?.['flex-direction']) ? 'alignItems' : 'justifyContent';\n const alignKey2 = !style?.['flex-direction'] || ['row', 'row-reverse'].includes(style?.['flex-direction']) ? 'alignItems' : 'justifyContent';\n const alignStyleMap:{[key:string]: {[key:string]: string}} = {\n leftTop: {\n [alignKey1]: 'flex-start',\n [alignKey2]: 'flex-start',\n },\n topCenter: {\n [alignKey1]: 'center',\n [alignKey2]: 'flex-start',\n },\n rightTop: {\n [alignKey1]: 'flex-end',\n [alignKey2]: 'flex-start',\n },\n leftCenter: {\n [alignKey1]: 'flex-start',\n [alignKey2]: 'center',\n },\n center: {\n [alignKey1]: 'center',\n [alignKey2]: 'center',\n },\n rightCenter: {\n [alignKey1]: 'flex-end',\n [alignKey2]: 'center',\n },\n leftBottom: {\n [alignKey1]: 'flex-start',\n [alignKey2]: 'flex-end',\n },\n bottomCenter: {\n [alignKey1]: 'center',\n [alignKey2]: 'flex-end',\n },\n rightBottom: {\n [alignKey1]: 'flex-end',\n [alignKey2]: 'flex-end',\n },\n };\n\n const styleObj:{[key:string]: any} = {};\n if (compProps.style && Object.keys(compProps.style)?.length > 0) {\n Object.keys(compProps.style).forEach(styleKey => {\n if (compProps.style?.[styleKey]) {\n if (['padding', 'margin'].includes(styleKey)) {\n styleObj[styleKey] = Array.isArray(compProps.style?.[styleKey]) ?\n compProps.style?.[styleKey].join(' ') : compProps.style?.[styleKey];\n } else if (!['gridColumns', 'alignMode'].includes(styleKey)) {\n styleObj[styleKey] = compProps.style?.[styleKey];\n }\n }\n });\n }\n\n if (parentModuleProps?.compProps?.style?.display === 'flex' && !compProps.style?.width) {\n styleObj.flex = '1';\n } else if (styleObj?.flex) {\n delete styleObj.flex;\n }\n\n if (compProps?.style?.display === 'grid') {\n const _gridColumns:string[] = [];\n if (Array.isArray(props?.children)) {\n props?.children.forEach((col:any) => {\n if (col?.compProps?.style?.width) {\n _gridColumns.push(col.compProps.style.width);\n } else {\n _gridColumns.push('1fr');\n }\n });\n }\n if (compProps?.style?.gridColumns > 1) {\n styleObj['grid-template-columns'] = `repeat(${compProps.style.gridColumns}, minmax(0, ${Math.ceil(100 / compProps?.style?.gridColumns)}%))`;\n } else if (_gridColumns?.length > 0) {\n styleObj['grid-template-columns'] = `${_gridColumns.join(' ')}`;\n } else if (compProps.style.gridColumns > 1) {\n styleObj['grid-template-columns'] = `repeat(${compProps.style.gridColumns}, 1fr)`;\n }\n } else if (styleObj['grid-template-columns']) {\n delete styleObj['grid-template-columns'];\n }\n \n return {\n ...styleObj,\n ...(alignStyleMap[style?.alignMode] || {}),\n };\n};\n\nexport default formatStyleProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["cloneDeep","formatStyleProps","props","parentModuleProps","_Object$keys","_parentModuleProps$co","_compProps$style6","_compProps$style7","cloneProps","_cloneProps$compProps","compProps","_ref","_ref$style","style","alignKey1","includes","alignKey2","alignStyleMap","leftTop","_defineProperty","topCenter","rightTop","leftCenter","center","rightCenter","leftBottom","bottomCenter","rightBottom","styleObj","Object","keys","length","forEach","styleKey","_compProps$style","_compProps$style2","_compProps$style3","_compProps$style4","Array","isArray","join","_compProps$style5","display","width","flex","_compProps$style8","_gridColumns","children","col","_col$compProps","push","gridColumns","_compProps$style9","concat","Math","ceil","_objectSpread","alignMode"],"sources":["../../../../src/formatModule/helpers/formatStyleProps.ts"],"sourcesContent":["import { cloneDeep } from 'lodash';\n\nconst formatStyleProps = (props: {[key:string]: any}, parentModuleProps?: {[key:string]: any}|null):{[key:string]: any} => {\n const cloneProps: {[key:string]: any} = props ? cloneDeep(props) : {};\n const { compProps = {} } = cloneProps;\n const { style = {} } = compProps || {};\n\n const alignKey1 = ['column', 'column-reverse'].includes(style?.['flex-direction']) ? 'alignItems' : 'justifyContent';\n const alignKey2 = !style?.['flex-direction'] || ['row', 'row-reverse'].includes(style?.['flex-direction']) ? 'alignItems' : 'justifyContent';\n const alignStyleMap:{[key:string]: {[key:string]: string}} = {\n leftTop: {\n [alignKey1]: 'flex-start',\n [alignKey2]: 'flex-start',\n },\n topCenter: {\n [alignKey1]: 'center',\n [alignKey2]: 'flex-start',\n },\n rightTop: {\n [alignKey1]: 'flex-end',\n [alignKey2]: 'flex-start',\n },\n leftCenter: {\n [alignKey1]: 'flex-start',\n [alignKey2]: 'center',\n },\n center: {\n [alignKey1]: 'center',\n [alignKey2]: 'center',\n },\n rightCenter: {\n [alignKey1]: 'flex-end',\n [alignKey2]: 'center',\n },\n leftBottom: {\n [alignKey1]: 'flex-start',\n [alignKey2]: 'flex-end',\n },\n bottomCenter: {\n [alignKey1]: 'center',\n [alignKey2]: 'flex-end',\n },\n rightBottom: {\n [alignKey1]: 'flex-end',\n [alignKey2]: 'flex-end',\n },\n };\n\n const styleObj:{[key:string]: any} = {};\n if (compProps.style && Object.keys(compProps.style)?.length > 0) {\n Object.keys(compProps.style).forEach(styleKey => {\n if (compProps.style?.[styleKey]) {\n if (['padding', 'margin'].includes(styleKey)) {\n styleObj[styleKey] = Array.isArray(compProps.style?.[styleKey]) ?\n compProps.style?.[styleKey].join(' ') : compProps.style?.[styleKey];\n } else if (!['gridColumns', 'alignMode'].includes(styleKey)) {\n styleObj[styleKey] = compProps.style?.[styleKey];\n }\n }\n });\n }\n\n if (parentModuleProps?.compProps?.style?.display === 'flex' && !compProps.style?.width) {\n styleObj.flex = '1';\n } else if (styleObj?.flex) {\n delete styleObj.flex;\n }\n\n if (compProps?.style?.display === 'grid') {\n const _gridColumns:string[] = [];\n if (Array.isArray(props?.children)) {\n props?.children.forEach((col:any) => {\n if (col?.compProps?.style?.width) {\n _gridColumns.push(col.compProps.style.width);\n } else {\n _gridColumns.push('1fr');\n }\n });\n }\n if (compProps?.style?.gridColumns > 1) {\n styleObj['grid-template-columns'] = `repeat(${compProps.style.gridColumns}, minmax(0, ${Math.ceil(100 / compProps?.style?.gridColumns)}%))`;\n } else if (_gridColumns?.length > 0) {\n styleObj['grid-template-columns'] = `${_gridColumns.join(' ')}`;\n } else if (compProps.style.gridColumns > 1) {\n styleObj['grid-template-columns'] = `repeat(${compProps.style.gridColumns}, 1fr)`;\n }\n } else if (styleObj['grid-template-columns']) {\n delete styleObj['grid-template-columns'];\n }\n \n return {\n ...styleObj,\n ...(alignStyleMap[style?.alignMode] || {}),\n };\n};\n\nexport default formatStyleProps;\n"],"mappings":";;;;;;AAAA,SAASA,SAAS,QAAQ,QAAQ;AAElC,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,KAA0B,EAAEC,iBAA4C,EAAyB;EAAA,IAAAC,YAAA,EAAAC,qBAAA,EAAAC,iBAAA,EAAAC,iBAAA;EACzH,IAAMC,UAA+B,GAAGN,KAAK,GAAGF,SAAS,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC;EACrE,IAAAO,qBAAA,GAA2BD,UAAU,CAA7BE,SAAS;IAATA,SAAS,GAAAD,qBAAA,cAAG,CAAC,CAAC,GAAAA,qBAAA;EACtB,IAAAE,IAAA,GAAuBD,SAAS,IAAI,CAAC,CAAC;IAAAE,UAAA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@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
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); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
3
7
|
/**
|
|
4
8
|
* 拼装静态数据键值对
|
|
5
9
|
* @param staticCodeList 静态数据列表
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["staticCodeAssemble","staticCodeList","staticCodeMap","staticOptionsMap","Object","keys","forEach","codeKey","objMap","loopStaticData","staticItems","staticOpts","Array","isArray","length","codeItem","attrValue","attrValueName","staticOptItem","value","label","attrCode","_objectSpread","_defineProperty","attrRelList","children","push"],"sources":["../../../../src/formatModule/helpers/staticCodeAssemble.ts"],"sourcesContent":["/**\n * 拼装静态数据键值对\n * @param staticCodeList 静态数据列表\n * @returns\n */\n\nconst staticCodeAssemble = (staticCodeList?:{[key:string]:any}|null):{\n staticCodeMap: { [key: string]: any },\n staticOptionsMap: { [key: string]: any }\n} => {\n const staticCodeMap: { [key: string]: any } = {};\n const staticOptionsMap: { [key: string]: any } = {};\n if (staticCodeList) {\n Object.keys(staticCodeList).forEach((codeKey) => {\n const objMap: { [key: string]: any } = {};\n\n const loopStaticData = (staticItems:{[key:string]: any}[]) => {\n const staticOpts:{ [key: string]: any }[] = [];\n if (Array.isArray(staticItems) && staticItems.length > 0) {\n staticItems.forEach((codeItem: any) => {\n objMap[codeItem?.attrValue] = codeItem?.attrValueName;\n const staticOptItem:{[key:string]: any} = {\n value: codeItem?.attrValue,\n label: codeItem?.attrValueName,\n };\n staticCodeMap[codeItem?.attrCode] = {\n ...staticCodeMap[codeItem?.attrCode],\n [codeItem?.attrValue]: codeItem?.attrValueName,\n };\n if (Array.isArray(codeItem?.attrRelList) && codeItem?.attrRelList.length > 0) {\n staticOptItem.children = loopStaticData(codeItem?.attrRelList);\n }\n staticOpts.push(staticOptItem);\n });\n }\n return staticOpts;\n };\n staticOptionsMap[codeKey] = loopStaticData(staticCodeList?.[codeKey]);\n });\n }\n\n return {\n staticCodeMap,\n staticOptionsMap,\n };\n};\n\n\nexport default staticCodeAssemble;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["staticCodeAssemble","staticCodeList","staticCodeMap","staticOptionsMap","Object","keys","forEach","codeKey","objMap","loopStaticData","staticItems","staticOpts","Array","isArray","length","codeItem","attrValue","attrValueName","staticOptItem","value","label","attrCode","_objectSpread","_defineProperty","attrRelList","children","push"],"sources":["../../../../src/formatModule/helpers/staticCodeAssemble.ts"],"sourcesContent":["/**\n * 拼装静态数据键值对\n * @param staticCodeList 静态数据列表\n * @returns\n */\n\nconst staticCodeAssemble = (staticCodeList?:{[key:string]:any}|null):{\n staticCodeMap: { [key: string]: any },\n staticOptionsMap: { [key: string]: any }\n} => {\n const staticCodeMap: { [key: string]: any } = {};\n const staticOptionsMap: { [key: string]: any } = {};\n if (staticCodeList) {\n Object.keys(staticCodeList).forEach((codeKey) => {\n const objMap: { [key: string]: any } = {};\n\n const loopStaticData = (staticItems:{[key:string]: any}[]) => {\n const staticOpts:{ [key: string]: any }[] = [];\n if (Array.isArray(staticItems) && staticItems.length > 0) {\n staticItems.forEach((codeItem: any) => {\n objMap[codeItem?.attrValue] = codeItem?.attrValueName;\n const staticOptItem:{[key:string]: any} = {\n value: codeItem?.attrValue,\n label: codeItem?.attrValueName,\n };\n staticCodeMap[codeItem?.attrCode] = {\n ...staticCodeMap[codeItem?.attrCode],\n [codeItem?.attrValue]: codeItem?.attrValueName,\n };\n if (Array.isArray(codeItem?.attrRelList) && codeItem?.attrRelList.length > 0) {\n staticOptItem.children = loopStaticData(codeItem?.attrRelList);\n }\n staticOpts.push(staticOptItem);\n });\n }\n return staticOpts;\n };\n staticOptionsMap[codeKey] = loopStaticData(staticCodeList?.[codeKey]);\n });\n }\n\n return {\n staticCodeMap,\n staticOptionsMap,\n };\n};\n\n\nexport default staticCodeAssemble;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,cAAuC,EAG9D;EACH,IAAMC,aAAqC,GAAG,CAAC,CAAC;EAChD,IAAMC,gBAAwC,GAAG,CAAC,CAAC;EACnD,IAAIF,cAAc,EAAE;IAClBG,MAAM,CAACC,IAAI,CAACJ,cAAc,CAAC,CAACK,OAAO,CAAC,UAACC,OAAO,EAAK;MAC/C,IAAMC,MAA8B,GAAG,CAAC,CAAC;MAEzC,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAI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CAACR,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAGM,OAAO,CAAC,CAAC;IACvE,CAAC,CAAC;EACJ;EAEA,OAAO;IACLL,aAAa,EAAbA,aAAa;IACbC,gBAAgB,EAAhBA;EACF,CAAC;AACH,CAAC;AAGD,eAAeH,kBAAkB"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import fileToBase64, { type fileToBase64Type } from './fileToBase64';
|
|
|
2
2
|
import CookieUtils from './CookieUtils';
|
|
3
3
|
import { argsToString, argsToObject, getSearchObj } from './pathArgsUtils';
|
|
4
4
|
import { asyncLocalStorage, asyncSessionStorage, type asyncLocalStorageType, type asyncSessionStorageType } from './asyncStorage';
|
|
5
|
-
import sseFetch, { type sseFetchOptionsProps } from './sseFetch';
|
|
6
5
|
import { camelToSnake, underscoreToCamelCase, generateRandom18Int } from './stringUtils';
|
|
7
6
|
import { getDataArr, replaceParamsValue, getParamsContentByParamKeys, replaceParamsValueForEvent } from './treeUtils';
|
|
8
7
|
import formatModuleData from './formatModule/formatModuleData';
|
|
@@ -10,5 +9,5 @@ import { patternTransitionRegExp, stringPramarsValTransition, stringScriptExecut
|
|
|
10
9
|
import loopPageStaticCodeMap from './loopPageStaticCodeMap';
|
|
11
10
|
import scriptExecution, { type scriptExecutionType } from './scriptExecution';
|
|
12
11
|
import { getFileUrlById, getRemoteComponentUrlByCode, getRemoteComponentUrlById } from './file';
|
|
13
|
-
export type { fileToBase64Type, asyncLocalStorageType, asyncSessionStorageType,
|
|
14
|
-
export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage,
|
|
12
|
+
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, };
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import fileToBase64 from "./fileToBase64";
|
|
|
2
2
|
import CookieUtils from "./CookieUtils";
|
|
3
3
|
import { argsToString, argsToObject, getSearchObj } from "./pathArgsUtils";
|
|
4
4
|
import { asyncLocalStorage, asyncSessionStorage } from "./asyncStorage";
|
|
5
|
-
import sseFetch from "./sseFetch";
|
|
6
5
|
import { camelToSnake, underscoreToCamelCase, generateRandom18Int } from "./stringUtils";
|
|
7
6
|
import { getDataArr, replaceParamsValue, getParamsContentByParamKeys, replaceParamsValueForEvent } from "./treeUtils";
|
|
8
7
|
import formatModuleData from "./formatModule/formatModuleData";
|
|
@@ -14,5 +13,5 @@ import { getFileUrlById, getRemoteComponentUrlByCode, getRemoteComponentUrlById
|
|
|
14
13
|
// 避免 _对象 和其他库冲突
|
|
15
14
|
var _ = require('lodash');
|
|
16
15
|
_.noConflict();
|
|
17
|
-
export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage,
|
|
16
|
+
export { fileToBase64, CookieUtils, argsToString, argsToObject, getSearchObj, asyncLocalStorage, asyncSessionStorage, camelToSnake, underscoreToCamelCase, generateRandom18Int, formatModuleData, patternTransitionRegExp, stringPramarsValTransition, loopPageStaticCodeMap, getDataArr, replaceParamsValue, replaceParamsValueForEvent, getParamsContentByParamKeys, getFileUrlById, getRemoteComponentUrlByCode, getRemoteComponentUrlById, stringScriptExecution, scriptExecution };
|
|
18
17
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fileToBase64","CookieUtils","argsToString","argsToObject","getSearchObj","asyncLocalStorage","asyncSessionStorage","
|
|
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","getRemoteComponentUrlByCode","getRemoteComponentUrlById","_","require","noConflict"],"sources":["../../src/index.ts"],"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"],"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,2BAA2B,EAC3BC,yBAAyB;;AAI3B;AACA,IAAMC,CAAC,GAAGC,OAAO,CAAC,QAAQ,CAAC;AAE3BD,CAAC,CAACE,UAAU,CAAC,CAAC;AASd,SACEzB,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,2BAA2B,EAC3BC,yBAAyB,EACzBL,qBAAqB,EACrBE,eAAe"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
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
8
|
/**
|
|
4
9
|
* 对象参数转字符串
|
|
5
10
|
* @param params
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["argsToString","params","paramsAttr","Array","isArray","_typeof","Object","keys","length","forEach","item","push","concat","join","_unused","argsToObject","res","_params","paramsArr","startsWith","slice","split","itemArr","key","value","getSearchObj","url","arguments","undefined","window","location","href","urlArr","search","pop","objs","obj","_value$split","_value$split2","_slicedToArray","k","v","decodeURIComponent"],"sources":["../../src/pathArgsUtils.ts"],"sourcesContent":["/**\n * 对象参数转字符串\n * @param params\n * @returns\n */\nconst argsToString = (params: { [key: string]: any }) => {\n const paramsAttr: string[] = [];\n try {\n if (\n params &&\n !Array.isArray(params) &&\n typeof params === 'object' &&\n Object.keys(params).length > 0\n ) {\n Object.keys(params).forEach((item: string) => {\n paramsAttr.push(`${item}=${params[item]}`);\n });\n return paramsAttr?.join('&') as string;\n }\n return '';\n } catch {\n return '';\n }\n};\n\n/**\n * 路径参数转对象\n * @param params\n * @returns\n */\nconst argsToObject = (params: string) => {\n const res: { [key: string]: any } = {};\n const _params = typeof params === 'string' && params ? params : '';\n const paramsArr = _params.startsWith('?') ? _params.slice(1).split('&') : _params.split('&');\n paramsArr.forEach((item: string) => {\n const itemArr: any[] = item.split('=');\n const key = itemArr[0];\n let value = itemArr[1];\n switch (value) {\n case 'false':\n value = false;\n break;\n case 'true':\n value = true;\n break;\n case 'undefined':\n case 'null':\n value = '';\n break;\n default:\n break;\n }\n res[key] = value;\n });\n return res as { [key: string]: any };\n};\n\nconst getSearchObj = (url: string = window.location.href) => {\n const urlArr = url.split('?');\n if (urlArr.length === 1) return {};\n const search = urlArr.pop();\n const objs = search ? search.split('&') : [];\n const obj: { [key: string]: any } = {};\n\n objs.forEach((value) => {\n const [k, v] = value.split('=');\n if (v) {\n obj[decodeURIComponent(k)] = decodeURIComponent(v);\n }\n });\n\n return obj as any;\n};\n\nexport { argsToString, argsToObject, getSearchObj };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["argsToString","params","paramsAttr","Array","isArray","_typeof","Object","keys","length","forEach","item","push","concat","join","_unused","argsToObject","res","_params","paramsArr","startsWith","slice","split","itemArr","key","value","getSearchObj","url","arguments","undefined","window","location","href","urlArr","search","pop","objs","obj","_value$split","_value$split2","_slicedToArray","k","v","decodeURIComponent"],"sources":["../../src/pathArgsUtils.ts"],"sourcesContent":["/**\n * 对象参数转字符串\n * @param params\n * @returns\n */\nconst argsToString = (params: { [key: string]: any }) => {\n const paramsAttr: string[] = [];\n try {\n if (\n params &&\n !Array.isArray(params) &&\n typeof params === 'object' &&\n Object.keys(params).length > 0\n ) {\n Object.keys(params).forEach((item: string) => {\n paramsAttr.push(`${item}=${params[item]}`);\n });\n return paramsAttr?.join('&') as string;\n }\n return '';\n } catch {\n return '';\n }\n};\n\n/**\n * 路径参数转对象\n * @param params\n * @returns\n */\nconst argsToObject = (params: string) => {\n const res: { [key: string]: any } = {};\n const _params = typeof params === 'string' && params ? params : '';\n const paramsArr = _params.startsWith('?') ? _params.slice(1).split('&') : _params.split('&');\n paramsArr.forEach((item: string) => {\n const itemArr: any[] = item.split('=');\n const key = itemArr[0];\n let value = itemArr[1];\n switch (value) {\n case 'false':\n value = false;\n break;\n case 'true':\n value = true;\n break;\n case 'undefined':\n case 'null':\n value = '';\n break;\n default:\n break;\n }\n res[key] = value;\n });\n return res as { [key: string]: any };\n};\n\nconst getSearchObj = (url: string = window.location.href) => {\n const urlArr = url.split('?');\n if (urlArr.length === 1) return {};\n const search = urlArr.pop();\n const objs = search ? search.split('&') : [];\n const obj: { [key: string]: any } = {};\n\n objs.forEach((value) => {\n const [k, v] = value.split('=');\n if (v) {\n obj[decodeURIComponent(k)] = decodeURIComponent(v);\n }\n });\n\n return obj as any;\n};\n\nexport { argsToString, argsToObject, getSearchObj };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,MAA8B,EAAK;EACvD,IAAMC,UAAoB,GAAG,EAAE;EAC/B,IAAI;IACF,IACED,MAAM,IACN,CAACE,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,IACtBI,OAAA,CAAOJ,MAAM,MAAK,QAAQ,IAC1BK,MAAM,CAACC,IAAI,CAACN,MAAM,CAAC,CAACO,MAAM,GAAG,CAAC,EAC9B;MACAF,MAAM,CAACC,IAAI,CAACN,MAAM,CAAC,CAACQ,OAAO,CAAC,UAACC,IAAY,EAAK;QAC5CR,UAAU,CAACS,IAAI,IAAAC,MAAA,CAAIF,IAAI,OAAAE,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AmB,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAGE,MAAM,CAACC,QAAQ,CAACC,IAAI;EACtD,IAAMC,MAAM,GAAGN,GAAG,CAACL,KAAK,CAAC,GAAG,CAAC;EAC7B,IAAIW,MAAM,CAACxB,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;EAClC,IAAMyB,MAAM,GAAGD,MAAM,CAACE,GAAG,CAAC,CAAC;EAC3B,IAAMC,IAAI,GAAGF,MAAM,GAAGA,MAAM,CAACZ,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;EAC5C,IAAMe,GAA2B,GAAG,CAAC,CAAC;EAEtCD,IAAI,CAAC1B,OAAO,CAAC,UAACe,KAAK,EAAK;IACtB,IAAAa,YAAA,GAAeb,KAAK,CAACH,KAAK,CAAC,GAAG,CAAC;MAAAiB,aAAA,GAAAC,cAAA,CAAAF,YAAA;MAAxBG,CAAC,GAAAF,aAAA;MAAEG,CAAC,GAAAH,aAAA;IACX,IAAIG,CAAC,EAAE;MACLL,GAAG,CAACM,kBAAkB,CAACF,CAAC,CAAC,CAAC,GAAGE,kBAAkB,CAACD,CAAC,CAAC;IACpD;EACF,CAAC,CAAC;EAEF,OAAOL,GAAG;AACZ,CAAC;AAED,SAASpC,YAAY,EAAEe,YAAY,EAAEU,YAAY"}
|
package/dist/esm/treeUtils.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
2
4
|
import { get, cloneDeep } from 'lodash';
|
|
3
5
|
import escapeString from "./markdownEscape";
|
|
4
6
|
export var getDataArr = function getDataArr(content) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["get","cloneDeep","escapeString","getDataArr","content","matchArr","_matchs","_matchArr","escapeRegex","regex","matchs","exec","split","_matchs2","filter","item","idx","includes","loopNodeByParamsPath","paramsArr","data","escape","arguments","length","undefined","Array","isArray","_iterator","_createForOfIteratorHelper","_step","_loop","_nextParamsArr5","keyword","value","dataNode","nextParamsArr","slice","_nextParamsArr","_nextParamsArr3","idxRegex","test","_nextParamsArr2","idxNum","replace","Number","Object","v","map","_nextParamsArr4","_ret","s","n","done","err","e","f","getParamsContentByParamKeys","paramNames","_Object$keys","keys","paramNameList","replaceLoopBodyParamsValue","contentStr","options","_ref","_ref$loopParams","loopParams","_ref$loopSourceArr","loopSourceArr","_ref$loopData","loopData","_ref$parameters","parameters","nowTemp","match","paramsPath","itemKey","filedVal","_parameters","forEach","sourceKey","replaceParamsValue","pararms","nowContent","splitStringWithTemplateLiteral","input","templateRegex","matches","result","Boolean","index","splice","getParamsContentByParamKeysForEvent","_matchs$","replaceParamsValueForEvent","_Object$keys2","valueArr","JSON","stringify","_unused"],"sources":["../../src/treeUtils.ts"],"sourcesContent":["import { get, cloneDeep } from 'lodash';\nimport escapeString from './markdownEscape';\n\nexport const getDataArr = (content: string) => {\n let matchArr:string[] = [];\n if (content && typeof content === 'string') {\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 变量正则表达式,${{xxx}}\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n let matchs = escapeRegex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n } else {\n matchs = regex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n }\n }\n return matchArr?.filter((item, idx) => !(idx === 0 && ['root', 'pageParams'].includes(item)) && !(idx === 1 && ['pageParams'].includes(item))); // 过滤掉第一个root,pageParams\n }\n return matchArr;\n};\n\nconst loopNodeByParamsPath:any = (\n paramsArr:string[],\n data: {[key:string]: any},\n escape:boolean = false\n) => {\n if (Array.isArray(paramsArr) && paramsArr.length > 0) {\n for (const keyword of paramsArr) {\n const dataNode = get(data, keyword);\n let nextParamsArr = paramsArr.slice(1); // 取下一个节点字段\n if (Array.isArray(dataNode)) {\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(nextParamsArr?.[0])) {\n const idxNum = nextParamsArr?.[0].replace(/\\[|\\]/g, '');\n if (dataNode?.[Number(idxNum)] instanceof Object) {\n return loopNodeByParamsPath(nextParamsArr.slice(1), dataNode?.[Number(idxNum)], escape);\n }\n return escape ? escapeString(dataNode?.[Number(idxNum)]) : dataNode?.[Number(idxNum)];\n }\n // 否则或缺中间节点,直接往下取值\n nextParamsArr = nextParamsArr.slice(1);\n if (nextParamsArr?.length >= 1) {\n return dataNode.map((item:any) => {\n // 如果数组节点是对象,则继续递归取值\n if (item instanceof Object && nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, item, escape);\n }\n // 否则直接返回数组值\n return escape ? escapeString(item) : item;\n });\n }\n return dataNode;\n } if (nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, dataNode, escape);\n }\n return escape ? escapeString(dataNode) : dataNode;\n }\n }\n return '';\n};\n\n\nexport const getParamsContentByParamKeys = (paramNames: string, data: {[key:string]: any} = {}) => {\n if (!paramNames || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 匹配${{}}格式的参数,属于需转义内容\n const paramNameList = getDataArr(paramNames);\n return loopNodeByParamsPath(paramNameList, data, escapeRegex.test(paramNames));\n};\n\n// 获取替换循环体内的参数值\nexport const replaceLoopBodyParamsValue = (\n contentStr: string,\n options: {\n loopParams: { [key: string]: any } // 循环体参数\n loopSourceArr: string[], // 循环体数据源\n loopData: {[key: string]: any}[], // 循环数据源数据\n parameters?: {[key: string]: any}, // 全量参数\n staticCodeMap?: {[key: string]: any}, // 静态数据\n },\n) => {\n const {\n loopParams = {},\n loopSourceArr = [],\n loopData = [],\n parameters = {},\n } = options || {};\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && loopParams) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/gi, (match) => {\n const paramsPath = getDataArr(match).filter((itemKey) => !loopSourceArr.includes(itemKey));\n let filedVal:any = '';\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(paramsPath?.[0])) {\n const idxNum = paramsPath?.[0].replace(/\\[|\\]/g, '');\n if (loopData?.[Number(idxNum)] instanceof Object) {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopData?.[Number(idxNum)]);\n } else {\n filedVal = loopData?.[Number(idxNum)] || '';\n }\n } else {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopParams);\n\n // 循环体内查找不到,则从参数中取值,但忽略循环体本身\n if (!filedVal && parameters) {\n const _parameters = cloneDeep(parameters);\n if (Array.isArray(loopSourceArr) && loopSourceArr.length > 0) {\n loopSourceArr.forEach((sourceKey:string) => {\n delete _parameters[sourceKey];\n });\n }\n const paramNameList = getDataArr(match);\n filedVal = loopNodeByParamsPath(paramNameList, _parameters);\n }\n }\n return filedVal || '';\n });\n }\n return nowTemp;\n};\n\nexport const replaceParamsValue = (\n contentStr: string,\n pararms: { [key: string]: any } = {},\n) => {\n let nowContent:string = '';\n if (typeof contentStr === 'string' && contentStr && pararms) {\n nowContent = contentStr.replace(/\\$\\{\\{?[^{}]+}?\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeys(match, pararms);\n return filedVal || '';\n });\n }\n return nowContent;\n};\n\n\n/** ======下面几个方法主要提供给事件参数使用 勿共用 ===== */\nconst splitStringWithTemplateLiteral = (input: string) => {\n // 正则表达式:匹配 ${...} 模式\n const templateRegex = /\\$\\{[^}]*\\}/;\n\n // 检查字符串是否包含 ${...}\n if (!templateRegex.test(input)) {\n return [input]; // 返回原始字符串\n }\n\n // 匹配所有 ${...} 模式\n const matches = input.match(templateRegex);\n\n if (!matches || matches.length === 0) {\n return [input]; // 返回原始字符串\n }\n\n // 分割字符串,同时保留 ${...} 模式\n const result = input.split(templateRegex).filter(Boolean); // 去掉空字符串\n\n // 将匹配到的 ${...} 模式重新插入到结果数组中\n matches.forEach((match, index) => {\n result.splice(index * 2 + 1, 0, match); // 插入到对应位置\n });\n\n return result;\n};\n\nconst getParamsContentByParamKeysForEvent = (\n paramNames: string,\n data: { [key: string]: any } = {},\n) => {\n let paramNameList: string[] = [];\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n if (paramNames && typeof paramNames === 'string') {\n const matchs = regex.exec(paramNames);\n if (matchs?.[1]) {\n paramNameList = matchs?.[1]?.split('.');\n }\n }\n\n // 如果替换不成功,需要返回字符串原始的值\n return paramNameList.length > 0\n ? loopNodeByParamsPath(paramNameList, data) || ''\n : paramNames;\n};\n\n\n/**\n * 提供给事件参数转换那边的方法\n * 和replaceParamsValue 区别,\n * 1、不能去掉pageParams那一层\n * 2、字符串拼对象,需要把对象做JSON.stringify转换\n * 3、如果替换不成功,需要返回字符串原始的值\n * @param contentStr \"你好\" ,\"你$好, ${pageParams.userName}\" , \"${pageData}, ${pageParams.userList[0]}\"\n * @param data 数据\n */\nexport const replaceParamsValueForEvent = (\n contentStr: string,\n data: { [key: string]: any } = {},\n) => {\n if (!contentStr || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n\n const valueArr = splitStringWithTemplateLiteral(contentStr);\n // 单个字符串, 没有拼接\n if (valueArr.length === 1) {\n return getParamsContentByParamKeysForEvent(valueArr[0], data);\n }\n\n\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && data) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeysForEvent(match, data);\n if (typeof filedVal === 'string') {\n return filedVal;\n }\n // 字符串拼对象,需要把对象做JSON.stringify转换\n try {\n return JSON.stringify(filedVal);\n } catch {\n return '';\n }\n });\n }\n return nowTemp;\n};\n\n/** ======上面几个方法主要提供给事件参数使用 勿共用 ===== */\n"],"mappings":";AAAA,SAASA,GAAG,EAAEC,SAAS,QAAQ,QAAQ;AACvC,OAAOC,YAAY;AAEnB,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,OAAe,EAAK;EAC7C,IAAIC,QAAiB,GAAG,EAAE;EAC1B,IAAID,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAAA,IAAAE,OAAA,EAAAC,SAAA;IAC1C,IAAMC,WAAW,GAAG,qBAAqB,CAAC,CAAC;IAC3C,IAAMC,KAAK,GAAG,eAAe,CAAC,CAAC;IAC/B,IAAIC,MAAM,GAAGF,WAAW,CAACG,IAAI,CAACP,OAAO,CAAC;IACtC,KAAAE,OAAA,GAAII,MAAM,cAAAJ,OAAA,eA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,UAAU,IAAI,CAAC1C,IAAI,IAAI,EAAA2E,aAAA,GAAAlD,MAAM,CAACc,IAAI,CAACvC,IAAI,CAAC,cAAA2E,aAAA,uBAAjBA,aAAA,CAAmBxE,MAAM,KAAI,CAAC,EAAE;IAC1D,OAAOC,SAAS;EAClB;EAEA,IAAMwE,QAAQ,GAAGZ,8BAA8B,CAACtB,UAAU,CAAC;EAC3D;EACA,IAAIkC,QAAQ,CAACzE,MAAM,KAAK,CAAC,EAAE;IACzB,OAAOqE,mCAAmC,CAACI,QAAQ,CAAC,CAAC,CAAC,EAAE5E,IAAI,CAAC;EAC/D;EAGA,IAAIqD,OAAO,GAAG,EAAE;EAChB,IAAI,OAAOX,UAAU,KAAK,QAAQ,IAAIA,UAAU,IAAI1C,IAAI,EAAE;IACxDqD,OAAO,GAAGX,UAAU,CAACnB,OAAO,CAAC,cAAc,EAAE,UAAC+B,KAAK,EAAK;MACtD,IAAMG,QAAQ,GAAGe,mCAAmC,CAAClB,KAAK,EAAEtD,IAAI,CAAC;MACjE,IAAI,OAAOyD,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAOA,QAAQ;MACjB;MACA;MACA,IAAI;QACF,OAAOoB,IAAI,CAACC,SAAS,CAACrB,QAAQ,CAAC;MACjC,CAAC,CAAC,OAAAsB,OAAA,EAAM;QACN,OAAO,EAAE;MACX;IACF,CAAC,CAAC;EACJ;EACA,OAAO1B,OAAO;AAChB,CAAC;;AAED"}
|
|
1
|
+
{"version":3,"names":["get","cloneDeep","escapeString","getDataArr","content","matchArr","_matchs","_matchArr","escapeRegex","regex","matchs","exec","split","_matchs2","filter","item","idx","includes","loopNodeByParamsPath","paramsArr","data","escape","arguments","length","undefined","Array","isArray","_iterator","_createForOfIteratorHelper","_step","_loop","_nextParamsArr5","keyword","value","dataNode","nextParamsArr","slice","_nextParamsArr","_nextParamsArr3","idxRegex","test","_nextParamsArr2","idxNum","replace","Number","Object","v","map","_nextParamsArr4","_ret","s","n","done","err","e","f","getParamsContentByParamKeys","paramNames","_Object$keys","keys","paramNameList","replaceLoopBodyParamsValue","contentStr","options","_ref","_ref$loopParams","loopParams","_ref$loopSourceArr","loopSourceArr","_ref$loopData","loopData","_ref$parameters","parameters","nowTemp","match","paramsPath","itemKey","filedVal","_parameters","forEach","sourceKey","replaceParamsValue","pararms","nowContent","splitStringWithTemplateLiteral","input","templateRegex","matches","result","Boolean","index","splice","getParamsContentByParamKeysForEvent","_matchs$","replaceParamsValueForEvent","_Object$keys2","valueArr","JSON","stringify","_unused"],"sources":["../../src/treeUtils.ts"],"sourcesContent":["import { get, cloneDeep } from 'lodash';\nimport escapeString from './markdownEscape';\n\nexport const getDataArr = (content: string) => {\n let matchArr:string[] = [];\n if (content && typeof content === 'string') {\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 变量正则表达式,${{xxx}}\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n let matchs = escapeRegex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n } else {\n matchs = regex.exec(content);\n if (matchs?.[1]) {\n matchArr = matchs[1].split('.');\n }\n }\n return matchArr?.filter((item, idx) => !(idx === 0 && ['root', 'pageParams'].includes(item)) && !(idx === 1 && ['pageParams'].includes(item))); // 过滤掉第一个root,pageParams\n }\n return matchArr;\n};\n\nconst loopNodeByParamsPath:any = (\n paramsArr:string[],\n data: {[key:string]: any},\n escape:boolean = false\n) => {\n if (Array.isArray(paramsArr) && paramsArr.length > 0) {\n for (const keyword of paramsArr) {\n const dataNode = get(data, keyword);\n let nextParamsArr = paramsArr.slice(1); // 取下一个节点字段\n if (Array.isArray(dataNode)) {\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(nextParamsArr?.[0])) {\n const idxNum = nextParamsArr?.[0].replace(/\\[|\\]/g, '');\n if (dataNode?.[Number(idxNum)] instanceof Object) {\n return loopNodeByParamsPath(nextParamsArr.slice(1), dataNode?.[Number(idxNum)], escape);\n }\n return escape ? escapeString(dataNode?.[Number(idxNum)]) : dataNode?.[Number(idxNum)];\n }\n // 否则或缺中间节点,直接往下取值\n nextParamsArr = nextParamsArr.slice(1);\n if (nextParamsArr?.length >= 1) {\n return dataNode.map((item:any) => {\n // 如果数组节点是对象,则继续递归取值\n if (item instanceof Object && nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, item, escape);\n }\n // 否则直接返回数组值\n return escape ? escapeString(item) : item;\n });\n }\n return dataNode;\n } if (nextParamsArr?.length >= 1) {\n return loopNodeByParamsPath(nextParamsArr, dataNode, escape);\n }\n return escape ? escapeString(dataNode) : dataNode;\n }\n }\n return '';\n};\n\n\nexport const getParamsContentByParamKeys = (paramNames: string, data: {[key:string]: any} = {}) => {\n if (!paramNames || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n const escapeRegex = /\\$\\{\\{([^}]+)\\}\\}/gi; // 匹配${{}}格式的参数,属于需转义内容\n const paramNameList = getDataArr(paramNames);\n return loopNodeByParamsPath(paramNameList, data, escapeRegex.test(paramNames));\n};\n\n// 获取替换循环体内的参数值\nexport const replaceLoopBodyParamsValue = (\n contentStr: string,\n options: {\n loopParams: { [key: string]: any } // 循环体参数\n loopSourceArr: string[], // 循环体数据源\n loopData: {[key: string]: any}[], // 循环数据源数据\n parameters?: {[key: string]: any}, // 全量参数\n staticCodeMap?: {[key: string]: any}, // 静态数据\n },\n) => {\n const {\n loopParams = {},\n loopSourceArr = [],\n loopData = [],\n parameters = {},\n } = options || {};\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && loopParams) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/gi, (match) => {\n const paramsPath = getDataArr(match).filter((itemKey) => !loopSourceArr.includes(itemKey));\n let filedVal:any = '';\n // 如果当前节点是数组,且下一个节点是数字,则取下标对应的值\n const idxRegex = /^\\[.*\\]$|^\\d+$/;\n if (idxRegex.test(paramsPath?.[0])) {\n const idxNum = paramsPath?.[0].replace(/\\[|\\]/g, '');\n if (loopData?.[Number(idxNum)] instanceof Object) {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopData?.[Number(idxNum)]);\n } else {\n filedVal = loopData?.[Number(idxNum)] || '';\n }\n } else {\n filedVal = loopNodeByParamsPath(paramsPath.slice(1), loopParams);\n\n // 循环体内查找不到,则从参数中取值,但忽略循环体本身\n if (!filedVal && parameters) {\n const _parameters = cloneDeep(parameters);\n if (Array.isArray(loopSourceArr) && loopSourceArr.length > 0) {\n loopSourceArr.forEach((sourceKey:string) => {\n delete _parameters[sourceKey];\n });\n }\n const paramNameList = getDataArr(match);\n filedVal = loopNodeByParamsPath(paramNameList, _parameters);\n }\n }\n return filedVal || '';\n });\n }\n return nowTemp;\n};\n\nexport const replaceParamsValue = (\n contentStr: string,\n pararms: { [key: string]: any } = {},\n) => {\n let nowContent:string = '';\n if (typeof contentStr === 'string' && contentStr && pararms) {\n nowContent = contentStr.replace(/\\$\\{\\{?[^{}]+}?\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeys(match, pararms);\n return filedVal || '';\n });\n }\n return nowContent;\n};\n\n\n/** ======下面几个方法主要提供给事件参数使用 勿共用 ===== */\nconst splitStringWithTemplateLiteral = (input: string) => {\n // 正则表达式:匹配 ${...} 模式\n const templateRegex = /\\$\\{[^}]*\\}/;\n\n // 检查字符串是否包含 ${...}\n if (!templateRegex.test(input)) {\n return [input]; // 返回原始字符串\n }\n\n // 匹配所有 ${...} 模式\n const matches = input.match(templateRegex);\n\n if (!matches || matches.length === 0) {\n return [input]; // 返回原始字符串\n }\n\n // 分割字符串,同时保留 ${...} 模式\n const result = input.split(templateRegex).filter(Boolean); // 去掉空字符串\n\n // 将匹配到的 ${...} 模式重新插入到结果数组中\n matches.forEach((match, index) => {\n result.splice(index * 2 + 1, 0, match); // 插入到对应位置\n });\n\n return result;\n};\n\nconst getParamsContentByParamKeysForEvent = (\n paramNames: string,\n data: { [key: string]: any } = {},\n) => {\n let paramNameList: string[] = [];\n const regex = /\\$\\{(.+?)\\}/gi; // 变量正则表达式,${xxx}\n if (paramNames && typeof paramNames === 'string') {\n const matchs = regex.exec(paramNames);\n if (matchs?.[1]) {\n paramNameList = matchs?.[1]?.split('.');\n }\n }\n\n // 如果替换不成功,需要返回字符串原始的值\n return paramNameList.length > 0\n ? loopNodeByParamsPath(paramNameList, data) || ''\n : paramNames;\n};\n\n\n/**\n * 提供给事件参数转换那边的方法\n * 和replaceParamsValue 区别,\n * 1、不能去掉pageParams那一层\n * 2、字符串拼对象,需要把对象做JSON.stringify转换\n * 3、如果替换不成功,需要返回字符串原始的值\n * @param contentStr \"你好\" ,\"你$好, ${pageParams.userName}\" , \"${pageData}, ${pageParams.userList[0]}\"\n * @param data 数据\n */\nexport const replaceParamsValueForEvent = (\n contentStr: string,\n data: { [key: string]: any } = {},\n) => {\n if (!contentStr || !data || Object.keys(data)?.length <= 0) {\n return undefined;\n }\n\n const valueArr = splitStringWithTemplateLiteral(contentStr);\n // 单个字符串, 没有拼接\n if (valueArr.length === 1) {\n return getParamsContentByParamKeysForEvent(valueArr[0], data);\n }\n\n\n let nowTemp = '';\n if (typeof contentStr === 'string' && contentStr && data) {\n nowTemp = contentStr.replace(/\\$\\{(.+?)\\}/g, (match) => {\n const filedVal = getParamsContentByParamKeysForEvent(match, data);\n if (typeof filedVal === 'string') {\n return filedVal;\n }\n // 字符串拼对象,需要把对象做JSON.stringify转换\n try {\n return JSON.stringify(filedVal);\n } catch {\n return '';\n }\n });\n }\n return nowTemp;\n};\n\n/** ======上面几个方法主要提供给事件参数使用 勿共用 ===== */\n"],"mappings":";;;AAAA,SAASA,GAAG,EAAEC,SAAS,QAAQ,QAAQ;AACvC,OAAOC,YAAY;AAEnB,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,OAAe,EAAK;EAC7C,IAAIC,QAAiB,GAAG,EAAE;EAC1B,IAAID,OAAO,IAAI,OAAOA,OAAO,K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