@ant-design/pro-components 3.1.0-0 → 3.1.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.es-PR.md +1 -3
- package/README.md +8 -10
- package/README.zh-CN.md +11 -11
- package/dist/pro-components.min.js +1 -1
- package/es/card/ProCard.js +8 -10
- package/es/card/components/Actions/index.js +25 -25
- package/es/card/components/Actions/style.js +79 -71
- package/es/card/components/Card/index.js +157 -142
- package/es/card/components/Card/style.js +249 -192
- package/es/card/components/CheckCard/Group.js +94 -115
- package/es/card/components/CheckCard/index.js +85 -79
- package/es/card/components/CheckCard/style.js +184 -168
- package/es/card/components/Divider/index.js +19 -15
- package/es/card/components/Divider/style.js +32 -29
- package/es/card/components/Loading/index.js +19 -16
- package/es/card/components/Loading/style.js +34 -31
- package/es/card/components/Operation/index.js +16 -13
- package/es/card/components/Operation/style.js +19 -18
- package/es/card/components/Statistic/index.js +46 -41
- package/es/card/components/Statistic/style.js +89 -70
- package/es/card/components/StatisticCard/index.js +46 -41
- package/es/card/components/StatisticCard/style.js +37 -35
- package/es/descriptions/index.js +214 -225
- package/es/descriptions/useFetchData.js +53 -91
- package/es/field/AllProField.js +265 -216
- package/es/field/FieldHOC/index.js +9 -14
- package/es/field/PureProField.js +82 -80
- package/es/field/ValueTypeToComponent.js +517 -618
- package/es/field/components/Cascader/index.d.ts +3 -3
- package/es/field/components/Cascader/index.js +66 -84
- package/es/field/components/Checkbox/index.d.ts +2 -2
- package/es/field/components/Checkbox/index.js +75 -72
- package/es/field/components/Code/index.js +40 -39
- package/es/field/components/ColorPicker/index.d.ts +2 -2
- package/es/field/components/ColorPicker/index.js +38 -32
- package/es/field/components/DatePicker/index.d.ts +2 -2
- package/es/field/components/DatePicker/index.js +49 -53
- package/es/field/components/Digit/index.js +41 -42
- package/es/field/components/DigitRange/index.js +71 -77
- package/es/field/components/FromNow/index.js +27 -25
- package/es/field/components/Image/index.js +28 -24
- package/es/field/components/IndexColumn/index.js +22 -16
- package/es/field/components/Money/index.js +107 -116
- package/es/field/components/Options/index.js +34 -33
- package/es/field/components/Password/index.js +35 -38
- package/es/field/components/Percent/index.js +40 -44
- package/es/field/components/Percent/util.js +3 -5
- package/es/field/components/Progress/index.js +29 -27
- package/es/field/components/Radio/index.d.ts +1 -1
- package/es/field/components/Radio/index.js +61 -62
- package/es/field/components/RangePicker/index.d.ts +2 -2
- package/es/field/components/RangePicker/index.js +52 -63
- package/es/field/components/Rate/index.js +24 -21
- package/es/field/components/Second/index.js +36 -33
- package/es/field/components/Segmented/index.d.ts +1 -1
- package/es/field/components/Segmented/index.js +37 -46
- package/es/field/components/Select/LightSelect/index.d.ts +1 -1
- package/es/field/components/Select/LightSelect/index.js +102 -109
- package/es/field/components/Select/SearchSelect/index.js +129 -155
- package/es/field/components/Select/index.d.ts +2 -2
- package/es/field/components/Select/index.js +193 -219
- package/es/field/components/Slider/index.js +25 -22
- package/es/field/components/Status/index.js +67 -78
- package/es/field/components/Switch/index.d.ts +1 -1
- package/es/field/components/Switch/index.js +32 -30
- package/es/field/components/Text/index.js +34 -37
- package/es/field/components/TextArea/index.js +26 -21
- package/es/field/components/TextArea/readonly.js +24 -21
- package/es/field/components/TimePicker/index.js +96 -105
- package/es/field/components/TreeSelect/index.d.ts +3 -3
- package/es/field/components/TreeSelect/index.js +107 -125
- package/es/form/BaseForm/BaseForm.js +416 -502
- package/es/form/BaseForm/EditOrReadOnlyContext.js +1 -1
- package/es/form/BaseForm/LightWrapper/index.js +56 -65
- package/es/form/BaseForm/LightWrapper/style.js +17 -13
- package/es/form/BaseForm/Submitter/index.js +44 -43
- package/es/form/FieldContext.js +1 -1
- package/es/form/components/Captcha/index.js +74 -134
- package/es/form/components/Cascader/index.d.ts +1 -1
- package/es/form/components/Cascader/index.js +26 -28
- package/es/form/components/Checkbox/index.js +60 -61
- package/es/form/components/ColorPicker/index.d.ts +1 -1
- package/es/form/components/ColorPicker/index.js +24 -26
- package/es/form/components/DatePicker/BaseDatePicker.js +32 -30
- package/es/form/components/DatePicker/DatePicker.js +14 -13
- package/es/form/components/DatePicker/DateTimePicker.js +11 -12
- package/es/form/components/DatePicker/MonthPicker.js +14 -13
- package/es/form/components/DatePicker/QuarterPicker.js +14 -13
- package/es/form/components/DatePicker/TimePicker.js +26 -27
- package/es/form/components/DatePicker/WeekPicker.js +14 -13
- package/es/form/components/DatePicker/YearPicker.js +14 -13
- package/es/form/components/DatePicker/index.js +1 -1
- package/es/form/components/DateRangePicker/BaseDateRanger.js +34 -34
- package/es/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
- package/es/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
- package/es/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
- package/es/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
- package/es/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
- package/es/form/components/DateRangePicker/TimeRangePicker.js +26 -29
- package/es/form/components/DateRangePicker/index.js +15 -16
- package/es/form/components/Dependency/index.js +31 -34
- package/es/form/components/Digit/DigitRange.d.ts +2 -2
- package/es/form/components/Digit/DigitRange.js +23 -24
- package/es/form/components/Digit/index.d.ts +1 -1
- package/es/form/components/Digit/index.js +27 -29
- package/es/form/components/Field/index.js +55 -63
- package/es/form/components/FieldSet/index.js +68 -76
- package/es/form/components/FormItem/FormItemRender/index.js +58 -48
- package/es/form/components/FormItem/Group/index.js +95 -95
- package/es/form/components/FormItem/Group/style.js +46 -40
- package/es/form/components/FormItem/index.js +135 -141
- package/es/form/components/FormItem/warpField.js +165 -149
- package/es/form/components/List/ListContainer.js +98 -189
- package/es/form/components/List/ListItem.js +151 -198
- package/es/form/components/List/index.js +97 -107
- package/es/form/components/List/style.js +71 -47
- package/es/form/components/Money/index.d.ts +1 -1
- package/es/form/components/Money/index.js +28 -30
- package/es/form/components/Radio/index.d.ts +2 -2
- package/es/form/components/Radio/index.js +45 -49
- package/es/form/components/Rate/index.d.ts +1 -1
- package/es/form/components/Rate/index.js +17 -20
- package/es/form/components/SchemaForm/index.js +58 -72
- package/es/form/components/SchemaForm/layoutType/Embed.js +5 -6
- package/es/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
- package/es/form/components/SchemaForm/valueType/dependency.js +11 -11
- package/es/form/components/SchemaForm/valueType/divider.js +4 -5
- package/es/form/components/SchemaForm/valueType/field.js +45 -44
- package/es/form/components/SchemaForm/valueType/formList.js +8 -7
- package/es/form/components/SchemaForm/valueType/formSet.js +8 -7
- package/es/form/components/SchemaForm/valueType/group.js +7 -8
- package/es/form/components/SchemaForm/valueType/ignore.js +2 -2
- package/es/form/components/SchemaForm/valueType/index.js +5 -5
- package/es/form/components/Segmented/index.js +20 -23
- package/es/form/components/Select/index.js +69 -73
- package/es/form/components/Slider/index.d.ts +1 -1
- package/es/form/components/Slider/index.js +33 -35
- package/es/form/components/Switch/index.js +24 -26
- package/es/form/components/Text/index.js +75 -86
- package/es/form/components/TextArea/index.d.ts +1 -1
- package/es/form/components/TextArea/index.js +17 -20
- package/es/form/components/TreeSelect/index.js +20 -23
- package/es/form/components/UploadButton/index.js +56 -103
- package/es/form/components/UploadDragger/index.js +37 -44
- package/es/form/helpers/grid.js +65 -67
- package/es/form/layouts/DrawerForm/index.js +150 -241
- package/es/form/layouts/DrawerForm/style.js +26 -25
- package/es/form/layouts/LightFilter/index.d.ts +12 -1
- package/es/form/layouts/LightFilter/index.js +158 -140
- package/es/form/layouts/LightFilter/style.js +52 -48
- package/es/form/layouts/LoginForm/index.js +44 -47
- package/es/form/layouts/LoginForm/style.js +71 -67
- package/es/form/layouts/LoginFormPage/index.js +45 -48
- package/es/form/layouts/LoginFormPage/style.js +136 -126
- package/es/form/layouts/ModalForm/index.js +119 -203
- package/es/form/layouts/ProForm/index.d.ts +2 -2
- package/es/form/layouts/ProForm/index.js +5 -5
- package/es/form/layouts/QueryFilter/Actions.js +23 -22
- package/es/form/layouts/QueryFilter/index.js +178 -203
- package/es/form/layouts/QueryFilter/style.js +45 -37
- package/es/form/layouts/StepsForm/StepForm.d.ts +2 -3
- package/es/form/layouts/StepsForm/StepForm.js +50 -71
- package/es/form/layouts/StepsForm/index.js +175 -217
- package/es/form/layouts/StepsForm/style.js +30 -28
- package/es/form/layouts/index.js +1 -1
- package/es/layout/ProLayout.js +281 -292
- package/es/layout/WrapContent.js +16 -12
- package/es/layout/assert/Logo.js +95 -97
- package/es/layout/components/AppsLogoComponents/AppsLogo.js +10 -12
- package/es/layout/components/AppsLogoComponents/DefaultContent.js +17 -16
- package/es/layout/components/AppsLogoComponents/SimpleContent.js +19 -18
- package/es/layout/components/AppsLogoComponents/index.js +33 -38
- package/es/layout/components/AppsLogoComponents/style/default.js +2 -2
- package/es/layout/components/AppsLogoComponents/style/index.js +52 -50
- package/es/layout/components/AppsLogoComponents/style/simple.js +1 -1
- package/es/layout/components/CollapsedIcon/index.js +18 -15
- package/es/layout/components/CollapsedIcon/style.js +40 -40
- package/es/layout/components/Footer.js +22 -21
- package/es/layout/components/FooterToolbar/index.js +58 -52
- package/es/layout/components/FooterToolbar/style/index.js +38 -37
- package/es/layout/components/FooterToolbar/style/stylish.js +11 -9
- package/es/layout/components/GlobalFooter/index.js +25 -25
- package/es/layout/components/GlobalFooter/style.js +31 -30
- package/es/layout/components/GlobalHeader/ActionsContent.js +62 -78
- package/es/layout/components/GlobalHeader/index.js +59 -47
- package/es/layout/components/GlobalHeader/rightContentStyle.js +49 -49
- package/es/layout/components/GlobalHeader/style.js +58 -54
- package/es/layout/components/GridContent/index.js +24 -19
- package/es/layout/components/GridContent/style.js +14 -13
- package/es/layout/components/Header/index.js +63 -57
- package/es/layout/components/Header/style/header.js +49 -47
- package/es/layout/components/Header/style/stylish.js +15 -11
- package/es/layout/components/Help/AsyncContentPanel.js +13 -18
- package/es/layout/components/Help/HelpProvide.js +1 -1
- package/es/layout/components/Help/ProHelpContentPanel.js +64 -83
- package/es/layout/components/Help/ProHelpDrawer.js +25 -31
- package/es/layout/components/Help/ProHelpModal.d.ts +1 -1
- package/es/layout/components/Help/ProHelpModal.js +24 -27
- package/es/layout/components/Help/ProHelpPanel.js +86 -94
- package/es/layout/components/Help/ProHelpPopover.js +18 -16
- package/es/layout/components/Help/RenderContentPanel.js +34 -24
- package/es/layout/components/Help/Search.js +52 -78
- package/es/layout/components/Help/index.js +9 -11
- package/es/layout/components/Help/style.js +82 -75
- package/es/layout/components/PageContainer/index.js +168 -149
- package/es/layout/components/PageContainer/style/index.js +95 -78
- package/es/layout/components/PageContainer/style/stylish.js +11 -9
- package/es/layout/components/PageHeader/index.js +96 -97
- package/es/layout/components/PageHeader/style/index.js +142 -122
- package/es/layout/components/PageLoading/index.js +17 -20
- package/es/layout/components/SettingDrawer/BlockCheckbox.js +29 -32
- package/es/layout/components/SettingDrawer/LayoutChange.js +22 -22
- package/es/layout/components/SettingDrawer/RegionalChange.js +14 -15
- package/es/layout/components/SettingDrawer/ThemeColor.js +32 -35
- package/es/layout/components/SettingDrawer/index.js +137 -168
- package/es/layout/components/SettingDrawer/style/index.js +141 -137
- package/es/layout/components/SiderMenu/BaseMenu.js +235 -221
- package/es/layout/components/SiderMenu/SiderMenu.js +125 -115
- package/es/layout/components/SiderMenu/index.js +47 -42
- package/es/layout/components/SiderMenu/style/index.js +179 -161
- package/es/layout/components/SiderMenu/style/menu.js +148 -110
- package/es/layout/components/SiderMenu/style/stylish.js +15 -11
- package/es/layout/components/TopNavHeader/index.js +71 -60
- package/es/layout/components/TopNavHeader/style.js +64 -63
- package/es/layout/context/RouteContext.js +1 -1
- package/es/layout/defaultSettings.js +1 -1
- package/es/layout/getPageTitle.js +23 -24
- package/es/layout/locales/en-US.js +3 -2
- package/es/layout/locales/index.js +5 -5
- package/es/layout/locales/it-IT.js +3 -2
- package/es/layout/locales/ko-KR.js +3 -2
- package/es/layout/locales/zh-CN.js +3 -2
- package/es/layout/locales/zh-TW.js +3 -2
- package/es/layout/style/index.js +48 -42
- package/es/layout/utils/getBreadcrumbProps.js +60 -60
- package/es/layout/utils/getMenuData.js +7 -11
- package/es/layout/utils/pathTools.js +2 -6
- package/es/layout/utils/useCurrentMenuLayoutProps.js +4 -9
- package/es/layout/utils/utils.js +15 -17
- package/es/list/Item.js +157 -137
- package/es/list/ListView.js +106 -115
- package/es/list/constants.js +2 -2
- package/es/list/index.js +72 -70
- package/es/list/style/index.js +281 -213
- package/es/provider/index.js +122 -115
- package/es/provider/intl.js +53 -55
- package/es/provider/typing/layoutToken.js +26 -23
- package/es/provider/useStyle/index.js +51 -59
- package/es/provider/utils/merge.js +10 -12
- package/es/skeleton/components/Descriptions/index.js +211 -229
- package/es/skeleton/components/List/index.js +208 -223
- package/es/skeleton/components/Result/index.js +45 -47
- package/es/skeleton/index.js +13 -10
- package/es/table/Store/Provide.d.ts +4 -4
- package/es/table/Store/Provide.js +102 -117
- package/es/table/Table.d.ts +5 -2
- package/es/table/Table.js +526 -691
- package/es/table/TableSearch.d.ts +24 -0
- package/es/table/TableSearch.js +54 -0
- package/es/table/TableToolbar.d.ts +22 -0
- package/es/table/TableToolbar.js +47 -0
- package/es/table/components/Alert/index.js +41 -40
- package/es/table/components/Alert/style.js +28 -27
- package/es/table/components/ColumnSetting/index.js +228 -223
- package/es/table/components/ColumnSetting/style.js +86 -71
- package/es/table/components/DragSortTable/index.js +65 -79
- package/es/table/components/DragSortTable/style.js +20 -19
- package/es/table/components/Dropdown/index.js +42 -47
- package/es/table/components/EditableTable/CellEditorTable.js +24 -32
- package/es/table/components/EditableTable/RowEditorTable.js +23 -28
- package/es/table/components/EditableTable/index.js +295 -329
- package/es/table/components/Form/FormRender.js +99 -103
- package/es/table/components/Form/index.d.ts +4 -19
- package/es/table/components/Form/index.js +112 -159
- package/es/table/components/ListToolBar/HeaderMenu.js +44 -52
- package/es/table/components/ListToolBar/index.js +122 -147
- package/es/table/components/ListToolBar/style.js +127 -117
- package/es/table/components/ToolBar/DensityIcon.js +10 -9
- package/es/table/components/ToolBar/FullscreenIcon.js +5 -9
- package/es/table/components/ToolBar/index.d.ts +2 -8
- package/es/table/components/ToolBar/index.js +155 -195
- package/es/table/style/index.js +144 -112
- package/es/table/typing.d.ts +4 -0
- package/es/table/useFetchData.js +199 -338
- package/es/table/utils/cellRenderToFromItem.js +105 -119
- package/es/table/utils/columnRender.js +63 -54
- package/es/table/utils/columnSort.js +22 -22
- package/es/table/utils/genProColumnToColumn.d.ts +13 -9
- package/es/table/utils/genProColumnToColumn.js +121 -98
- package/es/table/utils/index.d.ts +10 -0
- package/es/table/utils/index.js +112 -178
- package/es/table/utils/useDragSort.d.ts +1 -1
- package/es/table/utils/useDragSort.js +99 -92
- package/es/table/utils/usePageInfo.d.ts +6 -0
- package/es/table/utils/usePageInfo.js +55 -0
- package/es/utils/components/DropdownFooter/index.js +23 -21
- package/es/utils/components/DropdownFooter/style.js +16 -15
- package/es/utils/components/ErrorBoundary/index.js +27 -50
- package/es/utils/components/FieldLabel/index.js +70 -70
- package/es/utils/components/FieldLabel/style.js +104 -81
- package/es/utils/components/FilterDropdown/index.d.ts +11 -0
- package/es/utils/components/FilterDropdown/index.js +43 -32
- package/es/utils/components/FilterDropdown/style.js +19 -16
- package/es/utils/components/InlineErrorFormItem/index.js +78 -78
- package/es/utils/components/InlineErrorFormItem/style.js +56 -49
- package/es/utils/components/LabelIconTip/index.js +30 -31
- package/es/utils/components/LabelIconTip/style.js +36 -35
- package/es/utils/components/ProFormContext/index.js +1 -1
- package/es/utils/conversionMomentValue/index.js +19 -22
- package/es/utils/dateArrayFormatter/index.js +9 -14
- package/es/utils/genCopyable/index.js +74 -32
- package/es/utils/getFieldPropsOrFormItemProps/index.js +1 -1
- package/es/utils/hooks/useDebounceFn/index.js +18 -51
- package/es/utils/hooks/useDebounceValue/index.js +7 -16
- package/es/utils/hooks/useDeepCompareEffect/index.js +6 -18
- package/es/utils/hooks/useDocumentTitle/index.js +2 -2
- package/es/utils/hooks/useFetchData/index.js +36 -65
- package/es/utils/hooks/useForceRender/index.js +2 -9
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/usePrevious/index.js +3 -3
- package/es/utils/hooks/useReactiveRef/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +3 -3
- package/es/utils/hooks/useRefFunction/index.js +4 -9
- package/es/utils/index.d.ts +1 -2
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +2 -2
- package/es/utils/isDeepEqualReact/index.js +9 -44
- package/es/utils/isDropdownValueType/index.js +2 -2
- package/es/utils/isNil/index.js +1 -3
- package/es/utils/isUrl/index.js +2 -2
- package/es/utils/merge/index.js +10 -12
- package/es/utils/nanoid/index.js +5 -6
- package/es/utils/omitBoolean/index.js +1 -1
- package/es/utils/omitUndefined/index.js +3 -3
- package/es/utils/omitUndefinedAndEmptyArr/index.js +4 -5
- package/es/utils/parseValueToMoment/index.js +3 -7
- package/es/utils/pickProFormItemProps/index.js +3 -3
- package/es/utils/pickProProps/index.js +6 -7
- package/es/utils/proFieldParsingText/index.js +85 -98
- package/es/utils/runFunction/index.js +2 -5
- package/es/utils/stringify/index.js +1 -1
- package/es/utils/transformKeySubmitValue/index.js +99 -116
- package/es/utils/useEditableArray/index.d.ts +6 -1
- package/es/utils/useEditableArray/index.js +579 -735
- package/es/utils/useEditableMap/index.d.ts +1 -1
- package/es/utils/useEditableMap/index.js +89 -135
- package/es/utils/useMediaQuery/index.d.ts +2 -2
- package/es/utils/useMediaQuery/index.js +37 -34
- package/es/utils/useMediaQuery/query.js +7 -17
- package/es/version.js +1 -1
- package/guidelines/Guidelines.md +33 -0
- package/guidelines/components/drawer-form.md +90 -0
- package/guidelines/components/editable-pro-table.md +150 -0
- package/guidelines/components/modal-form.md +88 -0
- package/guidelines/components/pro-card.md +90 -0
- package/guidelines/components/pro-form.md +96 -0
- package/guidelines/components/pro-layout.md +84 -0
- package/guidelines/components/pro-table.md +142 -0
- package/guidelines/components/steps-form.md +105 -0
- package/guidelines/design-tokens/colors.md +58 -0
- package/guidelines/design-tokens/layout.md +53 -0
- package/guidelines/design-tokens/typography.md +49 -0
- package/guidelines/overview-components.md +55 -0
- package/guidelines/overview-icons.md +23 -0
- package/lib/card/ProCard.js +8 -10
- package/lib/card/components/Actions/index.js +25 -25
- package/lib/card/components/Actions/style.js +79 -72
- package/lib/card/components/Card/index.js +154 -139
- package/lib/card/components/Card/style.js +249 -193
- package/lib/card/components/CheckCard/Group.js +97 -115
- package/lib/card/components/CheckCard/index.js +85 -78
- package/lib/card/components/CheckCard/style.js +184 -169
- package/lib/card/components/Divider/index.js +20 -16
- package/lib/card/components/Divider/style.js +32 -30
- package/lib/card/components/Loading/index.js +19 -16
- package/lib/card/components/Loading/style.js +34 -32
- package/lib/card/components/Operation/index.js +16 -14
- package/lib/card/components/Operation/style.js +19 -19
- package/lib/card/components/Statistic/index.js +46 -42
- package/lib/card/components/Statistic/style.js +89 -71
- package/lib/card/components/StatisticCard/index.js +46 -41
- package/lib/card/components/StatisticCard/style.js +37 -36
- package/lib/card/index.js +4 -4
- package/lib/descriptions/index.js +219 -225
- package/lib/descriptions/useFetchData.js +51 -90
- package/lib/field/AllProField.js +267 -217
- package/lib/field/FieldHOC/index.js +9 -15
- package/lib/field/PureProField.js +84 -82
- package/lib/field/ValueTypeToComponent.js +517 -618
- package/lib/field/components/Cascader/index.d.ts +2 -2
- package/lib/field/components/Cascader/index.js +66 -85
- package/lib/field/components/Checkbox/index.d.ts +1 -1
- package/lib/field/components/Checkbox/index.js +75 -73
- package/lib/field/components/Code/index.js +40 -39
- package/lib/field/components/ColorPicker/index.js +38 -33
- package/lib/field/components/DatePicker/index.d.ts +1 -1
- package/lib/field/components/DatePicker/index.js +49 -53
- package/lib/field/components/Digit/index.js +41 -43
- package/lib/field/components/DigitRange/index.js +69 -76
- package/lib/field/components/FromNow/index.js +27 -25
- package/lib/field/components/Image/index.js +28 -24
- package/lib/field/components/IndexColumn/index.js +22 -17
- package/lib/field/components/Money/index.js +106 -116
- package/lib/field/components/Options/index.js +34 -34
- package/lib/field/components/Password/index.js +35 -38
- package/lib/field/components/Percent/index.js +40 -45
- package/lib/field/components/Percent/util.js +3 -6
- package/lib/field/components/Progress/index.js +29 -28
- package/lib/field/components/Radio/index.d.ts +1 -1
- package/lib/field/components/Radio/index.js +61 -63
- package/lib/field/components/RangePicker/index.d.ts +1 -1
- package/lib/field/components/RangePicker/index.js +52 -63
- package/lib/field/components/Rate/index.js +24 -21
- package/lib/field/components/Second/index.js +36 -33
- package/lib/field/components/Segmented/index.d.ts +1 -1
- package/lib/field/components/Segmented/index.js +37 -48
- package/lib/field/components/Select/LightSelect/index.d.ts +1 -1
- package/lib/field/components/Select/LightSelect/index.js +103 -110
- package/lib/field/components/Select/SearchSelect/index.js +133 -156
- package/lib/field/components/Select/index.d.ts +1 -1
- package/lib/field/components/Select/index.js +194 -218
- package/lib/field/components/Slider/index.js +25 -22
- package/lib/field/components/Status/index.js +69 -79
- package/lib/field/components/Switch/index.d.ts +1 -1
- package/lib/field/components/Switch/index.js +32 -31
- package/lib/field/components/Text/index.js +34 -38
- package/lib/field/components/TextArea/index.js +26 -21
- package/lib/field/components/TextArea/readonly.js +24 -22
- package/lib/field/components/TimePicker/index.js +96 -105
- package/lib/field/components/TreeSelect/index.d.ts +2 -2
- package/lib/field/components/TreeSelect/index.js +105 -124
- package/lib/field/index.js +34 -34
- package/lib/form/BaseForm/BaseForm.js +413 -499
- package/lib/form/BaseForm/EditOrReadOnlyContext.js +1 -1
- package/lib/form/BaseForm/LightWrapper/index.js +57 -66
- package/lib/form/BaseForm/LightWrapper/style.js +17 -14
- package/lib/form/BaseForm/Submitter/index.js +44 -44
- package/lib/form/BaseForm/index.js +3 -3
- package/lib/form/FieldContext.js +1 -1
- package/lib/form/components/Captcha/index.js +74 -135
- package/lib/form/components/Cascader/index.js +26 -29
- package/lib/form/components/Checkbox/index.js +60 -61
- package/lib/form/components/ColorPicker/index.js +24 -26
- package/lib/form/components/DatePicker/BaseDatePicker.js +32 -30
- package/lib/form/components/DatePicker/DatePicker.js +14 -13
- package/lib/form/components/DatePicker/DateTimePicker.js +11 -12
- package/lib/form/components/DatePicker/MonthPicker.js +14 -13
- package/lib/form/components/DatePicker/QuarterPicker.js +14 -13
- package/lib/form/components/DatePicker/TimePicker.js +26 -27
- package/lib/form/components/DatePicker/WeekPicker.js +14 -13
- package/lib/form/components/DatePicker/YearPicker.js +14 -13
- package/lib/form/components/DatePicker/index.js +1 -1
- package/lib/form/components/DateRangePicker/BaseDateRanger.js +34 -34
- package/lib/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
- package/lib/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
- package/lib/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
- package/lib/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
- package/lib/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
- package/lib/form/components/DateRangePicker/TimeRangePicker.js +26 -29
- package/lib/form/components/DateRangePicker/index.js +15 -16
- package/lib/form/components/Dependency/index.js +31 -35
- package/lib/form/components/Digit/DigitRange.js +23 -24
- package/lib/form/components/Digit/index.js +27 -29
- package/lib/form/components/Field/index.js +55 -63
- package/lib/form/components/FieldSet/index.js +68 -76
- package/lib/form/components/FormItem/FormItemRender/index.js +58 -48
- package/lib/form/components/FormItem/Group/index.js +95 -95
- package/lib/form/components/FormItem/Group/style.js +46 -41
- package/lib/form/components/FormItem/index.js +135 -141
- package/lib/form/components/FormItem/warpField.js +165 -149
- package/lib/form/components/List/ListContainer.js +100 -191
- package/lib/form/components/List/ListItem.js +153 -200
- package/lib/form/components/List/index.js +97 -107
- package/lib/form/components/List/style.js +71 -48
- package/lib/form/components/Money/index.js +28 -30
- package/lib/form/components/Radio/index.js +45 -49
- package/lib/form/components/Rate/index.js +17 -21
- package/lib/form/components/SchemaForm/index.js +54 -68
- package/lib/form/components/SchemaForm/layoutType/Embed.js +5 -6
- package/lib/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
- package/lib/form/components/SchemaForm/layoutType/index.js +2 -2
- package/lib/form/components/SchemaForm/valueType/dependency.js +13 -12
- package/lib/form/components/SchemaForm/valueType/divider.js +6 -7
- package/lib/form/components/SchemaForm/valueType/field.js +47 -45
- package/lib/form/components/SchemaForm/valueType/formList.js +10 -9
- package/lib/form/components/SchemaForm/valueType/formSet.js +10 -8
- package/lib/form/components/SchemaForm/valueType/group.js +9 -10
- package/lib/form/components/SchemaForm/valueType/ignore.js +4 -3
- package/lib/form/components/SchemaForm/valueType/index.js +7 -6
- package/lib/form/components/Segmented/index.js +20 -24
- package/lib/form/components/Select/index.js +69 -73
- package/lib/form/components/Slider/index.js +33 -35
- package/lib/form/components/Switch/index.js +24 -26
- package/lib/form/components/Text/index.js +73 -84
- package/lib/form/components/TextArea/index.js +17 -21
- package/lib/form/components/TreeSelect/index.js +20 -23
- package/lib/form/components/UploadButton/index.js +56 -103
- package/lib/form/components/UploadDragger/index.js +37 -44
- package/lib/form/components/index.js +42 -42
- package/lib/form/helpers/grid.js +68 -69
- package/lib/form/helpers/index.js +1 -1
- package/lib/form/index.js +8 -8
- package/lib/form/layouts/DrawerForm/index.js +149 -241
- package/lib/form/layouts/DrawerForm/style.js +26 -26
- package/lib/form/layouts/LightFilter/index.d.ts +12 -1
- package/lib/form/layouts/LightFilter/index.js +158 -141
- package/lib/form/layouts/LightFilter/style.js +52 -49
- package/lib/form/layouts/LoginForm/index.js +44 -48
- package/lib/form/layouts/LoginForm/style.js +71 -68
- package/lib/form/layouts/LoginFormPage/index.js +45 -49
- package/lib/form/layouts/LoginFormPage/style.js +136 -127
- package/lib/form/layouts/ModalForm/index.js +118 -203
- package/lib/form/layouts/ProForm/index.d.ts +1 -1
- package/lib/form/layouts/ProForm/index.js +5 -5
- package/lib/form/layouts/QueryFilter/Actions.js +23 -22
- package/lib/form/layouts/QueryFilter/index.js +177 -202
- package/lib/form/layouts/QueryFilter/style.js +45 -38
- package/lib/form/layouts/StepsForm/StepForm.d.ts +2 -3
- package/lib/form/layouts/StepsForm/StepForm.js +50 -72
- package/lib/form/layouts/StepsForm/index.js +174 -216
- package/lib/form/layouts/StepsForm/style.js +30 -29
- package/lib/form/layouts/index.js +9 -9
- package/lib/index.js +11 -11
- package/lib/layout/ProLayout.js +281 -292
- package/lib/layout/WrapContent.js +18 -14
- package/lib/layout/assert/Logo.js +96 -97
- package/lib/layout/components/AppsLogoComponents/AppsLogo.js +11 -12
- package/lib/layout/components/AppsLogoComponents/DefaultContent.js +19 -17
- package/lib/layout/components/AppsLogoComponents/SimpleContent.js +22 -19
- package/lib/layout/components/AppsLogoComponents/index.js +36 -40
- package/lib/layout/components/AppsLogoComponents/style/default.js +4 -3
- package/lib/layout/components/AppsLogoComponents/style/index.js +52 -51
- package/lib/layout/components/AppsLogoComponents/style/simple.js +3 -2
- package/lib/layout/components/CollapsedIcon/index.js +20 -17
- package/lib/layout/components/CollapsedIcon/style.js +40 -41
- package/lib/layout/components/Footer.js +23 -22
- package/lib/layout/components/FooterToolbar/index.js +59 -53
- package/lib/layout/components/FooterToolbar/style/index.js +38 -38
- package/lib/layout/components/FooterToolbar/style/stylish.js +11 -10
- package/lib/layout/components/GlobalFooter/index.js +27 -27
- package/lib/layout/components/GlobalFooter/style.js +31 -31
- package/lib/layout/components/GlobalHeader/ActionsContent.js +65 -81
- package/lib/layout/components/GlobalHeader/index.js +61 -49
- package/lib/layout/components/GlobalHeader/rightContentStyle.js +49 -50
- package/lib/layout/components/GlobalHeader/style.js +58 -55
- package/lib/layout/components/GridContent/index.js +26 -21
- package/lib/layout/components/GridContent/style.js +14 -14
- package/lib/layout/components/Header/index.js +65 -59
- package/lib/layout/components/Header/style/header.js +49 -48
- package/lib/layout/components/Header/style/stylish.js +15 -12
- package/lib/layout/components/Help/AsyncContentPanel.js +15 -20
- package/lib/layout/components/Help/HelpProvide.js +1 -1
- package/lib/layout/components/Help/ProHelpContentPanel.js +66 -85
- package/lib/layout/components/Help/ProHelpDrawer.js +27 -32
- package/lib/layout/components/Help/ProHelpModal.d.ts +1 -1
- package/lib/layout/components/Help/ProHelpModal.js +26 -28
- package/lib/layout/components/Help/ProHelpPanel.js +86 -94
- package/lib/layout/components/Help/ProHelpPopover.js +20 -18
- package/lib/layout/components/Help/RenderContentPanel.js +36 -26
- package/lib/layout/components/Help/Search.js +55 -80
- package/lib/layout/components/Help/index.js +19 -20
- package/lib/layout/components/Help/style.js +82 -76
- package/lib/layout/components/PageContainer/index.js +172 -151
- package/lib/layout/components/PageContainer/style/index.js +95 -79
- package/lib/layout/components/PageContainer/style/stylish.js +11 -10
- package/lib/layout/components/PageHeader/index.js +99 -99
- package/lib/layout/components/PageHeader/style/index.js +142 -123
- package/lib/layout/components/PageLoading/index.js +18 -20
- package/lib/layout/components/SettingDrawer/BlockCheckbox.js +31 -34
- package/lib/layout/components/SettingDrawer/LayoutChange.js +25 -23
- package/lib/layout/components/SettingDrawer/RegionalChange.js +16 -16
- package/lib/layout/components/SettingDrawer/ThemeColor.js +34 -36
- package/lib/layout/components/SettingDrawer/index.js +138 -168
- package/lib/layout/components/SettingDrawer/style/index.js +141 -138
- package/lib/layout/components/SiderMenu/BaseMenu.js +235 -221
- package/lib/layout/components/SiderMenu/SiderMenu.js +128 -117
- package/lib/layout/components/SiderMenu/index.js +49 -44
- package/lib/layout/components/SiderMenu/style/index.js +179 -162
- package/lib/layout/components/SiderMenu/style/menu.js +148 -111
- package/lib/layout/components/SiderMenu/style/stylish.js +15 -12
- package/lib/layout/components/TopNavHeader/index.js +73 -62
- package/lib/layout/components/TopNavHeader/style.js +64 -64
- package/lib/layout/context/RouteContext.js +1 -1
- package/lib/layout/defaultSettings.js +1 -1
- package/lib/layout/getPageTitle.js +27 -26
- package/lib/layout/index.js +16 -16
- package/lib/layout/locales/en-US.js +3 -2
- package/lib/layout/locales/index.js +8 -6
- package/lib/layout/locales/it-IT.js +3 -2
- package/lib/layout/locales/ko-KR.js +3 -2
- package/lib/layout/locales/zh-CN.js +3 -2
- package/lib/layout/locales/zh-TW.js +3 -2
- package/lib/layout/style/index.js +48 -43
- package/lib/layout/utils/getBreadcrumbProps.js +65 -62
- package/lib/layout/utils/getMenuData.js +9 -13
- package/lib/layout/utils/pathTools.js +2 -6
- package/lib/layout/utils/useCurrentMenuLayoutProps.js +6 -11
- package/lib/layout/utils/utils.js +16 -18
- package/lib/list/Item.js +155 -136
- package/lib/list/ListView.js +110 -119
- package/lib/list/constants.js +2 -2
- package/lib/list/index.js +72 -70
- package/lib/list/style/index.js +281 -214
- package/lib/provider/index.js +128 -118
- package/lib/provider/intl.js +56 -56
- package/lib/provider/typing/layoutToken.js +28 -25
- package/lib/provider/useStyle/index.js +55 -60
- package/lib/provider/utils/merge.js +12 -14
- package/lib/skeleton/components/Descriptions/index.js +213 -229
- package/lib/skeleton/components/List/index.js +211 -221
- package/lib/skeleton/components/Result/index.js +45 -47
- package/lib/skeleton/index.js +23 -19
- package/lib/table/Store/Provide.d.ts +4 -4
- package/lib/table/Store/Provide.js +103 -117
- package/lib/table/Table.d.ts +5 -2
- package/lib/table/Table.js +524 -689
- package/lib/table/TableSearch.d.ts +24 -0
- package/lib/table/TableSearch.js +61 -0
- package/lib/table/TableToolbar.d.ts +22 -0
- package/lib/table/TableToolbar.js +55 -0
- package/lib/table/components/Alert/index.js +41 -40
- package/lib/table/components/Alert/style.js +28 -28
- package/lib/table/components/ColumnSetting/index.js +228 -224
- package/lib/table/components/ColumnSetting/style.js +86 -72
- package/lib/table/components/DragSortTable/index.js +64 -78
- package/lib/table/components/DragSortTable/style.js +20 -20
- package/lib/table/components/Dropdown/index.js +42 -48
- package/lib/table/components/EditableTable/CellEditorTable.js +24 -32
- package/lib/table/components/EditableTable/RowEditorTable.js +23 -28
- package/lib/table/components/EditableTable/index.js +293 -327
- package/lib/table/components/Form/FormRender.js +99 -104
- package/lib/table/components/Form/index.d.ts +4 -19
- package/lib/table/components/Form/index.js +113 -159
- package/lib/table/components/ListToolBar/HeaderMenu.js +42 -51
- package/lib/table/components/ListToolBar/index.js +123 -148
- package/lib/table/components/ListToolBar/style.js +127 -118
- package/lib/table/components/ToolBar/DensityIcon.js +10 -9
- package/lib/table/components/ToolBar/FullscreenIcon.js +5 -10
- package/lib/table/components/ToolBar/index.d.ts +2 -8
- package/lib/table/components/ToolBar/index.js +154 -194
- package/lib/table/index.js +27 -27
- package/lib/table/style/index.js +144 -113
- package/lib/table/typing.d.ts +4 -0
- package/lib/table/useFetchData.js +197 -337
- package/lib/table/utils/cellRenderToFromItem.js +106 -120
- package/lib/table/utils/columnRender.js +65 -54
- package/lib/table/utils/columnSort.js +24 -23
- package/lib/table/utils/genProColumnToColumn.d.ts +13 -9
- package/lib/table/utils/genProColumnToColumn.js +121 -99
- package/lib/table/utils/index.d.ts +10 -0
- package/lib/table/utils/index.js +127 -181
- package/lib/table/utils/useDragSort.d.ts +1 -1
- package/lib/table/utils/useDragSort.js +99 -93
- package/lib/table/utils/usePageInfo.d.ts +6 -0
- package/lib/table/utils/usePageInfo.js +61 -0
- package/lib/utils/components/DropdownFooter/index.js +25 -23
- package/lib/utils/components/DropdownFooter/style.js +16 -16
- package/lib/utils/components/ErrorBoundary/index.js +28 -50
- package/lib/utils/components/FieldLabel/index.js +70 -71
- package/lib/utils/components/FieldLabel/style.js +104 -82
- package/lib/utils/components/FilterDropdown/index.d.ts +11 -0
- package/lib/utils/components/FilterDropdown/index.js +44 -33
- package/lib/utils/components/FilterDropdown/style.js +19 -17
- package/lib/utils/components/InlineErrorFormItem/index.js +80 -80
- package/lib/utils/components/InlineErrorFormItem/style.js +56 -50
- package/lib/utils/components/LabelIconTip/index.js +30 -32
- package/lib/utils/components/LabelIconTip/style.js +36 -36
- package/lib/utils/components/ProFormContext/index.js +1 -1
- package/lib/utils/conversionMomentValue/index.js +22 -23
- package/lib/utils/dateArrayFormatter/index.js +11 -15
- package/lib/utils/genCopyable/index.js +75 -33
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +3 -2
- package/lib/utils/hooks/useDebounceFn/index.js +18 -52
- package/lib/utils/hooks/useDebounceValue/index.js +7 -17
- package/lib/utils/hooks/useDeepCompareEffect/index.js +7 -19
- package/lib/utils/hooks/useDocumentTitle/index.js +2 -2
- package/lib/utils/hooks/useFetchData/index.js +36 -65
- package/lib/utils/hooks/useForceRender/index.js +2 -10
- package/lib/utils/hooks/useLatest/index.js +4 -3
- package/lib/utils/hooks/usePrevious/index.js +5 -4
- package/lib/utils/hooks/useReactiveRef/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +3 -3
- package/lib/utils/hooks/useRefFunction/index.js +6 -11
- package/lib/utils/index.d.ts +1 -2
- package/lib/utils/index.js +57 -65
- package/lib/utils/isBrowser/index.js +4 -3
- package/lib/utils/isDeepEqualReact/index.js +9 -45
- package/lib/utils/isDropdownValueType/index.js +4 -3
- package/lib/utils/isNil/index.js +2 -3
- package/lib/utils/isUrl/index.js +4 -3
- package/lib/utils/merge/index.js +12 -14
- package/lib/utils/nanoid/index.js +7 -7
- package/lib/utils/omitBoolean/index.js +3 -2
- package/lib/utils/omitUndefined/index.js +5 -4
- package/lib/utils/omitUndefinedAndEmptyArr/index.js +6 -6
- package/lib/utils/parseValueToMoment/index.js +5 -8
- package/lib/utils/pickProFormItemProps/index.js +3 -3
- package/lib/utils/pickProProps/index.js +6 -7
- package/lib/utils/proFieldParsingText/index.js +89 -99
- package/lib/utils/runFunction/index.js +2 -5
- package/lib/utils/stringify/index.js +2 -2
- package/lib/utils/transformKeySubmitValue/index.js +101 -117
- package/lib/utils/useEditableArray/index.d.ts +6 -1
- package/lib/utils/useEditableArray/index.js +582 -735
- package/lib/utils/useEditableMap/index.d.ts +1 -1
- package/lib/utils/useEditableMap/index.js +88 -135
- package/lib/utils/useMediaQuery/index.js +40 -35
- package/lib/utils/useMediaQuery/query.js +7 -18
- package/lib/version.js +1 -1
- package/package.json +20 -31
- package/es/utils/useMountMergeState/index.d.ts +0 -2
- package/es/utils/useMountMergeState/index.js +0 -2
- package/lib/utils/useMountMergeState/index.d.ts +0 -2
- package/lib/utils/useMountMergeState/index.js +0 -12
|
@@ -1,136 +1,155 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = useStyle;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _objectSpread5 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
7
|
var _utils = require("../../../../utils");
|
|
11
|
-
|
|
8
|
+
const textOverflowEllipsis = () => ({
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
whiteSpace: 'nowrap',
|
|
11
|
+
textOverflow: 'ellipsis'
|
|
12
|
+
});
|
|
13
|
+
const genPageHeaderStyle = token => {
|
|
12
14
|
return {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
[token.componentCls]: {
|
|
16
|
+
...(0, _utils.resetComponent)?.(token),
|
|
17
|
+
position: 'relative',
|
|
18
|
+
backgroundColor: token.colorWhite,
|
|
19
|
+
paddingBlock: token.pageHeaderPaddingVertical + 2,
|
|
20
|
+
paddingInline: token.pageHeaderPadding,
|
|
21
|
+
'&&-ghost': {
|
|
22
|
+
backgroundColor: token.pageHeaderBgGhost
|
|
23
|
+
},
|
|
24
|
+
'&-no-children': {
|
|
25
|
+
height: token.layout?.pageContainer?.paddingBlockPageContainerContent
|
|
26
|
+
},
|
|
27
|
+
'&&-has-breadcrumb': {
|
|
28
|
+
paddingBlockStart: token.pageHeaderPaddingBreadCrumb
|
|
29
|
+
},
|
|
30
|
+
'&&-has-footer': {
|
|
31
|
+
paddingBlockEnd: 0
|
|
32
|
+
},
|
|
33
|
+
'& &-back': {
|
|
34
|
+
marginInlineEnd: token.margin,
|
|
35
|
+
fontSize: 16,
|
|
36
|
+
lineHeight: 1,
|
|
37
|
+
'&-button': {
|
|
38
|
+
fontSize: 16,
|
|
39
|
+
...(0, _utils.operationUnit)?.(token),
|
|
40
|
+
color: token.pageHeaderColorBack,
|
|
41
|
+
cursor: 'pointer'
|
|
42
|
+
},
|
|
43
|
+
[`${token.componentCls}-rlt &`]: {
|
|
44
|
+
float: 'right',
|
|
45
|
+
marginInlineEnd: 0,
|
|
46
|
+
marginInlineStart: 0
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
[`& ${'ant'}-divider-vertical`]: {
|
|
50
|
+
height: 14,
|
|
51
|
+
marginBlock: 0,
|
|
52
|
+
marginInline: token.marginSM,
|
|
53
|
+
verticalAlign: 'middle'
|
|
54
|
+
},
|
|
55
|
+
[`& &-breadcrumb + &-heading`]: {
|
|
56
|
+
marginBlockStart: token.marginXS
|
|
57
|
+
},
|
|
58
|
+
'& &-heading': {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
justifyContent: 'space-between',
|
|
61
|
+
'&-left': {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
marginBlock: token.marginXS / 2,
|
|
65
|
+
marginInlineEnd: 0,
|
|
66
|
+
marginInlineStart: 0,
|
|
67
|
+
overflow: 'hidden'
|
|
68
|
+
},
|
|
69
|
+
'&-title': {
|
|
70
|
+
marginInlineEnd: token.marginSM,
|
|
71
|
+
marginBlockEnd: 0,
|
|
72
|
+
color: token.colorTextHeading,
|
|
73
|
+
fontWeight: 600,
|
|
74
|
+
fontSize: token.pageHeaderFontSizeHeaderTitle,
|
|
75
|
+
lineHeight: token.controlHeight + 'px',
|
|
76
|
+
...textOverflowEllipsis(),
|
|
77
|
+
[`${token.componentCls}-rlt &`]: {
|
|
78
|
+
marginInlineEnd: 0,
|
|
79
|
+
marginInlineStart: token.marginSM
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
'&-avatar': {
|
|
83
|
+
marginInlineEnd: token.marginSM,
|
|
84
|
+
[`${token.componentCls}-rlt &`]: {
|
|
85
|
+
float: 'right',
|
|
86
|
+
marginInlineEnd: 0,
|
|
87
|
+
marginInlineStart: token.marginSM
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'&-tags': {
|
|
91
|
+
[`${token.componentCls}-rlt &`]: {
|
|
92
|
+
float: 'right'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
'&-sub-title': {
|
|
96
|
+
marginInlineEnd: token.marginSM,
|
|
97
|
+
color: token.colorTextSecondary,
|
|
98
|
+
fontSize: token.pageHeaderFontSizeHeaderSubTitle,
|
|
99
|
+
lineHeight: token.lineHeight,
|
|
100
|
+
...textOverflowEllipsis(),
|
|
101
|
+
[`${token.componentCls}-rlt &`]: {
|
|
102
|
+
float: 'right',
|
|
103
|
+
marginInlineEnd: 0,
|
|
104
|
+
marginInlineStart: 12
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
'&-extra': {
|
|
108
|
+
marginBlock: token.marginXS / 2,
|
|
109
|
+
marginInlineEnd: 0,
|
|
110
|
+
marginInlineStart: 0,
|
|
111
|
+
whiteSpace: 'nowrap',
|
|
112
|
+
'> *': {
|
|
113
|
+
'white-space': 'unset',
|
|
114
|
+
[`${token.componentCls}-rlt &`]: {
|
|
115
|
+
marginInlineEnd: token.marginSM,
|
|
116
|
+
marginInlineStart: 0
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
[`${token.componentCls}-rlt &`]: {
|
|
120
|
+
float: 'left'
|
|
121
|
+
},
|
|
122
|
+
'*:first-child': {
|
|
123
|
+
[`${token.componentCls}-rlt &`]: {
|
|
124
|
+
marginInlineEnd: 0
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
'&-content': {
|
|
130
|
+
paddingBlockStart: token.pageHeaderPaddingContentPadding
|
|
131
|
+
},
|
|
132
|
+
'&-footer': {
|
|
133
|
+
marginBlockStart: token.margin
|
|
134
|
+
},
|
|
135
|
+
'&-compact &-heading': {
|
|
136
|
+
flexWrap: 'wrap'
|
|
137
|
+
},
|
|
138
|
+
'&-wide': {
|
|
139
|
+
maxWidth: 1152,
|
|
140
|
+
margin: '0 auto'
|
|
141
|
+
},
|
|
142
|
+
'&-rtl': {
|
|
143
|
+
direction: 'rtl'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
16
146
|
};
|
|
17
147
|
};
|
|
18
|
-
var genPageHeaderStyle = function genPageHeaderStyle(token) {
|
|
19
|
-
var _token$layout;
|
|
20
|
-
return (0, _defineProperty2.default)({}, token.componentCls, (0, _objectSpread5.default)((0, _objectSpread5.default)({}, _utils.resetComponent === null || _utils.resetComponent === void 0 ? void 0 : (0, _utils.resetComponent)(token)), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
21
|
-
position: 'relative',
|
|
22
|
-
backgroundColor: token.colorWhite,
|
|
23
|
-
paddingBlock: token.pageHeaderPaddingVertical + 2,
|
|
24
|
-
paddingInline: token.pageHeaderPadding,
|
|
25
|
-
'&&-ghost': {
|
|
26
|
-
backgroundColor: token.pageHeaderBgGhost
|
|
27
|
-
},
|
|
28
|
-
'&-no-children': {
|
|
29
|
-
height: (_token$layout = token.layout) === null || _token$layout === void 0 || (_token$layout = _token$layout.pageContainer) === null || _token$layout === void 0 ? void 0 : _token$layout.paddingBlockPageContainerContent
|
|
30
|
-
},
|
|
31
|
-
'&&-has-breadcrumb': {
|
|
32
|
-
paddingBlockStart: token.pageHeaderPaddingBreadCrumb
|
|
33
|
-
},
|
|
34
|
-
'&&-has-footer': {
|
|
35
|
-
paddingBlockEnd: 0
|
|
36
|
-
},
|
|
37
|
-
'& &-back': (0, _defineProperty2.default)({
|
|
38
|
-
marginInlineEnd: token.margin,
|
|
39
|
-
fontSize: 16,
|
|
40
|
-
lineHeight: 1,
|
|
41
|
-
'&-button': (0, _objectSpread5.default)((0, _objectSpread5.default)({
|
|
42
|
-
fontSize: 16
|
|
43
|
-
}, _utils.operationUnit === null || _utils.operationUnit === void 0 ? void 0 : (0, _utils.operationUnit)(token)), {}, {
|
|
44
|
-
color: token.pageHeaderColorBack,
|
|
45
|
-
cursor: 'pointer'
|
|
46
|
-
})
|
|
47
|
-
}, "".concat(token.componentCls, "-rlt &"), {
|
|
48
|
-
float: 'right',
|
|
49
|
-
marginInlineEnd: 0,
|
|
50
|
-
marginInlineStart: 0
|
|
51
|
-
})
|
|
52
|
-
}, "& ".concat('ant', "-divider-vertical"), {
|
|
53
|
-
height: 14,
|
|
54
|
-
marginBlock: 0,
|
|
55
|
-
marginInline: token.marginSM,
|
|
56
|
-
verticalAlign: 'middle'
|
|
57
|
-
}), "& &-breadcrumb + &-heading", {
|
|
58
|
-
marginBlockStart: token.marginXS
|
|
59
|
-
}), '& &-heading', {
|
|
60
|
-
display: 'flex',
|
|
61
|
-
justifyContent: 'space-between',
|
|
62
|
-
'&-left': {
|
|
63
|
-
display: 'flex',
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
marginBlock: token.marginXS / 2,
|
|
66
|
-
marginInlineEnd: 0,
|
|
67
|
-
marginInlineStart: 0,
|
|
68
|
-
overflow: 'hidden'
|
|
69
|
-
},
|
|
70
|
-
'&-title': (0, _objectSpread5.default)((0, _objectSpread5.default)({
|
|
71
|
-
marginInlineEnd: token.marginSM,
|
|
72
|
-
marginBlockEnd: 0,
|
|
73
|
-
color: token.colorTextHeading,
|
|
74
|
-
fontWeight: 600,
|
|
75
|
-
fontSize: token.pageHeaderFontSizeHeaderTitle,
|
|
76
|
-
lineHeight: token.controlHeight + 'px'
|
|
77
|
-
}, textOverflowEllipsis()), {}, (0, _defineProperty2.default)({}, "".concat(token.componentCls, "-rlt &"), {
|
|
78
|
-
marginInlineEnd: 0,
|
|
79
|
-
marginInlineStart: token.marginSM
|
|
80
|
-
})),
|
|
81
|
-
'&-avatar': (0, _defineProperty2.default)({
|
|
82
|
-
marginInlineEnd: token.marginSM
|
|
83
|
-
}, "".concat(token.componentCls, "-rlt &"), {
|
|
84
|
-
float: 'right',
|
|
85
|
-
marginInlineEnd: 0,
|
|
86
|
-
marginInlineStart: token.marginSM
|
|
87
|
-
}),
|
|
88
|
-
'&-tags': (0, _defineProperty2.default)({}, "".concat(token.componentCls, "-rlt &"), {
|
|
89
|
-
float: 'right'
|
|
90
|
-
}),
|
|
91
|
-
'&-sub-title': (0, _objectSpread5.default)((0, _objectSpread5.default)({
|
|
92
|
-
marginInlineEnd: token.marginSM,
|
|
93
|
-
color: token.colorTextSecondary,
|
|
94
|
-
fontSize: token.pageHeaderFontSizeHeaderSubTitle,
|
|
95
|
-
lineHeight: token.lineHeight
|
|
96
|
-
}, textOverflowEllipsis()), {}, (0, _defineProperty2.default)({}, "".concat(token.componentCls, "-rlt &"), {
|
|
97
|
-
float: 'right',
|
|
98
|
-
marginInlineEnd: 0,
|
|
99
|
-
marginInlineStart: 12
|
|
100
|
-
})),
|
|
101
|
-
'&-extra': (0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
102
|
-
marginBlock: token.marginXS / 2,
|
|
103
|
-
marginInlineEnd: 0,
|
|
104
|
-
marginInlineStart: 0,
|
|
105
|
-
whiteSpace: 'nowrap',
|
|
106
|
-
'> *': (0, _defineProperty2.default)({
|
|
107
|
-
'white-space': 'unset'
|
|
108
|
-
}, "".concat(token.componentCls, "-rlt &"), {
|
|
109
|
-
marginInlineEnd: token.marginSM,
|
|
110
|
-
marginInlineStart: 0
|
|
111
|
-
})
|
|
112
|
-
}, "".concat(token.componentCls, "-rlt &"), {
|
|
113
|
-
float: 'left'
|
|
114
|
-
}), '*:first-child', (0, _defineProperty2.default)({}, "".concat(token.componentCls, "-rlt &"), {
|
|
115
|
-
marginInlineEnd: 0
|
|
116
|
-
}))
|
|
117
|
-
}), '&-content', {
|
|
118
|
-
paddingBlockStart: token.pageHeaderPaddingContentPadding
|
|
119
|
-
}), '&-footer', {
|
|
120
|
-
marginBlockStart: token.margin
|
|
121
|
-
}), '&-compact &-heading', {
|
|
122
|
-
flexWrap: 'wrap'
|
|
123
|
-
}), '&-wide', {
|
|
124
|
-
maxWidth: 1152,
|
|
125
|
-
margin: '0 auto'
|
|
126
|
-
}), '&-rtl', {
|
|
127
|
-
direction: 'rtl'
|
|
128
|
-
})));
|
|
129
|
-
};
|
|
130
148
|
function useStyle(prefixCls) {
|
|
131
|
-
return (0, _utils.useStyle)('ProLayoutPageHeader',
|
|
132
|
-
|
|
133
|
-
|
|
149
|
+
return (0, _utils.useStyle)('ProLayoutPageHeader', token => {
|
|
150
|
+
const proCardToken = {
|
|
151
|
+
...token,
|
|
152
|
+
componentCls: `.${prefixCls}`,
|
|
134
153
|
pageHeaderBgGhost: 'transparent',
|
|
135
154
|
pageHeaderPadding: 16,
|
|
136
155
|
pageHeaderPaddingVertical: 4,
|
|
@@ -139,7 +158,7 @@ function useStyle(prefixCls) {
|
|
|
139
158
|
pageHeaderFontSizeHeaderTitle: token.fontSizeHeading4,
|
|
140
159
|
pageHeaderFontSizeHeaderSubTitle: 14,
|
|
141
160
|
pageHeaderPaddingContentPadding: token.paddingSM
|
|
142
|
-
}
|
|
161
|
+
};
|
|
143
162
|
return [genPageHeaderStyle(proCardToken)];
|
|
144
163
|
});
|
|
145
164
|
}
|
|
@@ -5,26 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.PageLoading = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
8
|
var _antd = require("antd");
|
|
11
9
|
var _react = _interopRequireDefault(require("react"));
|
|
12
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
const PageLoading = ({
|
|
12
|
+
isLoading,
|
|
13
|
+
pastDelay,
|
|
14
|
+
timedOut,
|
|
15
|
+
error,
|
|
16
|
+
retry,
|
|
17
|
+
...reset
|
|
18
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
|
+
style: {
|
|
20
|
+
paddingBlockStart: 100,
|
|
21
|
+
textAlign: 'center'
|
|
22
|
+
},
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Spin, {
|
|
24
|
+
size: "large",
|
|
25
|
+
...reset
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
exports.PageLoading = PageLoading;
|
|
@@ -1,49 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.BlockCheckbox = void 0;
|
|
8
7
|
var _icons = require("@ant-design/icons");
|
|
9
8
|
var _antd = require("antd");
|
|
10
|
-
var
|
|
9
|
+
var _clsx = require("clsx");
|
|
11
10
|
var _react = require("react");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
}, item.key);
|
|
41
|
-
});
|
|
12
|
+
const BlockCheckbox = ({
|
|
13
|
+
value,
|
|
14
|
+
configType,
|
|
15
|
+
onChange,
|
|
16
|
+
list,
|
|
17
|
+
prefixCls,
|
|
18
|
+
hashId
|
|
19
|
+
}) => {
|
|
20
|
+
const baseClassName = `${prefixCls}-block-checkbox`;
|
|
21
|
+
const dom = (0, _react.useMemo)(() => {
|
|
22
|
+
const domList = (list || []).map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
23
|
+
title: item.title,
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
25
|
+
className: (0, _clsx.clsx)(hashId, `${baseClassName}-item`, `${baseClassName}-item-${item.key}`, `${baseClassName}-${configType}-item`),
|
|
26
|
+
onClick: () => onChange(item.key),
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CheckOutlined, {
|
|
28
|
+
className: `${baseClassName}-selectIcon ${hashId}`.trim(),
|
|
29
|
+
style: {
|
|
30
|
+
display: value === item.key ? 'block' : 'none'
|
|
31
|
+
}
|
|
32
|
+
}), item?.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
|
+
className: `${baseClassName}-icon ${hashId}`.trim(),
|
|
34
|
+
children: item.icon
|
|
35
|
+
}) : null]
|
|
36
|
+
})
|
|
37
|
+
}, item.key));
|
|
42
38
|
return domList;
|
|
43
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
-
}, [value, list
|
|
40
|
+
}, [value, list?.length, onChange]);
|
|
45
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
46
|
-
className: (0,
|
|
42
|
+
className: (0, _clsx.clsx)(baseClassName, hashId),
|
|
47
43
|
children: dom
|
|
48
44
|
});
|
|
49
|
-
};
|
|
45
|
+
};
|
|
46
|
+
exports.BlockCheckbox = BlockCheckbox;
|
|
@@ -10,8 +10,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _defaultSettings = require("../../defaultSettings");
|
|
11
11
|
var _index = require("./index");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const renderLayoutSettingItem = item => {
|
|
14
|
+
const action = /*#__PURE__*/_react.default.cloneElement(item.action, {
|
|
15
15
|
disabled: item.disabled
|
|
16
16
|
});
|
|
17
17
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
@@ -28,20 +28,23 @@ var renderLayoutSettingItem = exports.renderLayoutSettingItem = function renderL
|
|
|
28
28
|
})
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
exports.renderLayoutSettingItem = renderLayoutSettingItem;
|
|
32
|
+
const LayoutSetting = ({
|
|
33
|
+
settings,
|
|
34
|
+
prefixCls,
|
|
35
|
+
changeSetting,
|
|
36
|
+
hashId
|
|
37
|
+
}) => {
|
|
38
|
+
const formatMessage = (0, _index.getFormatMessage)();
|
|
39
|
+
const {
|
|
40
|
+
contentWidth,
|
|
41
|
+
splitMenus,
|
|
42
|
+
fixedHeader,
|
|
43
|
+
layout,
|
|
44
|
+
fixSiderbar
|
|
45
|
+
} = settings || _defaultSettings.defaultSettings;
|
|
43
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List, {
|
|
44
|
-
className:
|
|
47
|
+
className: `${prefixCls}-list ${hashId}`.trim(),
|
|
45
48
|
split: false,
|
|
46
49
|
dataSource: [{
|
|
47
50
|
title: formatMessage({
|
|
@@ -51,8 +54,8 @@ var LayoutSetting = exports.LayoutSetting = function LayoutSetting(_ref) {
|
|
|
51
54
|
action: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Select, {
|
|
52
55
|
value: contentWidth || 'Fixed',
|
|
53
56
|
size: "small",
|
|
54
|
-
className:
|
|
55
|
-
onSelect:
|
|
57
|
+
className: `content-width ${hashId}`.trim(),
|
|
58
|
+
onSelect: value => {
|
|
56
59
|
changeSetting('contentWidth', value);
|
|
57
60
|
},
|
|
58
61
|
style: {
|
|
@@ -81,7 +84,7 @@ var LayoutSetting = exports.LayoutSetting = function LayoutSetting(_ref) {
|
|
|
81
84
|
size: "small",
|
|
82
85
|
className: "fixed-header",
|
|
83
86
|
checked: !!fixedHeader,
|
|
84
|
-
onChange:
|
|
87
|
+
onChange: checked => {
|
|
85
88
|
changeSetting('fixedHeader', checked);
|
|
86
89
|
}
|
|
87
90
|
})
|
|
@@ -99,9 +102,7 @@ var LayoutSetting = exports.LayoutSetting = function LayoutSetting(_ref) {
|
|
|
99
102
|
size: "small",
|
|
100
103
|
className: "fix-siderbar",
|
|
101
104
|
checked: !!fixSiderbar,
|
|
102
|
-
onChange:
|
|
103
|
-
return changeSetting('fixSiderbar', checked);
|
|
104
|
-
}
|
|
105
|
+
onChange: checked => changeSetting('fixSiderbar', checked)
|
|
105
106
|
})
|
|
106
107
|
}, {
|
|
107
108
|
title: formatMessage({
|
|
@@ -112,11 +113,12 @@ var LayoutSetting = exports.LayoutSetting = function LayoutSetting(_ref) {
|
|
|
112
113
|
size: "small",
|
|
113
114
|
checked: !!splitMenus,
|
|
114
115
|
className: "split-menus",
|
|
115
|
-
onChange:
|
|
116
|
+
onChange: checked => {
|
|
116
117
|
changeSetting('splitMenus', checked);
|
|
117
118
|
}
|
|
118
119
|
})
|
|
119
120
|
}],
|
|
120
121
|
renderItem: renderLayoutSettingItem
|
|
121
122
|
});
|
|
122
|
-
};
|
|
123
|
+
};
|
|
124
|
+
exports.LayoutSetting = LayoutSetting;
|
|
@@ -10,31 +10,31 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _index = require("./index");
|
|
11
11
|
var _LayoutChange = require("./LayoutChange");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const RegionalSetting = ({
|
|
14
|
+
settings,
|
|
15
|
+
prefixCls,
|
|
16
|
+
changeSetting,
|
|
17
|
+
hashId
|
|
18
|
+
}) => {
|
|
19
|
+
const formatMessage = (0, _index.getFormatMessage)();
|
|
20
|
+
const regionalSetting = ['header', 'footer', 'menu', 'menuHeader'];
|
|
20
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List, {
|
|
21
|
-
className:
|
|
22
|
+
className: `${prefixCls}-list ${hashId}`.trim(),
|
|
22
23
|
split: false,
|
|
23
24
|
renderItem: _LayoutChange.renderLayoutSettingItem,
|
|
24
|
-
dataSource: regionalSetting.map(
|
|
25
|
+
dataSource: regionalSetting.map(key => {
|
|
25
26
|
return {
|
|
26
27
|
title: formatMessage({
|
|
27
|
-
id:
|
|
28
|
+
id: `app.setting.regionalsettings.${key}`
|
|
28
29
|
}),
|
|
29
30
|
action: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Switch, {
|
|
30
31
|
size: "small",
|
|
31
|
-
className:
|
|
32
|
-
checked: settings[
|
|
33
|
-
onChange:
|
|
34
|
-
return changeSetting("".concat(key, "Render"), checked === true ? undefined : false);
|
|
35
|
-
}
|
|
32
|
+
className: `regional-${key} ${hashId}`.trim(),
|
|
33
|
+
checked: settings[`${key}Render`] || settings[`${key}Render`] === undefined,
|
|
34
|
+
onChange: checked => changeSetting(`${key}Render`, checked === true ? undefined : false)
|
|
36
35
|
})
|
|
37
36
|
};
|
|
38
37
|
})
|
|
39
38
|
});
|
|
40
|
-
};
|
|
39
|
+
};
|
|
40
|
+
exports.RegionalSetting = RegionalSetting;
|
|
@@ -5,56 +5,54 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ThemeColor = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
8
|
var _icons = require("@ant-design/icons");
|
|
11
9
|
var _antd = require("antd");
|
|
12
10
|
var _react = _interopRequireDefault(require("react"));
|
|
13
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!colorList ||
|
|
12
|
+
const Tag = /*#__PURE__*/_react.default.forwardRef(({
|
|
13
|
+
color,
|
|
14
|
+
check,
|
|
15
|
+
...rest
|
|
16
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
17
|
+
...rest,
|
|
18
|
+
style: {
|
|
19
|
+
backgroundColor: color
|
|
20
|
+
},
|
|
21
|
+
ref: ref,
|
|
22
|
+
children: check ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CheckOutlined, {}) : ''
|
|
23
|
+
}));
|
|
24
|
+
const ThemeColor = ({
|
|
25
|
+
value,
|
|
26
|
+
colorList,
|
|
27
|
+
onChange,
|
|
28
|
+
prefixCls,
|
|
29
|
+
formatMessage,
|
|
30
|
+
hashId
|
|
31
|
+
}) => {
|
|
32
|
+
if (!colorList || colorList?.length < 1) {
|
|
35
33
|
return null;
|
|
36
34
|
}
|
|
37
|
-
|
|
35
|
+
const baseClassName = `${prefixCls}-theme-color`;
|
|
38
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
-
className:
|
|
40
|
-
children: colorList
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
className: `${baseClassName} ${hashId}`.trim(),
|
|
38
|
+
children: colorList?.map(({
|
|
39
|
+
key,
|
|
40
|
+
color,
|
|
41
|
+
title
|
|
42
|
+
}) => {
|
|
44
43
|
if (!key) return null;
|
|
45
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
46
|
-
title: title
|
|
47
|
-
id:
|
|
45
|
+
title: title ?? formatMessage({
|
|
46
|
+
id: `app.setting.themecolor.${key}`
|
|
48
47
|
}),
|
|
49
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Tag, {
|
|
50
|
-
className:
|
|
49
|
+
className: `${baseClassName}-block ${hashId}`.trim(),
|
|
51
50
|
color: color,
|
|
52
51
|
check: value === color,
|
|
53
|
-
onClick:
|
|
54
|
-
return onChange && onChange(color);
|
|
55
|
-
}
|
|
52
|
+
onClick: () => onChange && onChange(color)
|
|
56
53
|
})
|
|
57
54
|
}, color);
|
|
58
55
|
})
|
|
59
56
|
});
|
|
60
|
-
};
|
|
57
|
+
};
|
|
58
|
+
exports.ThemeColor = ThemeColor;
|