vap1 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/basetype.d.ts +62 -0
- package/basetype.js +2 -0
- package/components/Box/Box.d.ts +118 -0
- package/components/Box/Box.js +150 -0
- package/components/Box/SelectBar.d.ts +90 -0
- package/components/Box/SelectBar.js +93 -0
- package/components/Box/_register.d.ts +49 -0
- package/components/Box/_register.js +29 -0
- package/components/Box/index.d.ts +9 -0
- package/components/Box/index.js +6 -0
- package/components/Lists/SList.d.ts +58 -0
- package/components/Lists/SList.js +167 -0
- package/components/SearchBar/ActionButtons.d.ts +49 -0
- package/components/SearchBar/ActionButtons.js +96 -0
- package/components/SearchBar/ByField.d.ts +3 -0
- package/components/SearchBar/ByField.js +193 -0
- package/components/SearchBar/ByKeyword.d.ts +3 -0
- package/components/SearchBar/ByKeyword.js +34 -0
- package/components/SearchBar/SearchField.d.ts +15 -0
- package/components/SearchBar/SearchField.js +25 -0
- package/components/SearchBar/SearchTags.d.ts +2 -0
- package/components/SearchBar/SearchTags.js +18 -0
- package/components/SearchBar/_FieldType.d.ts +8 -0
- package/components/SearchBar/_FieldType.js +45 -0
- package/components/SearchBar/_register.d.ts +65 -0
- package/components/SearchBar/_register.js +29 -0
- package/components/SearchBar/index.d.ts +134 -0
- package/components/SearchBar/index.js +33 -0
- package/components/Tables/ApiTable.d.ts +18 -0
- package/components/Tables/ApiTable.js +48 -0
- package/components/Tables/ApiTableModal.d.ts +22 -0
- package/components/Tables/ApiTableModal.js +73 -0
- package/components/Tables/Components/ActionBar.d.ts +56 -0
- package/components/Tables/Components/ActionBar.js +100 -0
- package/components/Tables/Components/Actions.d.ts +47 -0
- package/components/Tables/Components/Actions.js +91 -0
- package/components/Tables/Components/Summary.d.ts +11 -0
- package/components/Tables/Components/Summary.js +11 -0
- package/components/Tables/Components/index.d.ts +17 -0
- package/components/Tables/Components/index.js +19 -0
- package/components/Tables/STable.d.ts +5 -0
- package/components/Tables/STable.js +37 -0
- package/components/Tables/TopTable.d.ts +24 -0
- package/components/Tables/TopTable.js +157 -0
- package/components/Tables/TopTableModal.d.ts +5 -0
- package/components/Tables/TopTableModal.js +20 -0
- package/components/Tables/Util.d.ts +3 -0
- package/components/Tables/Util.js +41 -0
- package/components/Tables/VTable.d.ts +11 -0
- package/components/Tables/VTable.js +237 -0
- package/components/Tables/index.d.ts +81 -0
- package/components/Tables/index.js +20 -0
- package/components/TreeSelect/BaseTreeSelect.d.ts +33 -0
- package/components/TreeSelect/BaseTreeSelect.js +190 -0
- package/components/TreeSelect/DTreeSelect.d.ts +24 -0
- package/components/TreeSelect/DTreeSelect.js +66 -0
- package/components/TreeSelect/FTreeSelect.d.ts +11 -0
- package/components/TreeSelect/FTreeSelect.js +39 -0
- package/components/TreeSelect/STreeSelect.d.ts +14 -0
- package/components/TreeSelect/STreeSelect.js +52 -0
- package/components/TreeSelect/index.d.ts +94 -0
- package/components/TreeSelect/index.js +9 -0
- package/components/Trees/ActionTree.d.ts +54 -0
- package/components/Trees/ActionTree.js +657 -0
- package/components/Trees/BaseTree.d.ts +31 -0
- package/components/Trees/BaseTree.js +185 -0
- package/components/Trees/DTree.d.ts +48 -0
- package/components/Trees/DTree.js +142 -0
- package/components/Trees/FTree.d.ts +33 -0
- package/components/Trees/FTree.js +79 -0
- package/components/Trees/STree.d.ts +21 -0
- package/components/Trees/STree.js +92 -0
- package/components/Trees/index.d.ts +134 -0
- package/components/Trees/index.js +9 -0
- package/components/UForm/FormWrapper.d.ts +22 -0
- package/components/UForm/FormWrapper.js +270 -0
- package/components/UForm/UDescriptions.d.ts +5 -0
- package/components/UForm/UDescriptions.js +134 -0
- package/components/UForm/UForm.d.ts +33 -0
- package/components/UForm/UForm.js +484 -0
- package/components/UForm/UFormModal.d.ts +3 -0
- package/components/UForm/UFormModal.js +149 -0
- package/components/UForm/UInfo.d.ts +10 -0
- package/components/UForm/UInfo.js +75 -0
- package/components/UForm/UInfoModal.d.ts +3 -0
- package/components/UForm/UInfoModal.js +50 -0
- package/components/UForm/UModal.d.ts +3 -0
- package/components/UForm/UModal.js +24 -0
- package/components/UForm/_FieldType.d.ts +8 -0
- package/components/UForm/_FieldType.js +100 -0
- package/components/UForm/_FormUtils.d.ts +5 -0
- package/components/UForm/_FormUtils.js +75 -0
- package/components/UForm/_input.d.ts +59 -0
- package/components/UForm/_input.js +147 -0
- package/components/UForm/_register.d.ts +87 -0
- package/components/UForm/_register.js +44 -0
- package/components/UForm/index.d.ts +387 -0
- package/components/UForm/index.js +15 -0
- package/components/Upload/UploadFile.d.ts +3 -0
- package/components/Upload/UploadFile.js +40 -0
- package/components/Upload/UploadImage.d.ts +24 -0
- package/components/Upload/UploadImage.js +93 -0
- package/components/Upload/UploadModal.d.ts +50 -0
- package/components/Upload/UploadModal.js +140 -0
- package/components/Upload/index.d.ts +77 -0
- package/components/Upload/index.js +9 -0
- package/components/Upload/useUpload.d.ts +15 -0
- package/components/Upload/useUpload.js +93 -0
- package/components/_RegisterUtil.d.ts +1 -0
- package/components/_RegisterUtil.js +25 -0
- package/components/_adapt/Alert.d.ts +11 -0
- package/components/_adapt/Alert.js +43 -0
- package/components/_adapt/Button.d.ts +20 -0
- package/components/_adapt/Button.js +26 -0
- package/components/_adapt/Col.d.ts +53 -0
- package/components/_adapt/Col.js +90 -0
- package/components/_adapt/Collapse.d.ts +30 -0
- package/components/_adapt/Collapse.js +33 -0
- package/components/_adapt/Drawer.d.ts +12 -0
- package/components/_adapt/Drawer.js +11 -0
- package/components/_adapt/Dropdown.d.ts +15 -0
- package/components/_adapt/Dropdown.js +38 -0
- package/components/_adapt/Icon.d.ts +14 -0
- package/components/_adapt/Icon.js +34 -0
- package/components/_adapt/Image.d.ts +4 -0
- package/components/_adapt/Image.js +11 -0
- package/components/_adapt/Menu.d.ts +32 -0
- package/components/_adapt/Menu.js +25 -0
- package/components/_adapt/Modal.d.ts +23 -0
- package/components/_adapt/Modal.js +69 -0
- package/components/_adapt/Popconfirm.d.ts +5 -0
- package/components/_adapt/Popconfirm.js +34 -0
- package/components/_adapt/Popover.d.ts +5 -0
- package/components/_adapt/Popover.js +34 -0
- package/components/_adapt/Progress.d.ts +14 -0
- package/components/_adapt/Progress.js +56 -0
- package/components/_adapt/Row.d.ts +10 -0
- package/components/_adapt/Row.js +23 -0
- package/components/_adapt/Select.d.ts +14 -0
- package/components/_adapt/Select.js +47 -0
- package/components/_adapt/Tag.d.ts +7 -0
- package/components/_adapt/Tag.js +12 -0
- package/components/_adapt/Tooltip.d.ts +5 -0
- package/components/_adapt/Tooltip.js +11 -0
- package/components/_adapt/todo/ColorPicker.d.ts +3 -0
- package/components/_adapt/todo/ColorPicker.js +42 -0
- package/components/_adapt/todo/FloatButton.d.ts +2 -0
- package/components/_adapt/todo/FloatButton.js +6 -0
- package/components/_adapt/todo/Image.d.ts +2 -0
- package/components/_adapt/todo/Image.js +6 -0
- package/components/_adapt/todo/Segmented.d.ts +2 -0
- package/components/_adapt/todo/Segmented.js +6 -0
- package/components/_adapt/todo/Space.d.ts +2 -0
- package/components/_adapt/todo/Space.js +6 -0
- package/components/_adapt/utils.d.ts +12 -0
- package/components/_adapt/utils.js +93 -0
- package/components/_common/AutoComplete.d.ts +32 -0
- package/components/_common/AutoComplete.js +87 -0
- package/components/_common/CountUp.d.ts +38 -0
- package/components/_common/CountUp.js +60 -0
- package/components/_common/DateRange.d.ts +52 -0
- package/components/_common/DateRange.js +108 -0
- package/components/_common/HighLight.d.ts +15 -0
- package/components/_common/HighLight.js +37 -0
- package/components/_common/I18N.d.ts +7 -0
- package/components/_common/I18N.js +6 -0
- package/components/_common/Loading.d.ts +9 -0
- package/components/_common/Loading.js +52 -0
- package/components/_common/MonthRange.d.ts +46 -0
- package/components/_common/MonthRange.js +130 -0
- package/components/_common/PromiseLabel.d.ts +11 -0
- package/components/_common/PromiseLabel.js +34 -0
- package/components/_common/Role.d.ts +5 -0
- package/components/_common/Role.js +11 -0
- package/components/_common/Upagination.d.ts +21 -0
- package/components/_common/Upagination.js +106 -0
- package/components/_setup/Const.d.ts +205 -0
- package/components/_setup/Const.js +112 -0
- package/components/_setup/I18N/enUS.d.ts +1 -0
- package/components/_setup/I18N/enUS.js +106 -0
- package/components/_setup/I18N/index.d.ts +3 -0
- package/components/_setup/I18N/index.js +5 -0
- package/components/_setup/I18N/zhCN.d.ts +3 -0
- package/components/_setup/I18N/zhCN.js +109 -0
- package/components/_setup/I18N/zhHK.d.ts +1 -0
- package/components/_setup/I18N/zhHK.js +107 -0
- package/components/_setup/ICON/IconTypes.d.ts +1 -0
- package/components/_setup/ICON/IconTypes.js +10 -0
- package/components/_setup/SearchField/SearchFieldAdvance.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldAdvance.js +57 -0
- package/components/_setup/SearchField/SearchFieldDate.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldDate.js +186 -0
- package/components/_setup/SearchField/SearchFieldInput.d.ts +3 -0
- package/components/_setup/SearchField/SearchFieldInput.js +20 -0
- package/components/_setup/SearchField/SearchFieldSelect.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldSelect.js +106 -0
- package/components/_setup/SearchField/SearchFieldTree.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldTree.js +191 -0
- package/components/_setup/SelectBar/SelectList.d.ts +1 -0
- package/components/_setup/SelectBar/SelectList.js +21 -0
- package/components/_setup/SelectBar/SelectTree.d.ts +1 -0
- package/components/_setup/SelectBar/SelectTree.js +11 -0
- package/components/_setup/UForm/UFormAdvanceInput.d.ts +1 -0
- package/components/_setup/UForm/UFormAdvanceInput.js +300 -0
- package/components/_setup/UForm/UFormAdvanceSelect.d.ts +0 -0
- package/components/_setup/UForm/UFormAdvanceSelect.js +26 -0
- package/components/_setup/UForm/UFormCrontab.d.ts +1 -0
- package/components/_setup/UForm/UFormCrontab.js +199 -0
- package/components/_setup/UForm/UFormDate.d.ts +1 -0
- package/components/_setup/UForm/UFormDate.js +313 -0
- package/components/_setup/UForm/UFormInput.d.ts +1 -0
- package/components/_setup/UForm/UFormInput.js +159 -0
- package/components/_setup/UForm/UFormJSON.d.ts +1 -0
- package/components/_setup/UForm/UFormJSON.js +219 -0
- package/components/_setup/UForm/UFormOrg.d.ts +1 -0
- package/components/_setup/UForm/UFormOrg.js +121 -0
- package/components/_setup/UForm/UFormRole.d.ts +1 -0
- package/components/_setup/UForm/UFormRole.js +47 -0
- package/components/_setup/UForm/UFormSearch.d.ts +0 -0
- package/components/_setup/UForm/UFormSearch.js +35 -0
- package/components/_setup/UForm/UFormSelect.d.ts +1 -0
- package/components/_setup/UForm/UFormSelect.js +179 -0
- package/components/_setup/UForm/UFormTree.d.ts +0 -0
- package/components/_setup/UForm/UFormTree.js +134 -0
- package/components/_setup/UForm/UFormUpload.d.ts +1 -0
- package/components/_setup/UForm/UFormUpload.js +173 -0
- package/components/_setup/UForm/_utils.d.ts +11 -0
- package/components/_setup/UForm/_utils.js +41 -0
- package/components/_setup/index.d.ts +21 -0
- package/components/_setup/index.js +25 -0
- package/components/index.d.ts +7 -0
- package/components/index.js +16 -0
- package/deps/JsonView.d.ts +6 -0
- package/deps/JsonView.js +57 -0
- package/deps/SpringBoot.d.ts +4 -0
- package/deps/SpringBoot.js +18 -0
- package/deps/SpringCloud.d.ts +14 -0
- package/deps/SpringCloud.js +29 -0
- package/deps/_editor/advance/_Audio.d.ts +0 -0
- package/deps/_editor/advance/_Audio.js +1 -0
- package/deps/_editor/advance/_Image.d.ts +2 -0
- package/deps/_editor/advance/_Image.js +89 -0
- package/deps/_editor/advance/_Table.d.ts +0 -0
- package/deps/_editor/advance/_Table.js +1 -0
- package/deps/_editor/advance/_Video.d.ts +0 -0
- package/deps/_editor/advance/_Video.js +1 -0
- package/deps/_editor/base/Element.d.ts +5 -0
- package/deps/_editor/base/Element.js +43 -0
- package/deps/_editor/base/Leaf.d.ts +3 -0
- package/deps/_editor/base/Leaf.js +36 -0
- package/deps/_editor/base/Support.d.ts +2 -0
- package/deps/_editor/base/Support.js +78 -0
- package/deps/_editor/base/types.d.ts +156 -0
- package/deps/_editor/base/types.js +10 -0
- package/deps/_editor/i18n.d.ts +1 -0
- package/deps/_editor/i18n.js +31 -0
- package/deps/_editor/tools/Button.d.ts +6 -0
- package/deps/_editor/tools/Button.js +86 -0
- package/deps/_editor/tools/ToolBar.d.ts +8 -0
- package/deps/_editor/tools/ToolBar.js +10 -0
- package/deps/_editor/tools/_BlockButton.d.ts +4 -0
- package/deps/_editor/tools/_BlockButton.js +77 -0
- package/deps/_editor/tools/_InsertButton.d.ts +6 -0
- package/deps/_editor/tools/_InsertButton.js +65 -0
- package/deps/_editor/tools/_MarkButton.d.ts +6 -0
- package/deps/_editor/tools/_MarkButton.js +45 -0
- package/deps/_editor/tools/_TxtButton.d.ts +7 -0
- package/deps/_editor/tools/_TxtButton.js +187 -0
- package/deps/_editor/utils/ParseHtml.d.ts +0 -0
- package/deps/_editor/utils/ParseHtml.js +220 -0
- package/deps/api-audit.d.ts +1 -0
- package/deps/api-audit.js +6 -0
- package/deps/api-data.d.ts +0 -0
- package/deps/api-data.js +1 -0
- package/deps/apis/useSource.d.ts +0 -0
- package/deps/apis/useSource.js +152 -0
- package/deps/echarts.d.ts +26 -0
- package/deps/echarts.js +71 -0
- package/deps/editor.d.ts +34 -0
- package/deps/editor.js +111 -0
- package/deps/registerEditor.d.ts +1 -0
- package/deps/registerEditor.js +15 -0
- package/hooks/_list.d.ts +87 -0
- package/hooks/_list.js +13 -0
- package/hooks/index.d.ts +14 -0
- package/hooks/index.js +49 -0
- package/hooks/useAjax.d.ts +14 -0
- package/hooks/useAjax.js +43 -0
- package/hooks/useAjaxAction.d.ts +13 -0
- package/hooks/useAjaxAction.js +42 -0
- package/hooks/useAjaxQuery.d.ts +40 -0
- package/hooks/useAjaxQuery.js +81 -0
- package/hooks/useApi.d.ts +69 -0
- package/hooks/useApi.js +352 -0
- package/hooks/useApiGlobal.d.ts +0 -0
- package/hooks/useApiGlobal.js +5 -0
- package/hooks/useApp.d.ts +243 -0
- package/hooks/useApp.js +17 -0
- package/hooks/useArray.d.ts +21 -0
- package/hooks/useArray.js +182 -0
- package/hooks/useCounter.d.ts +0 -0
- package/hooks/useCounter.js +82 -0
- package/hooks/useDefault.d.ts +6 -0
- package/hooks/useDefault.js +16 -0
- package/hooks/useDoLoad.d.ts +17 -0
- package/hooks/useDoLoad.js +44 -0
- package/hooks/useEffectFunction.d.ts +8 -0
- package/hooks/useEffectFunction.js +16 -0
- package/hooks/useEffectOnce.d.ts +5 -0
- package/hooks/useEffectOnce.js +23 -0
- package/hooks/useError.d.ts +5 -0
- package/hooks/useError.js +21 -0
- package/hooks/useFirstMountState.d.ts +6 -0
- package/hooks/useFirstMountState.js +18 -0
- package/hooks/useGenkey.d.ts +2 -0
- package/hooks/useGenkey.js +16 -0
- package/hooks/useGetSet.d.ts +11 -0
- package/hooks/useGetSet.js +27 -0
- package/hooks/useGlobal.d.ts +19 -0
- package/hooks/useGlobal.js +62 -0
- package/hooks/useGlobal_back.d.ts +1 -0
- package/hooks/useGlobal_back.js +11 -0
- package/hooks/useHover.d.ts +8 -0
- package/hooks/useHover.js +49 -0
- package/hooks/useMemoPromise.d.ts +6 -0
- package/hooks/useMemoPromise.js +42 -0
- package/hooks/useModals.d.ts +40 -0
- package/hooks/useModals.js +98 -0
- package/hooks/useMountedState.d.ts +5 -0
- package/hooks/useMountedState.js +20 -0
- package/hooks/useOpenState.d.ts +28 -0
- package/hooks/useOpenState.js +23 -0
- package/hooks/usePromise.d.ts +7 -0
- package/hooks/usePromise.js +22 -0
- package/hooks/useQueue.d.ts +12 -0
- package/hooks/useQueue.js +34 -0
- package/hooks/useSetState.d.ts +9 -0
- package/hooks/useSetState.js +26 -0
- package/hooks/useStateList.d.ts +13 -0
- package/hooks/useStateList.js +59 -0
- package/hooks/useToggle.d.ts +6 -0
- package/hooks/useToggle.js +12 -0
- package/hooks/useUnmountPromise.d.ts +6 -0
- package/hooks/useUnmountPromise.js +36 -0
- package/hooks/useUpdate.d.ts +7 -0
- package/hooks/useUpdate.js +15 -0
- package/hooks/useUpdateEffect.d.ts +6 -0
- package/hooks/useUpdateEffect.js +18 -0
- package/index.d.ts +139 -0
- package/index.js +161 -0
- package/login/Base65.d.ts +8 -0
- package/login/Base65.js +65 -0
- package/login/Password.d.ts +61 -0
- package/login/Password.js +124 -0
- package/login/SM4.d.ts +20 -0
- package/login/SM4.js +193 -0
- package/login/cems/index.d.ts +10 -0
- package/login/cems/index.js +17 -0
- package/login/jit/index.d.ts +32 -0
- package/login/jit/index.js +180 -0
- package/login/jit/pnxclient.d.ts +54 -0
- package/login/jit/pnxclient.js +575 -0
- package/login/sso/index.d.ts +0 -0
- package/login/sso/index.js +0 -0
- package/login/vap/index.d.ts +1 -0
- package/login/vap/index.js +6 -0
- package/login/xrtx/index.d.ts +2 -0
- package/login/xrtx/index.js +33 -0
- package/package.json +1 -0
- package/screen/Comment.d.ts +31 -0
- package/screen/Comment.js +29 -0
- package/screen/EchartContent.d.ts +0 -0
- package/screen/EchartContent.js +63 -0
- package/screen/Page.d.ts +13 -0
- package/screen/Page.js +74 -0
- package/screen/index.d.ts +3 -0
- package/screen/index.js +9 -0
- package/screen/render.d.ts +5 -0
- package/screen/render.js +10 -0
- package/utils/Ajax.d.ts +85 -0
- package/utils/Ajax.js +147 -0
- package/utils/ArrayUtil.d.ts +22 -0
- package/utils/ArrayUtil.js +51 -0
- package/utils/CacheUtil.d.ts +20 -0
- package/utils/CacheUtil.js +86 -0
- package/utils/Const.d.ts +14 -0
- package/utils/Const.js +37 -0
- package/utils/CustomApp.d.ts +242 -0
- package/utils/CustomApp.js +18 -0
- package/utils/EventUtil.d.ts +22 -0
- package/utils/EventUtil.js +63 -0
- package/utils/Format.d.ts +28 -0
- package/utils/Format.js +206 -0
- package/utils/Global.d.ts +276 -0
- package/utils/Global.js +125 -0
- package/utils/Logger.d.ts +5 -0
- package/utils/Logger.js +32 -0
- package/utils/PageUtil.d.ts +24 -0
- package/utils/PageUtil.js +87 -0
- package/utils/Renders/ApiGetRender.d.ts +23 -0
- package/utils/Renders/ApiGetRender.js +192 -0
- package/utils/Renders/ApiPostRender.d.ts +17 -0
- package/utils/Renders/ApiPostRender.js +161 -0
- package/utils/Renders/DateRender.d.ts +8 -0
- package/utils/Renders/DateRender.js +35 -0
- package/utils/Renders/DictRender.d.ts +23 -0
- package/utils/Renders/DictRender.js +258 -0
- package/utils/Renders/FileRender.d.ts +3 -0
- package/utils/Renders/FileRender.js +46 -0
- package/utils/Renders/ListRender.d.ts +23 -0
- package/utils/Renders/ListRender.js +111 -0
- package/utils/Renders/NumberRender.d.ts +19 -0
- package/utils/Renders/NumberRender.js +65 -0
- package/utils/Renders/StatusRender.d.ts +12 -0
- package/utils/Renders/StatusRender.js +68 -0
- package/utils/Renders/StringRender.d.ts +14 -0
- package/utils/Renders/StringRender.js +194 -0
- package/utils/Renders/_define.d.ts +26 -0
- package/utils/Renders/_define.js +64 -0
- package/utils/Renders/index.d.ts +9 -0
- package/utils/Renders/index.js +42 -0
- package/utils/StringUtil.d.ts +124 -0
- package/utils/StringUtil.js +352 -0
- package/utils/TreeUtil.d.ts +42 -0
- package/utils/TreeUtil.js +69 -0
- package/utils/VAP.d.ts +16 -0
- package/utils/VAP.js +78 -0
- package/utils/XHR.d.ts +9 -0
- package/utils/XHR.js +53 -0
- package/utils/_AjaxUtil.d.ts +11 -0
- package/utils/_AjaxUtil.js +45 -0
- package/utils/_Support.d.ts +22 -0
- package/utils/_Support.js +106 -0
- package/utils/i18n.d.ts +60 -0
- package/utils/i18n.js +184 -0
- package/utils/index.d.ts +19 -0
- package/utils/index.js +54 -0
- package/utils/screenful.d.ts +15 -0
- package/utils/screenful.js +64 -0
- package/widget/index.d.ts +39 -0
- package/widget/index.js +21 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const antd_1 = require("antd");
|
|
9
|
+
const _register_1 = require("../../UForm/_register");
|
|
10
|
+
const _input_1 = require("../../UForm/_input");
|
|
11
|
+
const utils_1 = require("../../../utils");
|
|
12
|
+
const DateRange_1 = require("../../_common/DateRange");
|
|
13
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
14
|
+
const Const_1 = require("../Const");
|
|
15
|
+
// 日期输入相关的组件
|
|
16
|
+
const DatePick = (props) => {
|
|
17
|
+
const { field, disabled, value, form, onChange } = props;
|
|
18
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
19
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
20
|
+
params.allowClear = false;
|
|
21
|
+
if (field.config && field.config._startField) {
|
|
22
|
+
params.disabledDate = (current) => {
|
|
23
|
+
let startStr = form.getFieldValue(field.config._startField);
|
|
24
|
+
if (startStr == null || field.config._startField == '')
|
|
25
|
+
return false;
|
|
26
|
+
return (0, dayjs_1.default)(startStr).diff(current) > 0;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
else if (field.config && field.config._endField) {
|
|
30
|
+
params.disabledDate = (current) => {
|
|
31
|
+
let endDateStr = form.getFieldValue(field.config._endField);
|
|
32
|
+
if (endDateStr == null || field.config._endField == '')
|
|
33
|
+
return false;
|
|
34
|
+
return (0, dayjs_1.default)(endDateStr).diff(current) < 0;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (value) {
|
|
38
|
+
let day = (0, dayjs_1.default)(value);
|
|
39
|
+
if (day.isValid())
|
|
40
|
+
params.value = day;
|
|
41
|
+
}
|
|
42
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : (props.showTime ? utils_1.GLOBAL.CONFIG.DATE.DATE_TIME_FORMAT : utils_1.GLOBAL.CONFIG.DATE.DATE_FORMAT);
|
|
43
|
+
return react_1.default.createElement(antd_1.DatePicker, Object.assign({ style: { width: '80%' } }, params, field.config, { showTime: props.showTime, format: format, onChange: day => {
|
|
44
|
+
if (day == null) {
|
|
45
|
+
onChange(undefined);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
onChange(day.format(format));
|
|
49
|
+
}
|
|
50
|
+
} }));
|
|
51
|
+
};
|
|
52
|
+
const DatePickRender = (value, data, field, showTime) => {
|
|
53
|
+
if (field.render)
|
|
54
|
+
return field.render(value, data);
|
|
55
|
+
if (value == null || value == '')
|
|
56
|
+
return '';
|
|
57
|
+
let mnt = (0, dayjs_1.default)(value);
|
|
58
|
+
if (mnt.isValid()) {
|
|
59
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : (showTime ? utils_1.GLOBAL.CONFIG.DATE.DATE_TIME_FORMAT : utils_1.GLOBAL.CONFIG.DATE.DATE_FORMAT);
|
|
60
|
+
return mnt.format(format);
|
|
61
|
+
}
|
|
62
|
+
return '';
|
|
63
|
+
};
|
|
64
|
+
(0, _register_1.registerFormField)('date', (props) => react_1.default.createElement(DatePick, Object.assign({}, props, { showTime: false })), {
|
|
65
|
+
render: (value, data, field) => DatePickRender(value, data, field, false)
|
|
66
|
+
});
|
|
67
|
+
(0, _register_1.registerFormField)('datetime', (props) => react_1.default.createElement(DatePick, Object.assign({}, props, { showTime: true })), {
|
|
68
|
+
render: (value, data, field) => DatePickRender(value, data, field, true)
|
|
69
|
+
});
|
|
70
|
+
(0, _register_1.registerFormField)('month', (props) => {
|
|
71
|
+
const { field, disabled, value, onChange } = props;
|
|
72
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
73
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
74
|
+
params.allowClear = false;
|
|
75
|
+
if (value) {
|
|
76
|
+
let day = (0, dayjs_1.default)(value);
|
|
77
|
+
if (day.isValid())
|
|
78
|
+
params.value = day;
|
|
79
|
+
}
|
|
80
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : utils_1.GLOBAL.CONFIG.DATE.MONTH_FORMAT;
|
|
81
|
+
return react_1.default.createElement(antd_1.DatePicker.MonthPicker, Object.assign({ style: { width: '80%' } }, params, field.config, { format: format, onChange: day => {
|
|
82
|
+
if (day == null) {
|
|
83
|
+
onChange(undefined);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
onChange(day.format(format));
|
|
87
|
+
}
|
|
88
|
+
} }));
|
|
89
|
+
}, {
|
|
90
|
+
render: (value, data, field) => {
|
|
91
|
+
if (field.render)
|
|
92
|
+
return field.render(value, data);
|
|
93
|
+
if (value == null || value == '')
|
|
94
|
+
return '';
|
|
95
|
+
let mnt = (0, dayjs_1.default)(value);
|
|
96
|
+
if (mnt.isValid()) {
|
|
97
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : utils_1.GLOBAL.CONFIG.DATE.MONTH_FORMAT;
|
|
98
|
+
return mnt.format(format);
|
|
99
|
+
}
|
|
100
|
+
return '';
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
(0, _register_1.registerFormField)('week', (props) => {
|
|
104
|
+
const { field, disabled, value, onChange } = props;
|
|
105
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
106
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
107
|
+
params.allowClear = false;
|
|
108
|
+
if (value) {
|
|
109
|
+
let day = (0, dayjs_1.default)(value);
|
|
110
|
+
if (day.isValid())
|
|
111
|
+
params.value = day;
|
|
112
|
+
}
|
|
113
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : utils_1.GLOBAL.CONFIG.DATE.WEEK_FORMAT;
|
|
114
|
+
return react_1.default.createElement(antd_1.DatePicker.WeekPicker, Object.assign({ style: { width: '80%' } }, params, field.config, { format: format, onChange: day => {
|
|
115
|
+
if (day == null) {
|
|
116
|
+
onChange(undefined);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
onChange(day.format(format));
|
|
120
|
+
}
|
|
121
|
+
} }));
|
|
122
|
+
}, {
|
|
123
|
+
render: (value, data, field) => {
|
|
124
|
+
if (field.render)
|
|
125
|
+
return field.render(value, data);
|
|
126
|
+
if (value == null || value == '')
|
|
127
|
+
return '';
|
|
128
|
+
let mnt = (0, dayjs_1.default)(value);
|
|
129
|
+
if (mnt.isValid()) {
|
|
130
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : utils_1.GLOBAL.CONFIG.DATE.WEEK_FORMAT;
|
|
131
|
+
return mnt.format(format);
|
|
132
|
+
}
|
|
133
|
+
return '';
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
(0, _register_1.registerFormField)('time', (props) => {
|
|
137
|
+
const { field, disabled, value, onChange } = props;
|
|
138
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
139
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
140
|
+
params.allowClear = false;
|
|
141
|
+
if (value) {
|
|
142
|
+
let day = (0, dayjs_1.default)(value);
|
|
143
|
+
if (day.isValid())
|
|
144
|
+
params.value = day;
|
|
145
|
+
}
|
|
146
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : utils_1.GLOBAL.CONFIG.DATE.TIME_FORMAT;
|
|
147
|
+
return react_1.default.createElement(antd_1.TimePicker, Object.assign({ style: { width: '80%' } }, params, field.config, { format: format, onChange: day => {
|
|
148
|
+
if (day == null) {
|
|
149
|
+
onChange(undefined);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
onChange(day.format(format));
|
|
153
|
+
}
|
|
154
|
+
} }));
|
|
155
|
+
}, {
|
|
156
|
+
render: (value, data, field) => {
|
|
157
|
+
if (field.render)
|
|
158
|
+
return field.render(value, data);
|
|
159
|
+
if (value == null || value == '')
|
|
160
|
+
return '';
|
|
161
|
+
let mnt = (0, dayjs_1.default)(value);
|
|
162
|
+
if (mnt.isValid()) {
|
|
163
|
+
const format = lodash_1.default.has(field.config, 'format') ? field.config.format : utils_1.GLOBAL.CONFIG.DATE.TIME_FORMAT;
|
|
164
|
+
return mnt.format(format);
|
|
165
|
+
}
|
|
166
|
+
return '';
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
const AntdRangePick = (props) => {
|
|
170
|
+
const { field, disabled, value, onChange } = props;
|
|
171
|
+
let ptn = field.field.split(',');
|
|
172
|
+
if (ptn.length != 2) {
|
|
173
|
+
console.error('timerange field must hava a start and end, eg: field:"startTime,endTime"');
|
|
174
|
+
return react_1.default.createElement(DatePick, Object.assign({}, props));
|
|
175
|
+
}
|
|
176
|
+
const [startField, endField] = ptn;
|
|
177
|
+
let params = { disabled, allowClear: true };
|
|
178
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
179
|
+
params.allowClear = false;
|
|
180
|
+
params.value = [undefined, undefined];
|
|
181
|
+
if (value) {
|
|
182
|
+
if (value[startField]) {
|
|
183
|
+
let day = (0, dayjs_1.default)(value[startField]);
|
|
184
|
+
if (day.isValid())
|
|
185
|
+
params.value[0] = day;
|
|
186
|
+
}
|
|
187
|
+
if (value[endField]) {
|
|
188
|
+
let day = (0, dayjs_1.default)(value[endField]);
|
|
189
|
+
if (day.isValid())
|
|
190
|
+
params.value[1] = day;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// const format = _.has(field.config, 'format') ? field.config.format : (
|
|
194
|
+
// props.showTime ? GLOBAL.CONFIG.DATE.DATE_TIME_FORMAT : GLOBAL.CONFIG.DATE.DATE_FORMAT
|
|
195
|
+
// )
|
|
196
|
+
let format = props.isDate ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss';
|
|
197
|
+
let showTime = !props.isDate;
|
|
198
|
+
if (props.isDate) {
|
|
199
|
+
if (field.config && field.config.showTime) {
|
|
200
|
+
showTime = true;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return react_1.default.createElement(antd_1.DatePicker.RangePicker, Object.assign({ style: { width: '80%' } }, params, field.config, { showTime: !props.isDate && showTime, format: format, onChange: ([start, end]) => {
|
|
204
|
+
if (start && end) {
|
|
205
|
+
let startFormat, endFormat;
|
|
206
|
+
if (props.isDate) {
|
|
207
|
+
if (showTime) {
|
|
208
|
+
startFormat = 'YYYY-MM-DD 00:00:00';
|
|
209
|
+
endFormat = 'YYYY-MM-DD 23:59:59';
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
startFormat = 'YYYY-MM-DD';
|
|
213
|
+
endFormat = 'YYYY-MM-DD';
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
if (showTime === false) {
|
|
218
|
+
startFormat = 'YYYY-MM-DD 00:00:00';
|
|
219
|
+
endFormat = 'YYYY-MM-DD 23:59:59';
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
startFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
223
|
+
endFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
onChange({
|
|
227
|
+
[startField]: start.format(startFormat),
|
|
228
|
+
[endField]: end.format(endFormat),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
onChange({
|
|
233
|
+
[startField]: undefined,
|
|
234
|
+
[endField]: undefined,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
} }));
|
|
238
|
+
};
|
|
239
|
+
const DateRangePick = (props) => {
|
|
240
|
+
const { field, disabled, value, onChange, showTime } = props;
|
|
241
|
+
let ptn = field.field.split(',');
|
|
242
|
+
if (ptn.length != 2) {
|
|
243
|
+
console.error('timerange field must hava a start and end, eg: field:"startTime,endTime"');
|
|
244
|
+
return react_1.default.createElement(DatePick, Object.assign({}, props));
|
|
245
|
+
}
|
|
246
|
+
const [startField, endField] = ptn;
|
|
247
|
+
let params = {
|
|
248
|
+
disabled, allowClear: true, showTime, onChange: ([start, end]) => {
|
|
249
|
+
onChange({
|
|
250
|
+
[startField]: start || undefined,
|
|
251
|
+
[endField]: end || undefined,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
256
|
+
params.allowClear = false;
|
|
257
|
+
if (value) {
|
|
258
|
+
if (value[startField]) {
|
|
259
|
+
let day = (0, dayjs_1.default)(value[startField]);
|
|
260
|
+
if (day.isValid())
|
|
261
|
+
params.defaultStart = day;
|
|
262
|
+
}
|
|
263
|
+
if (value[endField]) {
|
|
264
|
+
let day = (0, dayjs_1.default)(value[endField]);
|
|
265
|
+
if (day.isValid())
|
|
266
|
+
params.defaultEnd = day;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return react_1.default.createElement(DateRange_1.DateRange, Object.assign({}, field.config, params));
|
|
270
|
+
};
|
|
271
|
+
const RangePickRender = (value, data, field, showTime) => {
|
|
272
|
+
if (!lodash_1.default.isPlainObject) {
|
|
273
|
+
if (lodash_1.default.isString(value))
|
|
274
|
+
return value;
|
|
275
|
+
return '';
|
|
276
|
+
}
|
|
277
|
+
let ptn = field.field.split(',');
|
|
278
|
+
if (ptn.length != 2)
|
|
279
|
+
return '';
|
|
280
|
+
const [startField, endField] = ptn;
|
|
281
|
+
if (data[startField] == null && data[endField] == null)
|
|
282
|
+
return '';
|
|
283
|
+
if (data[startField] == null)
|
|
284
|
+
return utils_1.i18n.txt(Const_1.V.DATE_START_FROM, data[endField]);
|
|
285
|
+
if (data[endField] == null)
|
|
286
|
+
return utils_1.i18n.txt(Const_1.V.DATE_END_TO, data[startField]);
|
|
287
|
+
return utils_1.i18n.txt(Const_1.V.DATE_START_TO_END, data[startField], data[endField]);
|
|
288
|
+
};
|
|
289
|
+
(0, _register_1.registerFormField)('daterange', (props) => react_1.default.createElement(AntdRangePick, Object.assign({}, props, { isDate: true })), {
|
|
290
|
+
render: (value, data, field) => RangePickRender(value, data, field, false),
|
|
291
|
+
breakCol: true,
|
|
292
|
+
isMultiple: true
|
|
293
|
+
});
|
|
294
|
+
(0, _register_1.registerFormField)('timerange', (props) => react_1.default.createElement(AntdRangePick, Object.assign({}, props, { isDate: false })), {
|
|
295
|
+
render: (value, data, field) => RangePickRender(value, data, field, true),
|
|
296
|
+
breakCol: true,
|
|
297
|
+
isMultiple: true
|
|
298
|
+
});
|
|
299
|
+
(0, _register_1.registerFormField)('daterange-single', (props) => react_1.default.createElement(DateRangePick, Object.assign({}, props, { showTime: false })), {
|
|
300
|
+
render: (value, data, field) => RangePickRender(value, data, field, false),
|
|
301
|
+
breakCol: true,
|
|
302
|
+
isMultiple: true
|
|
303
|
+
});
|
|
304
|
+
(0, _register_1.registerFormField)('timerange-single', (props) => react_1.default.createElement(DateRangePick, Object.assign({}, props, { showTime: true })), {
|
|
305
|
+
render: (value, data, field) => RangePickRender(value, data, field, true),
|
|
306
|
+
breakCol: true,
|
|
307
|
+
isMultiple: true
|
|
308
|
+
});
|
|
309
|
+
// registerFormField('monthrange', (props: FormFieldProps) => <AntdRangePick {...props} isDate={true} />, {
|
|
310
|
+
// render: (value, data, field) => RangePickRender(value, data, field, false),
|
|
311
|
+
// breakCol: true,
|
|
312
|
+
// isMultiple: true
|
|
313
|
+
// });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const antd_1 = require("antd");
|
|
9
|
+
const Select_1 = require("../../_adapt/Select");
|
|
10
|
+
const _register_1 = require("../../UForm/_register");
|
|
11
|
+
const _input_1 = require("../../UForm/_input");
|
|
12
|
+
const utils_1 = require("../../../utils");
|
|
13
|
+
const _utils_1 = require("./_utils");
|
|
14
|
+
(0, _register_1.registerFormField)('text', (props) => {
|
|
15
|
+
const { field, disabled, value, onChange } = props;
|
|
16
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field), disabled, autoComplete: 'off', };
|
|
17
|
+
if (utils_1.GLOBAL.CONFIG.FORM.INPUT_MAX_LENGTH) {
|
|
18
|
+
params.maxLength = utils_1.GLOBAL.CONFIG.FORM.INPUT_MAX_LENGTH;
|
|
19
|
+
if (field.ignore)
|
|
20
|
+
params.maxLength = null;
|
|
21
|
+
}
|
|
22
|
+
return react_1.default.createElement(antd_1.Input, Object.assign({}, params, field.config, { value: value === null ? undefined : value, onChange: evt => utils_1.PageUtil.stopEvent(evt, () => onChange(evt.target.value)) }));
|
|
23
|
+
}, {
|
|
24
|
+
rules: _utils_1.ILLEGAL_CHAR_VALIDATER
|
|
25
|
+
});
|
|
26
|
+
// registerFormField('color', (props: FormFieldProps) => {
|
|
27
|
+
// const { field, disabled, value, onChange } = props;
|
|
28
|
+
// let params: ColorPickerProps = { disabled, };
|
|
29
|
+
// return <ColorPicker
|
|
30
|
+
// {...params}
|
|
31
|
+
// {...field.config}
|
|
32
|
+
// value={value === null ? undefined : value}
|
|
33
|
+
// onChange={value => onChange(value.toHexString())}
|
|
34
|
+
// />
|
|
35
|
+
// });
|
|
36
|
+
(0, _register_1.registerFormField)('textarea', (props) => {
|
|
37
|
+
const { field, disabled, value, onChange } = props;
|
|
38
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field), disabled, autoComplete: 'off', };
|
|
39
|
+
return react_1.default.createElement(antd_1.Input.TextArea, Object.assign({}, params, field.config, { value: value === null ? undefined : value, onChange: evt => utils_1.PageUtil.stopEvent(evt, () => onChange(evt.target.value)) }));
|
|
40
|
+
}, {
|
|
41
|
+
breakCol: true,
|
|
42
|
+
rules: _utils_1.ILLEGAL_CHAR_VALIDATER
|
|
43
|
+
});
|
|
44
|
+
(0, _register_1.registerFormField)('password', (props) => {
|
|
45
|
+
const { field, disabled, value, onChange } = props;
|
|
46
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field), disabled, autoComplete: 'off', maxLength: 36, visibilityToggle: false, };
|
|
47
|
+
return react_1.default.createElement(antd_1.Input.Password, Object.assign({}, params, field.config, { value: value === null ? undefined : value, onChange: (evt) => utils_1.PageUtil.stopEvent(evt, () => onChange(evt.target.value)) }));
|
|
48
|
+
});
|
|
49
|
+
(0, _register_1.registerFormField)('number', (props) => {
|
|
50
|
+
const { field, disabled, value, onChange } = props;
|
|
51
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field), disabled, autoComplete: 'off', };
|
|
52
|
+
if (utils_1.GLOBAL.CONFIG.FORM.NUMBER_MIN_ZERO) {
|
|
53
|
+
params.min = 0;
|
|
54
|
+
if (field.ignore)
|
|
55
|
+
lodash_1.default.unset(params, 'min');
|
|
56
|
+
}
|
|
57
|
+
return react_1.default.createElement(antd_1.InputNumber, Object.assign({}, params, field.config, { className: 'i-number', value: value === null ? undefined : value, onChange: onChange }));
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* silder 说明
|
|
61
|
+
* 1. 默认 min: 0, max: 100, step: 1 ,需要传入 config 再次指定
|
|
62
|
+
* 2. 默认会加入一个显示列,结构为
|
|
63
|
+
* {valueWidth:number, valueFormat:(num:number)=>string }
|
|
64
|
+
* 用于控制显示列的宽度,及显示的内容
|
|
65
|
+
* 当 valueWidth 为 0 或 valueFormat 不为一个方法时,不显示此列
|
|
66
|
+
* 如 : {type:'slider',config:{valueWidth:0} }
|
|
67
|
+
* 或 {type:'slider',config:{valueFormat:null} }
|
|
68
|
+
*/
|
|
69
|
+
(0, _register_1.registerFormField)('slider', (props) => {
|
|
70
|
+
const { field, disabled, value, onChange } = props;
|
|
71
|
+
let config = lodash_1.default.merge({ valueWidth: 64, valueFormat: v => (v || 0) }, field.config);
|
|
72
|
+
let params = { disabled, min: 0, max: 100, step: 1 };
|
|
73
|
+
if (!lodash_1.default.isFunction(config.valueFormat) || config.valueWidth == 0) {
|
|
74
|
+
return react_1.default.createElement(antd_1.Slider, Object.assign({}, params, field.config, { range: false, value: value === null ? undefined : value, onChange: onChange }));
|
|
75
|
+
}
|
|
76
|
+
return react_1.default.createElement("div", { className: 'i-slider' },
|
|
77
|
+
react_1.default.createElement(antd_1.Slider, Object.assign({}, params, field.config, { range: false, value: value === null ? undefined : value, onChange: onChange })),
|
|
78
|
+
react_1.default.createElement("div", { className: 'i-slider-value', style: { width: config.valueWidth } },
|
|
79
|
+
" ",
|
|
80
|
+
config.valueFormat(value),
|
|
81
|
+
" "));
|
|
82
|
+
});
|
|
83
|
+
(0, _register_1.registerFormField)('slider-range', (props) => {
|
|
84
|
+
const { field, disabled, value, onChange } = props;
|
|
85
|
+
let config = lodash_1.default.merge({ valueWidth: 128, valueFormat: (range) => range ? `${range[0]} - ${range[1]}` : '0' }, field.config);
|
|
86
|
+
let params = { range: true, disabled, min: 0, max: 100, step: 1 };
|
|
87
|
+
const [fields, values] = (0, _input_1.getMultiFieldValues)(field, value);
|
|
88
|
+
if (!lodash_1.default.isFunction(config.valueFormat) || config.valueWidth == 0) {
|
|
89
|
+
return react_1.default.createElement(antd_1.Slider, Object.assign({}, params, field.config, { range: true, value: values, onChange: ([start, end]) => onChange({ [fields[0]]: start, [fields[1]]: end }) }));
|
|
90
|
+
}
|
|
91
|
+
return react_1.default.createElement("div", { className: 'i-slider' },
|
|
92
|
+
react_1.default.createElement(antd_1.Slider, Object.assign({}, params, field.config, { range: true, value: values, onChange: ([start, end]) => onChange({ [fields[0]]: start, [fields[1]]: end }) })),
|
|
93
|
+
react_1.default.createElement("div", { className: 'i-slider-value', style: { width: config.valueWidth } },
|
|
94
|
+
" ",
|
|
95
|
+
config.valueFormat(values),
|
|
96
|
+
" "));
|
|
97
|
+
}, { isMultiple: true });
|
|
98
|
+
// 带一个下接选择的输入框,需要传入两个字段,第一个为 input,第二个为select,需要传 options
|
|
99
|
+
// 默认 select 在 input 前,如果需要 select 在 input 后,可以传 config : { atAfter:true }
|
|
100
|
+
(0, _register_1.registerFormField)('input-with-select', (props) => {
|
|
101
|
+
const { field, disabled, value, onChange, options } = props;
|
|
102
|
+
const [fields, values] = (0, _input_1.getMultiFieldValues)(field, value);
|
|
103
|
+
let inputProps = {
|
|
104
|
+
placeholder: (0, _input_1.getPlaceholder)(field),
|
|
105
|
+
disabled,
|
|
106
|
+
autoComplete: 'off',
|
|
107
|
+
value: values[0],
|
|
108
|
+
onChange: (evt) => onChange({ [fields[0]]: evt.target.value, [fields[1]]: values[1] })
|
|
109
|
+
};
|
|
110
|
+
let selectProps = { options, disabled, allowClear: true, };
|
|
111
|
+
// selectProps.
|
|
112
|
+
if (lodash_1.default.has(field.config, 'selectProps') && lodash_1.default.isPlainObject(field.config.selectProps)) {
|
|
113
|
+
lodash_1.default.assign(selectProps, field.config.selectProps);
|
|
114
|
+
}
|
|
115
|
+
selectProps.value = values[1];
|
|
116
|
+
selectProps.onChange = (value) => onChange({ [fields[0]]: values[0], [fields[1]]: value });
|
|
117
|
+
let atRight = lodash_1.default.has(field.config, 'atAfter') && field.config.atAfter;
|
|
118
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
119
|
+
selectProps.allowClear = false;
|
|
120
|
+
if (atRight) {
|
|
121
|
+
inputProps.addonAfter = react_1.default.createElement(Select_1.Select, Object.assign({}, selectProps));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
inputProps.addonBefore = react_1.default.createElement(Select_1.Select, Object.assign({}, selectProps));
|
|
125
|
+
}
|
|
126
|
+
return react_1.default.createElement(antd_1.Input, Object.assign({}, inputProps));
|
|
127
|
+
}, { isMultiple: true });
|
|
128
|
+
const percentFormatter = (value) => `${value}%`;
|
|
129
|
+
const percentParser = (value) => value.replace('%', '');
|
|
130
|
+
(0, _register_1.registerFormField)('percent', (props) => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const { field, disabled, value, onChange } = props;
|
|
133
|
+
let precision = ((_a = field.config) === null || _a === void 0 ? void 0 : _a.precision) || 0;
|
|
134
|
+
let scale = ((_b = field.config) === null || _b === void 0 ? void 0 : _b.scale) || 2;
|
|
135
|
+
const scaleNum = Math.pow(10, scale);
|
|
136
|
+
let params = {
|
|
137
|
+
min: 0,
|
|
138
|
+
placeholder: (0, _input_1.getPlaceholder)(field),
|
|
139
|
+
disabled,
|
|
140
|
+
autoComplete: 'off',
|
|
141
|
+
precision,
|
|
142
|
+
formatter: percentFormatter,
|
|
143
|
+
parser: percentParser,
|
|
144
|
+
};
|
|
145
|
+
let val = 0;
|
|
146
|
+
try {
|
|
147
|
+
val = (parseFloat(value) * scaleNum).toFixed(precision);
|
|
148
|
+
}
|
|
149
|
+
catch (_c) { }
|
|
150
|
+
return react_1.default.createElement(antd_1.InputNumber, Object.assign({}, params, field.config, { className: 'i-number', value: val, onChange: value => {
|
|
151
|
+
try {
|
|
152
|
+
if (value == null || isNaN(value))
|
|
153
|
+
return;
|
|
154
|
+
let val = parseFloat(value) / scaleNum;
|
|
155
|
+
onChange(val);
|
|
156
|
+
}
|
|
157
|
+
catch (_a) { }
|
|
158
|
+
} }));
|
|
159
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|