@ant-design/pro-components 3.0.0-beta.1 → 3.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro-components.min.js +1 -1
- package/es/card/ProCard.d.ts +0 -1
- package/es/card/ProCard.js +11 -23
- package/es/card/components/Actions/index.js +33 -28
- package/es/card/components/Actions/style.js +72 -100
- package/es/card/components/Card/index.js +212 -258
- package/es/card/components/Card/style.js +192 -266
- package/es/card/components/CheckCard/Group.js +198 -208
- package/es/card/components/CheckCard/index.js +151 -160
- package/es/card/components/CheckCard/style.js +186 -212
- package/es/card/components/Divider/index.js +23 -18
- package/es/card/components/Divider/style.js +30 -54
- package/es/card/components/Loading/index.js +80 -13
- package/es/card/components/Loading/style.js +42 -63
- package/es/card/components/Operation/index.js +22 -17
- package/es/card/components/Operation/style.js +19 -43
- package/es/card/components/Statistic/index.js +79 -96
- package/es/card/components/Statistic/style.js +76 -115
- package/es/card/components/StatisticCard/index.d.ts +0 -2
- package/es/card/components/StatisticCard/index.js +59 -70
- package/es/card/components/StatisticCard/style.js +36 -55
- package/es/card/index.d.ts +2 -2
- package/es/card/index.js +2 -9
- package/es/card/typing.js +1 -0
- package/es/descriptions/index.js +363 -414
- package/es/descriptions/useFetchData.js +94 -73
- package/es/field/AllProField.js +438 -361
- package/es/field/FieldHOC/index.js +32 -28
- package/es/field/PureProField.js +129 -160
- package/es/field/ValueTypeToComponent.js +686 -396
- package/es/field/components/Cascader/index.d.ts +2 -2
- package/es/field/components/Cascader/index.js +124 -149
- package/es/field/components/Checkbox/index.d.ts +1 -1
- package/es/field/components/Checkbox/index.js +106 -128
- package/es/field/components/Code/index.js +67 -60
- package/es/field/components/ColorPicker/index.d.ts +1 -1
- package/es/field/components/ColorPicker/index.js +55 -78
- package/es/field/components/DatePicker/index.d.ts +2 -2
- package/es/field/components/DatePicker/index.js +100 -116
- package/es/field/components/Digit/index.js +84 -83
- package/es/field/components/DigitRange/index.js +102 -96
- package/es/field/components/FromNow/index.js +50 -62
- package/es/field/components/Image/index.js +46 -50
- package/es/field/components/IndexColumn/index.js +45 -43
- package/es/field/components/Money/index.js +244 -253
- package/es/field/components/Options/index.js +61 -71
- package/es/field/components/Password/index.js +62 -59
- package/es/field/components/Percent/index.js +74 -80
- package/es/field/components/Percent/util.js +23 -18
- package/es/field/components/Progress/index.js +53 -54
- package/es/field/components/Radio/index.d.ts +1 -1
- package/es/field/components/Radio/index.js +85 -107
- package/es/field/components/RangePicker/index.d.ts +2 -2
- package/es/field/components/RangePicker/index.js +122 -137
- package/es/field/components/Rate/index.js +39 -35
- package/es/field/components/Second/index.js +61 -59
- package/es/field/components/Segmented/index.d.ts +1 -1
- package/es/field/components/Segmented/index.js +68 -90
- package/es/field/components/Select/LightSelect/index.d.ts +1 -1
- package/es/field/components/Select/LightSelect/index.js +210 -256
- package/es/field/components/Select/SearchSelect/index.js +192 -225
- package/es/field/components/Select/index.d.ts +2 -2
- package/es/field/components/Select/index.js +299 -368
- package/es/field/components/Slider/index.js +39 -45
- package/es/field/components/Status/index.js +83 -23
- package/es/field/components/Switch/index.d.ts +1 -1
- package/es/field/components/Switch/index.js +60 -71
- package/es/field/components/Text/index.js +53 -48
- package/es/field/components/TextArea/index.js +39 -53
- package/es/field/components/TextArea/readonly.js +36 -50
- package/es/field/components/TimePicker/index.js +182 -190
- package/es/field/components/TreeSelect/index.d.ts +2 -2
- package/es/field/components/TreeSelect/index.js +178 -184
- package/es/field/index.js +3 -43
- package/es/form/BaseForm/BaseForm.js +581 -621
- package/es/form/BaseForm/EditOrReadOnlyContext.js +4 -8
- package/es/form/BaseForm/LightWrapper/index.js +104 -161
- package/es/form/BaseForm/LightWrapper/style.js +14 -41
- package/es/form/BaseForm/Submitter/index.js +69 -100
- package/es/form/BaseForm/index.js +1 -2
- package/es/form/FieldContext.js +4 -8
- package/es/form/components/Captcha/index.js +162 -169
- package/es/form/components/Cascader/index.js +46 -75
- package/es/form/components/Checkbox/index.js +73 -98
- package/es/form/components/ColorPicker/index.js +43 -64
- package/es/form/components/DatePicker/BaseDatePicker.js +45 -69
- package/es/form/components/DatePicker/DatePicker.js +26 -51
- package/es/form/components/DatePicker/DateTimePicker.js +26 -50
- package/es/form/components/DatePicker/MonthPicker.js +26 -51
- package/es/form/components/DatePicker/QuarterPicker.js +26 -51
- package/es/form/components/DatePicker/TimePicker.js +43 -72
- package/es/form/components/DatePicker/WeekPicker.js +26 -51
- package/es/form/components/DatePicker/YearPicker.js +26 -51
- package/es/form/components/DatePicker/index.js +4 -6
- package/es/form/components/DateRangePicker/BaseDateRanger.js +42 -70
- package/es/form/components/DateRangePicker/DateMonthRangePicker.js +29 -51
- package/es/form/components/DateRangePicker/DateQuarterRangePicker.js +29 -51
- package/es/form/components/DateRangePicker/DateTimeRangePicker.js +29 -51
- package/es/form/components/DateRangePicker/DateWeekRangePicker.js +29 -51
- package/es/form/components/DateRangePicker/DateYearRangePicker.js +29 -51
- package/es/form/components/DateRangePicker/TimeRangePicker.js +42 -67
- package/es/form/components/DateRangePicker/index.js +29 -51
- package/es/form/components/Dependency/index.js +56 -96
- package/es/form/components/Digit/DigitRange.d.ts +1 -1
- package/es/form/components/Digit/DigitRange.js +42 -75
- package/es/form/components/Digit/index.js +47 -78
- package/es/form/components/Field/index.js +80 -124
- package/es/form/components/FieldSet/index.js +95 -123
- package/es/form/components/FormItem/FormItemRender/index.js +135 -92
- package/es/form/components/FormItem/Group/index.js +134 -169
- package/es/form/components/FormItem/Group/style.js +41 -62
- package/es/form/components/FormItem/index.js +252 -293
- package/es/form/components/FormItem/warpField.js +218 -285
- package/es/form/components/List/ListContainer.js +221 -181
- package/es/form/components/List/ListItem.js +258 -350
- package/es/form/components/List/index.js +195 -252
- package/es/form/components/List/style.js +48 -95
- package/es/form/components/Money/index.js +50 -80
- package/es/form/components/Radio/index.js +52 -86
- package/es/form/components/Rate/index.js +37 -60
- package/es/form/components/SchemaForm/index.js +121 -167
- package/es/form/components/SchemaForm/layoutType/Embed.js +8 -5
- package/es/form/components/SchemaForm/layoutType/StepsForm.js +35 -68
- package/es/form/components/SchemaForm/layoutType/index.js +2 -7
- package/es/form/components/SchemaForm/typing.js +1 -0
- package/es/form/components/SchemaForm/valueType/dependency.js +19 -43
- package/es/form/components/SchemaForm/valueType/divider.js +11 -30
- package/es/form/components/SchemaForm/valueType/field.js +59 -100
- package/es/form/components/SchemaForm/valueType/formList.js +16 -42
- package/es/form/components/SchemaForm/valueType/formSet.js +16 -42
- package/es/form/components/SchemaForm/valueType/group.js +15 -37
- package/es/form/components/SchemaForm/valueType/ignore.js +4 -7
- package/es/form/components/SchemaForm/valueType/index.js +16 -17
- package/es/form/components/Segmented/index.js +43 -61
- package/es/form/components/Select/index.js +114 -151
- package/es/form/components/Slider/index.js +54 -91
- package/es/form/components/Switch/index.js +47 -71
- package/es/form/components/Text/index.js +132 -161
- package/es/form/components/TextArea/index.js +34 -57
- package/es/form/components/TreeSelect/index.js +42 -61
- package/es/form/components/UploadButton/index.js +125 -145
- package/es/form/components/UploadDragger/index.js +77 -92
- package/es/form/components/index.js +36 -88
- package/es/form/helpers/grid.js +77 -82
- package/es/form/helpers/index.js +1 -2
- package/es/form/index.js +6 -15
- package/es/form/layouts/DrawerForm/index.js +308 -315
- package/es/form/layouts/DrawerForm/style.js +26 -50
- package/es/form/layouts/LightFilter/index.js +208 -270
- package/es/form/layouts/LightFilter/style.js +49 -74
- package/es/form/layouts/LoginForm/index.js +85 -104
- package/es/form/layouts/LoginForm/style.js +68 -95
- package/es/form/layouts/LoginFormPage/index.js +141 -147
- package/es/form/layouts/LoginFormPage/style.js +129 -154
- package/es/form/layouts/ModalForm/index.js +247 -253
- package/es/form/layouts/ProForm/index.js +15 -32
- package/es/form/layouts/QueryFilter/Actions.js +52 -47
- package/es/form/layouts/QueryFilter/index.js +297 -359
- package/es/form/layouts/QueryFilter/style.js +38 -69
- package/es/form/layouts/StepsForm/StepForm.js +87 -119
- package/es/form/layouts/StepsForm/index.js +339 -353
- package/es/form/layouts/StepsForm/style.js +29 -50
- package/es/form/layouts/index.js +9 -20
- package/es/form/typing.js +1 -0
- package/es/index.js +1 -5
- package/es/layout/ProLayout.js +426 -497
- package/es/layout/WrapContent.js +26 -15
- package/es/layout/assert/Logo.js +107 -79
- package/es/layout/components/AppsLogoComponents/AppsLogo.js +13 -11
- package/es/layout/components/AppsLogoComponents/DefaultContent.js +50 -56
- package/es/layout/components/AppsLogoComponents/SimpleContent.js +73 -66
- package/es/layout/components/AppsLogoComponents/index.js +90 -73
- package/es/layout/components/AppsLogoComponents/style/default.js +31 -35
- package/es/layout/components/AppsLogoComponents/style/index.js +51 -77
- package/es/layout/components/AppsLogoComponents/style/simple.js +37 -40
- package/es/layout/components/CollapsedIcon/index.js +19 -55
- package/es/layout/components/CollapsedIcon/style.js +42 -66
- package/es/layout/components/Footer.js +27 -38
- package/es/layout/components/FooterToolbar/index.js +78 -102
- package/es/layout/components/FooterToolbar/style/index.js +38 -62
- package/es/layout/components/FooterToolbar/style/stylish.js +10 -38
- package/es/layout/components/GlobalFooter/index.js +37 -31
- package/es/layout/components/GlobalFooter/style.js +32 -53
- package/es/layout/components/GlobalHeader/ActionsContent.js +132 -181
- package/es/layout/components/GlobalHeader/index.d.ts +0 -5
- package/es/layout/components/GlobalHeader/index.js +76 -84
- package/es/layout/components/GlobalHeader/rightContentStyle.js +52 -76
- package/es/layout/components/GlobalHeader/style.js +57 -83
- package/es/layout/components/GridContent/index.js +35 -33
- package/es/layout/components/GridContent/style.js +14 -38
- package/es/layout/components/Header/index.js +95 -124
- package/es/layout/components/Header/style/header.js +48 -72
- package/es/layout/components/Header/style/stylish.js +12 -42
- package/es/layout/components/Help/AsyncContentPanel.js +53 -42
- package/es/layout/components/Help/HelpProvide.js +55 -6
- package/es/layout/components/Help/ProHelpContentPanel.js +128 -127
- package/es/layout/components/Help/ProHelpDrawer.js +48 -76
- package/es/layout/components/Help/ProHelpModal.js +47 -76
- package/es/layout/components/Help/ProHelpPanel.js +183 -224
- package/es/layout/components/Help/ProHelpPopover.js +37 -64
- package/es/layout/components/Help/RenderContentPanel.js +90 -103
- package/es/layout/components/Help/Search.js +124 -163
- package/es/layout/components/Help/index.js +19 -40
- package/es/layout/components/Help/style.js +90 -115
- package/es/layout/components/PageContainer/index.js +233 -280
- package/es/layout/components/PageContainer/style/index.js +78 -118
- package/es/layout/components/PageContainer/style/stylish.js +10 -38
- package/es/layout/components/PageHeader/index.js +144 -129
- package/es/layout/components/PageHeader/style/index.js +125 -172
- package/es/layout/components/PageLoading/index.js +23 -50
- package/es/layout/components/SettingDrawer/BlockCheckbox.js +42 -42
- package/es/layout/components/SettingDrawer/LayoutChange.js +108 -98
- package/es/layout/components/SettingDrawer/RegionalChange.js +31 -34
- package/es/layout/components/SettingDrawer/ThemeColor.js +50 -69
- package/es/layout/components/SettingDrawer/icon/group.js +109 -88
- package/es/layout/components/SettingDrawer/icon/sub.js +70 -116
- package/es/layout/components/SettingDrawer/index.js +405 -420
- package/es/layout/components/SettingDrawer/style/index.js +142 -146
- package/es/layout/components/SiderMenu/Arrow.js +12 -15
- package/es/layout/components/SiderMenu/BaseMenu.js +402 -451
- package/es/layout/components/SiderMenu/SiderMenu.js +246 -336
- package/es/layout/components/SiderMenu/index.js +72 -101
- package/es/layout/components/SiderMenu/style/index.js +171 -210
- package/es/layout/components/SiderMenu/style/menu.js +110 -173
- package/es/layout/components/SiderMenu/style/stylish.js +12 -42
- package/es/layout/components/TopNavHeader/index.js +106 -179
- package/es/layout/components/TopNavHeader/style.js +67 -95
- package/es/layout/context/RouteContext.js +2 -6
- package/es/layout/defaultSettings.js +6 -9
- package/es/layout/getPageTitle.js +46 -40
- package/es/layout/index.js +4 -27
- package/es/layout/locales/en-US/settingDrawer.js +43 -47
- package/es/layout/locales/en-US.js +2 -22
- package/es/layout/locales/index.js +13 -18
- package/es/layout/locales/it-IT/settingDrawer.js +34 -38
- package/es/layout/locales/it-IT.js +2 -22
- package/es/layout/locales/ko-KR/settingDrawer.js +39 -43
- package/es/layout/locales/ko-KR.js +2 -22
- package/es/layout/locales/zh-CN/settingDrawer.js +43 -47
- package/es/layout/locales/zh-CN.js +2 -22
- package/es/layout/locales/zh-TW/settingDrawer.js +35 -39
- package/es/layout/locales/zh-TW.js +2 -22
- package/es/layout/style/index.js +43 -73
- package/es/layout/typing.js +1 -0
- package/es/layout/utils/getBreadcrumbProps.js +111 -91
- package/es/layout/utils/getMenuData.js +18 -21
- package/es/layout/utils/pathTools.js +11 -12
- package/es/layout/utils/useCurrentMenuLayoutProps.js +21 -29
- package/es/layout/utils/utils.js +35 -51
- package/es/list/Item.js +222 -294
- package/es/list/ListView.js +188 -232
- package/es/list/constants.js +4 -17
- package/es/list/index.js +121 -178
- package/es/list/style/index.js +224 -287
- package/es/provider/index.js +228 -179
- package/es/provider/intl.js +100 -124
- package/es/provider/locale/ar_EG.js +47 -51
- package/es/provider/locale/ca_ES.js +45 -49
- package/es/provider/locale/cs_CZ.js +50 -54
- package/es/provider/locale/de_DE.js +47 -51
- package/es/provider/locale/en_GB.js +49 -53
- package/es/provider/locale/en_US.js +51 -55
- package/es/provider/locale/es_ES.js +47 -51
- package/es/provider/locale/fa_IR.js +47 -51
- package/es/provider/locale/fr_FR.js +47 -51
- package/es/provider/locale/he_IL.js +50 -54
- package/es/provider/locale/hr_HR.js +47 -51
- package/es/provider/locale/id_ID.js +47 -51
- package/es/provider/locale/it_IT.js +47 -51
- package/es/provider/locale/ja_JP.js +47 -51
- package/es/provider/locale/ko_KR.js +47 -51
- package/es/provider/locale/mn_MN.js +47 -51
- package/es/provider/locale/ms_MY.js +47 -51
- package/es/provider/locale/nl_NL.js +50 -54
- package/es/provider/locale/pl_PL.js +47 -51
- package/es/provider/locale/pt_BR.js +47 -51
- package/es/provider/locale/ro_RO.js +50 -54
- package/es/provider/locale/ru_RU.js +47 -51
- package/es/provider/locale/sk_SK.js +50 -54
- package/es/provider/locale/sr_RS.js +47 -51
- package/es/provider/locale/sv_SE.js +50 -54
- package/es/provider/locale/th_TH.js +50 -54
- package/es/provider/locale/tr_TR.js +47 -51
- package/es/provider/locale/uk_UA.js +50 -54
- package/es/provider/locale/uz_UZ.js +47 -51
- package/es/provider/locale/vi_VN.js +47 -51
- package/es/provider/locale/zh_CN.js +50 -54
- package/es/provider/locale/zh_HK.js +50 -54
- package/es/provider/locale/zh_TW.js +50 -54
- package/es/provider/typing/layoutToken.d.ts +0 -10
- package/es/provider/typing/layoutToken.js +19 -42
- package/es/provider/useStyle/index.d.ts +1 -1
- package/es/provider/useStyle/index.js +91 -78
- package/es/provider/utils/merge.js +13 -29
- package/es/skeleton/components/Descriptions/index.js +240 -252
- package/es/skeleton/components/List/index.js +217 -207
- package/es/skeleton/components/Result/index.js +57 -54
- package/es/skeleton/index.js +18 -62
- package/es/table/Store/Provide.d.ts +0 -1
- package/es/table/Store/Provide.js +141 -128
- package/es/table/Table.js +645 -698
- package/es/table/components/Alert/index.js +60 -37
- package/es/table/components/Alert/style.js +28 -52
- package/es/table/components/ColumnSetting/index.js +382 -387
- package/es/table/components/ColumnSetting/style.js +72 -108
- package/es/table/components/DragSortTable/index.js +101 -137
- package/es/table/components/DragSortTable/style.js +20 -44
- package/es/table/components/Dropdown/index.js +70 -83
- package/es/table/components/EditableTable/CellEditorTable.js +50 -65
- package/es/table/components/EditableTable/RowEditorTable.js +44 -62
- package/es/table/components/EditableTable/index.js +343 -347
- package/es/table/components/Form/FormRender.js +167 -173
- package/es/table/components/Form/index.js +123 -132
- package/es/table/components/ListToolBar/HeaderMenu.js +68 -102
- package/es/table/components/ListToolBar/index.js +254 -273
- package/es/table/components/ListToolBar/style.js +119 -134
- package/es/table/components/ToolBar/DensityIcon.js +36 -41
- package/es/table/components/ToolBar/FullscreenIcon.js +21 -14
- package/es/table/components/ToolBar/index.js +235 -267
- package/es/table/index.js +3 -50
- package/es/table/style/index.js +129 -175
- package/es/table/typing.d.ts +2 -2
- package/es/table/typing.js +1 -0
- package/es/table/useFetchData.js +432 -232
- package/es/table/utils/cellRenderToFromItem.js +186 -261
- package/es/table/utils/columnRender.js +116 -115
- package/es/table/utils/columnSort.js +23 -21
- package/es/table/utils/genProColumnToColumn.js +101 -129
- package/es/table/utils/index.js +197 -115
- package/es/table/utils/useDragSort.js +135 -174
- package/es/utils/components/DropdownFooter/index.js +48 -58
- package/es/utils/components/DropdownFooter/style.js +16 -40
- package/es/utils/components/ErrorBoundary/index.js +51 -25
- package/es/utils/components/FieldLabel/index.js +119 -146
- package/es/utils/components/FieldLabel/style.js +82 -128
- package/es/utils/components/FilterDropdown/index.js +54 -81
- package/es/utils/components/FilterDropdown/style.js +17 -38
- package/es/utils/components/InlineErrorFormItem/index.js +132 -167
- package/es/utils/components/InlineErrorFormItem/style.js +51 -79
- package/es/utils/components/LabelIconTip/index.js +58 -56
- package/es/utils/components/LabelIconTip/style.js +36 -57
- package/es/utils/components/ProFormContext/index.js +2 -6
- package/es/utils/conversionMomentValue/index.js +102 -83
- package/es/utils/dateArrayFormatter/index.js +31 -16
- package/es/utils/genCopyable/index.js +44 -38
- package/es/utils/getFieldPropsOrFormItemProps/index.js +10 -7
- package/es/utils/hooks/useDebounceFn/index.js +58 -48
- package/es/utils/hooks/useDebounceValue/index.js +29 -19
- package/es/utils/hooks/useDeepCompareEffect/index.js +29 -44
- package/es/utils/hooks/useDeepCompareMemo/index.js +12 -10
- package/es/utils/hooks/useDocumentTitle/index.js +5 -9
- package/es/utils/hooks/useFetchData/index.js +70 -63
- package/es/utils/hooks/useForceRender/index.js +12 -9
- package/es/utils/hooks/useLatest/index.js +8 -8
- package/es/utils/hooks/usePrevious/index.js +5 -9
- package/es/utils/hooks/useReactiveRef/index.js +4 -8
- package/es/utils/hooks/useRefCallback/index.js +6 -10
- package/es/utils/hooks/useRefFunction/index.js +11 -10
- package/es/utils/index.d.ts +1 -3
- package/es/utils/index.js +9 -84
- package/es/utils/isBrowser/index.js +14 -9
- package/es/utils/isDeepEqualReact/index.js +79 -53
- package/es/utils/isDropdownValueType/index.js +4 -8
- package/es/utils/isImg/index.js +3 -6
- package/es/utils/isNil/index.js +3 -5
- package/es/utils/isUrl/index.js +10 -10
- package/es/utils/merge/index.js +20 -27
- package/es/utils/nanoid/index.js +24 -18
- package/es/utils/omitBoolean/index.js +8 -7
- package/es/utils/omitUndefined/index.js +6 -10
- package/es/utils/omitUndefinedAndEmptyArr/index.js +7 -11
- package/es/utils/parseValueToMoment/index.js +16 -14
- package/es/utils/pickProFormItemProps/index.js +9 -42
- package/es/utils/pickProProps/index.js +9 -11
- package/es/utils/proFieldParsingText/index.js +141 -49
- package/es/utils/runFunction/index.js +8 -8
- package/es/utils/stringify/index.js +4 -9
- package/es/utils/transformKeySubmitValue/index.js +254 -130
- package/es/utils/typing.js +1 -0
- package/es/utils/useEditableArray/index.js +776 -611
- package/es/utils/useEditableMap/index.js +179 -161
- package/es/utils/useMediaQuery/index.js +47 -43
- package/es/utils/useMediaQuery/query.js +19 -15
- package/es/utils/useMountMergeState/index.d.ts +1 -1
- package/es/utils/useMountMergeState/index.js +2 -5
- package/es/version.js +3 -7
- package/lib/card/ProCard.d.ts +0 -1
- package/lib/card/ProCard.js +20 -52
- package/lib/card/components/Actions/index.js +39 -57
- package/lib/card/components/Actions/style.js +77 -115
- package/lib/card/components/Card/index.js +221 -287
- package/lib/card/components/Card/style.js +197 -281
- package/lib/card/components/CheckCard/Group.js +205 -230
- package/lib/card/components/CheckCard/index.js +160 -190
- package/lib/card/components/CheckCard/style.js +192 -227
- package/lib/card/components/Divider/index.js +30 -47
- package/lib/card/components/Divider/style.js +35 -69
- package/lib/card/components/Loading/index.js +85 -42
- package/lib/card/components/Loading/style.js +48 -78
- package/lib/card/components/Operation/index.js +29 -46
- package/lib/card/components/Operation/style.js +24 -58
- package/lib/card/components/Statistic/index.js +84 -117
- package/lib/card/components/Statistic/style.js +81 -130
- package/lib/card/components/StatisticCard/index.d.ts +0 -2
- package/lib/card/components/StatisticCard/index.js +72 -103
- package/lib/card/components/StatisticCard/style.js +41 -70
- package/lib/card/index.d.ts +2 -2
- package/lib/card/index.js +34 -41
- package/lib/card/typing.js +4 -16
- package/lib/descriptions/index.js +368 -436
- package/lib/descriptions/useFetchData.js +99 -100
- package/lib/field/AllProField.js +477 -415
- package/lib/field/FieldHOC/index.js +37 -56
- package/lib/field/PureProField.js +141 -187
- package/lib/field/ValueTypeToComponent.js +725 -454
- package/lib/field/components/Cascader/index.d.ts +2 -2
- package/lib/field/components/Cascader/index.js +132 -171
- package/lib/field/components/Checkbox/index.d.ts +1 -1
- package/lib/field/components/Checkbox/index.js +113 -155
- package/lib/field/components/Code/index.js +73 -86
- package/lib/field/components/ColorPicker/index.d.ts +1 -1
- package/lib/field/components/ColorPicker/index.js +61 -103
- package/lib/field/components/DatePicker/index.d.ts +2 -2
- package/lib/field/components/DatePicker/index.js +109 -145
- package/lib/field/components/Digit/index.js +92 -110
- package/lib/field/components/DigitRange/index.js +108 -122
- package/lib/field/components/FromNow/index.js +57 -90
- package/lib/field/components/Image/index.js +52 -76
- package/lib/field/components/IndexColumn/index.js +50 -72
- package/lib/field/components/Money/index.js +253 -281
- package/lib/field/components/Options/index.js +68 -98
- package/lib/field/components/Password/index.js +66 -85
- package/lib/field/components/Percent/index.js +80 -101
- package/lib/field/components/Percent/util.js +28 -33
- package/lib/field/components/Progress/index.js +61 -80
- package/lib/field/components/Radio/index.d.ts +1 -1
- package/lib/field/components/Radio/index.js +92 -134
- package/lib/field/components/RangePicker/index.d.ts +2 -2
- package/lib/field/components/RangePicker/index.js +129 -164
- package/lib/field/components/Rate/index.js +43 -60
- package/lib/field/components/Second/index.js +67 -84
- package/lib/field/components/Segmented/index.d.ts +1 -1
- package/lib/field/components/Segmented/index.js +74 -117
- package/lib/field/components/Select/LightSelect/index.d.ts +1 -1
- package/lib/field/components/Select/LightSelect/index.js +216 -282
- package/lib/field/components/Select/SearchSelect/index.js +195 -245
- package/lib/field/components/Select/index.d.ts +2 -2
- package/lib/field/components/Select/index.js +307 -379
- package/lib/field/components/Slider/index.js +43 -70
- package/lib/field/components/Status/index.js +89 -52
- package/lib/field/components/Switch/index.d.ts +1 -1
- package/lib/field/components/Switch/index.js +67 -98
- package/lib/field/components/Text/index.js +58 -74
- package/lib/field/components/TextArea/index.js +44 -80
- package/lib/field/components/TextArea/readonly.js +43 -76
- package/lib/field/components/TimePicker/index.js +188 -217
- package/lib/field/components/TreeSelect/index.d.ts +2 -2
- package/lib/field/components/TreeSelect/index.js +185 -206
- package/lib/field/index.js +240 -96
- package/lib/form/BaseForm/BaseForm.js +594 -634
- package/lib/form/BaseForm/EditOrReadOnlyContext.js +9 -36
- package/lib/form/BaseForm/LightWrapper/index.js +111 -182
- package/lib/form/BaseForm/LightWrapper/style.js +19 -56
- package/lib/form/BaseForm/Submitter/index.js +75 -126
- package/lib/form/BaseForm/index.js +37 -20
- package/lib/form/FieldContext.js +8 -36
- package/lib/form/components/Captcha/index.js +169 -196
- package/lib/form/components/Cascader/index.js +56 -104
- package/lib/form/components/Checkbox/index.js +83 -128
- package/lib/form/components/ColorPicker/index.js +51 -92
- package/lib/form/components/DatePicker/BaseDatePicker.js +54 -98
- package/lib/form/components/DatePicker/DatePicker.js +32 -77
- package/lib/form/components/DatePicker/DateTimePicker.js +32 -76
- package/lib/form/components/DatePicker/MonthPicker.js +32 -77
- package/lib/form/components/DatePicker/QuarterPicker.js +32 -77
- package/lib/form/components/DatePicker/TimePicker.js +55 -103
- package/lib/form/components/DatePicker/WeekPicker.js +32 -77
- package/lib/form/components/DatePicker/YearPicker.js +32 -77
- package/lib/form/components/DatePicker/index.js +19 -44
- package/lib/form/components/DateRangePicker/BaseDateRanger.js +53 -100
- package/lib/form/components/DateRangePicker/DateMonthRangePicker.js +36 -78
- package/lib/form/components/DateRangePicker/DateQuarterRangePicker.js +36 -78
- package/lib/form/components/DateRangePicker/DateTimeRangePicker.js +36 -78
- package/lib/form/components/DateRangePicker/DateWeekRangePicker.js +36 -78
- package/lib/form/components/DateRangePicker/DateYearRangePicker.js +36 -78
- package/lib/form/components/DateRangePicker/TimeRangePicker.js +53 -97
- package/lib/form/components/DateRangePicker/index.js +36 -78
- package/lib/form/components/Dependency/index.js +68 -127
- package/lib/form/components/Digit/DigitRange.d.ts +1 -1
- package/lib/form/components/Digit/DigitRange.js +50 -103
- package/lib/form/components/Digit/index.js +55 -106
- package/lib/form/components/Field/index.js +89 -153
- package/lib/form/components/FieldSet/index.js +107 -153
- package/lib/form/components/FormItem/FormItemRender/index.js +142 -114
- package/lib/form/components/FormItem/Group/index.js +143 -198
- package/lib/form/components/FormItem/Group/style.js +46 -77
- package/lib/form/components/FormItem/index.js +257 -316
- package/lib/form/components/FormItem/warpField.js +229 -308
- package/lib/form/components/List/ListContainer.js +227 -211
- package/lib/form/components/List/ListItem.js +267 -374
- package/lib/form/components/List/index.js +211 -277
- package/lib/form/components/List/style.js +53 -110
- package/lib/form/components/Money/index.js +58 -108
- package/lib/form/components/Radio/index.js +60 -114
- package/lib/form/components/Rate/index.js +45 -88
- package/lib/form/components/SchemaForm/index.js +154 -193
- package/lib/form/components/SchemaForm/layoutType/Embed.js +12 -24
- package/lib/form/components/SchemaForm/layoutType/StepsForm.js +43 -96
- package/lib/form/components/SchemaForm/layoutType/index.js +18 -35
- package/lib/form/components/SchemaForm/typing.js +4 -16
- package/lib/form/components/SchemaForm/valueType/dependency.js +25 -69
- package/lib/form/components/SchemaForm/valueType/divider.js +16 -45
- package/lib/form/components/SchemaForm/valueType/field.js +67 -128
- package/lib/form/components/SchemaForm/valueType/formList.js +22 -58
- package/lib/form/components/SchemaForm/valueType/formSet.js +22 -68
- package/lib/form/components/SchemaForm/valueType/group.js +21 -53
- package/lib/form/components/SchemaForm/valueType/ignore.js +8 -25
- package/lib/form/components/SchemaForm/valueType/index.js +27 -43
- package/lib/form/components/Segmented/index.js +50 -89
- package/lib/form/components/Select/index.js +125 -181
- package/lib/form/components/Slider/index.js +62 -119
- package/lib/form/components/Switch/index.js +55 -99
- package/lib/form/components/Text/index.js +141 -190
- package/lib/form/components/TextArea/index.js +42 -85
- package/lib/form/components/TreeSelect/index.js +50 -89
- package/lib/form/components/UploadButton/index.js +131 -172
- package/lib/form/components/UploadDragger/index.js +84 -119
- package/lib/form/components/index.js +294 -110
- package/lib/form/helpers/grid.js +82 -97
- package/lib/form/helpers/index.js +15 -18
- package/lib/form/index.js +78 -38
- package/lib/form/layouts/DrawerForm/index.js +317 -338
- package/lib/form/layouts/DrawerForm/style.js +31 -65
- package/lib/form/layouts/LightFilter/index.js +217 -293
- package/lib/form/layouts/LightFilter/style.js +54 -89
- package/lib/form/layouts/LoginForm/index.js +93 -133
- package/lib/form/layouts/LoginForm/style.js +73 -110
- package/lib/form/layouts/LoginFormPage/index.js +148 -174
- package/lib/form/layouts/LoginFormPage/style.js +133 -165
- package/lib/form/layouts/ModalForm/index.js +253 -273
- package/lib/form/layouts/ProForm/index.js +28 -68
- package/lib/form/layouts/QueryFilter/Actions.js +57 -77
- package/lib/form/layouts/QueryFilter/index.js +308 -390
- package/lib/form/layouts/QueryFilter/style.js +43 -84
- package/lib/form/layouts/StepsForm/StepForm.js +94 -146
- package/lib/form/layouts/StepsForm/index.js +351 -378
- package/lib/form/layouts/StepsForm/style.js +34 -65
- package/lib/form/layouts/index.js +62 -40
- package/lib/form/typing.js +4 -16
- package/lib/index.js +133 -34
- package/lib/layout/ProLayout.js +447 -528
- package/lib/layout/WrapContent.js +34 -46
- package/lib/layout/assert/Logo.js +110 -97
- package/lib/layout/components/AppsLogoComponents/AppsLogo.js +17 -29
- package/lib/layout/components/AppsLogoComponents/DefaultContent.js +55 -85
- package/lib/layout/components/AppsLogoComponents/SimpleContent.js +78 -95
- package/lib/layout/components/AppsLogoComponents/index.js +98 -105
- package/lib/layout/components/AppsLogoComponents/style/default.js +36 -55
- package/lib/layout/components/AppsLogoComponents/style/index.js +58 -94
- package/lib/layout/components/AppsLogoComponents/style/simple.js +41 -59
- package/lib/layout/components/CollapsedIcon/index.js +26 -82
- package/lib/layout/components/CollapsedIcon/style.js +47 -81
- package/lib/layout/components/Footer.js +33 -65
- package/lib/layout/components/FooterToolbar/index.js +87 -132
- package/lib/layout/components/FooterToolbar/style/index.js +43 -77
- package/lib/layout/components/FooterToolbar/style/stylish.js +16 -54
- package/lib/layout/components/GlobalFooter/index.js +43 -61
- package/lib/layout/components/GlobalFooter/style.js +37 -68
- package/lib/layout/components/GlobalHeader/ActionsContent.js +138 -208
- package/lib/layout/components/GlobalHeader/index.d.ts +0 -5
- package/lib/layout/components/GlobalHeader/index.js +86 -116
- package/lib/layout/components/GlobalHeader/rightContentStyle.js +57 -91
- package/lib/layout/components/GlobalHeader/style.js +62 -98
- package/lib/layout/components/GridContent/index.js +43 -64
- package/lib/layout/components/GridContent/style.js +19 -53
- package/lib/layout/components/Header/index.js +105 -156
- package/lib/layout/components/Header/style/header.js +53 -87
- package/lib/layout/components/Header/style/stylish.js +18 -58
- package/lib/layout/components/Help/AsyncContentPanel.js +59 -62
- package/lib/layout/components/Help/HelpProvide.js +59 -34
- package/lib/layout/components/Help/ProHelpContentPanel.js +139 -157
- package/lib/layout/components/Help/ProHelpDrawer.js +54 -102
- package/lib/layout/components/Help/ProHelpModal.js +53 -102
- package/lib/layout/components/Help/ProHelpPanel.js +192 -254
- package/lib/layout/components/Help/ProHelpPopover.js +46 -92
- package/lib/layout/components/Help/RenderContentPanel.js +97 -130
- package/lib/layout/components/Help/Search.js +130 -191
- package/lib/layout/components/Help/index.js +113 -74
- package/lib/layout/components/Help/style.js +96 -130
- package/lib/layout/components/PageContainer/index.js +245 -308
- package/lib/layout/components/PageContainer/style/index.js +83 -133
- package/lib/layout/components/PageContainer/style/stylish.js +16 -54
- package/lib/layout/components/PageHeader/index.js +149 -156
- package/lib/layout/components/PageHeader/style/index.js +129 -182
- package/lib/layout/components/PageLoading/index.js +28 -76
- package/lib/layout/components/SettingDrawer/BlockCheckbox.js +46 -71
- package/lib/layout/components/SettingDrawer/LayoutChange.js +114 -129
- package/lib/layout/components/SettingDrawer/RegionalChange.js +38 -65
- package/lib/layout/components/SettingDrawer/ThemeColor.js +55 -95
- package/lib/layout/components/SettingDrawer/icon/group.js +111 -105
- package/lib/layout/components/SettingDrawer/icon/sub.js +72 -133
- package/lib/layout/components/SettingDrawer/index.js +424 -447
- package/lib/layout/components/SettingDrawer/style/index.js +147 -161
- package/lib/layout/components/SiderMenu/Arrow.js +16 -34
- package/lib/layout/components/SiderMenu/BaseMenu.js +416 -487
- package/lib/layout/components/SiderMenu/SiderMenu.js +254 -367
- package/lib/layout/components/SiderMenu/index.js +81 -130
- package/lib/layout/components/SiderMenu/style/index.js +178 -226
- package/lib/layout/components/SiderMenu/style/menu.js +115 -188
- package/lib/layout/components/SiderMenu/style/stylish.js +18 -58
- package/lib/layout/components/TopNavHeader/index.js +117 -211
- package/lib/layout/components/TopNavHeader/style.js +72 -110
- package/lib/layout/context/RouteContext.js +6 -24
- package/lib/layout/defaultSettings.js +11 -29
- package/lib/layout/getPageTitle.js +53 -60
- package/lib/layout/index.js +145 -55
- package/lib/layout/locales/en-US/settingDrawer.js +47 -65
- package/lib/layout/locales/en-US.js +8 -48
- package/lib/layout/locales/index.js +24 -52
- package/lib/layout/locales/it-IT/settingDrawer.js +38 -56
- package/lib/layout/locales/it-IT.js +8 -48
- package/lib/layout/locales/ko-KR/settingDrawer.js +43 -61
- package/lib/layout/locales/ko-KR.js +8 -48
- package/lib/layout/locales/zh-CN/settingDrawer.js +47 -65
- package/lib/layout/locales/zh-CN.js +8 -48
- package/lib/layout/locales/zh-TW/settingDrawer.js +39 -57
- package/lib/layout/locales/zh-TW.js +8 -48
- package/lib/layout/style/index.js +48 -88
- package/lib/layout/typing.js +4 -16
- package/lib/layout/utils/getBreadcrumbProps.js +117 -107
- package/lib/layout/utils/getMenuData.js +23 -40
- package/lib/layout/utils/pathTools.js +14 -29
- package/lib/layout/utils/useCurrentMenuLayoutProps.js +27 -49
- package/lib/layout/utils/utils.js +40 -64
- package/lib/list/Item.js +229 -321
- package/lib/list/ListView.js +197 -260
- package/lib/list/constants.js +7 -35
- package/lib/list/index.js +132 -207
- package/lib/list/style/index.js +230 -302
- package/lib/provider/index.js +270 -215
- package/lib/provider/intl.js +140 -188
- package/lib/provider/locale/ar_EG.js +51 -69
- package/lib/provider/locale/ca_ES.js +49 -67
- package/lib/provider/locale/cs_CZ.js +54 -72
- package/lib/provider/locale/de_DE.js +51 -69
- package/lib/provider/locale/en_GB.js +53 -71
- package/lib/provider/locale/en_US.js +55 -73
- package/lib/provider/locale/es_ES.js +51 -69
- package/lib/provider/locale/fa_IR.js +51 -69
- package/lib/provider/locale/fr_FR.js +51 -69
- package/lib/provider/locale/he_IL.js +54 -72
- package/lib/provider/locale/hr_HR.js +51 -69
- package/lib/provider/locale/id_ID.js +51 -69
- package/lib/provider/locale/it_IT.js +51 -69
- package/lib/provider/locale/ja_JP.js +51 -69
- package/lib/provider/locale/ko_KR.js +51 -69
- package/lib/provider/locale/mn_MN.js +51 -69
- package/lib/provider/locale/ms_MY.js +51 -69
- package/lib/provider/locale/nl_NL.js +54 -72
- package/lib/provider/locale/pl_PL.js +51 -69
- package/lib/provider/locale/pt_BR.js +51 -69
- package/lib/provider/locale/ro_RO.js +54 -72
- package/lib/provider/locale/ru_RU.js +51 -69
- package/lib/provider/locale/sk_SK.js +54 -72
- package/lib/provider/locale/sr_RS.js +51 -69
- package/lib/provider/locale/sv_SE.js +54 -72
- package/lib/provider/locale/th_TH.js +54 -72
- package/lib/provider/locale/tr_TR.js +51 -69
- package/lib/provider/locale/uk_UA.js +54 -72
- package/lib/provider/locale/uz_UZ.js +51 -69
- package/lib/provider/locale/vi_VN.js +51 -69
- package/lib/provider/locale/zh_CN.js +54 -72
- package/lib/provider/locale/zh_HK.js +54 -72
- package/lib/provider/locale/zh_TW.js +54 -72
- package/lib/provider/typing/layoutToken.d.ts +0 -10
- package/lib/provider/typing/layoutToken.js +36 -69
- package/lib/provider/useStyle/index.d.ts +1 -1
- package/lib/provider/useStyle/index.js +98 -94
- package/lib/provider/utils/merge.js +18 -44
- package/lib/skeleton/components/Descriptions/index.js +246 -282
- package/lib/skeleton/components/List/index.js +221 -236
- package/lib/skeleton/components/Result/index.js +63 -84
- package/lib/skeleton/index.js +73 -79
- package/lib/table/Store/Provide.d.ts +0 -1
- package/lib/table/Store/Provide.js +147 -151
- package/lib/table/Table.js +664 -712
- package/lib/table/components/Alert/index.js +66 -67
- package/lib/table/components/Alert/style.js +33 -67
- package/lib/table/components/ColumnSetting/index.js +391 -404
- package/lib/table/components/ColumnSetting/style.js +77 -123
- package/lib/table/components/DragSortTable/index.js +110 -165
- package/lib/table/components/DragSortTable/style.js +25 -59
- package/lib/table/components/Dropdown/index.js +75 -108
- package/lib/table/components/EditableTable/CellEditorTable.js +55 -90
- package/lib/table/components/EditableTable/RowEditorTable.js +49 -87
- package/lib/table/components/EditableTable/index.js +351 -365
- package/lib/table/components/Form/FormRender.js +176 -201
- package/lib/table/components/Form/index.js +132 -161
- package/lib/table/components/ListToolBar/HeaderMenu.js +74 -128
- package/lib/table/components/ListToolBar/index.js +263 -302
- package/lib/table/components/ListToolBar/style.js +124 -149
- package/lib/table/components/ToolBar/DensityIcon.js +43 -71
- package/lib/table/components/ToolBar/FullscreenIcon.js +30 -45
- package/lib/table/components/ToolBar/index.js +247 -299
- package/lib/table/index.js +179 -71
- package/lib/table/style/index.js +135 -190
- package/lib/table/typing.d.ts +2 -2
- package/lib/table/typing.js +4 -16
- package/lib/table/useFetchData.js +437 -241
- package/lib/table/utils/cellRenderToFromItem.js +192 -277
- package/lib/table/utils/columnRender.js +126 -144
- package/lib/table/utils/columnSort.js +27 -39
- package/lib/table/utils/genProColumnToColumn.js +111 -141
- package/lib/table/utils/index.js +204 -128
- package/lib/table/utils/useDragSort.js +141 -188
- package/lib/utils/components/DropdownFooter/index.js +56 -89
- package/lib/utils/components/DropdownFooter/style.js +21 -55
- package/lib/utils/components/ErrorBoundary/index.js +55 -53
- package/lib/utils/components/FieldLabel/index.js +126 -176
- package/lib/utils/components/FieldLabel/style.js +87 -143
- package/lib/utils/components/FilterDropdown/index.js +61 -109
- package/lib/utils/components/FilterDropdown/style.js +22 -53
- package/lib/utils/components/InlineErrorFormItem/index.js +137 -193
- package/lib/utils/components/InlineErrorFormItem/style.js +56 -94
- package/lib/utils/components/LabelIconTip/index.js +62 -82
- package/lib/utils/components/LabelIconTip/style.js +41 -72
- package/lib/utils/components/ProFormContext/index.js +7 -34
- package/lib/utils/conversionMomentValue/index.js +112 -115
- package/lib/utils/dateArrayFormatter/index.js +38 -46
- package/lib/utils/genCopyable/index.js +49 -66
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +15 -27
- package/lib/utils/hooks/useDebounceFn/index.js +63 -65
- package/lib/utils/hooks/useDebounceValue/index.js +35 -38
- package/lib/utils/hooks/useDeepCompareEffect/index.js +37 -61
- package/lib/utils/hooks/useDeepCompareMemo/index.js +17 -39
- package/lib/utils/hooks/useDocumentTitle/index.js +10 -28
- package/lib/utils/hooks/useFetchData/index.js +74 -89
- package/lib/utils/hooks/useForceRender/index.js +16 -26
- package/lib/utils/hooks/useLatest/index.js +11 -26
- package/lib/utils/hooks/usePrevious/index.js +9 -27
- package/lib/utils/hooks/useReactiveRef/index.js +10 -37
- package/lib/utils/hooks/useRefCallback/index.js +9 -27
- package/lib/utils/hooks/useRefFunction/index.js +16 -29
- package/lib/utils/index.d.ts +1 -3
- package/lib/utils/index.js +455 -138
- package/lib/utils/isBrowser/index.js +18 -27
- package/lib/utils/isDeepEqualReact/index.js +83 -70
- package/lib/utils/isDropdownValueType/index.js +8 -26
- package/lib/utils/isImg/index.js +6 -23
- package/lib/utils/isNil/index.js +7 -23
- package/lib/utils/isUrl/index.js +14 -28
- package/lib/utils/merge/index.js +26 -44
- package/lib/utils/nanoid/index.js +28 -36
- package/lib/utils/omitBoolean/index.js +12 -25
- package/lib/utils/omitUndefined/index.js +10 -28
- package/lib/utils/omitUndefinedAndEmptyArr/index.js +11 -29
- package/lib/utils/parseValueToMoment/index.js +26 -47
- package/lib/utils/pickProFormItemProps/index.js +12 -59
- package/lib/utils/pickProProps/index.js +13 -29
- package/lib/utils/proFieldParsingText/index.js +146 -77
- package/lib/utils/runFunction/index.js +12 -26
- package/lib/utils/stringify/index.js +14 -28
- package/lib/utils/transformKeySubmitValue/index.js +262 -160
- package/lib/utils/typing.js +4 -16
- package/lib/utils/useEditableArray/index.js +790 -630
- package/lib/utils/useEditableMap/index.js +188 -179
- package/lib/utils/useMediaQuery/index.js +53 -73
- package/lib/utils/useMediaQuery/query.js +23 -32
- package/lib/utils/useMountMergeState/index.d.ts +1 -1
- package/lib/utils/useMountMergeState/index.js +10 -33
- package/lib/version.js +7 -25
- package/package.json +4 -3
- package/es/card/components/TabPane/index.d.ts +0 -26
- package/es/card/components/TabPane/index.js +0 -84
- package/es/utils/compareVersions/coverToNewToken.d.ts +0 -2
- package/es/utils/compareVersions/coverToNewToken.js +0 -56
- package/es/utils/compareVersions/index.d.ts +0 -8
- package/es/utils/compareVersions/index.js +0 -48
- package/lib/card/components/TabPane/index.d.ts +0 -26
- package/lib/card/components/TabPane/index.js +0 -111
- package/lib/utils/compareVersions/coverToNewToken.d.ts +0 -2
- package/lib/utils/compareVersions/coverToNewToken.js +0 -73
- package/lib/utils/compareVersions/index.d.ts +0 -8
- package/lib/utils/compareVersions/index.js +0 -68
|
@@ -1,290 +1,284 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/form/layouts/ModalForm/index.tsx
|
|
54
|
-
import { ConfigProvider, Modal } from "antd";
|
|
55
|
-
import { merge } from "lodash-es";
|
|
56
|
-
import useMergedState from "rc-util/lib/hooks/useMergedState";
|
|
57
|
-
import { noteOnce } from "rc-util/lib/warning";
|
|
58
|
-
import React, {
|
|
59
|
-
useCallback,
|
|
60
|
-
useContext,
|
|
61
|
-
useEffect,
|
|
62
|
-
useImperativeHandle,
|
|
63
|
-
useMemo,
|
|
64
|
-
useRef,
|
|
65
|
-
useState
|
|
66
|
-
} from "react";
|
|
67
|
-
import { createPortal } from "react-dom";
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
|
+
var _excluded = ["children", "trigger", "onOpenChange", "modalProps", "onFinish", "submitTimeout", "title", "width", "open"];
|
|
7
|
+
import { useMergedState, warning } from '@rc-component/util';
|
|
8
|
+
import { ConfigProvider, Modal } from 'antd';
|
|
9
|
+
import { merge } from 'lodash-es';
|
|
10
|
+
import React, { useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
11
|
+
import { createPortal } from 'react-dom';
|
|
68
12
|
import { BaseForm } from "../../BaseForm";
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"onFinish",
|
|
86
|
-
"submitTimeout",
|
|
87
|
-
"title",
|
|
88
|
-
"width",
|
|
89
|
-
"open"
|
|
90
|
-
]);
|
|
91
|
-
var _a2, _b2, _c, _d;
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
var noteOnce = warning.noteOnce;
|
|
17
|
+
function ModalForm(_ref) {
|
|
18
|
+
var _context$locale3, _context$locale4;
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
trigger = _ref.trigger,
|
|
21
|
+
onOpenChange = _ref.onOpenChange,
|
|
22
|
+
modalProps = _ref.modalProps,
|
|
23
|
+
onFinish = _ref.onFinish,
|
|
24
|
+
submitTimeout = _ref.submitTimeout,
|
|
25
|
+
title = _ref.title,
|
|
26
|
+
width = _ref.width,
|
|
27
|
+
propsOpen = _ref.open,
|
|
28
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
92
29
|
noteOnce(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
31
|
+
!rest['footer'] || !(modalProps !== null && modalProps !== void 0 && modalProps.footer), 'ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
|
|
32
|
+
var context = useContext(ConfigProvider.ConfigContext);
|
|
33
|
+
var _useState = useState([]),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
forceUpdate = _useState2[1];
|
|
36
|
+
var _useState3 = useState(false),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
loading = _useState4[0],
|
|
39
|
+
setLoading = _useState4[1];
|
|
40
|
+
var _useMergedState = useMergedState(false, {
|
|
41
|
+
value: propsOpen,
|
|
42
|
+
onChange: onOpenChange
|
|
43
|
+
}),
|
|
44
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
45
|
+
open = _useMergedState2[0],
|
|
46
|
+
setOpen = _useMergedState2[1];
|
|
47
|
+
var footerRef = useRef(null);
|
|
48
|
+
var footerDomRef = useCallback(function (element) {
|
|
49
|
+
if (footerRef.current === null && element) {
|
|
50
|
+
forceUpdate([]);
|
|
51
|
+
}
|
|
52
|
+
footerRef.current = element;
|
|
53
|
+
}, []);
|
|
54
|
+
var formRef = useRef();
|
|
55
|
+
var resetFields = useCallback(function () {
|
|
56
|
+
var _ref2, _rest$form, _rest$formRef;
|
|
57
|
+
var form = (_ref2 = (_rest$form = rest.form) !== null && _rest$form !== void 0 ? _rest$form : (_rest$formRef = rest.formRef) === null || _rest$formRef === void 0 ? void 0 : _rest$formRef.current) !== null && _ref2 !== void 0 ? _ref2 : formRef.current;
|
|
58
|
+
// 重置表单
|
|
59
|
+
if (form && modalProps !== null && modalProps !== void 0 && modalProps.destroyOnHidden) {
|
|
119
60
|
form.resetFields();
|
|
120
61
|
}
|
|
121
|
-
}, [modalProps
|
|
122
|
-
useImperativeHandle(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
[formRef.current]
|
|
128
|
-
);
|
|
129
|
-
useEffect(() => {
|
|
62
|
+
}, [modalProps === null || modalProps === void 0 ? void 0 : modalProps.destroyOnHidden, rest.form, rest.formRef]);
|
|
63
|
+
useImperativeHandle(rest.formRef, function () {
|
|
64
|
+
return formRef.current;
|
|
65
|
+
}, [formRef.current]);
|
|
66
|
+
useEffect(function () {
|
|
130
67
|
if (propsOpen) {
|
|
131
|
-
onOpenChange
|
|
68
|
+
onOpenChange === null || onOpenChange === void 0 || onOpenChange(true);
|
|
132
69
|
}
|
|
70
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
71
|
}, [propsOpen]);
|
|
134
|
-
|
|
72
|
+
var triggerDom = useMemo(function () {
|
|
135
73
|
if (!trigger) {
|
|
136
74
|
return null;
|
|
137
75
|
}
|
|
138
|
-
return React.cloneElement(trigger,
|
|
139
|
-
key:
|
|
140
|
-
}, trigger.props), {
|
|
141
|
-
onClick:
|
|
142
|
-
var
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
76
|
+
return /*#__PURE__*/React.cloneElement(trigger, _objectSpread(_objectSpread({
|
|
77
|
+
key: 'trigger'
|
|
78
|
+
}, trigger.props), {}, {
|
|
79
|
+
onClick: function () {
|
|
80
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
|
81
|
+
var _trigger$props, _trigger$props$onClic;
|
|
82
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
83
|
+
while (1) switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
setOpen(!open);
|
|
86
|
+
(_trigger$props = trigger.props) === null || _trigger$props === void 0 || (_trigger$props$onClic = _trigger$props.onClick) === null || _trigger$props$onClic === void 0 || _trigger$props$onClic.call(_trigger$props, e);
|
|
87
|
+
case 2:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
90
|
+
}
|
|
91
|
+
}, _callee);
|
|
92
|
+
}));
|
|
93
|
+
function onClick(_x) {
|
|
94
|
+
return _onClick.apply(this, arguments);
|
|
95
|
+
}
|
|
96
|
+
return onClick;
|
|
97
|
+
}()
|
|
146
98
|
}));
|
|
147
99
|
}, [setOpen, trigger, open]);
|
|
148
|
-
|
|
149
|
-
var
|
|
100
|
+
var submitterConfig = useMemo(function () {
|
|
101
|
+
var _ref3, _modalProps$okText, _context$locale, _ref4, _modalProps$cancelTex, _context$locale2, _rest$submitter;
|
|
150
102
|
if (rest.submitter === false) {
|
|
151
103
|
return false;
|
|
152
104
|
}
|
|
153
|
-
return merge(
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
resetText: (_h = (_g = modalProps == null ? void 0 : modalProps.cancelText) != null ? _g : (_f = (_e = context.locale) == null ? void 0 : _e.Modal) == null ? void 0 : _f.cancelText) != null ? _h : "取消"
|
|
158
|
-
},
|
|
159
|
-
resetButtonProps: {
|
|
160
|
-
preventDefault: true,
|
|
161
|
-
disabled: submitTimeout && loading,
|
|
162
|
-
onClick: (e) => {
|
|
163
|
-
var _a4;
|
|
164
|
-
setOpen(false);
|
|
165
|
-
(_a4 = modalProps == null ? void 0 : modalProps.onCancel) == null ? void 0 : _a4.call(modalProps, e);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
105
|
+
return merge({
|
|
106
|
+
searchConfig: {
|
|
107
|
+
submitText: (_ref3 = (_modalProps$okText = modalProps === null || modalProps === void 0 ? void 0 : modalProps.okText) !== null && _modalProps$okText !== void 0 ? _modalProps$okText : (_context$locale = context.locale) === null || _context$locale === void 0 || (_context$locale = _context$locale.Modal) === null || _context$locale === void 0 ? void 0 : _context$locale.okText) !== null && _ref3 !== void 0 ? _ref3 : '确认',
|
|
108
|
+
resetText: (_ref4 = (_modalProps$cancelTex = modalProps === null || modalProps === void 0 ? void 0 : modalProps.cancelText) !== null && _modalProps$cancelTex !== void 0 ? _modalProps$cancelTex : (_context$locale2 = context.locale) === null || _context$locale2 === void 0 || (_context$locale2 = _context$locale2.Modal) === null || _context$locale2 === void 0 ? void 0 : _context$locale2.cancelText) !== null && _ref4 !== void 0 ? _ref4 : '取消'
|
|
168
109
|
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
setOpen,
|
|
177
|
-
loading,
|
|
178
|
-
submitTimeout
|
|
179
|
-
]);
|
|
180
|
-
const contentRender = useCallback((formDom, submitter) => {
|
|
181
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, formDom, footerRef.current && submitter ? /* @__PURE__ */ React.createElement(React.Fragment, { key: "submitter" }, createPortal(submitter, footerRef.current)) : submitter);
|
|
182
|
-
}, []);
|
|
183
|
-
const onFinishHandle = useCallback(
|
|
184
|
-
(values) => __async(this, null, function* () {
|
|
185
|
-
const response = onFinish == null ? void 0 : onFinish(values);
|
|
186
|
-
if (submitTimeout && response instanceof Promise) {
|
|
187
|
-
setLoading(true);
|
|
188
|
-
const timer = setTimeout(() => setLoading(false), submitTimeout);
|
|
189
|
-
try {
|
|
190
|
-
const result2 = yield response;
|
|
191
|
-
clearTimeout(timer);
|
|
192
|
-
setLoading(false);
|
|
193
|
-
if (result2) {
|
|
194
|
-
setOpen(false);
|
|
195
|
-
}
|
|
196
|
-
return result2;
|
|
197
|
-
} catch (error) {
|
|
198
|
-
clearTimeout(timer);
|
|
199
|
-
setLoading(false);
|
|
200
|
-
throw error;
|
|
201
|
-
}
|
|
202
|
-
} else if (submitTimeout) {
|
|
203
|
-
setLoading(true);
|
|
204
|
-
const timer = setTimeout(() => setLoading(false), submitTimeout);
|
|
205
|
-
try {
|
|
206
|
-
const result2 = yield response;
|
|
207
|
-
clearTimeout(timer);
|
|
208
|
-
setLoading(false);
|
|
209
|
-
if (result2) {
|
|
210
|
-
setOpen(false);
|
|
211
|
-
}
|
|
212
|
-
return result2;
|
|
213
|
-
} catch (error) {
|
|
214
|
-
clearTimeout(timer);
|
|
215
|
-
setLoading(false);
|
|
216
|
-
throw error;
|
|
110
|
+
resetButtonProps: {
|
|
111
|
+
preventDefault: true,
|
|
112
|
+
disabled: submitTimeout && loading,
|
|
113
|
+
onClick: function onClick(e) {
|
|
114
|
+
var _modalProps$onCancel;
|
|
115
|
+
setOpen(false);
|
|
116
|
+
modalProps === null || modalProps === void 0 || (_modalProps$onCancel = modalProps.onCancel) === null || _modalProps$onCancel === void 0 || _modalProps$onCancel.call(modalProps, e);
|
|
217
117
|
}
|
|
218
118
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
119
|
+
}, (_rest$submitter = rest.submitter) !== null && _rest$submitter !== void 0 ? _rest$submitter : {});
|
|
120
|
+
}, [(_context$locale3 = context.locale) === null || _context$locale3 === void 0 || (_context$locale3 = _context$locale3.Modal) === null || _context$locale3 === void 0 ? void 0 : _context$locale3.cancelText, (_context$locale4 = context.locale) === null || _context$locale4 === void 0 || (_context$locale4 = _context$locale4.Modal) === null || _context$locale4 === void 0 ? void 0 : _context$locale4.okText, modalProps, rest.submitter, setOpen, loading, submitTimeout]);
|
|
121
|
+
var contentRender = useCallback(function (formDom, submitter) {
|
|
122
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
123
|
+
children: [formDom, footerRef.current && submitter ? /*#__PURE__*/_jsx(React.Fragment, {
|
|
124
|
+
children: /*#__PURE__*/createPortal(submitter, footerRef.current)
|
|
125
|
+
}, "submitter") : submitter]
|
|
126
|
+
});
|
|
127
|
+
}, []);
|
|
128
|
+
var onFinishHandle = useCallback( /*#__PURE__*/function () {
|
|
129
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
130
|
+
var response, timer, _result, _timer, _result2, result;
|
|
131
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
132
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
133
|
+
case 0:
|
|
134
|
+
response = onFinish === null || onFinish === void 0 ? void 0 : onFinish(values);
|
|
135
|
+
if (!(submitTimeout && response instanceof Promise)) {
|
|
136
|
+
_context2.next = 21;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
setLoading(true);
|
|
140
|
+
timer = setTimeout(function () {
|
|
141
|
+
return setLoading(false);
|
|
142
|
+
}, submitTimeout);
|
|
143
|
+
_context2.prev = 4;
|
|
144
|
+
_context2.next = 7;
|
|
145
|
+
return response;
|
|
146
|
+
case 7:
|
|
147
|
+
_result = _context2.sent;
|
|
148
|
+
clearTimeout(timer);
|
|
149
|
+
setLoading(false);
|
|
150
|
+
// 返回真值,关闭弹框
|
|
151
|
+
if (_result) {
|
|
152
|
+
setOpen(false);
|
|
153
|
+
}
|
|
154
|
+
return _context2.abrupt("return", _result);
|
|
155
|
+
case 14:
|
|
156
|
+
_context2.prev = 14;
|
|
157
|
+
_context2.t0 = _context2["catch"](4);
|
|
158
|
+
clearTimeout(timer);
|
|
159
|
+
setLoading(false);
|
|
160
|
+
throw _context2.t0;
|
|
161
|
+
case 19:
|
|
162
|
+
_context2.next = 39;
|
|
163
|
+
break;
|
|
164
|
+
case 21:
|
|
165
|
+
if (!submitTimeout) {
|
|
166
|
+
_context2.next = 39;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
// 如果 submitTimeout 存在但 response 不是 Promise,也要设置 loading
|
|
170
|
+
setLoading(true);
|
|
171
|
+
_timer = setTimeout(function () {
|
|
172
|
+
return setLoading(false);
|
|
173
|
+
}, submitTimeout);
|
|
174
|
+
_context2.prev = 24;
|
|
175
|
+
_context2.next = 27;
|
|
176
|
+
return response;
|
|
177
|
+
case 27:
|
|
178
|
+
_result2 = _context2.sent;
|
|
179
|
+
clearTimeout(_timer);
|
|
180
|
+
setLoading(false);
|
|
181
|
+
// 返回真值,关闭弹框
|
|
182
|
+
if (_result2) {
|
|
183
|
+
setOpen(false);
|
|
184
|
+
}
|
|
185
|
+
return _context2.abrupt("return", _result2);
|
|
186
|
+
case 34:
|
|
187
|
+
_context2.prev = 34;
|
|
188
|
+
_context2.t1 = _context2["catch"](24);
|
|
189
|
+
clearTimeout(_timer);
|
|
190
|
+
setLoading(false);
|
|
191
|
+
throw _context2.t1;
|
|
192
|
+
case 39:
|
|
193
|
+
_context2.next = 41;
|
|
194
|
+
return response;
|
|
195
|
+
case 41:
|
|
196
|
+
result = _context2.sent;
|
|
197
|
+
// 返回真值,关闭弹框
|
|
198
|
+
if (result) {
|
|
199
|
+
setOpen(false);
|
|
200
|
+
}
|
|
201
|
+
return _context2.abrupt("return", result);
|
|
202
|
+
case 44:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context2.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee2, null, [[4, 14], [24, 34]]);
|
|
207
|
+
}));
|
|
208
|
+
return function (_x2) {
|
|
209
|
+
return _ref5.apply(this, arguments);
|
|
210
|
+
};
|
|
211
|
+
}(), [onFinish, setOpen, submitTimeout]);
|
|
212
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
213
|
+
children: [/*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
|
|
214
|
+
title: title,
|
|
231
215
|
width: width || 800
|
|
232
|
-
}, modalProps), {
|
|
233
|
-
open,
|
|
234
|
-
onCancel: (e)
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
216
|
+
}, modalProps), {}, {
|
|
217
|
+
open: open,
|
|
218
|
+
onCancel: function onCancel(e) {
|
|
219
|
+
var _modalProps$onCancel2;
|
|
220
|
+
// 提交表单loading时,阻止弹框关闭
|
|
221
|
+
if (submitTimeout && loading) return;
|
|
238
222
|
setOpen(false);
|
|
239
|
-
|
|
223
|
+
modalProps === null || modalProps === void 0 || (_modalProps$onCancel2 = modalProps.onCancel) === null || _modalProps$onCancel2 === void 0 || _modalProps$onCancel2.call(modalProps, e);
|
|
240
224
|
},
|
|
241
|
-
afterClose: ()
|
|
242
|
-
var
|
|
243
|
-
|
|
225
|
+
afterClose: function afterClose() {
|
|
226
|
+
var _modalProps$afterClos;
|
|
227
|
+
// 确保在关闭时立即重置表单
|
|
228
|
+
if (modalProps !== null && modalProps !== void 0 && modalProps.destroyOnHidden) {
|
|
244
229
|
resetFields();
|
|
245
230
|
}
|
|
246
231
|
if (open) {
|
|
247
232
|
setOpen(false);
|
|
248
233
|
}
|
|
249
|
-
|
|
234
|
+
modalProps === null || modalProps === void 0 || (_modalProps$afterClos = modalProps.afterClose) === null || _modalProps$afterClos === void 0 || _modalProps$afterClos.call(modalProps);
|
|
250
235
|
},
|
|
251
|
-
footer: rest.submitter !== false ?
|
|
252
|
-
|
|
253
|
-
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
display: "flex",
|
|
257
|
-
justifyContent: "flex-end"
|
|
258
|
-
}
|
|
236
|
+
footer: rest.submitter !== false ? /*#__PURE__*/_jsx("div", {
|
|
237
|
+
ref: footerDomRef,
|
|
238
|
+
style: {
|
|
239
|
+
display: 'flex',
|
|
240
|
+
justifyContent: 'flex-end'
|
|
259
241
|
}
|
|
260
|
-
) : null
|
|
261
|
-
|
|
262
|
-
/* @__PURE__ */ React.createElement(
|
|
263
|
-
BaseForm,
|
|
264
|
-
__spreadProps(__spreadValues({
|
|
242
|
+
}) : null,
|
|
243
|
+
children: /*#__PURE__*/_jsx(BaseForm, _objectSpread(_objectSpread({
|
|
265
244
|
formComponentType: "ModalForm",
|
|
266
245
|
layout: "vertical"
|
|
267
|
-
}, rest), {
|
|
268
|
-
onInit: (_, form)
|
|
269
|
-
var
|
|
246
|
+
}, rest), {}, {
|
|
247
|
+
onInit: function onInit(_, form) {
|
|
248
|
+
var _rest$onInit;
|
|
270
249
|
if (rest.formRef) {
|
|
271
250
|
rest.formRef.current = form;
|
|
272
251
|
}
|
|
273
|
-
|
|
252
|
+
rest === null || rest === void 0 || (_rest$onInit = rest.onInit) === null || _rest$onInit === void 0 || _rest$onInit.call(rest, _, form);
|
|
274
253
|
formRef.current = form;
|
|
275
254
|
},
|
|
276
|
-
formRef,
|
|
255
|
+
formRef: formRef,
|
|
277
256
|
submitter: submitterConfig,
|
|
278
|
-
onFinish: (
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
257
|
+
onFinish: ( /*#__PURE__*/function () {
|
|
258
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(values) {
|
|
259
|
+
var result;
|
|
260
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
261
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
262
|
+
case 0:
|
|
263
|
+
_context3.next = 2;
|
|
264
|
+
return onFinishHandle(values);
|
|
265
|
+
case 2:
|
|
266
|
+
result = _context3.sent;
|
|
267
|
+
return _context3.abrupt("return", result);
|
|
268
|
+
case 4:
|
|
269
|
+
case "end":
|
|
270
|
+
return _context3.stop();
|
|
271
|
+
}
|
|
272
|
+
}, _callee3);
|
|
273
|
+
}));
|
|
274
|
+
return function (_x3) {
|
|
275
|
+
return _ref6.apply(this, arguments);
|
|
276
|
+
};
|
|
277
|
+
}()),
|
|
278
|
+
contentRender: contentRender,
|
|
279
|
+
children: children
|
|
280
|
+
}))
|
|
281
|
+
})), triggerDom]
|
|
282
|
+
});
|
|
287
283
|
}
|
|
288
|
-
export {
|
|
289
|
-
ModalForm
|
|
290
|
-
};
|
|
284
|
+
export { ModalForm };
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// src/form/layouts/ProForm/index.tsx
|
|
19
|
-
import { Form } from "antd";
|
|
20
|
-
import React from "react";
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { Form } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
21
4
|
import { BaseForm } from "../../BaseForm";
|
|
22
5
|
import { EditOrReadOnlyContext } from "../../BaseForm/EditOrReadOnlyContext";
|
|
23
6
|
import { Group, ProFormItem } from "../../components";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
10
|
function ProForm(props) {
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
11
|
+
return /*#__PURE__*/_jsx(BaseForm, _objectSpread({
|
|
12
|
+
layout: "vertical",
|
|
13
|
+
contentRender: function contentRender(items, submitter) {
|
|
14
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
15
|
+
children: [items, submitter]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}, props));
|
|
34
19
|
}
|
|
35
20
|
ProForm.Group = Group;
|
|
36
21
|
ProForm.useForm = Form.useForm;
|
|
@@ -40,6 +25,4 @@ ProForm.ErrorList = Form.ErrorList;
|
|
|
40
25
|
ProForm.Provider = Form.Provider;
|
|
41
26
|
ProForm.useFormInstance = Form.useFormInstance;
|
|
42
27
|
ProForm.EditOrReadOnlyContext = EditOrReadOnlyContext;
|
|
43
|
-
export {
|
|
44
|
-
ProForm
|
|
45
|
-
};
|
|
28
|
+
export { ProForm };
|