@lingxiteam/ebe-utils 0.0.1
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/README.md +217 -0
- package/bin/ebe.js +7 -0
- package/es/constants.d.ts +2 -0
- package/es/constants.js +183 -0
- package/es/index.d.ts +64 -0
- package/es/index.js +539 -0
- package/es/node/babel/getAllImportFiles.d.ts +1 -0
- package/es/node/babel/getAllImportFiles.js +79 -0
- package/es/node/babel/getRealPath.d.ts +5 -0
- package/es/node/babel/getRealPath.js +40 -0
- package/es/node/babel/parse.d.ts +6 -0
- package/es/node/babel/parse.js +20 -0
- package/es/node/cli.d.ts +1 -0
- package/es/node/cli.js +87 -0
- package/es/node/constants.d.ts +1 -0
- package/es/node/constants.js +3 -0
- package/es/node/copyStatic.d.ts +6 -0
- package/es/node/copyStatic.js +25 -0
- package/es/node/move.d.ts +5 -0
- package/es/node/move.js +64 -0
- package/es/node/setup.d.ts +4 -0
- package/es/node/setup.js +40 -0
- package/es/shims.d.ts +4 -0
- package/es/types.d.ts +14 -0
- package/es/types.js +1 -0
- package/lib/node/babel/getAllImportFiles.d.ts +1 -0
- package/lib/node/babel/getAllImportFiles.js +106 -0
- package/lib/node/babel/getRealPath.d.ts +5 -0
- package/lib/node/babel/getRealPath.js +59 -0
- package/lib/node/babel/parse.d.ts +6 -0
- package/lib/node/babel/parse.js +64 -0
- package/lib/node/cli.d.ts +1 -0
- package/lib/node/cli.js +37 -0
- package/lib/node/constants.d.ts +1 -0
- package/lib/node/constants.js +30 -0
- package/lib/node/copyStatic.d.ts +6 -0
- package/lib/node/copyStatic.js +57 -0
- package/lib/node/move.d.ts +5 -0
- package/lib/node/move.js +66 -0
- package/lib/node/setup.d.ts +4 -0
- package/lib/node/setup.js +43 -0
- package/lib/public/.editorconfig +17 -0
- package/lib/public/.prettierignore +15 -0
- package/lib/public/.stylelintrc.js +3 -0
- package/lib/public/deploy.sh +48 -0
- package/lib/public/docker/Dockerfile +11 -0
- package/lib/public/docker/default.conf +24 -0
- package/lib/public/src/assets/pageicon/closeIcon.png +0 -0
- package/lib/public/src/assets/pageicon/deleteIcon.png +0 -0
- package/lib/public/src/assets/pageicon/downloadIcon.png +0 -0
- package/lib/public/src/assets/pageicon/excel.png +0 -0
- package/lib/public/src/assets/pageicon/ico-container-drawer.png +0 -0
- package/lib/public/src/assets/pageicon/ico-container-modal.png +0 -0
- package/lib/public/src/assets/pageicon/ico-container-page.png +0 -0
- package/lib/public/src/assets/pageicon/index.ts +25 -0
- package/lib/public/src/assets/pageicon/leftIcon.png +0 -0
- package/lib/public/src/assets/pageicon/rightIcon.png +0 -0
- package/lib/public/src/assets/pageicon/zoomInIcon.png +0 -0
- package/lib/public/src/assets/pageicon/zoomOutIcon.png +0 -0
- package/lib/public/src/components/ExpBusiObjModal/index.less +28 -0
- package/lib/public/src/components/ExpBusiObjModal/index.tsx +315 -0
- package/lib/public/src/components/ExpSQLServiceModal/index.less +28 -0
- package/lib/public/src/components/ExpSQLServiceModal/index.tsx +295 -0
- package/lib/public/src/components/IconFont/IconFont.tsx +26 -0
- package/lib/public/src/components/IconFont/index.ts +1 -0
- package/lib/public/src/components/ImportBusiObjModal/index.less +262 -0
- package/lib/public/src/components/ImportBusiObjModal/index.tsx +1243 -0
- package/lib/public/src/components/LoaderHelper/index.tsx +29 -0
- package/lib/public/src/components/PreviewFile/index.less +200 -0
- package/lib/public/src/components/PreviewFile/index.tsx +787 -0
- package/lib/public/src/components/PreviewFile/utils.ts +90 -0
- package/lib/public/src/components/ProgressComp/ProgressComp.less +64 -0
- package/lib/public/src/components/ProgressComp/ProgressComp.tsx +34 -0
- package/lib/public/src/components/ProgressComp/index.tsx +153 -0
- package/lib/public/src/components/common/ExpBusiObjModal/index.less +28 -0
- package/lib/public/src/components/common/ExpBusiObjModal/index.tsx +315 -0
- package/lib/public/src/components/common/PreviewFile/index.less +200 -0
- package/lib/public/src/components/common/PreviewFile/index.tsx +787 -0
- package/lib/public/src/components/common/PreviewFile/utils.ts +90 -0
- package/lib/public/src/components/pcfactory/src/Alert/index.tsx +22 -0
- package/lib/public/src/components/pcfactory/src/Animation/index.tsx +186 -0
- package/lib/public/src/components/pcfactory/src/Animation/useAnimation.ts +270 -0
- package/lib/public/src/components/pcfactory/src/Animation/useBackgroundStyle.ts +74 -0
- package/lib/public/src/components/pcfactory/src/Audio/index.tsx +240 -0
- package/lib/public/src/components/pcfactory/src/BarChart/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/Button/index.tsx +151 -0
- package/lib/public/src/components/pcfactory/src/Card/index.tsx +201 -0
- package/lib/public/src/components/pcfactory/src/Card/useExtendBtn.tsx +195 -0
- package/lib/public/src/components/pcfactory/src/Cascader/index.tsx +398 -0
- package/lib/public/src/components/pcfactory/src/ChartBar/index.tsx +15 -0
- package/lib/public/src/components/pcfactory/src/ChartBar/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/ChartLine/ChartLine.tsx +48 -0
- package/lib/public/src/components/pcfactory/src/ChartLine/PropsType.ts +88 -0
- package/lib/public/src/components/pcfactory/src/ChartLine/index.tsx +15 -0
- package/lib/public/src/components/pcfactory/src/ChartLine/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/Checkbox/index.tsx +144 -0
- package/lib/public/src/components/pcfactory/src/CheckboxGroup/index.tsx +319 -0
- package/lib/public/src/components/pcfactory/src/Collapse/index.tsx +195 -0
- package/lib/public/src/components/pcfactory/src/CollapsePanel/index.tsx +186 -0
- package/lib/public/src/components/pcfactory/src/Condition/index.tsx +22 -0
- package/lib/public/src/components/pcfactory/src/DatePicker/index.tsx +756 -0
- package/lib/public/src/components/pcfactory/src/Description/index.tsx +447 -0
- package/lib/public/src/components/pcfactory/src/Description/utils/getLabelSizeMode.ts +40 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/CenterLineDivider/index.tsx +190 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/CenterTabDivider/index.tsx +77 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LeftCardDivider/index.tsx +87 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LeftLineDivider/index.tsx +106 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LeftTabDivider/index.tsx +60 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LeftTopDivider/index.tsx +55 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LxDashed/index.module.less +10 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LxDashed/index.tsx +143 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LxSolid/index.module.less +10 -0
- package/lib/public/src/components/pcfactory/src/Divider/components/LxSolid/index.tsx +126 -0
- package/lib/public/src/components/pcfactory/src/Divider/index.tsx +210 -0
- package/lib/public/src/components/pcfactory/src/Dropdown/index.tsx +385 -0
- package/lib/public/src/components/pcfactory/src/DynamicTabs/PropsType.ts +31 -0
- package/lib/public/src/components/pcfactory/src/DynamicTabs/TabPage.tsx +63 -0
- package/lib/public/src/components/pcfactory/src/DynamicTabs/index.tsx +214 -0
- package/lib/public/src/components/pcfactory/src/Form/Form.tsx +600 -0
- package/lib/public/src/components/pcfactory/src/Form/WrapperForm.ts +14 -0
- package/lib/public/src/components/pcfactory/src/Form/index.tsx +15 -0
- package/lib/public/src/components/pcfactory/src/Form/useFormStatus.ts +47 -0
- package/lib/public/src/components/pcfactory/src/Form/useMonitor.ts +40 -0
- package/lib/public/src/components/pcfactory/src/FormGroup/TitleComp.tsx +107 -0
- package/lib/public/src/components/pcfactory/src/FormGroup/index.tsx +181 -0
- package/lib/public/src/components/pcfactory/src/FreeLayout/index.tsx +151 -0
- package/lib/public/src/components/pcfactory/src/Gantt/Gantt.tsx +460 -0
- package/lib/public/src/components/pcfactory/src/Gantt/const.ts +122 -0
- package/lib/public/src/components/pcfactory/src/Gantt/index.tsx +16 -0
- package/lib/public/src/components/pcfactory/src/Gantt/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/GridView/GridView.tsx +435 -0
- package/lib/public/src/components/pcfactory/src/GridView/index.tsx +24 -0
- package/lib/public/src/components/pcfactory/src/GridView/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/HorizontalView/index.tsx +32 -0
- package/lib/public/src/components/pcfactory/src/Icon/IconED/index.tsx +42 -0
- package/lib/public/src/components/pcfactory/src/Icon/PropsType.ts +57 -0
- package/lib/public/src/components/pcfactory/src/Icon/hooks/index.tsx +300 -0
- package/lib/public/src/components/pcfactory/src/Icon/index.tsx +69 -0
- package/lib/public/src/components/pcfactory/src/IconFont/index.tsx +24 -0
- package/lib/public/src/components/pcfactory/src/Img/BasicImage/index.tsx +90 -0
- package/lib/public/src/components/pcfactory/src/Img/assets/placeholder.png +0 -0
- package/lib/public/src/components/pcfactory/src/Img/index.tsx +91 -0
- package/lib/public/src/components/pcfactory/src/Input/index.tsx +425 -0
- package/lib/public/src/components/pcfactory/src/InputNumber/index.tsx +263 -0
- package/lib/public/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +23 -0
- package/lib/public/src/components/pcfactory/src/LXPieChart/PropsType.ts +11 -0
- package/lib/public/src/components/pcfactory/src/LXPieChart/index.less +6 -0
- package/lib/public/src/components/pcfactory/src/LXPieChart/index.tsx +15 -0
- package/lib/public/src/components/pcfactory/src/LXPieChart/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +25 -0
- package/lib/public/src/components/pcfactory/src/LXRadarChart/PropsType.ts +9 -0
- package/lib/public/src/components/pcfactory/src/LXRadarChart/index.less +7 -0
- package/lib/public/src/components/pcfactory/src/LXRadarChart/index.tsx +17 -0
- package/lib/public/src/components/pcfactory/src/LXRadarChart/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/Layout/index.tsx +130 -0
- package/lib/public/src/components/pcfactory/src/Layout/utils.ts +48 -0
- package/lib/public/src/components/pcfactory/src/LineChart/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/Link/index.tsx +117 -0
- package/lib/public/src/components/pcfactory/src/LoopList/index.tsx +551 -0
- package/lib/public/src/components/pcfactory/src/Menu/index.tsx +422 -0
- package/lib/public/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +95 -0
- package/lib/public/src/components/pcfactory/src/ModalSelect/index.tsx +453 -0
- package/lib/public/src/components/pcfactory/src/MultipleSelect/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/Pagination/index.tsx +104 -0
- package/lib/public/src/components/pcfactory/src/Password/index.tsx +88 -0
- package/lib/public/src/components/pcfactory/src/PictureVerifyCode/assets/placeholder.png +0 -0
- package/lib/public/src/components/pcfactory/src/PictureVerifyCode/index.tsx +76 -0
- package/lib/public/src/components/pcfactory/src/PieChart/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/Progress/index.tsx +155 -0
- package/lib/public/src/components/pcfactory/src/QRCode/const.ts +5 -0
- package/lib/public/src/components/pcfactory/src/QRCode/index.tsx +146 -0
- package/lib/public/src/components/pcfactory/src/QuillEditor/QuillEditor.tsx +197 -0
- package/lib/public/src/components/pcfactory/src/QuillEditor/index.tsx +37 -0
- package/lib/public/src/components/pcfactory/src/QuillEditor/loader.ts +12 -0
- package/lib/public/src/components/pcfactory/src/RadarChart/RadarChartHook.ts +449 -0
- package/lib/public/src/components/pcfactory/src/RadarChart/RadarChartType.ts +39 -0
- package/lib/public/src/components/pcfactory/src/RadarChart/RadarECharts.tsx +86 -0
- package/lib/public/src/components/pcfactory/src/RadarChart/index.tsx +16 -0
- package/lib/public/src/components/pcfactory/src/RadarChart/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/RadarChart/radarDefaultConfig.js +55 -0
- package/lib/public/src/components/pcfactory/src/Radio/index.tsx +260 -0
- package/lib/public/src/components/pcfactory/src/RangePicker/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/Rate/index.tsx +187 -0
- package/lib/public/src/components/pcfactory/src/ReactECharts/PropsType.ts +37 -0
- package/lib/public/src/components/pcfactory/src/ReactECharts/ReactECharts.tsx +672 -0
- package/lib/public/src/components/pcfactory/src/ReactECharts/index.tsx +26 -0
- package/lib/public/src/components/pcfactory/src/ReactECharts/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/RemoteComponent/components/FishRender.tsx +31 -0
- package/lib/public/src/components/pcfactory/src/RemoteComponent/components/ReactRender.tsx +55 -0
- package/lib/public/src/components/pcfactory/src/RemoteComponent/components/VueRender.tsx +32 -0
- package/lib/public/src/components/pcfactory/src/RemoteComponent/constant.ts +9 -0
- package/lib/public/src/components/pcfactory/src/RemoteComponent/index.tsx +82 -0
- package/lib/public/src/components/pcfactory/src/RemoteComponent/remote-component.config.ts +12 -0
- package/lib/public/src/components/pcfactory/src/Result/index.tsx +27 -0
- package/lib/public/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +105 -0
- package/lib/public/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +234 -0
- package/lib/public/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +41 -0
- package/lib/public/src/components/pcfactory/src/RichTextEditor/index.tsx +33 -0
- package/lib/public/src/components/pcfactory/src/RichTextEditor/loader.ts +12 -0
- package/lib/public/src/components/pcfactory/src/Row/Row.tsx +66 -0
- package/lib/public/src/components/pcfactory/src/Row/index.tsx +9 -0
- package/lib/public/src/components/pcfactory/src/Row/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/Select/index.tsx +628 -0
- package/lib/public/src/components/pcfactory/src/Select/selectUtils.ts +257 -0
- package/lib/public/src/components/pcfactory/src/Slider/index.tsx +351 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/DownloadProgress/DownloadProgress.tsx +27 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/DownloadProgress/index.ts +3 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/UploadItem.tsx +257 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/default.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/js.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/pdf.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/ppt.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/txt.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/word.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/xls.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/assets/zip.png +0 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/index.tsx +1050 -0
- package/lib/public/src/components/pcfactory/src/StdUpload/uploadItem.less +64 -0
- package/lib/public/src/components/pcfactory/src/Steps/constant/checkcircle.tsx +29 -0
- package/lib/public/src/components/pcfactory/src/Steps/constant/index.ts +2 -0
- package/lib/public/src/components/pcfactory/src/Steps/constant/vector.tsx +13 -0
- package/lib/public/src/components/pcfactory/src/Steps/index.tsx +343 -0
- package/lib/public/src/components/pcfactory/src/SuperSelect/ComSelect.tsx +538 -0
- package/lib/public/src/components/pcfactory/src/SuperSelect/index.tsx +127 -0
- package/lib/public/src/components/pcfactory/src/SuperSelect/loader.tsx +12 -0
- package/lib/public/src/components/pcfactory/src/Swiper/index.tsx +184 -0
- package/lib/public/src/components/pcfactory/src/Switch/index.tsx +219 -0
- package/lib/public/src/components/pcfactory/src/TabPane/index.tsx +145 -0
- package/lib/public/src/components/pcfactory/src/Table/BodyCell/index.tsx +278 -0
- package/lib/public/src/components/pcfactory/src/Table/EditComponent/index.tsx +554 -0
- package/lib/public/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +34 -0
- package/lib/public/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +26 -0
- package/lib/public/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +41 -0
- package/lib/public/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +32 -0
- package/lib/public/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +34 -0
- package/lib/public/src/components/pcfactory/src/Table/FormatCell/index.tsx +227 -0
- package/lib/public/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +63 -0
- package/lib/public/src/components/pcfactory/src/Table/HeaderCell/index.tsx +32 -0
- package/lib/public/src/components/pcfactory/src/Table/TableHead/index.tsx +501 -0
- package/lib/public/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +46 -0
- package/lib/public/src/components/pcfactory/src/Table/constant.ts +73 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/index.ts +32 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +325 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +176 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useColumns.tsx +1851 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useCommon.ts +39 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useDataSource.ts +201 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +324 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useFilter.tsx +274 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useFormatCell.ts +309 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/usePagination.ts +104 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +302 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +93 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useScroll.ts +120 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useSelection.ts +467 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useSort.ts +39 -0
- package/lib/public/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +191 -0
- package/lib/public/src/components/pcfactory/src/Table/index.tsx +525 -0
- package/lib/public/src/components/pcfactory/src/Table/utils/SequenceId.ts +104 -0
- package/lib/public/src/components/pcfactory/src/Table/utils/index.ts +442 -0
- package/lib/public/src/components/pcfactory/src/Tabs/index.tsx +209 -0
- package/lib/public/src/components/pcfactory/src/Tag/index.tsx +39 -0
- package/lib/public/src/components/pcfactory/src/Text/index.tsx +191 -0
- package/lib/public/src/components/pcfactory/src/TextArea/ForIETextArea.tsx +96 -0
- package/lib/public/src/components/pcfactory/src/TextArea/index.tsx +255 -0
- package/lib/public/src/components/pcfactory/src/TimePicker/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/TlrView/index.tsx +3 -0
- package/lib/public/src/components/pcfactory/src/TooltipView/PropsType.ts +22 -0
- package/lib/public/src/components/pcfactory/src/TooltipView/TooltipViewED/index.tsx +10 -0
- package/lib/public/src/components/pcfactory/src/TooltipView/hooks/index.tsx +90 -0
- package/lib/public/src/components/pcfactory/src/TooltipView/index.tsx +13 -0
- package/lib/public/src/components/pcfactory/src/Transfer/index.tsx +753 -0
- package/lib/public/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +102 -0
- package/lib/public/src/components/pcfactory/src/Tree/index.tsx +1303 -0
- package/lib/public/src/components/pcfactory/src/TreeSelect/index.tsx +639 -0
- package/lib/public/src/components/pcfactory/src/TreeTable/hooks/index.ts +4 -0
- package/lib/public/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +82 -0
- package/lib/public/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +61 -0
- package/lib/public/src/components/pcfactory/src/TreeTable/index.tsx +273 -0
- package/lib/public/src/components/pcfactory/src/Upload/Upload.tsx +740 -0
- package/lib/public/src/components/pcfactory/src/Upload/index.tsx +29 -0
- package/lib/public/src/components/pcfactory/src/Upload/loader.tsx +13 -0
- package/lib/public/src/components/pcfactory/src/VerificationCode/assets/placeholder.png +0 -0
- package/lib/public/src/components/pcfactory/src/VerificationCode/index.tsx +297 -0
- package/lib/public/src/components/pcfactory/src/VerticalView/index.tsx +25 -0
- package/lib/public/src/components/pcfactory/src/VideoPlayer/index.tsx +159 -0
- package/lib/public/src/components/pcfactory/src/View/index.tsx +150 -0
- package/lib/public/src/components/pcfactory/src/View/useBackgroundStyle.ts +75 -0
- package/lib/public/src/components/pcfactory/src/VirtualGroup/index.tsx +16 -0
- package/lib/public/src/components/pcfactory/src/Webview/index.tsx +104 -0
- package/lib/public/src/components/pcfactory/src/index.component.ts +253 -0
- package/lib/public/src/components/pcfactory/src/styles/common.less +107 -0
- package/lib/public/src/components/pcfactory/src/styles/compatible.less +976 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Alert.less +25 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Audio.less +198 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Button.less +32 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Card.less +155 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Cascader.less +54 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Checkbox.less +7 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Collapse.less +214 -0
- package/lib/public/src/components/pcfactory/src/styles/components/DatePicker.less +22 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Description.less +64 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Divider.less +530 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Drawer.less +54 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Dropdown.less +11 -0
- package/lib/public/src/components/pcfactory/src/styles/components/DynamicDataContainer.less +16 -0
- package/lib/public/src/components/pcfactory/src/styles/components/DynamicTabs.less +254 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Form.less +265 -0
- package/lib/public/src/components/pcfactory/src/styles/components/FormGroup.less +111 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Gantt.less +139 -0
- package/lib/public/src/components/pcfactory/src/styles/components/GridView.less +62 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Icon.less +20 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Input.less +164 -0
- package/lib/public/src/components/pcfactory/src/styles/components/InputNumber.less +124 -0
- package/lib/public/src/components/pcfactory/src/styles/components/InputPassword.less +3 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Link.less +4 -0
- package/lib/public/src/components/pcfactory/src/styles/components/LoopList.less +67 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Menu.less +54 -0
- package/lib/public/src/components/pcfactory/src/styles/components/ModalSelect.less +42 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Popconfirm.less +7 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Progress.less +57 -0
- package/lib/public/src/components/pcfactory/src/styles/components/QuillEditor.less +15 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Radio.less +7 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Rate.less +16 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Result.less +26 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Select.less +146 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Slider.less +78 -0
- package/lib/public/src/components/pcfactory/src/styles/components/StdUpload.less +225 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Step.less +91 -0
- package/lib/public/src/components/pcfactory/src/styles/components/SuperSelect.less +83 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Swiper.less +106 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Switch.less +49 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Table.less +1229 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Tabs.less +291 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Tag.less +107 -0
- package/lib/public/src/components/pcfactory/src/styles/components/TextArea.less +12 -0
- package/lib/public/src/components/pcfactory/src/styles/components/TooltipView.less +43 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Transfer.less +155 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Tree.less +329 -0
- package/lib/public/src/components/pcfactory/src/styles/components/TreeSelect.less +65 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Upload.less +26 -0
- package/lib/public/src/components/pcfactory/src/styles/components/VerificationCode.less +162 -0
- package/lib/public/src/components/pcfactory/src/styles/components/Webview.less +31 -0
- package/lib/public/src/components/pcfactory/src/styles/index.less +10 -0
- package/lib/public/src/components/pcfactory/src/styles/index.ued.less +65 -0
- package/lib/public/src/components/pcfactory/src/styles/theme/variables/antdVariables.less +84 -0
- package/lib/public/src/components/pcfactory/src/styles/theme/variables/common.less +9 -0
- package/lib/public/src/components/pcfactory/src/styles/theme/variables/customVariables.less +35 -0
- package/lib/public/src/components/pcfactory/src/styles/theme/variables/index.less +2 -0
- package/lib/public/src/components/pcfactory/src/utils/ChannelContainer.tsx +150 -0
- package/lib/public/src/components/pcfactory/src/utils/ChildRender.ts +103 -0
- package/lib/public/src/components/pcfactory/src/utils/CustomModule.tsx +134 -0
- package/lib/public/src/components/pcfactory/src/utils/DummyFormContext.ts +136 -0
- package/lib/public/src/components/pcfactory/src/utils/Empty/customLocale.tsx +6 -0
- package/lib/public/src/components/pcfactory/src/utils/Empty/empty.tsx +37 -0
- package/lib/public/src/components/pcfactory/src/utils/LoaderHelper.tsx +29 -0
- package/lib/public/src/components/pcfactory/src/utils/PropsType.ts +21 -0
- package/lib/public/src/components/pcfactory/src/utils/WithSyncValue.ts +218 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/index.ts +22 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useCreation.ts +23 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useDeepCompareEffect.ts +27 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useMap.ts +46 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +27 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/usePrevious.ts +19 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +26 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useSetState.ts +26 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useUnmountedRef.ts +14 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useUpdate.ts +9 -0
- package/lib/public/src/components/pcfactory/src/utils/ahooks/useUpdateEffect.ts +16 -0
- package/lib/public/src/components/pcfactory/src/utils/basicStatusTransfer.ts +32 -0
- package/lib/public/src/components/pcfactory/src/utils/common.ts +367 -0
- package/lib/public/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +106 -0
- package/lib/public/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +131 -0
- package/lib/public/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +646 -0
- package/lib/public/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +123 -0
- package/lib/public/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +411 -0
- package/lib/public/src/components/pcfactory/src/utils/formUtils/common.ts +28 -0
- package/lib/public/src/components/pcfactory/src/utils/getExportDefaultObj.ts +11 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +140 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useDataMask.ts +83 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +63 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +86 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +41 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +43 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +90 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useListenState.ts +26 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useLocale.ts +129 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +80 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useRules.ts +89 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +26 -0
- package/lib/public/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +33 -0
- package/lib/public/src/components/pcfactory/src/utils/index.ts +19 -0
- package/lib/public/src/components/pcfactory/src/utils/polyfill.js +305 -0
- package/lib/public/src/components/pcfactory/src/utils/renderReadOnly.tsx +105 -0
- package/lib/public/src/components/pcfactory/src/variables.ts +2 -0
- package/lib/public/src/components/pcfactory/typings.d.ts +27 -0
- package/lib/public/src/hooks/useExportCustomDataFile.ts +566 -0
- package/lib/public/src/hooks/useLifeCycle.ts +110 -0
- package/lib/public/src/hooks/useListenProps.ts +14 -0
- package/lib/public/src/hooks/useSafeState.ts +26 -0
- package/lib/public/src/hooks/useSetState.ts +41 -0
- package/lib/public/src/hooks/useSyncState.ts +27 -0
- package/lib/public/src/hooks/useTransSuperObjectParams.ts +82 -0
- package/lib/public/src/hooks/useUnmountedRef.ts +14 -0
- package/lib/public/src/hooks/useUpdateEffect.ts +16 -0
- package/lib/public/src/pages/_preview/index.tsx +23 -0
- package/lib/public/src/services/README.md +32 -0
- package/lib/public/src/services/api/batchInsert.ts +21 -0
- package/lib/public/src/services/api/engine.ts +59 -0
- package/lib/public/src/services/api/file.ts +50 -0
- package/lib/public/src/services/api/findAppConfig.ts +14 -0
- package/lib/public/src/services/api/getAppFileUrlByFileCode.ts +14 -0
- package/lib/public/src/services/api/index.ts +38 -0
- package/lib/public/src/services/type.ts +51 -0
- package/lib/public/src/styles/common.less +41 -0
- package/lib/public/src/styles/index.less +4 -0
- package/lib/public/src/styles/index.ts +1 -0
- package/lib/public/src/styles/theme/variables.less +130 -0
- package/lib/public/src/types/index.ts +246 -0
- package/lib/public/src/utils/AwaitHandleData.ts +46 -0
- package/lib/public/src/utils/Context/Container.tsx +65 -0
- package/lib/public/src/utils/Context/context.tsx +95 -0
- package/lib/public/src/utils/LcdpSpin/index.less +13 -0
- package/lib/public/src/utils/LcdpSpin/index.tsx +12 -0
- package/lib/public/src/utils/ModalManager/Drawer/index.less +30 -0
- package/lib/public/src/utils/ModalManager/Drawer/index.tsx +109 -0
- package/lib/public/src/utils/ModalManager/Modal/index.less +7 -0
- package/lib/public/src/utils/ModalManager/Modal/index.tsx +96 -0
- package/lib/public/src/utils/ModalManager/index.tsx +278 -0
- package/lib/public/src/utils/Security/clientCapabilities.ts +19 -0
- package/lib/public/src/utils/Security/config.ts +89 -0
- package/lib/public/src/utils/Security/const.ts +129 -0
- package/lib/public/src/utils/Security/encipher/aes.ts +52 -0
- package/lib/public/src/utils/Security/encipher/des.ts +52 -0
- package/lib/public/src/utils/Security/encipher/rsa.ts +42 -0
- package/lib/public/src/utils/Security/encipher/sign.ts +212 -0
- package/lib/public/src/utils/Security/encipher/token.ts +52 -0
- package/lib/public/src/utils/Security/httpEncryption.ts +75 -0
- package/lib/public/src/utils/Security/index.ts +28 -0
- package/lib/public/src/utils/Security/requester/fetch.ts +119 -0
- package/lib/public/src/utils/Security/requester/wx.ts +132 -0
- package/lib/public/src/utils/Security/requester/xhr.ts +121 -0
- package/lib/public/src/utils/Security/types.ts +181 -0
- package/lib/public/src/utils/Security/utils/check.ts +62 -0
- package/lib/public/src/utils/Security/utils/cookie.ts +70 -0
- package/lib/public/src/utils/Security/utils/encrypted.ts +122 -0
- package/lib/public/src/utils/Security/utils/message.ts +17 -0
- package/lib/public/src/utils/Security/utils/url.ts +78 -0
- package/lib/public/src/utils/StateListener.ts +69 -0
- package/lib/public/src/utils/User.ts +16 -0
- package/lib/public/src/utils/array.ts +151 -0
- package/lib/public/src/utils/basicStatusTransfer.ts +32 -0
- package/lib/public/src/utils/cmd.ts +27 -0
- package/lib/public/src/utils/customFuncMapping.ts +107 -0
- package/lib/public/src/utils/dataSource/fetchQuery.ts +154 -0
- package/lib/public/src/utils/dataSource/index.ts +1 -0
- package/lib/public/src/utils/engine-utils/exportCustomUtils.ts +215 -0
- package/lib/public/src/utils/engine-utils/hooks/index.ts +3 -0
- package/lib/public/src/utils/engine-utils/hooks/useCreation.ts +23 -0
- package/lib/public/src/utils/engine-utils/index.ts +2 -0
- package/lib/public/src/utils/engine-utils/previewUtil.ts +18 -0
- package/lib/public/src/utils/formUtils.ts +458 -0
- package/lib/public/src/utils/functors/ABS.ts +23 -0
- package/lib/public/src/utils/functors/AESDECRYPT.ts +26 -0
- package/lib/public/src/utils/functors/AESENCRYPT.ts +26 -0
- package/lib/public/src/utils/functors/ARRAYINDEX.ts +23 -0
- package/lib/public/src/utils/functors/ARRAYTOSTR.ts +23 -0
- package/lib/public/src/utils/functors/AVERAGE.ts +23 -0
- package/lib/public/src/utils/functors/CONCAT.ts +20 -0
- package/lib/public/src/utils/functors/COUNTA.ts +22 -0
- package/lib/public/src/utils/functors/COUNTARRAY.ts +20 -0
- package/lib/public/src/utils/functors/COUNTBLANK.ts +22 -0
- package/lib/public/src/utils/functors/COUNTCHAR.ts +26 -0
- package/lib/public/src/utils/functors/DATAMASK.ts +150 -0
- package/lib/public/src/utils/functors/DATEADD.ts +37 -0
- package/lib/public/src/utils/functors/DATENOW.ts +27 -0
- package/lib/public/src/utils/functors/DATETIME.ts +20 -0
- package/lib/public/src/utils/functors/IF.ts +20 -0
- package/lib/public/src/utils/functors/INT.ts +23 -0
- package/lib/public/src/utils/functors/LOG.ts +24 -0
- package/lib/public/src/utils/functors/MAX.ts +24 -0
- package/lib/public/src/utils/functors/MIN.ts +24 -0
- package/lib/public/src/utils/functors/MOD.ts +24 -0
- package/lib/public/src/utils/functors/NUMBER.ts +26 -0
- package/lib/public/src/utils/functors/OBJECTVALUE.ts +20 -0
- package/lib/public/src/utils/functors/POWER.ts +24 -0
- package/lib/public/src/utils/functors/PRODUCT.ts +20 -0
- package/lib/public/src/utils/functors/RANDBETWEEN.ts +22 -0
- package/lib/public/src/utils/functors/RANDOMNUM.ts +30 -0
- package/lib/public/src/utils/functors/ROUND.ts +24 -0
- package/lib/public/src/utils/functors/ROUNDDOWN.ts +24 -0
- package/lib/public/src/utils/functors/ROUNDUP.ts +25 -0
- package/lib/public/src/utils/functors/STRTOARRAY.ts +23 -0
- package/lib/public/src/utils/functors/SUM.ts +20 -0
- package/lib/public/src/utils/functors/index.ts +32 -0
- package/lib/public/src/utils/functors/types.ts +32 -0
- package/lib/public/src/utils/functors/utils/tools.ts +15 -0
- package/lib/public/src/utils/historytool.ts +154 -0
- package/lib/public/src/utils/hooks/index.ts +22 -0
- package/lib/public/src/utils/hooks/useCreation.ts +23 -0
- package/lib/public/src/utils/hooks/useHiddenStyle.ts +19 -0
- package/lib/public/src/utils/hooks/useMovable.ts +227 -0
- package/lib/public/src/utils/hooks/usePersistFn.ts +17 -0
- package/lib/public/src/utils/hooks/useReactive.ts +73 -0
- package/lib/public/src/utils/hooks/useRefState.ts +25 -0
- package/lib/public/src/utils/hooks/useSetState.ts +25 -0
- package/lib/public/src/utils/hooks/useStyle.ts +139 -0
- package/lib/public/src/utils/hooks/useTrackedEffect.ts +39 -0
- package/lib/public/src/utils/hooks/useUpdate.ts +9 -0
- package/lib/public/src/utils/hooks/useUpdateDeepEffect.ts +22 -0
- package/lib/public/src/utils/hooks/useUpdateEffect.ts +18 -0
- package/lib/public/src/utils/hooks/useWhyDidYouUpdate.ts +32 -0
- package/lib/public/src/utils/i18n/i18n.ts +15 -0
- package/lib/public/src/utils/i18n/index.ts +7 -0
- package/lib/public/src/utils/i18n/locale/app/en_US.ts +77 -0
- package/lib/public/src/utils/i18n/locale/app/index.ts +9 -0
- package/lib/public/src/utils/i18n/locale/app/otherLocale.ts +2 -0
- package/lib/public/src/utils/i18n/locale/app/zh_CN.ts +65 -0
- package/lib/public/src/utils/i18n/locale/app/zh_HK.ts +66 -0
- package/lib/public/src/utils/i18n/locale/base/en_US.ts +449 -0
- package/lib/public/src/utils/i18n/locale/base/index.ts +5 -0
- package/lib/public/src/utils/i18n/locale/base/zh_CN.ts +413 -0
- package/lib/public/src/utils/i18n/locale/base/zh_HK.ts +411 -0
- package/lib/public/src/utils/i18n/locale/pc/en_US.ts +131 -0
- package/lib/public/src/utils/i18n/locale/pc/index.ts +9 -0
- package/lib/public/src/utils/i18n/locale/pc/otherLocale.ts +2 -0
- package/lib/public/src/utils/i18n/locale/pc/zh_CN.ts +105 -0
- package/lib/public/src/utils/i18n/locale/pc/zh_HK.ts +105 -0
- package/lib/public/src/utils/i18n/localeMonitor.ts +71 -0
- package/lib/public/src/utils/i18n/locales.ts +30 -0
- package/lib/public/src/utils/i18n/replaceMessage.ts +29 -0
- package/lib/public/src/utils/i18n/types.ts +2 -0
- package/lib/public/src/utils/i18n/useLocale.ts +129 -0
- package/lib/public/src/utils/lcdpApi.ts +215 -0
- package/lib/public/src/utils/lcdpBaseApi.ts +293 -0
- package/lib/public/src/utils/messageApi.ts +93 -0
- package/lib/public/src/utils/platform/index.ts +1 -0
- package/lib/public/src/utils/platform/type.ts +7 -0
- package/lib/public/src/utils/platform/utils/fileUtils.ts +536 -0
- package/lib/public/src/utils/preprocess.ts +88 -0
- package/lib/public/src/utils/sandBoxLoadModule.ts +216 -0
- package/lib/public/src/utils/sandbox/browserCompatible.ts +54 -0
- package/lib/public/src/utils/sandbox/compileCode.ts +81 -0
- package/lib/public/src/utils/sandbox/index.ts +5 -0
- package/lib/public/src/utils/sandbox/sandbox.ts +324 -0
- package/lib/public/src/utils/sandbox/sandboxrules.ts +206 -0
- package/lib/public/src/utils/sandbox/utils.ts +9 -0
- package/lib/public/src/utils/service/baseRequest.ts +111 -0
- package/lib/public/src/utils/service/commonFetch.ts +140 -0
- package/lib/public/src/utils/service/defaultResponseInterceptor.ts +84 -0
- package/lib/public/src/utils/service/resolveApiPath.ts +24 -0
- package/lib/public/src/utils/service/urlHelper.ts +56 -0
- package/lib/public/src/utils/styleInject.ts +17 -0
- package/lib/public/src/utils/svgImage/imageUtils.ts +3 -0
- package/lib/public/src/utils/svgImage/index.ts +10 -0
- package/lib/public/src/utils/uid.ts +33 -0
- package/lib/public/src/utils/useComponentHoc.ts +96 -0
- package/lib/public/src/utils/useSetState.ts +26 -0
- package/lib/public/src/utils/useTool.ts +428 -0
- package/lib/public/tsconfig.json +33 -0
- package/lib/public/typings.d.ts +1 -0
- package/package.json +31 -0
package/es/index.js
ADDED
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
var _excluded = ["frontendDatasourceContent"];
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
5
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
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); }
|
|
14
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
|
+
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; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
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); }
|
|
23
|
+
import { generateCode, init as ebeInit, publishers } from '@lingxiteam/ebe';
|
|
24
|
+
import { lingxiDslRules } from "./constants";
|
|
25
|
+
export * from "./types";
|
|
26
|
+
var isArray = function isArray(arr) {
|
|
27
|
+
if (Array.isArray) {
|
|
28
|
+
return Array.isArray(arr);
|
|
29
|
+
} else {
|
|
30
|
+
return Object.prototype.toString.call(arr) === '[object Array]';
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export var clearAppInfo = function clearAppInfo(appInfo) {
|
|
34
|
+
var includes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['appId', 'appCode', 'appName', 'applicationIcon'];
|
|
35
|
+
return Object.keys(appInfo || {}).reduce(function (pre, key) {
|
|
36
|
+
if (includes.includes(key)) {
|
|
37
|
+
pre[key] = appInfo[key];
|
|
38
|
+
}
|
|
39
|
+
return pre;
|
|
40
|
+
}, {});
|
|
41
|
+
};
|
|
42
|
+
export var clearProps = function clearProps(data, diff) {
|
|
43
|
+
var clearedProps = _objectSpread({}, data);
|
|
44
|
+
Object.keys(diff).forEach(function (key) {
|
|
45
|
+
if (_typeof(diff[key]) === 'object' && !isArray(diff[key])) {
|
|
46
|
+
clearedProps[key] = clearProps(clearedProps[key], diff[key]);
|
|
47
|
+
} else if (isArray(diff[key]) && isArray(clearedProps[key])) {
|
|
48
|
+
delete clearedProps[key];
|
|
49
|
+
} else if (typeof diff[key] === 'function') {
|
|
50
|
+
if (diff[key](clearedProps)) {
|
|
51
|
+
delete clearedProps[key];
|
|
52
|
+
}
|
|
53
|
+
} else if (diff[key] === clearedProps[key]) {
|
|
54
|
+
delete clearedProps[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return clearedProps;
|
|
58
|
+
};
|
|
59
|
+
export var getNewDataByRules = function getNewDataByRules(value, rule, path) {
|
|
60
|
+
var newValue = _objectSpread({}, value);
|
|
61
|
+
var newData = newValue;
|
|
62
|
+
var rootObj = rule === null || rule === void 0 ? void 0 : rule({
|
|
63
|
+
paths: path,
|
|
64
|
+
value: newValue,
|
|
65
|
+
key: 'root',
|
|
66
|
+
diffraction: function diffraction(diffObj) {
|
|
67
|
+
return clearProps(newValue, diffObj);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
if (rootObj && rootObj !== true) {
|
|
71
|
+
newData = rootObj;
|
|
72
|
+
} else {
|
|
73
|
+
// 只支持两层
|
|
74
|
+
Object.keys(newValue).forEach(function (newKey) {
|
|
75
|
+
var res = rule === null || rule === void 0 ? void 0 : rule({
|
|
76
|
+
paths: [].concat(_toConsumableArray(path), [newKey]),
|
|
77
|
+
value: newValue[newKey],
|
|
78
|
+
key: newKey
|
|
79
|
+
});
|
|
80
|
+
if (res === true) {
|
|
81
|
+
delete newValue[newKey];
|
|
82
|
+
} else if (res) {
|
|
83
|
+
newValue[newKey] = res;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
newData = newValue;
|
|
87
|
+
}
|
|
88
|
+
return newData;
|
|
89
|
+
};
|
|
90
|
+
export var removeObjectByRules = function removeObjectByRules(data, rules) {
|
|
91
|
+
var paths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
92
|
+
var newData = {};
|
|
93
|
+
var _loop = function _loop() {
|
|
94
|
+
if (data.hasOwnProperty(key)) {
|
|
95
|
+
var value = data[key];
|
|
96
|
+
var rule = rules[key];
|
|
97
|
+
var path = [].concat(_toConsumableArray(paths), [key]);
|
|
98
|
+
if (rule && rule.rule && rule.rule({
|
|
99
|
+
paths: [key],
|
|
100
|
+
value: value,
|
|
101
|
+
key: key
|
|
102
|
+
}) === true) {
|
|
103
|
+
return 1; // continue
|
|
104
|
+
}
|
|
105
|
+
var loopRule = rule && rule.loopRule;
|
|
106
|
+
var loop = rule && rule.loop;
|
|
107
|
+
if (loopRule && loop) {
|
|
108
|
+
newData[key] = value.map(function (item) {
|
|
109
|
+
var loopKey = loopRule(item);
|
|
110
|
+
var loopRuleObj = loop[loopKey];
|
|
111
|
+
if (loopKey === 'item') {
|
|
112
|
+
return removeObjectByRules(item, loopRuleObj, path);
|
|
113
|
+
}
|
|
114
|
+
if (loopRuleObj && loopRuleObj !== null && loopRuleObj !== void 0 && loopRuleObj.rule) {
|
|
115
|
+
return getNewDataByRules(item, loopRuleObj === null || loopRuleObj === void 0 ? void 0 : loopRuleObj.rule, path);
|
|
116
|
+
}
|
|
117
|
+
return item;
|
|
118
|
+
});
|
|
119
|
+
} else if (_typeof(value) === 'object' && value !== null && rule !== null && rule !== void 0 && rule.rule) {
|
|
120
|
+
newData[key] = getNewDataByRules(value, rule === null || rule === void 0 ? void 0 : rule.rule, path);
|
|
121
|
+
} else {
|
|
122
|
+
newData[key] = value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
for (var key in data) {
|
|
127
|
+
if (_loop()) continue;
|
|
128
|
+
}
|
|
129
|
+
return newData;
|
|
130
|
+
};
|
|
131
|
+
// 删除 defaultVersionId 字段 ,
|
|
132
|
+
// components 中的 compName 值为 View 时
|
|
133
|
+
// 当 props 中的 conten 字段等于 $$ 时 删除 conten
|
|
134
|
+
// const dsRules: IRulesType = {
|
|
135
|
+
// defaultVersionId: {
|
|
136
|
+
// rule: () => true,
|
|
137
|
+
// },
|
|
138
|
+
// components: {
|
|
139
|
+
// loopRule: (item) => item.compName,
|
|
140
|
+
// loop: {
|
|
141
|
+
// View: {
|
|
142
|
+
// rule: ({ diffraction }) => {
|
|
143
|
+
// return diffraction?.({
|
|
144
|
+
// props: {
|
|
145
|
+
// conten: '$$',
|
|
146
|
+
// },
|
|
147
|
+
// });
|
|
148
|
+
// },
|
|
149
|
+
// },
|
|
150
|
+
// },
|
|
151
|
+
// },
|
|
152
|
+
// };
|
|
153
|
+
|
|
154
|
+
export var treeForEach = function treeForEach(tree, callback) {
|
|
155
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
156
|
+
children: 'components'
|
|
157
|
+
};
|
|
158
|
+
callback(tree, true);
|
|
159
|
+
var loop = function loop(children) {
|
|
160
|
+
children === null || children === void 0 || children.forEach(function (item) {
|
|
161
|
+
callback(item, false);
|
|
162
|
+
if (Array.isArray(item === null || item === void 0 ? void 0 : item[options.children])) {
|
|
163
|
+
loop(item === null || item === void 0 ? void 0 : item[options.children]);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
var list = tree[options.children];
|
|
168
|
+
loop(list);
|
|
169
|
+
};
|
|
170
|
+
export var getPageDsls = function getPageDsls(resultObjects) {
|
|
171
|
+
return resultObjects.filter(Boolean).map(function (i) {
|
|
172
|
+
try {
|
|
173
|
+
var pageData = JSON.parse(i.attrMappingJson);
|
|
174
|
+
pageData.pageId = i === null || i === void 0 ? void 0 : i.pageId;
|
|
175
|
+
return pageData;
|
|
176
|
+
} catch (error) {
|
|
177
|
+
console.error(error, '该页面信息出错', i);
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
}).filter(Boolean);
|
|
181
|
+
};
|
|
182
|
+
export function findAllItem(target, callback, itemHash) {
|
|
183
|
+
var list = target;
|
|
184
|
+
// Makes sures is always has an positive integer as length.
|
|
185
|
+
// eslint-disable-next-line
|
|
186
|
+
var length = list.length >>> 0;
|
|
187
|
+
// eslint-disable-next-line
|
|
188
|
+
var thisArg = arguments[1];
|
|
189
|
+
for (var i = 0; i < length;) {
|
|
190
|
+
var element = list[i];
|
|
191
|
+
if (callback.call(thisArg, element, i, list)) {
|
|
192
|
+
var _element$props$busiCo, _element$props;
|
|
193
|
+
itemHash[(_element$props$busiCo = element === null || element === void 0 || (_element$props = element.props) === null || _element$props === void 0 ? void 0 : _element$props.busiCompId) !== null && _element$props$busiCo !== void 0 ? _element$props$busiCo : ''] = 1;
|
|
194
|
+
}
|
|
195
|
+
i += 1;
|
|
196
|
+
if (element !== null && element !== void 0 && element.components) {
|
|
197
|
+
findAllItem(element === null || element === void 0 ? void 0 : element.components, callback, itemHash);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
export function findItem(target, callback) {
|
|
202
|
+
var list = target;
|
|
203
|
+
// Makes sures is always has an positive integer as length.
|
|
204
|
+
// eslint-disable-next-line
|
|
205
|
+
var length = list.length >>> 0;
|
|
206
|
+
// eslint-disable-next-line
|
|
207
|
+
var thisArg = arguments[1];
|
|
208
|
+
for (var i = 0; i < length;) {
|
|
209
|
+
var element = list[i];
|
|
210
|
+
if (callback.call(thisArg, element, i, list)) {
|
|
211
|
+
return element;
|
|
212
|
+
}
|
|
213
|
+
i += 1;
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
export var cleanTree = function cleanTree(tree, fields) {
|
|
218
|
+
var fieldSet = new Set(fields); // 使用set结构可以提高查询速度
|
|
219
|
+
|
|
220
|
+
if (Array.isArray(tree)) {
|
|
221
|
+
return tree.map(function (item) {
|
|
222
|
+
return cleanTree(item, fields);
|
|
223
|
+
});
|
|
224
|
+
} else if (_typeof(tree) === 'object' && tree !== null) {
|
|
225
|
+
return Object.entries(tree).reduce(function (newTree, _ref) {
|
|
226
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
227
|
+
key = _ref2[0],
|
|
228
|
+
value = _ref2[1];
|
|
229
|
+
if (!fieldSet.has(key)) {
|
|
230
|
+
// @ts-ignore
|
|
231
|
+
newTree[key] = cleanTree(value, fields);
|
|
232
|
+
}
|
|
233
|
+
return newTree;
|
|
234
|
+
}, {});
|
|
235
|
+
} else {
|
|
236
|
+
return tree;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
export var clearLXPagesDSL = function clearLXPagesDSL(pages) {
|
|
240
|
+
return pages.map(function (page) {
|
|
241
|
+
return removeObjectByRules(page, lingxiDslRules);
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
var workerJsUrl = '';
|
|
245
|
+
export var setWorkerJsUrl = function setWorkerJsUrl(url) {
|
|
246
|
+
workerJsUrl = url;
|
|
247
|
+
};
|
|
248
|
+
export var init = /*#__PURE__*/function () {
|
|
249
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
250
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
251
|
+
while (1) switch (_context.prev = _context.next) {
|
|
252
|
+
case 0:
|
|
253
|
+
_context.next = 2;
|
|
254
|
+
return ebeInit({
|
|
255
|
+
workerJsUrl: workerJsUrl
|
|
256
|
+
});
|
|
257
|
+
case 2:
|
|
258
|
+
case "end":
|
|
259
|
+
return _context.stop();
|
|
260
|
+
}
|
|
261
|
+
}, _callee);
|
|
262
|
+
}));
|
|
263
|
+
return function init() {
|
|
264
|
+
return _ref3.apply(this, arguments);
|
|
265
|
+
};
|
|
266
|
+
}();
|
|
267
|
+
export var fetchData = /*#__PURE__*/function () {
|
|
268
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref4) {
|
|
269
|
+
var appId, services, platform, baseUrl, onProgress, appInfo, attrSpecPage, resultObject, frontendHookList, themeCss, temCompAssetList, compAssetList, globalDataInfo, dataSourceList, globalDataMap, pageIdMapping, appPageList, lastPageId, data, pages, itemHash, itemLists, busiData, busiCompMapping, busiPages, pageDSLS, options, cleanedTree;
|
|
270
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
271
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
272
|
+
case 0:
|
|
273
|
+
appId = _ref4.appId, services = _ref4.services, platform = _ref4.platform, baseUrl = _ref4.baseUrl, onProgress = _ref4.onProgress;
|
|
274
|
+
_context2.next = 3;
|
|
275
|
+
return services.findApplication({
|
|
276
|
+
appId: appId
|
|
277
|
+
});
|
|
278
|
+
case 3:
|
|
279
|
+
appInfo = _context2.sent;
|
|
280
|
+
onProgress({
|
|
281
|
+
log: '获取应用信息',
|
|
282
|
+
progress: 1
|
|
283
|
+
});
|
|
284
|
+
// 根据 appId 获取当前应用的全部页面
|
|
285
|
+
_context2.next = 7;
|
|
286
|
+
return services.qryAttrSpecPage({
|
|
287
|
+
appId: appId,
|
|
288
|
+
pageNum: 1,
|
|
289
|
+
pageSize: 999999
|
|
290
|
+
});
|
|
291
|
+
case 7:
|
|
292
|
+
attrSpecPage = _context2.sent;
|
|
293
|
+
onProgress({
|
|
294
|
+
log: '获取当前应用的全部页面',
|
|
295
|
+
progress: 2
|
|
296
|
+
});
|
|
297
|
+
// 根据 appId 获取当前应用的全部页面
|
|
298
|
+
_context2.next = 11;
|
|
299
|
+
return services.qryPageInstListByAppId({
|
|
300
|
+
appId: appId,
|
|
301
|
+
terminalType: platform
|
|
302
|
+
});
|
|
303
|
+
case 11:
|
|
304
|
+
resultObject = _context2.sent;
|
|
305
|
+
_context2.next = 14;
|
|
306
|
+
return services.queryFrontendHookList({
|
|
307
|
+
appId: appId
|
|
308
|
+
});
|
|
309
|
+
case 14:
|
|
310
|
+
frontendHookList = _context2.sent;
|
|
311
|
+
themeCss = '';
|
|
312
|
+
_context2.prev = 16;
|
|
313
|
+
_context2.next = 19;
|
|
314
|
+
return Promise.race([services.getThemeCss({
|
|
315
|
+
appId: appId,
|
|
316
|
+
terminalType: platform
|
|
317
|
+
}), new Promise(function (resolve) {
|
|
318
|
+
return setTimeout(resolve, 3000);
|
|
319
|
+
})]);
|
|
320
|
+
case 19:
|
|
321
|
+
themeCss = _context2.sent;
|
|
322
|
+
_context2.next = 24;
|
|
323
|
+
break;
|
|
324
|
+
case 22:
|
|
325
|
+
_context2.prev = 22;
|
|
326
|
+
_context2.t0 = _context2["catch"](16);
|
|
327
|
+
case 24:
|
|
328
|
+
// 根据 appId 获取当前应用的使用的自定义组件
|
|
329
|
+
onProgress({
|
|
330
|
+
log: '获取当前应用的使用的自定义组件',
|
|
331
|
+
progress: 3
|
|
332
|
+
});
|
|
333
|
+
_context2.next = 27;
|
|
334
|
+
return services.qryPageCompAssetList({
|
|
335
|
+
appId: appId
|
|
336
|
+
});
|
|
337
|
+
case 27:
|
|
338
|
+
temCompAssetList = _context2.sent;
|
|
339
|
+
// 兼容下割接数据,数组前面的自定义组件是新的
|
|
340
|
+
compAssetList = temCompAssetList.reduce(function (acc, current) {
|
|
341
|
+
var codes = acc.map(function (item) {
|
|
342
|
+
return item.compCode;
|
|
343
|
+
});
|
|
344
|
+
if (!codes.includes(current.compCode)) {
|
|
345
|
+
acc.push(current);
|
|
346
|
+
}
|
|
347
|
+
return acc;
|
|
348
|
+
}, []); // 根据appId 获取全局数据源
|
|
349
|
+
onProgress({
|
|
350
|
+
log: '获取全局数据源',
|
|
351
|
+
progress: 4
|
|
352
|
+
});
|
|
353
|
+
_context2.next = 32;
|
|
354
|
+
return services.queryFrontendDatasourcePage({
|
|
355
|
+
appId: appId,
|
|
356
|
+
pageSize: 10000
|
|
357
|
+
});
|
|
358
|
+
case 32:
|
|
359
|
+
globalDataInfo = _context2.sent;
|
|
360
|
+
dataSourceList = (globalDataInfo === null || globalDataInfo === void 0 ? void 0 : globalDataInfo.list) || [];
|
|
361
|
+
globalDataMap = {};
|
|
362
|
+
dataSourceList.forEach(function (item) {
|
|
363
|
+
var frontendDatasourceContent = item.frontendDatasourceContent,
|
|
364
|
+
restItem = _objectWithoutProperties(item, _excluded);
|
|
365
|
+
try {
|
|
366
|
+
globalDataMap[item.frontendDatasourceMainId] = _objectSpread(_objectSpread({}, restItem), {}, {
|
|
367
|
+
frontendDatasourceContent: JSON.parse(frontendDatasourceContent)
|
|
368
|
+
});
|
|
369
|
+
} catch (err) {}
|
|
370
|
+
return null;
|
|
371
|
+
});
|
|
372
|
+
pageIdMapping = {};
|
|
373
|
+
appPageList = resultObject === null || resultObject === void 0 ? void 0 : resultObject.map(function (i) {
|
|
374
|
+
pageIdMapping[i.pagePath] = i.pageId;
|
|
375
|
+
return i;
|
|
376
|
+
});
|
|
377
|
+
lastPageId = ''; // 根据 pageId 获得 dsl
|
|
378
|
+
data = [];
|
|
379
|
+
onProgress({
|
|
380
|
+
log: '获取所有页面dsl',
|
|
381
|
+
progress: 5
|
|
382
|
+
});
|
|
383
|
+
_context2.next = 43;
|
|
384
|
+
return Promise.all(appPageList.map(function (i) {
|
|
385
|
+
lastPageId = i.pageId;
|
|
386
|
+
return services.findPageInstByVersionId({
|
|
387
|
+
appId: appId,
|
|
388
|
+
pageId: i.pageId
|
|
389
|
+
});
|
|
390
|
+
}));
|
|
391
|
+
case 43:
|
|
392
|
+
data = _context2.sent;
|
|
393
|
+
pages = getPageDsls(data); // busiCompId 过滤重复
|
|
394
|
+
itemHash = {}; // 找到所有页面使用到的 业务组件
|
|
395
|
+
findAllItem(pages, function (item) {
|
|
396
|
+
return item.compName === 'BOFramer';
|
|
397
|
+
}, itemHash);
|
|
398
|
+
itemLists = Object.keys(itemHash); // 请求所有业务组件的 dsl
|
|
399
|
+
onProgress({
|
|
400
|
+
log: '获取所有业务组件dsl',
|
|
401
|
+
progress: 6
|
|
402
|
+
});
|
|
403
|
+
_context2.next = 51;
|
|
404
|
+
return Promise.all(itemLists.map(function (i) {
|
|
405
|
+
return services.findBusiCompById({
|
|
406
|
+
busiCompId: i,
|
|
407
|
+
appId: appId,
|
|
408
|
+
pageId: lastPageId
|
|
409
|
+
});
|
|
410
|
+
}));
|
|
411
|
+
case 51:
|
|
412
|
+
busiData = _context2.sent;
|
|
413
|
+
busiCompMapping = {};
|
|
414
|
+
busiPages = busiData.map(function (i, index) {
|
|
415
|
+
var _i$busiCompVersion;
|
|
416
|
+
var busiData = JSON.parse(i === null || i === void 0 || (_i$busiCompVersion = i.busiCompVersion) === null || _i$busiCompVersion === void 0 ? void 0 : _i$busiCompVersion.sourceCodeJson);
|
|
417
|
+
busiData.busiCompId = i === null || i === void 0 ? void 0 : i.busiCompId;
|
|
418
|
+
busiCompMapping[itemLists[index]] = busiData.id;
|
|
419
|
+
return busiData;
|
|
420
|
+
}); // 合并页面,生成器那边支持页面类型和业务组件类型
|
|
421
|
+
pageDSLS = [].concat(_toConsumableArray(pages), _toConsumableArray(busiPages));
|
|
422
|
+
options = {
|
|
423
|
+
platform: platform,
|
|
424
|
+
appId: appId,
|
|
425
|
+
pageIdMapping: pageIdMapping,
|
|
426
|
+
busiCompMapping: busiCompMapping,
|
|
427
|
+
compAssetList: compAssetList || [],
|
|
428
|
+
baseUrl: baseUrl,
|
|
429
|
+
appConfig: {
|
|
430
|
+
frontendHookList: frontendHookList
|
|
431
|
+
},
|
|
432
|
+
attrSpecPage: ((attrSpecPage === null || attrSpecPage === void 0 ? void 0 : attrSpecPage.list) || []).map(function (i) {
|
|
433
|
+
return i.attrNbr;
|
|
434
|
+
}),
|
|
435
|
+
themeCss: themeCss,
|
|
436
|
+
models: globalDataMap,
|
|
437
|
+
appInfo: clearAppInfo(appInfo)
|
|
438
|
+
};
|
|
439
|
+
onProgress({
|
|
440
|
+
log: '清理无用数据',
|
|
441
|
+
progress: 7
|
|
442
|
+
});
|
|
443
|
+
cleanedTree = cleanTree(pageDSLS, ['path']); // 清理字段'b'和字段'e'
|
|
444
|
+
cleanedTree = clearLXPagesDSL(cleanedTree);
|
|
445
|
+
return _context2.abrupt("return", {
|
|
446
|
+
options: options,
|
|
447
|
+
cleanedTree: cleanedTree
|
|
448
|
+
});
|
|
449
|
+
case 60:
|
|
450
|
+
case "end":
|
|
451
|
+
return _context2.stop();
|
|
452
|
+
}
|
|
453
|
+
}, _callee2, null, [[16, 22]]);
|
|
454
|
+
}));
|
|
455
|
+
return function fetchData(_x) {
|
|
456
|
+
return _ref5.apply(this, arguments);
|
|
457
|
+
};
|
|
458
|
+
}();
|
|
459
|
+
export var codeCreate = /*#__PURE__*/function () {
|
|
460
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref6) {
|
|
461
|
+
var appId, services, platform, baseUrl, _onProgress, _yield$fetchData, cleanedTree, options, result;
|
|
462
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
463
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
464
|
+
case 0:
|
|
465
|
+
appId = _ref6.appId, services = _ref6.services, platform = _ref6.platform, baseUrl = _ref6.baseUrl, _onProgress = _ref6.onProgress;
|
|
466
|
+
_context3.prev = 1;
|
|
467
|
+
_context3.next = 4;
|
|
468
|
+
return fetchData({
|
|
469
|
+
appId: appId,
|
|
470
|
+
services: services,
|
|
471
|
+
platform: platform,
|
|
472
|
+
baseUrl: baseUrl,
|
|
473
|
+
onProgress: _onProgress
|
|
474
|
+
});
|
|
475
|
+
case 4:
|
|
476
|
+
_yield$fetchData = _context3.sent;
|
|
477
|
+
cleanedTree = _yield$fetchData.cleanedTree;
|
|
478
|
+
options = _yield$fetchData.options;
|
|
479
|
+
console.log(cleanedTree);
|
|
480
|
+
console.log(options);
|
|
481
|
+
_context3.next = 11;
|
|
482
|
+
return generateCode({
|
|
483
|
+
solution: 'alita',
|
|
484
|
+
// 出码方案
|
|
485
|
+
options: options,
|
|
486
|
+
schema: cleanedTree,
|
|
487
|
+
// 编排搭建出来的 schema
|
|
488
|
+
onProgress: function onProgress(log) {
|
|
489
|
+
var _log$match;
|
|
490
|
+
if (!log || typeof log !== 'string') {
|
|
491
|
+
// 错误数据,不给返回
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
if (log !== null && log !== void 0 && log.includes('出码生成完成')) {
|
|
495
|
+
_onProgress({
|
|
496
|
+
log: log,
|
|
497
|
+
progress: 100
|
|
498
|
+
});
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
var p = ((_log$match = log.match(/(?<=\(总进度: ).*?(?=\%)/)) === null || _log$match === void 0 ? void 0 : _log$match[0]) || '0';
|
|
502
|
+
if (p) {
|
|
503
|
+
_onProgress({
|
|
504
|
+
log: log,
|
|
505
|
+
progress: parseFloat(p)
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
workerJsUrl: workerJsUrl
|
|
510
|
+
});
|
|
511
|
+
case 11:
|
|
512
|
+
result = _context3.sent;
|
|
513
|
+
console.log(result);
|
|
514
|
+
// 出码结果(默认是递归结构描述的,可以传 flattenResult: true 以生成扁平结构的结果)
|
|
515
|
+
publishers.zip().publish({
|
|
516
|
+
project: result,
|
|
517
|
+
// 上一步生成的 project
|
|
518
|
+
projectSlug: appId // 项目标识
|
|
519
|
+
});
|
|
520
|
+
return _context3.abrupt("return", {
|
|
521
|
+
success: true
|
|
522
|
+
});
|
|
523
|
+
case 17:
|
|
524
|
+
_context3.prev = 17;
|
|
525
|
+
_context3.t0 = _context3["catch"](1);
|
|
526
|
+
return _context3.abrupt("return", {
|
|
527
|
+
msg: _context3.t0,
|
|
528
|
+
success: false
|
|
529
|
+
});
|
|
530
|
+
case 20:
|
|
531
|
+
case "end":
|
|
532
|
+
return _context3.stop();
|
|
533
|
+
}
|
|
534
|
+
}, _callee3, null, [[1, 17]]);
|
|
535
|
+
}));
|
|
536
|
+
return function codeCreate(_x2) {
|
|
537
|
+
return _ref7.apply(this, arguments);
|
|
538
|
+
};
|
|
539
|
+
}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getAllImportFiles: (target: string, allImportFiles?: any) => any;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import traverse from '@babel/traverse';
|
|
2
|
+
import { existsSync, readFileSync } from 'fs';
|
|
3
|
+
import { dirname, resolve } from 'path';
|
|
4
|
+
import { getRealPath, isJsFile, isLessFile } from "./getRealPath";
|
|
5
|
+
import { parse } from "./parse";
|
|
6
|
+
export var getAllImportFiles = function getAllImportFiles(target) {
|
|
7
|
+
var allImportFiles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8
|
+
if (!existsSync(target)) {
|
|
9
|
+
return allImportFiles;
|
|
10
|
+
}
|
|
11
|
+
// 如果不是 js 或 less 文件 ,只拷贝了它自己。
|
|
12
|
+
if (!isJsFile(target) && !isLessFile(target)) {
|
|
13
|
+
allImportFiles[target] = true;
|
|
14
|
+
return allImportFiles;
|
|
15
|
+
}
|
|
16
|
+
var content = readFileSync(target, 'utf-8').toString();
|
|
17
|
+
var getNextImport = function getNextImport(importName) {
|
|
18
|
+
var isAlias = importName.startsWith('@/');
|
|
19
|
+
var isRelative = importName.startsWith('.');
|
|
20
|
+
if (isAlias || isRelative) {
|
|
21
|
+
// 绝对路径是三方包
|
|
22
|
+
// @/ 是别名到 ${cwd}/src
|
|
23
|
+
var nextPath = resolve(dirname(target), importName);
|
|
24
|
+
if (isAlias) {
|
|
25
|
+
nextPath = importName.replace('@/', "".concat(process.cwd(), "/src/"));
|
|
26
|
+
}
|
|
27
|
+
var nextTarget = getRealPath(nextPath);
|
|
28
|
+
if (!allImportFiles[nextTarget]) {
|
|
29
|
+
allImportFiles[nextTarget] = true;
|
|
30
|
+
getAllImportFiles(nextTarget, allImportFiles);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
// 手动解析 less 文件
|
|
35
|
+
if (isLessFile(target)) {
|
|
36
|
+
var _content$match;
|
|
37
|
+
// 注释中的 less 文件也会被拷贝,方便开启和关闭
|
|
38
|
+
var importList = ((_content$match = content.match(/@import '([^']+)'/g)) === null || _content$match === void 0 ? void 0 : _content$match.map(function (match) {
|
|
39
|
+
return match.slice(9, -1);
|
|
40
|
+
}).filter(function (i) {
|
|
41
|
+
return i.startsWith('.');
|
|
42
|
+
})) || [];
|
|
43
|
+
importList.forEach(function (i) {
|
|
44
|
+
getNextImport(i);
|
|
45
|
+
});
|
|
46
|
+
return allImportFiles;
|
|
47
|
+
}
|
|
48
|
+
var ast = parse(content);
|
|
49
|
+
var visitor = {
|
|
50
|
+
Import: function Import(path) {
|
|
51
|
+
var source = path.parentPath;
|
|
52
|
+
var args = source.get('arguments');
|
|
53
|
+
if (args[0].node) {
|
|
54
|
+
var importName = args[0].node.value;
|
|
55
|
+
getNextImport(importName);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
ImportDeclaration: function ImportDeclaration(path) {
|
|
59
|
+
var source = path.get('source');
|
|
60
|
+
var importName = source.node.value;
|
|
61
|
+
getNextImport(importName);
|
|
62
|
+
},
|
|
63
|
+
ExportAllDeclaration: function ExportAllDeclaration(path) {
|
|
64
|
+
var source = path.get('source');
|
|
65
|
+
var importName = source.node.value;
|
|
66
|
+
getNextImport(importName);
|
|
67
|
+
},
|
|
68
|
+
ExportNamedDeclaration: function ExportNamedDeclaration(path) {
|
|
69
|
+
var source = path.get('source');
|
|
70
|
+
// export 不一定是 from 来源,可能是上下文变量
|
|
71
|
+
if (source.node) {
|
|
72
|
+
var importName = source.node.value;
|
|
73
|
+
getNextImport(importName);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
traverse(ast, visitor);
|
|
78
|
+
return allImportFiles;
|
|
79
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const FILE_EXT_NAMES: string[];
|
|
2
|
+
export declare const LESS_EXT_NAMES: string[];
|
|
3
|
+
export declare const isJsFile: (file: string) => boolean;
|
|
4
|
+
export declare const isLessFile: (file: string) => boolean;
|
|
5
|
+
export declare function getRealPath(target: string): string;
|