@ant-design/pro-components 3.0.0-beta.1 → 3.0.0-beta.2
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 +213 -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 +364 -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 +2 -2
- 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 +245 -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 +582 -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.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 +259 -350
- package/es/form/components/List/index.d.ts +2 -2
- 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 +309 -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.d.ts +1 -1
- 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 +298 -358
- package/es/form/layouts/QueryFilter/style.js +38 -69
- package/es/form/layouts/StepsForm/StepForm.js +88 -119
- package/es/form/layouts/StepsForm/index.js +340 -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 +428 -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 +406 -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 +222 -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 +369 -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 +2 -2
- 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 +254 -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 +595 -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.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 +268 -374
- package/lib/form/components/List/index.d.ts +2 -2
- 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 +318 -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.d.ts +1 -1
- 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 +95 -146
- package/lib/form/layouts/StepsForm/index.js +352 -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 +449 -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 +425 -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 +2 -1
- 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,63 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
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 __async = (__this, __arguments, generator) => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
var fulfilled = (value) => {
|
|
23
|
-
try {
|
|
24
|
-
step(generator.next(value));
|
|
25
|
-
} catch (e) {
|
|
26
|
-
reject(e);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var rejected = (value) => {
|
|
30
|
-
try {
|
|
31
|
-
step(generator.throw(value));
|
|
32
|
-
} catch (e) {
|
|
33
|
-
reject(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/layout/components/SettingDrawer/index.tsx
|
|
42
|
-
import {
|
|
43
|
-
CloseOutlined,
|
|
44
|
-
CopyOutlined,
|
|
45
|
-
NotificationOutlined,
|
|
46
|
-
SettingOutlined
|
|
47
|
-
} from "@ant-design/icons";
|
|
48
|
-
import { useUrlSearchParams } from "@umijs/use-params";
|
|
49
|
-
import {
|
|
50
|
-
Alert,
|
|
51
|
-
Button,
|
|
52
|
-
Divider,
|
|
53
|
-
Drawer,
|
|
54
|
-
List,
|
|
55
|
-
Switch,
|
|
56
|
-
message
|
|
57
|
-
} from "antd";
|
|
58
|
-
import useMergedState from "rc-util/lib/hooks/useMergedState";
|
|
59
|
-
import omit from "rc-util/lib/omit";
|
|
60
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
|
+
import { CloseOutlined, CopyOutlined, NotificationOutlined, SettingOutlined } from '@ant-design/icons';
|
|
6
|
+
import { useUrlSearchParams } from '@umijs/use-params';
|
|
7
|
+
import { Alert, Button, Divider, Drawer, List, Switch, message } from 'antd';
|
|
8
|
+
import { useMergedState } from 'rc-util';
|
|
9
|
+
import omit from 'rc-util/lib/omit';
|
|
10
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
61
11
|
import { isBrowser, merge } from "../../../utils";
|
|
62
12
|
import { defaultSettings } from "../../defaultSettings";
|
|
63
13
|
import { gLocaleObject, getLanguage } from "../../locales";
|
|
@@ -69,157 +19,220 @@ import { LayoutSetting, renderLayoutSettingItem } from "./LayoutChange";
|
|
|
69
19
|
import { RegionalSetting } from "./RegionalChange";
|
|
70
20
|
import { useStyle } from "./style/index";
|
|
71
21
|
import { ThemeColor } from "./ThemeColor";
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
+
var Body = function Body(_ref) {
|
|
26
|
+
var children = _ref.children,
|
|
27
|
+
hashId = _ref.hashId,
|
|
28
|
+
prefixCls = _ref.prefixCls,
|
|
29
|
+
title = _ref.title;
|
|
30
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
31
|
+
style: {
|
|
32
|
+
marginBlockEnd: 12
|
|
33
|
+
},
|
|
34
|
+
children: [/*#__PURE__*/_jsx("h3", {
|
|
35
|
+
className: "".concat(prefixCls, "-body-title ").concat(hashId).trim(),
|
|
36
|
+
children: title
|
|
37
|
+
}), children]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var getDifferentSetting = function getDifferentSetting(state) {
|
|
41
|
+
var stateObj = {};
|
|
42
|
+
Object.keys(state).forEach(function (key) {
|
|
43
|
+
if (state[key] !== defaultSettings[key] &&
|
|
44
|
+
//@ts-ignore
|
|
45
|
+
key !== 'collapse') {
|
|
78
46
|
stateObj[key] = state[key];
|
|
79
47
|
} else {
|
|
80
|
-
stateObj[key] =
|
|
48
|
+
stateObj[key] = undefined;
|
|
81
49
|
}
|
|
82
|
-
if (key.includes(
|
|
83
|
-
stateObj[key] = state[key] === false ? false : void 0;
|
|
50
|
+
if (key.includes('Render')) stateObj[key] = state[key] === false ? false : undefined;
|
|
84
51
|
});
|
|
85
|
-
stateObj.menu =
|
|
52
|
+
stateObj.menu = undefined;
|
|
86
53
|
return stateObj;
|
|
87
54
|
};
|
|
88
|
-
var getFormatMessage = ()
|
|
89
|
-
|
|
90
|
-
id
|
|
91
|
-
|
|
92
|
-
const locales = gLocaleObject();
|
|
55
|
+
export var getFormatMessage = function getFormatMessage() {
|
|
56
|
+
var formatMessage = function formatMessage(_ref2) {
|
|
57
|
+
var id = _ref2.id;
|
|
58
|
+
var locales = gLocaleObject();
|
|
93
59
|
return locales[id];
|
|
94
60
|
};
|
|
95
61
|
return formatMessage;
|
|
96
62
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 初始化的时候需要做的工作
|
|
66
|
+
*
|
|
67
|
+
* @param param0
|
|
68
|
+
*/
|
|
69
|
+
var initState = function initState(urlParams, settings, onSettingChange) {
|
|
70
|
+
if (!isBrowser()) return;
|
|
71
|
+
var replaceSetting = {};
|
|
72
|
+
Object.keys(urlParams).forEach(function (key) {
|
|
73
|
+
if (defaultSettings[key] || defaultSettings[key] === undefined) {
|
|
74
|
+
if (key === 'colorPrimary') {
|
|
104
75
|
replaceSetting[key] = genStringToTheme(urlParams[key]);
|
|
105
76
|
return;
|
|
106
77
|
}
|
|
107
78
|
replaceSetting[key] = urlParams[key];
|
|
108
79
|
}
|
|
109
80
|
});
|
|
110
|
-
|
|
111
|
-
{},
|
|
112
|
-
settings,
|
|
113
|
-
replaceSetting
|
|
114
|
-
);
|
|
81
|
+
var newSettings = merge({}, settings, replaceSetting);
|
|
115
82
|
delete newSettings.menu;
|
|
116
83
|
delete newSettings.title;
|
|
117
84
|
delete newSettings.iconfontUrl;
|
|
118
|
-
|
|
85
|
+
|
|
86
|
+
// 同步数据到外部
|
|
87
|
+
onSettingChange === null || onSettingChange === void 0 || onSettingChange(newSettings);
|
|
88
|
+
};
|
|
89
|
+
var getParamsFromUrl = function getParamsFromUrl(urlParams, settings) {
|
|
90
|
+
if (!isBrowser()) return defaultSettings;
|
|
91
|
+
return _objectSpread(_objectSpread(_objectSpread({}, defaultSettings), settings || {}), urlParams);
|
|
119
92
|
};
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
93
|
+
var genCopySettingJson = function genCopySettingJson(settingState) {
|
|
94
|
+
return JSON.stringify(omit(_objectSpread(_objectSpread({}, settingState), {}, {
|
|
95
|
+
colorPrimary: settingState.colorPrimary
|
|
96
|
+
}), ['colorWeak']), null, 2);
|
|
124
97
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 可视化配置组件
|
|
101
|
+
*
|
|
102
|
+
* @param props
|
|
103
|
+
*/
|
|
104
|
+
export var SettingDrawer = function SettingDrawer(props) {
|
|
105
|
+
var _props$defaultSetting = props.defaultSettings,
|
|
106
|
+
propsDefaultSettings = _props$defaultSetting === void 0 ? undefined : _props$defaultSetting,
|
|
107
|
+
_props$settings = props.settings,
|
|
108
|
+
propsSettings = _props$settings === void 0 ? undefined : _props$settings,
|
|
109
|
+
hideHintAlert = props.hideHintAlert,
|
|
110
|
+
hideCopyButton = props.hideCopyButton,
|
|
111
|
+
_props$colorList = props.colorList,
|
|
112
|
+
colorList = _props$colorList === void 0 ? [{
|
|
113
|
+
key: 'techBlue',
|
|
114
|
+
color: '#1677FF'
|
|
115
|
+
}, {
|
|
116
|
+
key: 'daybreak',
|
|
117
|
+
color: '#1890ff'
|
|
118
|
+
}, {
|
|
119
|
+
key: 'dust',
|
|
120
|
+
color: '#F5222D'
|
|
121
|
+
}, {
|
|
122
|
+
key: 'volcano',
|
|
123
|
+
color: '#FA541C'
|
|
124
|
+
}, {
|
|
125
|
+
key: 'sunset',
|
|
126
|
+
color: '#FAAD14'
|
|
127
|
+
}, {
|
|
128
|
+
key: 'cyan',
|
|
129
|
+
color: '#13C2C2'
|
|
130
|
+
}, {
|
|
131
|
+
key: 'green',
|
|
132
|
+
color: '#52C41A'
|
|
133
|
+
}, {
|
|
134
|
+
key: 'geekblue',
|
|
135
|
+
color: '#2F54EB'
|
|
136
|
+
}, {
|
|
137
|
+
key: 'purple',
|
|
138
|
+
color: '#722ED1'
|
|
139
|
+
}] : _props$colorList,
|
|
140
|
+
getContainer = props.getContainer,
|
|
141
|
+
onSettingChange = props.onSettingChange,
|
|
142
|
+
enableDarkTheme = props.enableDarkTheme,
|
|
143
|
+
_props$prefixCls = props.prefixCls,
|
|
144
|
+
prefixCls = _props$prefixCls === void 0 ? 'ant-pro' : _props$prefixCls,
|
|
145
|
+
_props$pathname = props.pathname,
|
|
146
|
+
pathname = _props$pathname === void 0 ? isBrowser() ? window.location.pathname : '' : _props$pathname,
|
|
147
|
+
_props$disableUrlPara = props.disableUrlParams,
|
|
148
|
+
disableUrlParams = _props$disableUrlPara === void 0 ? true : _props$disableUrlPara,
|
|
149
|
+
themeOnly = props.themeOnly,
|
|
150
|
+
drawerProps = props.drawerProps;
|
|
151
|
+
var firstRender = useRef(true);
|
|
152
|
+
var _useMergedState = useMergedState(false, {
|
|
153
|
+
value: props.collapse,
|
|
154
|
+
onChange: props.onCollapseChange
|
|
129
155
|
}),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
settings: propsSettings = void 0,
|
|
139
|
-
hideHintAlert,
|
|
140
|
-
hideCopyButton,
|
|
141
|
-
colorList = [
|
|
142
|
-
{ key: "techBlue", color: "#1677FF" },
|
|
143
|
-
{ key: "daybreak", color: "#1890ff" },
|
|
144
|
-
{ key: "dust", color: "#F5222D" },
|
|
145
|
-
{ key: "volcano", color: "#FA541C" },
|
|
146
|
-
{ key: "sunset", color: "#FAAD14" },
|
|
147
|
-
{ key: "cyan", color: "#13C2C2" },
|
|
148
|
-
{ key: "green", color: "#52C41A" },
|
|
149
|
-
{ key: "geekblue", color: "#2F54EB" },
|
|
150
|
-
{ key: "purple", color: "#722ED1" }
|
|
151
|
-
],
|
|
152
|
-
getContainer,
|
|
153
|
-
onSettingChange,
|
|
154
|
-
enableDarkTheme,
|
|
155
|
-
prefixCls = "ant-pro",
|
|
156
|
-
pathname = isBrowser() ? window.location.pathname : "",
|
|
157
|
-
disableUrlParams = true,
|
|
158
|
-
themeOnly,
|
|
159
|
-
drawerProps
|
|
160
|
-
} = props;
|
|
161
|
-
const firstRender = useRef(true);
|
|
162
|
-
const [open, setOpen] = useMergedState(false, {
|
|
163
|
-
value: props.collapse,
|
|
164
|
-
onChange: props.onCollapseChange
|
|
165
|
-
});
|
|
166
|
-
const [language, setLanguage] = useState(getLanguage());
|
|
167
|
-
const [urlParams, setUrlParams] = useUrlSearchParams(
|
|
168
|
-
{},
|
|
169
|
-
{
|
|
156
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
157
|
+
open = _useMergedState2[0],
|
|
158
|
+
setOpen = _useMergedState2[1];
|
|
159
|
+
var _useState = useState(getLanguage()),
|
|
160
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
161
|
+
language = _useState2[0],
|
|
162
|
+
setLanguage = _useState2[1];
|
|
163
|
+
var _useUrlSearchParams = useUrlSearchParams({}, {
|
|
170
164
|
disabled: disableUrlParams
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
}),
|
|
166
|
+
_useUrlSearchParams2 = _slicedToArray(_useUrlSearchParams, 2),
|
|
167
|
+
urlParams = _useUrlSearchParams2[0],
|
|
168
|
+
setUrlParams = _useUrlSearchParams2[1];
|
|
169
|
+
var _useMergedState3 = useMergedState(function () {
|
|
170
|
+
return getParamsFromUrl(urlParams, propsSettings || propsDefaultSettings);
|
|
171
|
+
}, {
|
|
176
172
|
value: propsSettings,
|
|
177
173
|
onChange: onSettingChange
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
174
|
+
}),
|
|
175
|
+
_useMergedState4 = _slicedToArray(_useMergedState3, 2),
|
|
176
|
+
settingState = _useMergedState4[0],
|
|
177
|
+
setSettingState = _useMergedState4[1];
|
|
178
|
+
var _ref3 = settingState || {},
|
|
179
|
+
navTheme = _ref3.navTheme,
|
|
180
|
+
colorPrimary = _ref3.colorPrimary,
|
|
181
|
+
siderMenuType = _ref3.siderMenuType,
|
|
182
|
+
layout = _ref3.layout,
|
|
183
|
+
colorWeak = _ref3.colorWeak;
|
|
184
|
+
useEffect(function () {
|
|
185
|
+
// 语言修改,这个是和 locale 是配置起来的
|
|
186
|
+
var onLanguageChange = function onLanguageChange() {
|
|
183
187
|
if (language !== getLanguage()) {
|
|
184
188
|
setLanguage(getLanguage());
|
|
185
189
|
}
|
|
186
190
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
window.document.addEventListener("languagechange", onLanguageChange, {
|
|
191
|
+
|
|
192
|
+
/** 如果不是浏览器 都没有必要做了 */
|
|
193
|
+
if (!isBrowser()) return function () {
|
|
194
|
+
return null;
|
|
195
|
+
};
|
|
196
|
+
initState(getParamsFromUrl(urlParams, propsSettings), settingState, setSettingState);
|
|
197
|
+
window.document.addEventListener('languagechange', onLanguageChange, {
|
|
195
198
|
passive: true
|
|
196
199
|
});
|
|
197
|
-
return ()
|
|
200
|
+
return function () {
|
|
201
|
+
return window.document.removeEventListener('languagechange', onLanguageChange);
|
|
202
|
+
};
|
|
203
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
198
204
|
}, []);
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 修改设置
|
|
208
|
+
*
|
|
209
|
+
* @param key
|
|
210
|
+
* @param value
|
|
211
|
+
*/
|
|
212
|
+
var changeSetting = function changeSetting(key, value) {
|
|
213
|
+
var nextState = {};
|
|
201
214
|
nextState[key] = value;
|
|
202
|
-
if (key ===
|
|
203
|
-
nextState.contentWidth = value ===
|
|
215
|
+
if (key === 'layout') {
|
|
216
|
+
nextState.contentWidth = value === 'top' ? 'Fixed' : 'Fluid';
|
|
204
217
|
}
|
|
205
|
-
if (key ===
|
|
218
|
+
if (key === 'layout' && value !== 'mix') {
|
|
206
219
|
nextState.splitMenus = false;
|
|
207
220
|
}
|
|
208
|
-
if (key ===
|
|
209
|
-
nextState.navTheme =
|
|
221
|
+
if (key === 'layout' && value === 'mix') {
|
|
222
|
+
nextState.navTheme = 'light';
|
|
210
223
|
}
|
|
211
|
-
if (key ===
|
|
212
|
-
|
|
224
|
+
if (key === 'colorWeak' && value === true) {
|
|
225
|
+
var dom = document.querySelector('body');
|
|
213
226
|
if (dom) {
|
|
214
227
|
dom.dataset.prosettingdrawer = dom.style.filter;
|
|
215
|
-
dom.style.filter =
|
|
228
|
+
dom.style.filter = 'invert(80%)';
|
|
216
229
|
}
|
|
217
230
|
}
|
|
218
|
-
if (key ===
|
|
219
|
-
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
delete
|
|
231
|
+
if (key === 'colorWeak' && value === false) {
|
|
232
|
+
var _dom = document.querySelector('body');
|
|
233
|
+
if (_dom) {
|
|
234
|
+
_dom.style.filter = _dom.dataset.prosettingdrawer || 'none';
|
|
235
|
+
delete _dom.dataset.prosettingdrawer;
|
|
223
236
|
}
|
|
224
237
|
}
|
|
225
238
|
delete nextState.menu;
|
|
@@ -227,21 +240,22 @@ var SettingDrawer = (props) => {
|
|
|
227
240
|
delete nextState.iconfontUrl;
|
|
228
241
|
delete nextState.logo;
|
|
229
242
|
delete nextState.pwa;
|
|
230
|
-
setSettingState(
|
|
243
|
+
setSettingState(_objectSpread(_objectSpread({}, settingState), nextState));
|
|
231
244
|
};
|
|
232
|
-
|
|
233
|
-
useEffect(()
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (disableUrlParams)
|
|
237
|
-
return;
|
|
245
|
+
var formatMessage = getFormatMessage();
|
|
246
|
+
useEffect(function () {
|
|
247
|
+
/** 如果不是浏览器 都没有必要做了 */
|
|
248
|
+
if (!isBrowser()) return;
|
|
249
|
+
if (disableUrlParams) return;
|
|
238
250
|
if (firstRender.current) {
|
|
239
251
|
firstRender.current = false;
|
|
240
252
|
return;
|
|
241
253
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
254
|
+
|
|
255
|
+
/** 每次从url拿最新的防止记忆 */
|
|
256
|
+
var urlSearchParams = new URLSearchParams(window.location.search);
|
|
257
|
+
var params = Object.fromEntries(urlSearchParams.entries());
|
|
258
|
+
var diffParams = getDifferentSetting(_objectSpread(_objectSpread({}, params), settingState));
|
|
245
259
|
delete diffParams.logo;
|
|
246
260
|
delete diffParams.menu;
|
|
247
261
|
delete diffParams.title;
|
|
@@ -249,270 +263,242 @@ var SettingDrawer = (props) => {
|
|
|
249
263
|
delete diffParams.pwa;
|
|
250
264
|
setUrlParams(diffParams);
|
|
251
265
|
}, [setUrlParams, settingState, urlParams, pathname, disableUrlParams]);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
width: 48,
|
|
262
|
-
height: 48
|
|
263
|
-
}
|
|
266
|
+
var baseClassName = "".concat(prefixCls, "-setting-drawer");
|
|
267
|
+
var _useStyle = useStyle(baseClassName),
|
|
268
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
269
|
+
hashId = _useStyle.hashId;
|
|
270
|
+
return wrapSSR( /*#__PURE__*/_jsxs(_Fragment, {
|
|
271
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
272
|
+
className: "".concat(baseClassName, "-handle ").concat(hashId).trim(),
|
|
273
|
+
onClick: function onClick() {
|
|
274
|
+
return setOpen(!open);
|
|
264
275
|
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
) : /* @__PURE__ */ React.createElement(
|
|
274
|
-
SettingOutlined,
|
|
275
|
-
{
|
|
276
|
-
style: {
|
|
277
|
-
color: "#fff",
|
|
278
|
-
fontSize: 20
|
|
279
|
-
}
|
|
276
|
+
style: {
|
|
277
|
+
width: 48,
|
|
278
|
+
height: 48
|
|
279
|
+
},
|
|
280
|
+
children: open ? /*#__PURE__*/_jsx(CloseOutlined, {
|
|
281
|
+
style: {
|
|
282
|
+
color: '#fff',
|
|
283
|
+
fontSize: 20
|
|
280
284
|
}
|
|
281
|
-
)
|
|
282
|
-
), /* @__PURE__ */ React.createElement(
|
|
283
|
-
Drawer,
|
|
284
|
-
__spreadValues({
|
|
285
|
-
open,
|
|
286
|
-
width: 300,
|
|
287
|
-
onClose: () => setOpen(false),
|
|
288
|
-
closable: false,
|
|
289
|
-
placement: "right",
|
|
290
|
-
getContainer,
|
|
285
|
+
}) : /*#__PURE__*/_jsx(SettingOutlined, {
|
|
291
286
|
style: {
|
|
292
|
-
|
|
287
|
+
color: '#fff',
|
|
288
|
+
fontSize: 20
|
|
293
289
|
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
290
|
+
})
|
|
291
|
+
}), /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
|
292
|
+
open: open,
|
|
293
|
+
width: 300,
|
|
294
|
+
onClose: function onClose() {
|
|
295
|
+
return setOpen(false);
|
|
296
|
+
},
|
|
297
|
+
closable: false,
|
|
298
|
+
placement: "right",
|
|
299
|
+
getContainer: getContainer,
|
|
300
|
+
style: {
|
|
301
|
+
zIndex: 999
|
|
302
|
+
}
|
|
303
|
+
}, drawerProps), {}, {
|
|
304
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
305
|
+
className: "".concat(baseClassName, "-drawer-content ").concat(hashId).trim(),
|
|
306
|
+
children: [/*#__PURE__*/_jsx(Body, {
|
|
298
307
|
title: formatMessage({
|
|
299
|
-
id:
|
|
300
|
-
defaultMessage:
|
|
308
|
+
id: 'app.setting.pagestyle',
|
|
309
|
+
defaultMessage: 'Page style setting'
|
|
301
310
|
}),
|
|
302
|
-
hashId,
|
|
303
|
-
prefixCls: baseClassName
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
BlockCheckbox,
|
|
307
|
-
{
|
|
308
|
-
hashId,
|
|
311
|
+
hashId: hashId,
|
|
312
|
+
prefixCls: baseClassName,
|
|
313
|
+
children: /*#__PURE__*/_jsx(BlockCheckbox, {
|
|
314
|
+
hashId: hashId,
|
|
309
315
|
prefixCls: baseClassName,
|
|
310
|
-
list: [
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
{
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
].filter((item) => {
|
|
326
|
-
if (item.key === "dark" && settingState.layout === "mix")
|
|
327
|
-
return false;
|
|
328
|
-
if (item.key === "realDark" && !enableDarkTheme)
|
|
329
|
-
return false;
|
|
316
|
+
list: [{
|
|
317
|
+
key: 'light',
|
|
318
|
+
title: formatMessage({
|
|
319
|
+
id: 'app.setting.pagestyle.light',
|
|
320
|
+
defaultMessage: '亮色菜单风格'
|
|
321
|
+
})
|
|
322
|
+
}, {
|
|
323
|
+
key: 'realDark',
|
|
324
|
+
title: formatMessage({
|
|
325
|
+
id: 'app.setting.pagestyle.realdark',
|
|
326
|
+
defaultMessage: '暗色菜单风格'
|
|
327
|
+
})
|
|
328
|
+
}].filter(function (item) {
|
|
329
|
+
if (item.key === 'dark' && settingState.layout === 'mix') return false;
|
|
330
|
+
if (item.key === 'realDark' && !enableDarkTheme) return false;
|
|
330
331
|
return true;
|
|
331
332
|
}),
|
|
332
333
|
value: navTheme,
|
|
333
334
|
configType: "theme",
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
{
|
|
341
|
-
hashId,
|
|
335
|
+
onChange: function onChange(value) {
|
|
336
|
+
return changeSetting('navTheme', value);
|
|
337
|
+
}
|
|
338
|
+
}, "navTheme")
|
|
339
|
+
}), colorList !== false && /*#__PURE__*/_jsx(Body, {
|
|
340
|
+
hashId: hashId,
|
|
342
341
|
title: formatMessage({
|
|
343
|
-
id:
|
|
344
|
-
defaultMessage:
|
|
342
|
+
id: 'app.setting.themecolor',
|
|
343
|
+
defaultMessage: 'Theme color'
|
|
345
344
|
}),
|
|
346
|
-
prefixCls: baseClassName
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
ThemeColor,
|
|
350
|
-
{
|
|
351
|
-
hashId,
|
|
345
|
+
prefixCls: baseClassName,
|
|
346
|
+
children: /*#__PURE__*/_jsx(ThemeColor, {
|
|
347
|
+
hashId: hashId,
|
|
352
348
|
prefixCls: baseClassName,
|
|
353
|
-
colorList,
|
|
349
|
+
colorList: colorList,
|
|
354
350
|
value: genStringToTheme(colorPrimary),
|
|
355
|
-
formatMessage,
|
|
356
|
-
onChange: (color)
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
prefixCls: baseClassName,
|
|
364
|
-
title: formatMessage({ id: "app.setting.navigationmode" })
|
|
365
|
-
},
|
|
366
|
-
/* @__PURE__ */ React.createElement(
|
|
367
|
-
BlockCheckbox,
|
|
368
|
-
{
|
|
351
|
+
formatMessage: formatMessage,
|
|
352
|
+
onChange: function onChange(color) {
|
|
353
|
+
return changeSetting('colorPrimary', color);
|
|
354
|
+
}
|
|
355
|
+
})
|
|
356
|
+
}), !themeOnly && /*#__PURE__*/_jsxs(_Fragment, {
|
|
357
|
+
children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(Body, {
|
|
358
|
+
hashId: hashId,
|
|
369
359
|
prefixCls: baseClassName,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
{
|
|
384
|
-
key:
|
|
385
|
-
title: formatMessage({
|
|
360
|
+
title: formatMessage({
|
|
361
|
+
id: 'app.setting.navigationmode'
|
|
362
|
+
}),
|
|
363
|
+
children: /*#__PURE__*/_jsx(BlockCheckbox, {
|
|
364
|
+
prefixCls: baseClassName,
|
|
365
|
+
value: layout,
|
|
366
|
+
hashId: hashId,
|
|
367
|
+
configType: "layout",
|
|
368
|
+
list: [{
|
|
369
|
+
key: 'side',
|
|
370
|
+
title: formatMessage({
|
|
371
|
+
id: 'app.setting.sidemenu'
|
|
372
|
+
})
|
|
373
|
+
}, {
|
|
374
|
+
key: 'top',
|
|
375
|
+
title: formatMessage({
|
|
376
|
+
id: 'app.setting.topmenu'
|
|
377
|
+
})
|
|
378
|
+
}, {
|
|
379
|
+
key: 'mix',
|
|
380
|
+
title: formatMessage({
|
|
381
|
+
id: 'app.setting.mixmenu'
|
|
382
|
+
})
|
|
383
|
+
}],
|
|
384
|
+
onChange: function onChange(value) {
|
|
385
|
+
return changeSetting('layout', value);
|
|
386
386
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
)
|
|
391
|
-
), settingState.layout == "side" || settingState.layout == "mix" ? /* @__PURE__ */ React.createElement(
|
|
392
|
-
Body,
|
|
393
|
-
{
|
|
394
|
-
hashId,
|
|
395
|
-
prefixCls: baseClassName,
|
|
396
|
-
title: formatMessage({ id: "app.setting.sidermenutype" })
|
|
397
|
-
},
|
|
398
|
-
/* @__PURE__ */ React.createElement(
|
|
399
|
-
BlockCheckbox,
|
|
400
|
-
{
|
|
387
|
+
}, "layout")
|
|
388
|
+
}), settingState.layout == 'side' || settingState.layout == 'mix' ? /*#__PURE__*/_jsx(Body, {
|
|
389
|
+
hashId: hashId,
|
|
401
390
|
prefixCls: baseClassName,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
391
|
+
title: formatMessage({
|
|
392
|
+
id: 'app.setting.sidermenutype'
|
|
393
|
+
}),
|
|
394
|
+
children: /*#__PURE__*/_jsx(BlockCheckbox, {
|
|
395
|
+
prefixCls: baseClassName,
|
|
396
|
+
value: siderMenuType,
|
|
397
|
+
hashId: hashId,
|
|
398
|
+
configType: "siderMenuType",
|
|
399
|
+
list: [{
|
|
400
|
+
key: 'sub',
|
|
401
|
+
icon: /*#__PURE__*/_jsx(SubIcon, {}),
|
|
410
402
|
title: formatMessage({
|
|
411
|
-
id:
|
|
403
|
+
id: 'app.setting.sidermenutype-sub'
|
|
412
404
|
})
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
icon: /* @__PURE__ */ React.createElement(GroupIcon, null),
|
|
405
|
+
}, {
|
|
406
|
+
key: 'group',
|
|
407
|
+
icon: /*#__PURE__*/_jsx(GroupIcon, {}),
|
|
417
408
|
title: formatMessage({
|
|
418
|
-
id:
|
|
409
|
+
id: 'app.setting.sidermenutype-group'
|
|
419
410
|
})
|
|
411
|
+
}],
|
|
412
|
+
onChange: function onChange(value) {
|
|
413
|
+
return changeSetting('siderMenuType', value);
|
|
420
414
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
)
|
|
425
|
-
) : null, /* @__PURE__ */ React.createElement(
|
|
426
|
-
LayoutSetting,
|
|
427
|
-
{
|
|
428
|
-
prefixCls: baseClassName,
|
|
429
|
-
hashId,
|
|
430
|
-
settings: settingState,
|
|
431
|
-
changeSetting
|
|
432
|
-
}
|
|
433
|
-
), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
434
|
-
Body,
|
|
435
|
-
{
|
|
436
|
-
hashId,
|
|
437
|
-
prefixCls: baseClassName,
|
|
438
|
-
title: formatMessage({ id: "app.setting.regionalsettings" })
|
|
439
|
-
},
|
|
440
|
-
/* @__PURE__ */ React.createElement(
|
|
441
|
-
RegionalSetting,
|
|
442
|
-
{
|
|
443
|
-
hashId,
|
|
415
|
+
}, "siderMenuType")
|
|
416
|
+
}) : null, /*#__PURE__*/_jsx(LayoutSetting, {
|
|
444
417
|
prefixCls: baseClassName,
|
|
418
|
+
hashId: hashId,
|
|
445
419
|
settings: settingState,
|
|
446
|
-
changeSetting
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
420
|
+
changeSetting: changeSetting
|
|
421
|
+
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(Body, {
|
|
422
|
+
hashId: hashId,
|
|
423
|
+
prefixCls: baseClassName,
|
|
424
|
+
title: formatMessage({
|
|
425
|
+
id: 'app.setting.regionalsettings'
|
|
426
|
+
}),
|
|
427
|
+
children: /*#__PURE__*/_jsx(RegionalSetting, {
|
|
428
|
+
hashId: hashId,
|
|
429
|
+
prefixCls: baseClassName,
|
|
430
|
+
settings: settingState,
|
|
431
|
+
changeSetting: changeSetting
|
|
432
|
+
})
|
|
433
|
+
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(Body, {
|
|
434
|
+
hashId: hashId,
|
|
435
|
+
prefixCls: baseClassName,
|
|
436
|
+
title: formatMessage({
|
|
437
|
+
id: 'app.setting.othersettings'
|
|
438
|
+
}),
|
|
439
|
+
children: /*#__PURE__*/_jsx(List, {
|
|
440
|
+
className: "".concat(baseClassName, "-list ").concat(hashId).trim(),
|
|
441
|
+
split: false,
|
|
442
|
+
size: "small",
|
|
443
|
+
renderItem: renderLayoutSettingItem,
|
|
444
|
+
dataSource: [{
|
|
445
|
+
title: formatMessage({
|
|
446
|
+
id: 'app.setting.weakmode'
|
|
447
|
+
}),
|
|
448
|
+
action: /*#__PURE__*/_jsx(Switch, {
|
|
449
|
+
size: "small",
|
|
450
|
+
className: "color-weak",
|
|
451
|
+
checked: !!colorWeak,
|
|
452
|
+
onChange: function onChange(checked) {
|
|
453
|
+
changeSetting('colorWeak', checked);
|
|
475
454
|
}
|
|
476
|
-
)
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
icon: /* @__PURE__ */ React.createElement(NotificationOutlined, null),
|
|
489
|
-
showIcon: true,
|
|
490
|
-
style: { marginBlockEnd: 16 }
|
|
491
|
-
}
|
|
492
|
-
), hideCopyButton ? null : /* @__PURE__ */ React.createElement(
|
|
493
|
-
Button,
|
|
494
|
-
{
|
|
495
|
-
block: true,
|
|
496
|
-
icon: /* @__PURE__ */ React.createElement(CopyOutlined, null),
|
|
497
|
-
style: { marginBlockEnd: 24 },
|
|
498
|
-
onClick: () => __async(void 0, null, function* () {
|
|
499
|
-
try {
|
|
500
|
-
yield navigator.clipboard.writeText(
|
|
501
|
-
genCopySettingJson(settingState)
|
|
502
|
-
);
|
|
503
|
-
message.success(
|
|
504
|
-
formatMessage({ id: "app.setting.copyinfo" })
|
|
505
|
-
);
|
|
506
|
-
} catch (error) {
|
|
455
|
+
})
|
|
456
|
+
}]
|
|
457
|
+
})
|
|
458
|
+
}), hideHintAlert && hideCopyButton ? null : /*#__PURE__*/_jsx(Divider, {}), hideHintAlert ? null : /*#__PURE__*/_jsx(Alert, {
|
|
459
|
+
type: "warning",
|
|
460
|
+
message: formatMessage({
|
|
461
|
+
id: 'app.setting.production.hint'
|
|
462
|
+
}),
|
|
463
|
+
icon: /*#__PURE__*/_jsx(NotificationOutlined, {}),
|
|
464
|
+
showIcon: true,
|
|
465
|
+
style: {
|
|
466
|
+
marginBlockEnd: 16
|
|
507
467
|
}
|
|
508
|
-
})
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
468
|
+
}), hideCopyButton ? null : /*#__PURE__*/_jsx(Button, {
|
|
469
|
+
block: true,
|
|
470
|
+
icon: /*#__PURE__*/_jsx(CopyOutlined, {}),
|
|
471
|
+
style: {
|
|
472
|
+
marginBlockEnd: 24
|
|
473
|
+
},
|
|
474
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
475
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
476
|
+
while (1) switch (_context.prev = _context.next) {
|
|
477
|
+
case 0:
|
|
478
|
+
_context.prev = 0;
|
|
479
|
+
_context.next = 3;
|
|
480
|
+
return navigator.clipboard.writeText(genCopySettingJson(settingState));
|
|
481
|
+
case 3:
|
|
482
|
+
message.success(formatMessage({
|
|
483
|
+
id: 'app.setting.copyinfo'
|
|
484
|
+
}));
|
|
485
|
+
_context.next = 8;
|
|
486
|
+
break;
|
|
487
|
+
case 6:
|
|
488
|
+
_context.prev = 6;
|
|
489
|
+
_context.t0 = _context["catch"](0);
|
|
490
|
+
case 8:
|
|
491
|
+
case "end":
|
|
492
|
+
return _context.stop();
|
|
493
|
+
}
|
|
494
|
+
}, _callee, null, [[0, 6]]);
|
|
495
|
+
})),
|
|
496
|
+
children: formatMessage({
|
|
497
|
+
id: 'app.setting.copy'
|
|
498
|
+
})
|
|
499
|
+
})]
|
|
500
|
+
})]
|
|
501
|
+
})
|
|
502
|
+
}))]
|
|
503
|
+
}));
|
|
504
|
+
};
|