@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/lib/actions/index.js
CHANGED
@@ -3,172 +3,212 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
var _exportNames = {
|
7
|
-
registerActionHandler: true,
|
8
|
-
useAction: true,
|
9
|
-
ProActionButton: true,
|
10
|
-
ProActionMenuButton: true,
|
11
|
-
ProActionGroup: true,
|
12
|
-
ActionGroup: true,
|
13
|
-
ActionButton: true,
|
14
|
-
ActionMenuButton: true
|
15
|
-
};
|
16
6
|
exports.ProActionButton = exports.ActionMenuButton = exports.ActionGroup = exports.ActionButton = void 0;
|
17
7
|
exports.ProActionGroup = ProActionGroup;
|
18
8
|
exports.default = exports.ProActionMenuButton = void 0;
|
19
9
|
exports.registerActionHandler = registerActionHandler;
|
20
10
|
exports.useAction = useAction;
|
11
|
+
|
21
12
|
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
22
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
15
|
+
|
23
16
|
var _components = require("@alicloudfe/components");
|
17
|
+
|
24
18
|
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
19
|
+
|
25
20
|
var _utils = require("@teamix/utils");
|
21
|
+
|
26
22
|
var _link = require("./link");
|
23
|
+
|
27
24
|
var _request = require("./request");
|
25
|
+
|
28
26
|
var _dialog = require("./dialog");
|
27
|
+
|
29
28
|
var _confirm = require("./confirm");
|
29
|
+
|
30
30
|
var _dangerConfirm = require("./danger-confirm");
|
31
|
+
|
31
32
|
var _notice = require("./notice");
|
33
|
+
|
32
34
|
var _error = require("./error");
|
35
|
+
|
33
36
|
var _dialogForm = require("./dialog-form");
|
37
|
+
|
34
38
|
var _dialogTable = require("./dialog-table");
|
39
|
+
|
35
40
|
var _dialogInfo = require("./dialog-info");
|
41
|
+
|
36
42
|
var _drawer = require("./drawer");
|
43
|
+
|
37
44
|
var _drawerForm = require("./drawer-form");
|
45
|
+
|
38
46
|
var _drawerTable = require("./drawer-table");
|
47
|
+
|
39
48
|
var _drawerInfo = require("./drawer-info");
|
49
|
+
|
40
50
|
var _popConfirm = require("./pop-confirm");
|
51
|
+
|
41
52
|
var _dangerPopConfirm = require("./danger-pop-confirm");
|
53
|
+
|
42
54
|
require("./index.scss");
|
43
|
-
|
44
|
-
Object.keys(_quick).forEach(function (key) {
|
45
|
-
if (key === "default" || key === "__esModule") return;
|
46
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
47
|
-
if (key in exports && exports[key] === _quick[key]) return;
|
48
|
-
Object.defineProperty(exports, key, {
|
49
|
-
enumerable: true,
|
50
|
-
get: function get() {
|
51
|
-
return _quick[key];
|
52
|
-
}
|
53
|
-
});
|
54
|
-
});
|
55
|
+
|
55
56
|
var _excluded = ["type"],
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "disabled", "onClick", "tooltip", "disabledTooltip", "tooltipProps"],
|
58
|
+
_excluded3 = ["loading"],
|
59
|
+
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
|
60
|
+
_excluded5 = ["context", "text"],
|
61
|
+
_excluded6 = ["key", "actions"],
|
62
|
+
_excluded7 = ["key", "config"],
|
63
|
+
_excluded8 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
|
64
|
+
|
63
65
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
66
|
+
|
64
67
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
68
|
+
|
65
69
|
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."); }
|
70
|
+
|
66
71
|
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); }
|
72
|
+
|
67
73
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
74
|
+
|
68
75
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
76
|
+
|
69
77
|
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; }
|
78
|
+
|
70
79
|
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; }
|
80
|
+
|
71
81
|
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; }
|
82
|
+
|
72
83
|
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; }
|
84
|
+
|
73
85
|
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; }
|
86
|
+
|
74
87
|
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; }
|
88
|
+
|
75
89
|
var RegistedActions = new Map();
|
90
|
+
|
76
91
|
function registerActionHandler(id, extendActionId, defaultConfig) {
|
77
92
|
RegistedActions.set(id, {
|
78
93
|
extendActionId: extendActionId,
|
79
94
|
defaultConfig: defaultConfig
|
80
95
|
});
|
81
96
|
}
|
97
|
+
|
82
98
|
function useAction(config, context) {
|
83
99
|
if (!config) {
|
84
100
|
return {};
|
85
101
|
}
|
102
|
+
|
86
103
|
var type = config.type,
|
87
|
-
|
104
|
+
others = _objectWithoutProperties(config, _excluded);
|
105
|
+
|
88
106
|
if (type === 'request') {
|
89
107
|
return (0, _request.useRequestAction)(others, context);
|
90
108
|
}
|
109
|
+
|
91
110
|
if (type === 'link') {
|
92
111
|
return (0, _link.useLinkAction)(others, context);
|
93
112
|
}
|
113
|
+
|
94
114
|
if (type === 'dialog') {
|
95
115
|
return (0, _dialog.useDialogAction)(others, context);
|
96
116
|
}
|
117
|
+
|
97
118
|
if (type === 'confirm') {
|
98
119
|
return (0, _confirm.useConfirmAction)(others, context);
|
99
120
|
}
|
121
|
+
|
100
122
|
if (type === 'danger-confirm') {
|
101
123
|
return (0, _dangerConfirm.useDangerConfirmAction)(others, context);
|
102
124
|
}
|
125
|
+
|
103
126
|
if (type === 'notice') {
|
104
127
|
return (0, _notice.useNoticeAction)(others, context);
|
105
128
|
}
|
129
|
+
|
106
130
|
if (type === 'error') {
|
107
131
|
return (0, _error.useErrorAction)(others, context);
|
108
132
|
}
|
133
|
+
|
109
134
|
if (type === 'dialog-form') {
|
110
135
|
return (0, _dialogForm.useDialogFormAction)(others, context);
|
111
136
|
}
|
137
|
+
|
112
138
|
if (type === 'dialog-table') {
|
113
139
|
return (0, _dialogTable.useDialogTableAction)(others, context);
|
114
140
|
}
|
141
|
+
|
115
142
|
if (type === 'dialog-info') {
|
116
143
|
return (0, _dialogInfo.useDialogInfoAction)(others, context);
|
117
144
|
}
|
145
|
+
|
118
146
|
if (type === 'drawer') {
|
119
147
|
return (0, _drawer.useDrawerAction)(others, context);
|
120
148
|
}
|
149
|
+
|
121
150
|
if (type === 'drawer-form') {
|
122
151
|
return (0, _drawerForm.useDrawerFormAction)(others, context);
|
123
152
|
}
|
153
|
+
|
124
154
|
if (type === 'drawer-table') {
|
125
155
|
return (0, _drawerTable.useDrawerTableAction)(others, context);
|
126
156
|
}
|
157
|
+
|
127
158
|
if (type === 'drawer-info') {
|
128
159
|
return (0, _drawerInfo.useDrawerInfoAction)(others, context);
|
129
160
|
}
|
161
|
+
|
130
162
|
if (type === 'pop-confirm') {
|
131
163
|
return (0, _popConfirm.usePopConfirmAction)(others, context);
|
132
164
|
}
|
165
|
+
|
133
166
|
if (type === 'danger-pop-confirm') {
|
134
167
|
return (0, _dangerPopConfirm.useDangerPopConfirmAction)(others, context);
|
135
168
|
}
|
169
|
+
|
136
170
|
var registedAction = RegistedActions.get(type);
|
171
|
+
|
137
172
|
if (!registedAction) {
|
138
173
|
return {};
|
139
174
|
}
|
175
|
+
|
140
176
|
return useAction(_objectSpread(_objectSpread({
|
141
177
|
type: registedAction.extendActionId
|
142
178
|
}, registedAction.defaultConfig), others), context);
|
143
179
|
}
|
180
|
+
|
144
181
|
var buttonContent = function buttonContent(content, iconType, iconSize, context) {
|
145
182
|
var renderedContent = typeof content === 'function' ? content(context) : content;
|
183
|
+
|
146
184
|
if (!iconType) {
|
147
185
|
return renderedContent;
|
148
186
|
}
|
187
|
+
|
149
188
|
return [/*#__PURE__*/_react.default.createElement(_icon.default, {
|
150
189
|
type: iconType,
|
151
190
|
size: iconSize,
|
152
191
|
key: "teamix-button-icon"
|
153
192
|
}), renderedContent];
|
154
193
|
};
|
194
|
+
|
155
195
|
var ProActionButton = function ProActionButton(props) {
|
156
196
|
var config = props.config,
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
197
|
+
icon = props.icon,
|
198
|
+
_props$iconSize = props.iconSize,
|
199
|
+
iconSize = _props$iconSize === void 0 ? 'medium' : _props$iconSize,
|
200
|
+
_props$type = props.type,
|
201
|
+
type = _props$type === void 0 ? 'primary' : _props$type,
|
202
|
+
context = props.context,
|
203
|
+
children = props.children,
|
204
|
+
visible = props.visible,
|
205
|
+
disabled = props.disabled,
|
206
|
+
_onClick = props.onClick,
|
207
|
+
tooltip = props.tooltip,
|
208
|
+
disabledTooltip = props.disabledTooltip,
|
209
|
+
tooltipProps = props.tooltipProps,
|
210
|
+
others = _objectWithoutProperties(props, _excluded2);
|
211
|
+
|
172
212
|
var actionProps = useAction(config, context);
|
173
213
|
var buttonProps = _onClick ? _objectSpread(_objectSpread(_objectSpread({
|
174
214
|
disabled: disabled
|
@@ -179,17 +219,17 @@ var ProActionButton = function ProActionButton(props) {
|
|
179
219
|
}) : _objectSpread(_objectSpread({
|
180
220
|
disabled: disabled
|
181
221
|
}, actionProps), others);
|
182
|
-
|
183
|
-
buttonProps['data-teamix-spm'] = dataTeamixSpm;
|
184
|
-
}
|
222
|
+
|
185
223
|
var content = /*#__PURE__*/_react.default.createElement(_components.Button, _objectSpread({
|
186
224
|
type: type
|
187
225
|
}, buttonProps), buttonContent(children, icon, iconSize, context));
|
226
|
+
|
188
227
|
var baseToolTipProps = _objectSpread({
|
189
228
|
triggerType: 'hover',
|
190
229
|
align: 't',
|
191
230
|
trigger: content
|
192
231
|
}, tooltipProps);
|
232
|
+
|
193
233
|
if (tooltip || disabledTooltip) {
|
194
234
|
if (tooltip && !disabledTooltip) {
|
195
235
|
if (!disabled) {
|
@@ -204,22 +244,24 @@ var ProActionButton = function ProActionButton(props) {
|
|
204
244
|
content = /*#__PURE__*/_react.default.createElement(_components.Balloon.Tooltip, _objectSpread({}, baseToolTipProps), showToolTip);
|
205
245
|
}
|
206
246
|
}
|
247
|
+
|
207
248
|
return content;
|
208
249
|
};
|
250
|
+
|
209
251
|
exports.ProActionButton = ProActionButton;
|
252
|
+
|
210
253
|
var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
211
254
|
var action = props.action,
|
212
|
-
|
213
|
-
dataTeamixSpm = props['data-teamix-spm'];
|
255
|
+
context = props.context;
|
214
256
|
var config = action.config,
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
257
|
+
btnContext = action.context,
|
258
|
+
_onClick2 = action.onClick,
|
259
|
+
children = action.children,
|
260
|
+
icon = action.icon,
|
261
|
+
disabled = action.disabled,
|
262
|
+
tooltip = action.tooltip,
|
263
|
+
disabledTooltip = action.disabledTooltip,
|
264
|
+
tooltipProps = action.tooltipProps;
|
223
265
|
var basePrefix = (0, _utils.usePrefixCls)('', {
|
224
266
|
base: true
|
225
267
|
});
|
@@ -227,23 +269,24 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
227
269
|
var menuItemActionConfig = Object.assign({}, config, {
|
228
270
|
trigger: 'onClick'
|
229
271
|
});
|
272
|
+
|
230
273
|
var _useAction = useAction(menuItemActionConfig, btnContext || context),
|
231
|
-
|
232
|
-
|
274
|
+
loading = _useAction.loading,
|
275
|
+
menuItemProps = _objectWithoutProperties(_useAction, _excluded3);
|
276
|
+
|
233
277
|
var buttonProps = disabled ? {} : _onClick2 ? _objectSpread(_objectSpread({}, menuItemProps), {}, {
|
234
278
|
onClick: function onClick(e) {
|
235
279
|
return _onClick2(e, context);
|
236
280
|
}
|
237
281
|
}) : _objectSpread({}, menuItemProps);
|
238
|
-
if (dataTeamixSpm) {
|
239
|
-
buttonProps['data-teamix-spm'] = dataTeamixSpm;
|
240
|
-
}
|
241
282
|
var content = buttonContent(children, icon, undefined, context);
|
283
|
+
|
242
284
|
var baseToolTipProps = _objectSpread({
|
243
285
|
triggerType: 'hover',
|
244
286
|
align: 't',
|
245
287
|
trigger: content
|
246
288
|
}, tooltipProps);
|
289
|
+
|
247
290
|
if (tooltip || disabledTooltip) {
|
248
291
|
if (tooltip && !disabledTooltip) {
|
249
292
|
if (!disabled) {
|
@@ -258,44 +301,50 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
258
301
|
content = /*#__PURE__*/_react.default.createElement(_components.Balloon.Tooltip, _objectSpread({}, baseToolTipProps), showToolTip);
|
259
302
|
}
|
260
303
|
}
|
304
|
+
|
261
305
|
return /*#__PURE__*/_react.default.createElement("div", _objectSpread({
|
262
306
|
className: (0, _classnames.default)(_defineProperty({}, basePrefix('disabled'), disabled), basePrefix('menu-item'), prefixCls('menu-item'))
|
263
307
|
}, buttonProps), content);
|
264
308
|
};
|
265
|
-
|
309
|
+
|
310
|
+
function renderCommonActionButtonMenuItem(action, key, context) {
|
266
311
|
if (action.type === 'divider') {
|
267
312
|
return /*#__PURE__*/_react.default.createElement(_components.Menu.Divider, {
|
268
313
|
key: key
|
269
314
|
});
|
270
315
|
}
|
316
|
+
|
271
317
|
var menuBtn = action;
|
318
|
+
|
272
319
|
if (menuBtn.actions && menuBtn.actions.length && menuBtn.disabled !== true) {
|
273
320
|
return /*#__PURE__*/_react.default.createElement(_components.Menu.SubMenu, {
|
274
321
|
key: key,
|
275
322
|
label: menuBtn.label || menuBtn.children
|
276
323
|
}, menuBtn.actions.map(function (a) {
|
277
|
-
return renderCommonActionButtonMenuItem(a, a.key, context
|
324
|
+
return renderCommonActionButtonMenuItem(a, a.key, context);
|
278
325
|
}));
|
279
326
|
}
|
327
|
+
|
280
328
|
return /*#__PURE__*/_react.default.createElement(ProActionMenuButtonItem, {
|
281
329
|
key: key,
|
282
330
|
action: action,
|
283
|
-
context: context
|
284
|
-
"data-teamix-spm": "".concat(dataTeamixSpm, "-").concat(key)
|
331
|
+
context: context
|
285
332
|
});
|
286
333
|
}
|
334
|
+
|
287
335
|
var ProActionMenuButton = function ProActionMenuButton(props) {
|
288
336
|
var icon = props.icon,
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
337
|
+
iconSize = props.iconSize,
|
338
|
+
label = props.label,
|
339
|
+
actions = props.actions,
|
340
|
+
children = props.children,
|
341
|
+
context = props.context,
|
342
|
+
_props$type2 = props.type,
|
343
|
+
type = _props$type2 === void 0 ? 'primary' : _props$type2,
|
344
|
+
className = props.className,
|
345
|
+
noArrow = props.noArrow,
|
346
|
+
others = _objectWithoutProperties(props, _excluded4);
|
347
|
+
|
299
348
|
return /*#__PURE__*/_react.default.createElement(_components.MenuButton, _objectSpread({
|
300
349
|
popupTriggerType: "hover",
|
301
350
|
autoWidth: false,
|
@@ -312,57 +361,66 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
|
|
312
361
|
'teamix-pro-actions-text-menu-btn-no-arrow': noArrow
|
313
362
|
})
|
314
363
|
}, others), actions.map(function (action, i) {
|
315
|
-
return renderCommonActionButtonMenuItem(action, action.key || i, context
|
364
|
+
return renderCommonActionButtonMenuItem(action, action.key || i, context);
|
316
365
|
}));
|
317
|
-
};
|
318
|
-
|
366
|
+
}; // 超出 max,则折叠起来
|
367
|
+
|
368
|
+
|
319
369
|
exports.ProActionMenuButton = ProActionMenuButton;
|
370
|
+
|
320
371
|
function foldExtraActions(actions, max, moreConfig) {
|
321
372
|
if (actions.length <= max) {
|
322
373
|
return actions;
|
323
374
|
}
|
375
|
+
|
324
376
|
return [].concat(_toConsumableArray(actions.slice(0, max - 1)), [_objectSpread(_objectSpread({
|
325
377
|
key: '__teamix_pro_action_group_more_btn'
|
326
378
|
}, moreConfig), {}, {
|
327
379
|
actions: actions.slice(max - 1)
|
328
380
|
})]);
|
329
|
-
}
|
330
|
-
// 如果 actions 数量超过了 max,则把第 max 个和剩余超出部分折叠起来成为一个 menu
|
381
|
+
} // 如果 actions 数量超过了 max,则把第 max 个和剩余超出部分折叠起来成为一个 menu
|
331
382
|
// divider 不计数
|
383
|
+
|
384
|
+
|
332
385
|
function formatGroupActions(actions, max, moreConfig) {
|
333
386
|
var MAX = max < 1 ? MAX_ACTTIONS : max;
|
334
387
|
var count = 0;
|
335
388
|
var index = 0;
|
389
|
+
|
336
390
|
for (; index < actions.length && count < MAX; index++) {
|
337
391
|
if (actions[index].type !== 'divider') {
|
338
392
|
count += 1;
|
339
393
|
}
|
340
394
|
}
|
395
|
+
|
341
396
|
return foldExtraActions(actions, Math.max(index, MAX), moreConfig);
|
342
|
-
}
|
343
|
-
|
344
|
-
|
397
|
+
} // 渲染一个 button 或者 menu button
|
398
|
+
|
399
|
+
|
400
|
+
function renderCommonActionButton(button, context, isTypeText) {
|
345
401
|
if (button.type === 'divider') {
|
346
402
|
return /*#__PURE__*/_react.default.createElement(_components.Divider, {
|
347
403
|
key: button.key,
|
348
404
|
direction: "ver"
|
349
405
|
});
|
350
406
|
}
|
407
|
+
|
351
408
|
var buttonContext = button.context,
|
352
|
-
|
353
|
-
|
409
|
+
text = button.text,
|
410
|
+
others = _objectWithoutProperties(button, _excluded5);
|
411
|
+
|
354
412
|
var buttonProps = _objectSpread({
|
355
413
|
context: Object.assign({}, context, buttonContext),
|
356
414
|
text: text || isTypeText
|
357
415
|
}, others);
|
358
|
-
|
359
|
-
buttonProps['data-teamix-spm'] = dataTeamixSpm;
|
360
|
-
}
|
416
|
+
|
361
417
|
if (!button.actions) {
|
362
418
|
return /*#__PURE__*/_react.default.createElement(ProActionButton, _objectSpread({}, buttonProps));
|
363
419
|
}
|
420
|
+
|
364
421
|
return /*#__PURE__*/_react.default.createElement(ProActionMenuButton, _objectSpread({}, buttonProps));
|
365
422
|
}
|
423
|
+
|
366
424
|
function getDefaultMoreButton(type, more) {
|
367
425
|
var defaultConfig = type === 'button' ? {
|
368
426
|
children: (0, _utils.getMessage)('more')
|
@@ -371,29 +429,38 @@ function getDefaultMoreButton(type, more) {
|
|
371
429
|
autoWidth: false,
|
372
430
|
noArrow: true
|
373
431
|
};
|
432
|
+
|
374
433
|
if (!more) {
|
375
434
|
return defaultConfig;
|
376
435
|
}
|
436
|
+
|
377
437
|
var moreConfig = typeof more === 'string' ? {
|
378
438
|
children: more
|
379
439
|
} : more;
|
440
|
+
|
380
441
|
if (type === 'button') {
|
381
442
|
return Object.assign(defaultConfig, moreConfig);
|
382
443
|
}
|
444
|
+
|
383
445
|
return moreConfig;
|
384
446
|
}
|
447
|
+
|
385
448
|
var MAX_ACTTIONS = 4;
|
449
|
+
|
386
450
|
function getKey(index, key) {
|
387
451
|
if (key !== undefined) {
|
388
452
|
return key;
|
389
453
|
}
|
454
|
+
|
390
455
|
return "__teamix_pro_action_key_".concat(index);
|
391
456
|
}
|
457
|
+
|
392
458
|
function getActionConfig(action, index, context) {
|
393
459
|
if (action.actions) {
|
394
460
|
var _key = action.key,
|
395
|
-
|
396
|
-
|
461
|
+
actions = action.actions,
|
462
|
+
_others = _objectWithoutProperties(action, _excluded6);
|
463
|
+
|
397
464
|
return _objectSpread({
|
398
465
|
key: getKey(index, _key),
|
399
466
|
actions: actions.map(function (a, j) {
|
@@ -403,29 +470,32 @@ function getActionConfig(action, index, context) {
|
|
403
470
|
})
|
404
471
|
}, (0, _utils.getTargetValue)(_others, context));
|
405
472
|
}
|
473
|
+
|
406
474
|
var key = action.key,
|
407
|
-
|
408
|
-
|
475
|
+
config = action.config,
|
476
|
+
others = _objectWithoutProperties(action, _excluded7);
|
477
|
+
|
409
478
|
return _objectSpread({
|
410
479
|
key: getKey(index, key),
|
411
480
|
config: config
|
412
481
|
}, (0, _utils.getTargetValue)(others, context));
|
413
482
|
}
|
483
|
+
|
414
484
|
function ProActionGroup(props) {
|
415
485
|
var _props$type3 = props.type,
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
486
|
+
type = _props$type3 === void 0 ? 'button' : _props$type3,
|
487
|
+
_props$divider = props.divider,
|
488
|
+
divider = _props$divider === void 0 ? true : _props$divider,
|
489
|
+
_props$max = props.max,
|
490
|
+
max = _props$max === void 0 ? MAX_ACTTIONS : _props$max,
|
491
|
+
moreText = props.moreText,
|
492
|
+
more = props.more,
|
493
|
+
context = props.context,
|
494
|
+
_props$actions = props.actions,
|
495
|
+
actions = _props$actions === void 0 ? [] : _props$actions,
|
496
|
+
className = props.className,
|
497
|
+
containerProps = _objectWithoutProperties(props, _excluded8);
|
498
|
+
|
429
499
|
var isTypeText = type === 'text';
|
430
500
|
var filteredActions = actions.map(function (action, index) {
|
431
501
|
return getActionConfig(action, index, context);
|
@@ -439,36 +509,35 @@ function ProActionGroup(props) {
|
|
439
509
|
})
|
440
510
|
}, containerProps), formatedActions.map(function (actionBtn, i) {
|
441
511
|
var isLastOne = i === formatedActions.length - 1;
|
442
|
-
|
443
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
444
|
-
key: actionBtn.key
|
445
|
-
}, renderCommonActionButton(actionBtn, context, isTypeText, "".concat(dataTeamixSpm, "-").concat(actionBtn.key || i)), isTypeText && divider && !isLastOne && /*#__PURE__*/_react.default.createElement(_components.Divider, {
|
446
|
-
direction: "ver"
|
447
|
-
}));
|
448
|
-
} else return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
512
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
449
513
|
key: actionBtn.key
|
450
514
|
}, renderCommonActionButton(actionBtn, context, isTypeText), isTypeText && divider && !isLastOne && /*#__PURE__*/_react.default.createElement(_components.Divider, {
|
451
515
|
direction: "ver"
|
452
516
|
}));
|
453
517
|
}));
|
454
518
|
}
|
519
|
+
|
455
520
|
var ProAction = function ProAction(props) {
|
456
521
|
return renderCommonActionButton(props);
|
457
522
|
};
|
523
|
+
|
458
524
|
var _default = ProAction;
|
459
|
-
exports.default = _default;
|
460
525
|
/**
|
461
526
|
* @deprecated 建议使用 ProActionGroup 代替
|
462
527
|
*/
|
528
|
+
|
529
|
+
exports.default = _default;
|
463
530
|
var ActionGroup = ProActionGroup;
|
464
531
|
/**
|
465
532
|
* @deprecated 建议使用 ProActionButton 代替
|
466
533
|
*/
|
534
|
+
|
467
535
|
exports.ActionGroup = ActionGroup;
|
468
536
|
var ActionButton = ProActionButton;
|
469
537
|
/**
|
470
538
|
* @deprecated 建议使用 ProActionMenuButton 代替
|
471
539
|
*/
|
540
|
+
|
472
541
|
exports.ActionButton = ActionButton;
|
473
542
|
var ActionMenuButton = ProActionMenuButton;
|
474
543
|
exports.ActionMenuButton = ActionMenuButton;
|
package/lib/actions/index.scss
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
}
|
11
11
|
|
12
12
|
&.teamix-pro-actions-type-button {
|
13
|
-
& > button
|
13
|
+
& > button {
|
14
14
|
&:not(:last-child) {
|
15
15
|
margin-right: var(--s-2);
|
16
16
|
}
|
@@ -110,20 +110,15 @@
|
|
110
110
|
|
111
111
|
.next-dialog-body {
|
112
112
|
.teamix-pro-info {
|
113
|
-
padding-right: 16px;
|
114
113
|
.next-card-content-container {
|
115
114
|
margin-top: 10px;
|
116
115
|
padding-bottom: 10px;
|
117
|
-
padding-right: 0;
|
118
116
|
.next-col.next-col-24:last-child {
|
119
117
|
.teamix-pro-info-item:last-child {
|
120
118
|
padding-bottom: 0px;
|
121
119
|
}
|
122
120
|
}
|
123
121
|
}
|
124
|
-
.teamix-pro-info-item-value {
|
125
|
-
padding-right: 0px;
|
126
|
-
}
|
127
122
|
}
|
128
123
|
}
|
129
124
|
|
package/lib/actions/link.js
CHANGED
@@ -5,17 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
exports.useLinkAction = useLinkAction;
|
8
|
+
|
8
9
|
var _utils = require("@teamix/utils");
|
10
|
+
|
11
|
+
var _reactRouterDom = require("react-router-dom");
|
12
|
+
|
9
13
|
var _base = require("./base");
|
14
|
+
|
10
15
|
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; }
|
16
|
+
|
11
17
|
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; }
|
18
|
+
|
12
19
|
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; }
|
20
|
+
|
13
21
|
function useLinkAction(action, actionContext) {
|
14
|
-
var history = (0,
|
22
|
+
var history = (0, _reactRouterDom.useHistory)();
|
15
23
|
return _objectSpread({}, (0, _base.eventHandler)(action, actionContext, function (context) {
|
16
24
|
var linkAction = (0, _utils.getTargetValue)(action, context);
|
17
25
|
(0, _utils.goToLink)(linkAction, history);
|
18
26
|
}));
|
19
27
|
}
|
28
|
+
|
20
29
|
var _default = useLinkAction;
|
21
30
|
exports.default = _default;
|