@teamix/pro 1.4.25-bugfix.2 → 1.4.25-bugfix.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro.css +1 -1
- package/dist/pro.js +64943 -84006
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +6 -13
- package/es/actions/base.js +21 -8
- package/es/actions/dialog-component.js +9 -2
- package/es/actions/dialog-form.js +75 -37
- package/es/actions/dialog-info.js +5 -1
- package/es/actions/dialog.js +95 -57
- package/es/actions/index.d.ts +0 -7
- package/es/actions/index.js +153 -93
- package/es/actions/index.scss +1 -6
- package/es/actions/link.js +5 -3
- package/es/actions/request.js +27 -12
- package/es/actions/utils.js +9 -1
- package/es/card/card-container.js +5 -0
- package/es/card/divider.js +5 -0
- package/es/card/index.js +100 -61
- package/es/card/index.scss +0 -15
- package/es/card/selectable.js +13 -4
- package/es/card/tab.js +10 -1
- package/es/card/utils.js +2 -0
- package/es/form/Components/Editable/index.js +55 -16
- package/es/form/Components/FormGroup/index.d.ts +0 -1
- package/es/form/Components/FormGroup/index.js +22 -7
- package/es/form/Components/LightFilter/index.js +35 -15
- package/es/form/Components/ProField/index.js +14 -2
- package/es/form/Components/ProField/mapDateFormat.js +28 -2
- package/es/form/Components/Text/index.d.ts +0 -1
- package/es/form/Components/Text/index.js +11 -2
- package/es/form/Filter/AdvancedFilter.js +26 -11
- package/es/form/Filter/Layout.js +24 -11
- package/es/form/Filter/LightFilter.js +24 -13
- package/es/form/Filter/SimpleFilter.js +21 -7
- package/es/form/Filter/index.js +171 -117
- package/es/form/Filter/index2.js +28 -11
- package/es/form/Filter/layout.scss +1 -1
- package/es/form/Filter/useBindUrl.js +46 -18
- package/es/form/Filter/useSpecialProps.js +13 -8
- package/es/form/ProForm/customComponent.js +5 -0
- package/es/form/ProForm/index.js +38 -30
- package/es/form/ProForm/useAutoLayout.js +42 -21
- package/es/form/ProForm/useAutoSubmit.js +8 -3
- package/es/form/ProForm/useFieldRequest.js +5 -0
- package/es/form/ProForm/useFormDisplayValues.js +28 -12
- package/es/form/ProForm/useInitialRequest.js +5 -0
- package/es/form/SchemaForm/adapterComponent.js +3 -0
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +8 -0
- package/es/form/SchemaForm/adapterType.js +2 -0
- package/es/form/SchemaForm/index.js +114 -78
- package/es/form/SchemaForm/initializeArrayCards.js +6 -0
- package/es/form/SchemaForm/initializeArrayCollapse.js +6 -0
- package/es/form/SchemaForm/initializeArrayItems.js +9 -2
- package/es/form/SchemaForm/initializeArrayTable.js +34 -21
- package/es/form/SchemaForm/initializeDataSource.js +6 -2
- package/es/form/SchemaForm/initializeFormButton.js +31 -14
- package/es/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/es/form/SchemaForm/initializeFormGroup.js +20 -10
- package/es/form/SchemaForm/initializeFormStep.js +23 -11
- package/es/form/SchemaForm/initializeFormTab.js +20 -10
- package/es/form/SchemaForm/initializeReactions.js +33 -9
- package/es/form/SchemaForm/initializeRequest.js +16 -2
- package/es/form/SchemaForm/initializeRules.js +22 -4
- package/es/form/SchemaForm/initializeSelectTable.js +33 -7
- package/es/form/SchemaForm/reactions.js +34 -19
- package/es/form/docs/ActionResponse.d.ts +0 -1
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +9 -0
- package/es/form/typing.d.ts +4 -26
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +49 -4
- package/es/form/warning.js +7 -2
- package/es/global.scss +1 -3
- package/es/index-without-icon.js +3 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +8 -18
- package/es/info/components/InfoGroup/index.js +32 -21
- package/es/info/components/InfoValueItem/index.js +119 -66
- package/es/info/components/ProInfoItem/index.js +21 -13
- package/es/info/components/baseInfo/index.js +27 -17
- package/es/info/components/headerInfo/index.js +20 -8
- package/es/info/components/tableInfo/index.js +50 -20
- package/es/info/index.js +86 -61
- package/es/info/typing.d.ts +0 -2
- package/es/info/utils/index.js +11 -0
- package/es/nocode/configurators/ProTable.js +22 -1
- package/es/nocode/configurators/common.js +6 -5
- package/es/nocode/configurators/index.js +3 -2
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +9 -5
- package/es/nocode/pages/index.js +30 -5
- package/es/nocode/pages/playground.js +35 -18
- package/es/nocode/pages/renderer.js +42 -9
- package/es/nocode/playground.js +23 -10
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +76 -40
- package/es/page-header/index.scss +1 -2
- package/es/sidebar/components/sidebar-container/index.js +69 -54
- package/es/sidebar/components/sidebar-container/index.scss +14 -21
- package/es/sidebar/components/tree/index.js +138 -100
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +26 -11
- package/es/sidebar/components/tree-node/components/IconAction/index.js +35 -9
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +25 -12
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/es/sidebar/components/tree-node/index.js +84 -42
- package/es/sidebar/components/tree-node/index.scss +0 -6
- package/es/sidebar/index.d.ts +0 -2
- package/es/sidebar/index.js +95 -72
- package/es/sidebar/typing.d.ts +0 -4
- package/es/sidebar/utils/action-ref.js +7 -2
- package/es/sidebar/utils/index.d.ts +2 -5
- package/es/sidebar/utils/index.js +98 -41
- package/es/table/components/Filter/index.d.ts +3 -6
- package/es/table/components/Filter/index.js +128 -115
- package/es/table/components/Layout/index.js +47 -32
- package/es/table/components/Layout/index.scss +1 -2
- package/es/table/components/Pagination/index.js +58 -25
- package/es/table/components/QuickAction/index.d.ts +0 -1
- package/es/table/components/QuickAction/index.js +11 -3
- package/es/table/components/ToolBar/DensityIcon.js +31 -19
- package/es/table/components/ToolBar/FilterColumnIcon.js +125 -87
- package/es/table/components/ToolBar/FullScreenIcon.js +62 -7
- package/es/table/components/ToolBar/Fullscreen.js +28 -25
- package/es/table/components/ToolBar/RefreshIcon.js +27 -162
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/components/ToolBar/index.js +38 -130
- package/es/table/components/ToolBar/index.scss +3 -49
- package/es/table/index.js +423 -455
- package/es/table/index.scss +0 -8
- package/es/table/typing.d.ts +6 -125
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +79 -39
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +16 -13
- package/es/table/utils/index.js +47 -14
- package/es/table/utils/pureColumnRender.js +53 -21
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +10 -2
- package/es/table/utils/useTableSelection.js +33 -6
- package/es/templates/List/index.js +9 -2
- package/es/timeline/ProTimeLineItem/index.js +65 -25
- package/es/timeline/index.js +22 -8
- package/es/timeline/typing.d.ts +0 -1
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +5 -0
- package/lib/actions/base.js +24 -8
- package/lib/actions/confirm.js +5 -0
- package/lib/actions/danger-confirm.js +5 -0
- package/lib/actions/danger-pop-confirm.js +4 -0
- package/lib/actions/dialog-component.js +15 -2
- package/lib/actions/dialog-form.js +89 -36
- package/lib/actions/dialog-info.js +10 -1
- package/lib/actions/dialog-table.js +5 -0
- package/lib/actions/dialog.js +112 -55
- package/lib/actions/drawer-form.js +3 -0
- package/lib/actions/drawer-info.js +3 -0
- package/lib/actions/drawer-table.js +3 -0
- package/lib/actions/drawer.js +4 -0
- package/lib/actions/error.js +5 -0
- package/lib/actions/index.d.ts +0 -7
- package/lib/actions/index.js +184 -115
- package/lib/actions/index.scss +1 -6
- package/lib/actions/link.js +10 -1
- package/lib/actions/notice.js +5 -0
- package/lib/actions/pop-confirm.js +5 -0
- package/lib/actions/request.js +32 -8
- package/lib/actions/utils.js +9 -1
- package/lib/card/card-container.js +9 -0
- package/lib/card/divider.js +7 -0
- package/lib/card/index.js +127 -61
- package/lib/card/index.scss +0 -15
- package/lib/card/selectable.js +20 -4
- package/lib/card/tab.js +14 -1
- package/lib/card/utils.js +6 -0
- package/lib/field/index.js +6 -0
- package/lib/form/Components/Editable/index.js +65 -15
- package/lib/form/Components/FormGroup/index.d.ts +0 -1
- package/lib/form/Components/FormGroup/index.js +28 -7
- package/lib/form/Components/LightFilter/index.js +47 -15
- package/lib/form/Components/ProField/index.js +21 -2
- package/lib/form/Components/ProField/mapDateFormat.js +32 -2
- package/lib/form/Components/Text/index.d.ts +0 -1
- package/lib/form/Components/Text/index.js +16 -2
- package/lib/form/Filter/AdvancedFilter.js +34 -11
- package/lib/form/Filter/Layout.js +33 -11
- package/lib/form/Filter/LightFilter.js +32 -13
- package/lib/form/Filter/SimpleFilter.js +27 -5
- package/lib/form/Filter/index.js +191 -116
- package/lib/form/Filter/index2.js +38 -11
- package/lib/form/Filter/layout.scss +1 -1
- package/lib/form/Filter/useBindUrl.js +50 -18
- package/lib/form/Filter/useSpecialProps.js +13 -6
- package/lib/form/ProForm/customComponent.js +8 -0
- package/lib/form/ProForm/index.js +60 -30
- package/lib/form/ProForm/useAutoLayout.js +45 -21
- package/lib/form/ProForm/useAutoSubmit.js +10 -1
- package/lib/form/ProForm/useFieldRequest.js +8 -0
- package/lib/form/ProForm/useFormDisplayValues.js +34 -12
- package/lib/form/ProForm/useInitialRequest.js +6 -0
- package/lib/form/SchemaForm/adapterComponent.js +6 -0
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +12 -0
- package/lib/form/SchemaForm/adapterType.js +5 -0
- package/lib/form/SchemaForm/index.js +144 -78
- package/lib/form/SchemaForm/initializeArrayCards.js +7 -0
- package/lib/form/SchemaForm/initializeArrayCollapse.js +7 -0
- package/lib/form/SchemaForm/initializeArrayItems.js +10 -2
- package/lib/form/SchemaForm/initializeArrayTable.js +34 -21
- package/lib/form/SchemaForm/initializeDataSource.js +8 -2
- package/lib/form/SchemaForm/initializeFormButton.js +32 -14
- package/lib/form/SchemaForm/initializeFormCollapse.js +18 -8
- package/lib/form/SchemaForm/initializeFormGroup.js +20 -10
- package/lib/form/SchemaForm/initializeFormStep.js +23 -11
- package/lib/form/SchemaForm/initializeFormTab.js +20 -10
- package/lib/form/SchemaForm/initializeReactions.js +37 -9
- package/lib/form/SchemaForm/initializeRequest.js +18 -2
- package/lib/form/SchemaForm/initializeRules.js +24 -4
- package/lib/form/SchemaForm/initializeSelectTable.js +36 -7
- package/lib/form/SchemaForm/reactions.js +37 -17
- package/lib/form/docs/ActionResponse.d.ts +0 -1
- package/lib/form/docs/ActionResponse.js +5 -0
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +25 -0
- package/lib/form/typing.d.ts +4 -26
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +61 -4
- package/lib/form/warning.js +8 -2
- package/lib/global.scss +1 -3
- package/lib/hooks/index.js +5 -0
- package/lib/index-without-icon.js +36 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +40 -13
- package/lib/info/components/InfoGroup/index.js +42 -21
- package/lib/info/components/InfoValueItem/index.js +134 -66
- package/lib/info/components/ProInfoItem/index.js +29 -13
- package/lib/info/components/baseInfo/index.js +39 -17
- package/lib/info/components/headerInfo/index.js +31 -8
- package/lib/info/components/tableInfo/index.js +62 -20
- package/lib/info/index.js +101 -61
- package/lib/info/typing.d.ts +0 -2
- package/lib/info/utils/index.js +19 -0
- package/lib/info/utils/utils.js +1 -0
- package/lib/nocode/configurators/PageHeader.js +2 -0
- package/lib/nocode/configurators/ProTable.js +24 -1
- package/lib/nocode/configurators/common.js +10 -5
- package/lib/nocode/configurators/index.js +10 -2
- package/lib/nocode/configurators/map.js +5 -0
- package/lib/nocode/index.js +11 -0
- package/lib/nocode/pages/editor.js +19 -5
- package/lib/nocode/pages/index.js +35 -3
- package/lib/nocode/pages/playground.js +52 -18
- package/lib/nocode/pages/renderer.js +53 -9
- package/lib/nocode/playground.js +35 -10
- package/lib/page-container/index.js +6 -0
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +90 -39
- package/lib/page-header/index.scss +1 -2
- package/lib/sidebar/components/sidebar-container/index.js +81 -54
- package/lib/sidebar/components/sidebar-container/index.scss +14 -21
- package/lib/sidebar/components/tree/index.js +152 -100
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +34 -11
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +46 -9
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +2 -2
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +35 -12
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +1 -1
- package/lib/sidebar/components/tree-node/index.js +100 -42
- package/lib/sidebar/components/tree-node/index.scss +0 -6
- package/lib/sidebar/index.d.ts +0 -2
- package/lib/sidebar/index.js +111 -79
- package/lib/sidebar/typing.d.ts +0 -4
- package/lib/sidebar/utils/action-ref.js +8 -2
- package/lib/sidebar/utils/index.d.ts +2 -5
- package/lib/sidebar/utils/index.js +106 -41
- package/lib/skeleton/index.js +6 -0
- package/lib/table/components/EmptyContent/index.js +6 -0
- package/lib/table/components/Filter/index.d.ts +3 -6
- package/lib/table/components/Filter/index.js +137 -114
- package/lib/table/components/Layout/index.js +60 -32
- package/lib/table/components/Layout/index.scss +1 -2
- package/lib/table/components/Pagination/index.js +68 -25
- package/lib/table/components/QuickAction/index.d.ts +0 -1
- package/lib/table/components/QuickAction/index.js +15 -3
- package/lib/table/components/ToolBar/DensityIcon.js +42 -19
- package/lib/table/components/ToolBar/FilterColumnIcon.js +136 -86
- package/lib/table/components/ToolBar/FullScreenIcon.js +74 -10
- package/lib/table/components/ToolBar/Fullscreen.js +35 -25
- package/lib/table/components/ToolBar/RefreshIcon.js +36 -164
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/components/ToolBar/index.js +47 -133
- package/lib/table/components/ToolBar/index.scss +3 -49
- package/lib/table/index.js +445 -454
- package/lib/table/index.scss +0 -8
- package/lib/table/typing.d.ts +6 -125
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +92 -39
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +21 -13
- package/lib/table/utils/getTableProps.js +2 -0
- package/lib/table/utils/getTableSortIcons.js +5 -0
- package/lib/table/utils/index.js +55 -12
- package/lib/table/utils/pureColumnRender.js +64 -21
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +11 -2
- package/lib/table/utils/useTableSelection.js +35 -6
- package/lib/templates/Detail/index.js +5 -0
- package/lib/templates/Form/index.js +5 -0
- package/lib/templates/List/index.js +19 -2
- package/lib/templates/index.js +6 -0
- package/lib/timeline/ProTimeLineItem/index.js +76 -25
- package/lib/timeline/index.js +33 -8
- package/lib/timeline/typing.d.ts +0 -1
- package/lib/utils/index.js +6 -0
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +10 -0
- package/package.json +1 -1
- package/dist/pro.all.min.css +0 -1
- package/dist/pro.xconsole.min.css +0 -1
- package/es/actions/quick.d.ts +0 -2
- package/es/actions/quick.js +0 -26
- package/es/card/xconsole.scss +0 -3
- package/es/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/es/form/ProForm/addCascadeEffect.js +0 -203
- package/es/next-xconsole.scss +0 -34
- package/es/page-header/xconsole.scss +0 -5
- package/es/table/components/CardView/index.d.ts +0 -5
- package/es/table/components/CardView/index.js +0 -392
- package/es/table/components/CardView/index.scss +0 -46
- package/es/table/components/LoadMore/index.d.ts +0 -20
- package/es/table/components/LoadMore/index.js +0 -88
- package/es/table/components/LoadMore/index.scss +0 -19
- package/es/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/es/table/components/ToolBar/CardSwitch.js +0 -52
- package/es/table/utils/util.d.ts +0 -5
- package/es/table/utils/util.js +0 -19
- package/es/xconsole.scss +0 -503
- package/lib/actions/quick.d.ts +0 -2
- package/lib/actions/quick.js +0 -33
- package/lib/card/xconsole.scss +0 -3
- package/lib/form/ProForm/addCascadeEffect.d.ts +0 -2
- package/lib/form/ProForm/addCascadeEffect.js +0 -210
- package/lib/next-xconsole.scss +0 -34
- package/lib/page-header/xconsole.scss +0 -5
- package/lib/table/components/CardView/index.d.ts +0 -5
- package/lib/table/components/CardView/index.js +0 -402
- package/lib/table/components/CardView/index.scss +0 -46
- package/lib/table/components/LoadMore/index.d.ts +0 -20
- package/lib/table/components/LoadMore/index.js +0 -99
- package/lib/table/components/LoadMore/index.scss +0 -19
- package/lib/table/components/ToolBar/CardSwitch.d.ts +0 -8
- package/lib/table/components/ToolBar/CardSwitch.js +0 -60
- package/lib/table/utils/util.d.ts +0 -5
- package/lib/table/utils/util.js +0 -25
- package/lib/xconsole.scss +0 -503
package/es/index.d.ts
CHANGED
@@ -28,5 +28,5 @@ export * from './table';
|
|
28
28
|
export * from './sidebar';
|
29
29
|
export * from './utils';
|
30
30
|
export * from './timeline';
|
31
|
-
declare const version = "1.
|
31
|
+
declare const version = "1.4.25-bugfix.3";
|
32
32
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
var _window;
|
2
|
+
|
2
3
|
import ProAction from './actions';
|
3
4
|
import ProCard from './card';
|
4
5
|
import ProField from './field';
|
5
6
|
import ProForm from './form';
|
6
7
|
import hooks from './hooks';
|
7
|
-
import ProInfo from './info';
|
8
|
-
|
8
|
+
import ProInfo from './info'; // import ProLayout from './layout';
|
9
|
+
|
9
10
|
import ProPageContainer from './page-container';
|
10
11
|
import ProPageHeader from './page-header';
|
11
12
|
import ProTable from './table';
|
@@ -16,12 +17,12 @@ import { ProTimeline } from './timeline';
|
|
16
17
|
import * as nocode from './nocode';
|
17
18
|
import * as templates from './templates';
|
18
19
|
import TeamixIcon from '@teamix/icon';
|
19
|
-
import './global.scss';
|
20
|
-
|
21
|
-
// @ts-ignore
|
20
|
+
import './global.scss'; // 设置图标源
|
21
|
+
|
22
22
|
if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
|
23
23
|
TeamixIcon.setConfig(utils.getTeamixIconConfig());
|
24
24
|
}
|
25
|
+
|
25
26
|
export * from './actions';
|
26
27
|
export * from './card';
|
27
28
|
export * from './field';
|
@@ -35,17 +36,6 @@ export * from './table';
|
|
35
36
|
export * from './sidebar';
|
36
37
|
export * from './utils';
|
37
38
|
export * from './timeline';
|
38
|
-
var version = '1.
|
39
|
-
//
|
40
|
-
window.postMessage({
|
41
|
-
source: 'teamix-test-devtools',
|
42
|
-
url: window.location.href,
|
43
|
-
event: 'getModuleInfo',
|
44
|
-
moduleName: '@teamix/pro',
|
45
|
-
moduleVersion: version,
|
46
|
-
moduleType: 'TeamixPro',
|
47
|
-
componentName: 'TeamixPro'
|
48
|
-
}, '*');
|
49
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo,
|
50
|
-
// ProLayout,
|
39
|
+
var version = '1.4.25-bugfix.3';
|
40
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
51
41
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
|
@@ -1,41 +1,50 @@
|
|
1
1
|
var _excluded = ["children", "url", "method", "params", "formatResult", "onSuccess", "onError", "formatParams", "beforeRequest", "extendParams", "className", "compacted", "divider", "style", "backgroundColor", "context"];
|
2
|
+
|
2
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
|
+
|
3
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
|
+
|
4
7
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
+
|
5
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
|
6
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
|
+
|
7
13
|
import React, { isValidElement, useRef } from 'react';
|
8
14
|
import { ProInfoGroupContext } from '../../utils';
|
9
15
|
import { useSize } from '@teamix/hooks';
|
10
16
|
import './index.scss';
|
11
17
|
import cls from 'classnames';
|
12
18
|
import ProInfo from '../..';
|
19
|
+
|
13
20
|
var ProInfoGroup = function ProInfoGroup(props) {
|
14
21
|
var children = props.children,
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
url = props.url,
|
23
|
+
method = props.method,
|
24
|
+
params = props.params,
|
25
|
+
formatResult = props.formatResult,
|
26
|
+
onSuccess = props.onSuccess,
|
27
|
+
onError = props.onError,
|
28
|
+
formatParams = props.formatParams,
|
29
|
+
beforeRequest = props.beforeRequest,
|
30
|
+
extendParams = props.extendParams,
|
31
|
+
_props$className = props.className,
|
32
|
+
className = _props$className === void 0 ? '' : _props$className,
|
33
|
+
_props$compacted = props.compacted,
|
34
|
+
compacted = _props$compacted === void 0 ? true : _props$compacted,
|
35
|
+
_props$divider = props.divider,
|
36
|
+
divider = _props$divider === void 0 ? true : _props$divider,
|
37
|
+
style = props.style,
|
38
|
+
_props$backgroundColo = props.backgroundColor,
|
39
|
+
backgroundColor = _props$backgroundColo === void 0 ? '' : _props$backgroundColo,
|
40
|
+
_props$context = props.context,
|
41
|
+
context = _props$context === void 0 ? {} : _props$context,
|
42
|
+
others = _objectWithoutProperties(props, _excluded);
|
43
|
+
|
36
44
|
var ref = useRef();
|
37
45
|
var size = useSize(ref);
|
38
46
|
var infoType = 'infoDom';
|
47
|
+
|
39
48
|
if (Array.isArray(children)) {
|
40
49
|
if ( /*#__PURE__*/isValidElement(children === null || children === void 0 ? void 0 : children[0])) {
|
41
50
|
infoType = 'infoDomGroup';
|
@@ -43,6 +52,7 @@ var ProInfoGroup = function ProInfoGroup(props) {
|
|
43
52
|
infoType = 'infoPropsGroup';
|
44
53
|
}
|
45
54
|
}
|
55
|
+
|
46
56
|
var providerValue = {
|
47
57
|
visible: true,
|
48
58
|
size: size,
|
@@ -83,4 +93,5 @@ var ProInfoGroup = function ProInfoGroup(props) {
|
|
83
93
|
className: proInfoClassName
|
84
94
|
}, children)));
|
85
95
|
};
|
96
|
+
|
86
97
|
export default ProInfoGroup;
|
@@ -1,19 +1,35 @@
|
|
1
1
|
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource", "context", "props"];
|
2
|
+
|
2
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
|
+
|
3
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
6
|
+
|
4
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
8
|
+
|
5
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
10
|
+
|
6
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
12
|
+
|
7
13
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
14
|
+
|
8
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
16
|
+
|
9
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
18
|
+
|
10
19
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
20
|
+
|
11
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
22
|
+
|
12
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
24
|
+
|
13
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
26
|
+
|
14
27
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
28
|
+
|
15
29
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
30
|
+
|
16
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
32
|
+
|
17
33
|
import TeamixIcon from '@teamix/icon';
|
18
34
|
import ProField from '../../../field';
|
19
35
|
import { usePrefixCls, getTargetValue, request } from '@teamix/utils';
|
@@ -25,49 +41,56 @@ import { Message } from '@alicloudfe/components';
|
|
25
41
|
import { ProActionGroup } from '../../../actions';
|
26
42
|
var cls = usePrefixCls('teamix-pro-info');
|
27
43
|
var toJS = formilyReactive.toJS;
|
44
|
+
|
28
45
|
var InfoValueItem = function InfoValueItem(props) {
|
29
46
|
var _props$type = props.type,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
47
|
+
type = _props$type === void 0 ? 'text' : _props$type,
|
48
|
+
value = props.value,
|
49
|
+
render = props.render,
|
50
|
+
infoItem = props.infoItem,
|
51
|
+
record = props.record,
|
52
|
+
actionRef = props.actionRef,
|
53
|
+
dataSource = props.dataSource,
|
54
|
+
context = props.context,
|
55
|
+
fieldProps = props.props,
|
56
|
+
others = _objectWithoutProperties(props, _excluded);
|
57
|
+
|
40
58
|
var dataIndex = infoItem.dataIndex,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
59
|
+
isEdit = infoItem.isEdit,
|
60
|
+
editOnCancel = infoItem.editOnCancel,
|
61
|
+
editOnOk = infoItem.editOnOk,
|
62
|
+
editUrl = infoItem.editUrl,
|
63
|
+
editFormatParams = infoItem.editFormatParams,
|
64
|
+
_infoItem$editMethod = infoItem.editMethod,
|
65
|
+
editMethod = _infoItem$editMethod === void 0 ? 'post' : _infoItem$editMethod,
|
66
|
+
_infoItem$successMess = infoItem.successMessage,
|
67
|
+
successMessage = _infoItem$successMess === void 0 ? 'success' : _infoItem$successMess,
|
68
|
+
actions = infoItem.actions,
|
69
|
+
extra = infoItem.extra,
|
70
|
+
valueType = infoItem.valueType,
|
71
|
+
_infoItem$editProForm = infoItem.editProFormProps,
|
72
|
+
editProFormProps = _infoItem$editProForm === void 0 ? {} : _infoItem$editProForm; // 获取配置
|
73
|
+
|
56
74
|
var getInfoItemProps = function getInfoItemProps(prop) {
|
57
75
|
if (typeof prop === 'function') {
|
58
76
|
return prop === null || prop === void 0 ? void 0 : prop(value, record);
|
59
77
|
}
|
78
|
+
|
60
79
|
return prop;
|
61
|
-
};
|
62
|
-
|
80
|
+
}; // 获取处理过的 render
|
81
|
+
|
82
|
+
|
63
83
|
var getRender = function getRender() {
|
64
84
|
var _processRenderFunctio;
|
85
|
+
|
65
86
|
if (typeof render === 'function') {
|
66
87
|
return function () {
|
67
88
|
return render(value, record);
|
68
89
|
};
|
69
90
|
}
|
91
|
+
|
70
92
|
var newRender = processBuriedPoint((_processRenderFunctio = processRenderFunction(render !== null && render !== void 0 ? render : {}, value, record)) !== null && _processRenderFunctio !== void 0 ? _processRenderFunctio : {}, value, record);
|
93
|
+
|
71
94
|
if (valueType === 'selectGroup') {
|
72
95
|
newRender = _objectSpread(_objectSpread({
|
73
96
|
maxShowNumber: 'auto',
|
@@ -76,8 +99,10 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
76
99
|
ellipsis: false
|
77
100
|
});
|
78
101
|
}
|
102
|
+
|
79
103
|
return newRender;
|
80
104
|
};
|
105
|
+
|
81
106
|
var getFieldProps = function getFieldProps() {
|
82
107
|
if (valueType === 'selectGroup') {
|
83
108
|
return _objectSpread({
|
@@ -88,46 +113,56 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
88
113
|
layout: 'compact'
|
89
114
|
}, fieldProps);
|
90
115
|
}
|
116
|
+
|
91
117
|
return fieldProps;
|
92
|
-
};
|
93
|
-
|
118
|
+
}; // 获取处理过的 dataSource
|
119
|
+
|
120
|
+
|
94
121
|
var getDataSource = function getDataSource() {
|
95
122
|
var newDataSource = null;
|
123
|
+
|
96
124
|
if (typeof dataSource === 'function') {
|
97
125
|
newDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource(value, record);
|
98
126
|
} else {
|
99
127
|
newDataSource = (dataSource !== null && dataSource !== void 0 ? dataSource : []).map(function (item) {
|
100
128
|
return Object.fromEntries(Object.entries(item).map(function (_ref) {
|
101
129
|
var _ref2 = _slicedToArray(_ref, 2),
|
102
|
-
|
103
|
-
|
130
|
+
k = _ref2[0],
|
131
|
+
v = _ref2[1];
|
132
|
+
|
104
133
|
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
105
134
|
value: value
|
106
135
|
}, context))];
|
107
136
|
}));
|
108
137
|
});
|
109
138
|
}
|
139
|
+
|
110
140
|
return newDataSource;
|
111
|
-
};
|
112
|
-
|
141
|
+
}; // 浮层的显隐状态
|
142
|
+
|
143
|
+
|
113
144
|
var _useState = useState(false),
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
145
|
+
_useState2 = _slicedToArray(_useState, 2),
|
146
|
+
popConfirmVisible = _useState2[0],
|
147
|
+
setPopConfirmVisible = _useState2[1]; // 确认按钮的loading状态
|
148
|
+
|
149
|
+
|
118
150
|
var _useState3 = useState(false),
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
151
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
152
|
+
confirmLoading = _useState4[0],
|
153
|
+
setConfirmLoading = _useState4[1]; // edit 的显隐状态
|
154
|
+
|
155
|
+
|
123
156
|
var _useState5 = useState(false),
|
124
|
-
|
125
|
-
|
126
|
-
|
157
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
158
|
+
editVisible = _useState6[0],
|
159
|
+
setEditVisible = _useState6[1];
|
160
|
+
|
127
161
|
var requestDataKey = editMethod.toLowerCase() === 'get' ? 'params' : 'data';
|
128
162
|
var dataFilterForm = useMemo(function () {
|
129
163
|
return createForm();
|
130
164
|
}, []);
|
165
|
+
|
131
166
|
var renderAction = function renderAction() {
|
132
167
|
if (actions) {
|
133
168
|
return /*#__PURE__*/React.createElement(ProActionGroup, {
|
@@ -139,6 +174,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
139
174
|
context: _objectSpread({}, context)
|
140
175
|
});
|
141
176
|
}
|
177
|
+
|
142
178
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
143
179
|
};
|
144
180
|
/**
|
@@ -148,24 +184,31 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
148
184
|
* @param record table cell record
|
149
185
|
* @returns
|
150
186
|
*/
|
187
|
+
|
188
|
+
|
151
189
|
var processRenderFunction = function processRenderFunction(render, value, record) {
|
152
190
|
var external = ['linkOnClick', 'link', 'value'];
|
153
191
|
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
154
192
|
var _ref4 = _slicedToArray(_ref3, 2),
|
155
|
-
|
156
|
-
|
193
|
+
k = _ref4[0],
|
194
|
+
v = _ref4[1];
|
195
|
+
|
157
196
|
if (typeof v === 'function') {
|
158
197
|
var _v;
|
198
|
+
|
159
199
|
if (external.includes(k)) {
|
160
200
|
return [k, function () {
|
161
201
|
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
162
202
|
others[_key] = arguments[_key];
|
163
203
|
}
|
204
|
+
|
164
205
|
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, record].concat(others));
|
165
206
|
}];
|
166
207
|
}
|
208
|
+
|
167
209
|
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, record)) !== null && _v !== void 0 ? _v : ''];
|
168
210
|
}
|
211
|
+
|
169
212
|
return [k, v];
|
170
213
|
}));
|
171
214
|
};
|
@@ -175,21 +218,24 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
175
218
|
* @param record table cell record
|
176
219
|
* @returns
|
177
220
|
*/
|
221
|
+
|
222
|
+
|
178
223
|
var processBuriedPoint = function processBuriedPoint(render, value, record) {
|
179
|
-
return Object.fromEntries([
|
180
|
-
// 默认 ellipsis、descriptionEllipsis 为 true
|
224
|
+
return Object.fromEntries([// 默认 ellipsis、descriptionEllipsis 为 true
|
181
225
|
// emptyText 默认为 '-'
|
182
226
|
['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
|
183
227
|
var _ref6 = _slicedToArray(_ref5, 2),
|
184
|
-
|
185
|
-
|
228
|
+
k = _ref6[0],
|
229
|
+
v = _ref6[1];
|
230
|
+
|
186
231
|
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
187
232
|
record: record,
|
188
233
|
value: value
|
189
234
|
}))];
|
190
235
|
}))));
|
191
|
-
};
|
192
|
-
|
236
|
+
}; // 重写编辑逻辑替代field原有逻辑
|
237
|
+
|
238
|
+
|
193
239
|
if (getInfoItemProps(isEdit)) {
|
194
240
|
// 渲染表单
|
195
241
|
var renderContent = function renderContent() {
|
@@ -202,33 +248,35 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
202
248
|
}],
|
203
249
|
form: dataFilterForm
|
204
250
|
}, getInfoItemProps(editProFormProps)));
|
205
|
-
};
|
206
|
-
|
251
|
+
}; // 表单提交
|
252
|
+
|
253
|
+
|
207
254
|
var onConfirm = function onConfirm(e) {
|
208
|
-
var formData = toJS(dataFilterForm.values);
|
209
|
-
|
255
|
+
var formData = toJS(dataFilterForm.values); // 如果传入了 editUrl 则内置请求
|
256
|
+
|
210
257
|
if (editUrl) {
|
211
258
|
setConfirmLoading(true);
|
212
259
|
var params = formData;
|
260
|
+
|
213
261
|
if (editFormatParams) {
|
214
262
|
params = editFormatParams === null || editFormatParams === void 0 ? void 0 : editFormatParams(formData, record);
|
215
263
|
}
|
264
|
+
|
216
265
|
request(_defineProperty({
|
217
266
|
url: editUrl,
|
218
267
|
method: editMethod
|
219
268
|
}, requestDataKey, params)).then(function (resp) {
|
220
269
|
var _actionRef$current, _actionRef$current$re;
|
270
|
+
|
221
271
|
Message.success(successMessage);
|
222
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.refresh) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current);
|
223
|
-
|
224
|
-
}).
|
225
|
-
// TODO 暂时不处理。是否需要开放函数?
|
226
|
-
}).finally(function () {
|
227
|
-
// setConfirmLoading(false);
|
272
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.refresh) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current); // setEditVisible(!editVisible);
|
273
|
+
}).catch(function (error) {// TODO 暂时不处理。是否需要开放函数?
|
274
|
+
}).finally(function () {// setConfirmLoading(false);
|
228
275
|
});
|
229
276
|
}
|
230
|
-
|
231
|
-
// 重写了 editOnOk
|
277
|
+
|
278
|
+
var okResult = editOnOk === null || editOnOk === void 0 ? void 0 : editOnOk(formData, e); // 重写了 editOnOk
|
279
|
+
|
232
280
|
if (okResult instanceof Promise) {
|
233
281
|
setConfirmLoading(true);
|
234
282
|
okResult.then(function () {
|
@@ -240,10 +288,12 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
240
288
|
setPopConfirmVisible(!popConfirmVisible);
|
241
289
|
setEditVisible(!editVisible);
|
242
290
|
}
|
243
|
-
};
|
244
|
-
|
291
|
+
}; // 取消
|
292
|
+
|
293
|
+
|
245
294
|
var onCancel = function onCancel(e) {
|
246
295
|
var formData = toJS(dataFilterForm.values);
|
296
|
+
|
247
297
|
if (editOnCancel) {
|
248
298
|
editOnCancel === null || editOnCancel === void 0 ? void 0 : editOnCancel(formData, e);
|
249
299
|
setPopConfirmVisible(!popConfirmVisible);
|
@@ -253,6 +303,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
253
303
|
setEditVisible(!editVisible);
|
254
304
|
}
|
255
305
|
};
|
306
|
+
|
256
307
|
return /*#__PURE__*/React.createElement("div", {
|
257
308
|
className: cls('edit'),
|
258
309
|
onMouseEnter: function onMouseEnter() {
|
@@ -290,6 +341,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
290
341
|
})
|
291
342
|
}), renderAction(), extra && extra);
|
292
343
|
}
|
344
|
+
|
293
345
|
return /*#__PURE__*/React.createElement("div", {
|
294
346
|
className: cls('item-value')
|
295
347
|
}, /*#__PURE__*/React.createElement(ProField, _objectSpread(_objectSpread({
|
@@ -299,4 +351,5 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
299
351
|
dataSource: getDataSource()
|
300
352
|
}, others), getFieldProps())), renderAction(), extra && extra);
|
301
353
|
};
|
354
|
+
|
302
355
|
export default InfoValueItem;
|
@@ -6,34 +6,39 @@ import { Ellipsis, LabelIconTip } from '../../../field';
|
|
6
6
|
import './index.scss';
|
7
7
|
var cls = usePrefixCls('teamix-pro-info-item');
|
8
8
|
var Row = Grid.Row,
|
9
|
-
|
9
|
+
Col = Grid.Col;
|
10
|
+
|
10
11
|
var ProInfoItem = function ProInfoItem(prop) {
|
11
12
|
var value = prop.value,
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
label = prop.label,
|
14
|
+
baseInfoLayout = prop.baseInfoLayout,
|
15
|
+
headerInfoLayout = prop.headerInfoLayout,
|
16
|
+
loading = prop.loading,
|
17
|
+
tooltip = prop.tooltip,
|
18
|
+
tooltipIcon = prop.tooltipIcon,
|
19
|
+
valueType = prop.valueType,
|
20
|
+
render = prop.render,
|
21
|
+
alignItems = prop.alignItems; // 判断是否需要居中
|
22
|
+
|
22
23
|
var isAlignItemsCenter = function isAlignItemsCenter() {
|
23
24
|
if (typeof render !== 'function') {
|
24
25
|
var type = render === null || render === void 0 ? void 0 : render.type;
|
26
|
+
|
25
27
|
if (valueType === 'selectGroup') {
|
26
28
|
return true;
|
27
29
|
}
|
30
|
+
|
28
31
|
if (type === 'tag' || type === 'statusIconTag' || type === 'eventLevelTag' || type === 'warningLevelTag') {
|
29
32
|
return true;
|
30
33
|
}
|
31
34
|
}
|
35
|
+
|
32
36
|
return false;
|
33
37
|
};
|
38
|
+
|
34
39
|
if (baseInfoLayout) {
|
35
40
|
var labelCol = baseInfoLayout.labelCol,
|
36
|
-
|
41
|
+
wrapperCol = baseInfoLayout.wrapperCol;
|
37
42
|
return /*#__PURE__*/React.createElement("div", {
|
38
43
|
className: cls('')
|
39
44
|
}, /*#__PURE__*/React.createElement(Row, {
|
@@ -61,9 +66,10 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
61
66
|
className: cls('base-skeleton-box')
|
62
67
|
}, /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null)), !loading && value)));
|
63
68
|
}
|
69
|
+
|
64
70
|
if (headerInfoLayout) {
|
65
71
|
var _headerInfoLayout$lab = headerInfoLayout.labelGutter,
|
66
|
-
|
72
|
+
labelGutter = _headerInfoLayout$lab === void 0 ? '16px' : _headerInfoLayout$lab;
|
67
73
|
return /*#__PURE__*/React.createElement("div", {
|
68
74
|
className: cls()
|
69
75
|
}, /*#__PURE__*/React.createElement(Row, {
|
@@ -87,6 +93,8 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
87
93
|
className: cls('base-skeleton-box')
|
88
94
|
}, /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null)), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, value))));
|
89
95
|
}
|
96
|
+
|
90
97
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
91
98
|
};
|
99
|
+
|
92
100
|
export default ProInfoItem;
|