@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
@@ -91,11 +91,11 @@ export declare function getTreeNodeProps(item: ProSidebarDataSourceItem): {
|
|
91
91
|
[k: string]: boolean | undefined;
|
92
92
|
};
|
93
93
|
labelProps: {
|
94
|
-
label?:
|
94
|
+
label?: (string & (boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | null)) | undefined;
|
95
95
|
value?: any;
|
96
96
|
tag?: import("@teamix/pro-field").ProTagItem | undefined;
|
97
97
|
extra?: import("../typing").ProSidebarExtraProps;
|
98
|
-
children?: (ProSidebarDataSourceItem[] & (
|
98
|
+
children?: (ProSidebarDataSourceItem[] & (boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | null)) | undefined;
|
99
99
|
valueType?: import("@teamix/pro-field").ProFieldType | undefined;
|
100
100
|
render?: import("@teamix/pro-field").ProFieldRenderProps | undefined;
|
101
101
|
fieldProps?: import("@teamix/pro-field").ProFieldProps | undefined;
|
@@ -111,7 +111,6 @@ export declare function getTreeNodeProps(item: ProSidebarDataSourceItem): {
|
|
111
111
|
hidden?: boolean | undefined;
|
112
112
|
id?: string | undefined;
|
113
113
|
lang?: string | undefined;
|
114
|
-
nonce?: string | undefined;
|
115
114
|
placeholder?: string | undefined;
|
116
115
|
slot?: string | undefined;
|
117
116
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
@@ -262,8 +261,6 @@ export declare function getTreeNodeProps(item: ProSidebarDataSourceItem): {
|
|
262
261
|
onProgressCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
263
262
|
onRateChange?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
264
263
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
265
|
-
onResize?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
266
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
267
264
|
onSeeked?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
268
265
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
269
266
|
onSeeking?: import("react").ReactEventHandler<HTMLElement> | undefined;
|
@@ -1,30 +1,50 @@
|
|
1
1
|
var _excluded = ["selectable", "checkable", "editable", "draggable", "disabled", "checkboxDisabled", "isLeaf", "treeNodeProps"];
|
2
|
+
|
2
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
+
|
3
5
|
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."); }
|
6
|
+
|
4
7
|
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; }
|
8
|
+
|
5
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
10
|
+
|
6
11
|
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; }
|
12
|
+
|
7
13
|
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; }
|
8
|
-
|
9
|
-
function _extends() { _extends = Object.assign
|
14
|
+
|
15
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
16
|
+
|
10
17
|
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; }
|
18
|
+
|
11
19
|
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; }
|
20
|
+
|
12
21
|
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; }
|
22
|
+
|
13
23
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
24
|
+
|
14
25
|
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."); }
|
26
|
+
|
15
27
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
28
|
+
|
16
29
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
30
|
+
|
17
31
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
32
|
+
|
18
33
|
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); }
|
34
|
+
|
19
35
|
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; }
|
36
|
+
|
20
37
|
export function loop(data, func, aliasMap) {
|
21
38
|
var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
39
|
+
|
22
40
|
var _ref = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
23
|
-
|
24
|
-
|
41
|
+
_ref$children = _ref.children,
|
42
|
+
children = _ref$children === void 0 ? 'children' : _ref$children;
|
43
|
+
|
25
44
|
if (data && data.length > 0) {
|
26
45
|
data.forEach(function (item) {
|
27
46
|
func(item, level, data);
|
47
|
+
|
28
48
|
if (Array.isArray(item[children])) {
|
29
49
|
loop(item[children], func, {
|
30
50
|
children: children
|
@@ -40,27 +60,35 @@ export function loop(data, func, aliasMap) {
|
|
40
60
|
* @param aliasMap 标识
|
41
61
|
* @returns
|
42
62
|
*/
|
63
|
+
|
43
64
|
export function findNodeWithoutPath(data, predicate, aliasMap) {
|
44
65
|
var _ref2 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
45
|
-
|
46
|
-
|
47
|
-
|
66
|
+
_ref2$children = _ref2.children,
|
67
|
+
children = _ref2$children === void 0 ? 'children' : _ref2$children; // 如果已经没有节点了,结束递归
|
68
|
+
|
69
|
+
|
48
70
|
if (!(data && data.length)) {
|
49
71
|
return [];
|
50
72
|
}
|
73
|
+
|
51
74
|
var newChildren = [];
|
75
|
+
|
52
76
|
var _iterator = _createForOfIteratorHelper(data),
|
53
|
-
|
77
|
+
_step;
|
78
|
+
|
54
79
|
try {
|
55
80
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
56
81
|
var node = _step.value;
|
82
|
+
|
57
83
|
if (predicate(node)) {
|
58
84
|
var _node$children;
|
85
|
+
|
59
86
|
// 如果节点符合条件,直接加入新的节点集
|
60
87
|
newChildren.push(node);
|
61
88
|
node.children = findNodeWithoutPath((_node$children = node[children]) !== null && _node$children !== void 0 ? _node$children : [], predicate);
|
62
89
|
} else {
|
63
90
|
var _node$children2;
|
91
|
+
|
64
92
|
// 如果当前节点不符合条件,递归过滤子节点,
|
65
93
|
// 把符合条件的子节点提升上来,并入新节点集
|
66
94
|
newChildren.push.apply(newChildren, _toConsumableArray(findNodeWithoutPath((_node$children2 = node[children]) !== null && _node$children2 !== void 0 ? _node$children2 : [], predicate)));
|
@@ -71,6 +99,7 @@ export function findNodeWithoutPath(data, predicate, aliasMap) {
|
|
71
99
|
} finally {
|
72
100
|
_iterator.f();
|
73
101
|
}
|
102
|
+
|
74
103
|
return newChildren;
|
75
104
|
}
|
76
105
|
/**
|
@@ -80,25 +109,31 @@ export function findNodeWithoutPath(data, predicate, aliasMap) {
|
|
80
109
|
* @param aliasMap 标识
|
81
110
|
* @returns
|
82
111
|
*/
|
112
|
+
|
83
113
|
export function findNodeWithPath(data, predicate, aliasMap) {
|
84
114
|
var _ref3 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
85
|
-
|
86
|
-
|
115
|
+
_ref3$children = _ref3.children,
|
116
|
+
children = _ref3$children === void 0 ? 'children' : _ref3$children;
|
117
|
+
|
87
118
|
var getNodes = function getNodes(result, node) {
|
88
119
|
if (predicate(node)) {
|
89
120
|
result.push(node);
|
90
121
|
return result;
|
91
122
|
}
|
123
|
+
|
92
124
|
if (Array.isArray(node[children])) {
|
93
125
|
var nodes = node[children].reduce(getNodes, []);
|
126
|
+
|
94
127
|
if (nodes.length) {
|
95
128
|
result.push(_objectSpread(_objectSpread({}, node), {}, {
|
96
129
|
nodes: nodes
|
97
130
|
}));
|
98
131
|
}
|
99
132
|
}
|
133
|
+
|
100
134
|
return result;
|
101
135
|
};
|
136
|
+
|
102
137
|
return data.reduce(getNodes, []);
|
103
138
|
}
|
104
139
|
/**
|
@@ -107,12 +142,14 @@ export function findNodeWithPath(data, predicate, aliasMap) {
|
|
107
142
|
* @param aliasMap 标识
|
108
143
|
* @returns
|
109
144
|
*/
|
145
|
+
|
110
146
|
export function getAllNodeKey(data, aliasMap) {
|
111
147
|
var _ref4 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
148
|
+
_ref4$key = _ref4.key,
|
149
|
+
key = _ref4$key === void 0 ? 'value' : _ref4$key,
|
150
|
+
_ref4$children = _ref4.children,
|
151
|
+
children = _ref4$children === void 0 ? 'children' : _ref4$children;
|
152
|
+
|
116
153
|
var keyList = [];
|
117
154
|
loop(data, function (node) {
|
118
155
|
keyList.push(node[key]);
|
@@ -128,12 +165,14 @@ export function getAllNodeKey(data, aliasMap) {
|
|
128
165
|
* @param aliasMap 标识
|
129
166
|
* @returns
|
130
167
|
*/
|
168
|
+
|
131
169
|
export function getTreeNodeLevel(data, value, aliasMap) {
|
132
170
|
var _ref5 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
171
|
+
_ref5$key = _ref5.key,
|
172
|
+
key = _ref5$key === void 0 ? 'value' : _ref5$key,
|
173
|
+
_ref5$children = _ref5.children,
|
174
|
+
children = _ref5$children === void 0 ? 'children' : _ref5$children;
|
175
|
+
|
137
176
|
var result = 0;
|
138
177
|
loop(data, function (item, level) {
|
139
178
|
if (item[key] === value) {
|
@@ -150,10 +189,12 @@ export function getTreeNodeLevel(data, value, aliasMap) {
|
|
150
189
|
* @param aliasMap 标识
|
151
190
|
* @returns
|
152
191
|
*/
|
192
|
+
|
153
193
|
export function getTreeLevel(data, aliasMap) {
|
154
194
|
var _ref6 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
155
|
-
|
156
|
-
|
195
|
+
_ref6$children = _ref6.children,
|
196
|
+
children = _ref6$children === void 0 ? 'children' : _ref6$children;
|
197
|
+
|
157
198
|
var result = 0;
|
158
199
|
loop(data, function (item, level) {
|
159
200
|
if (result < level) {
|
@@ -171,14 +212,16 @@ export function getTreeLevel(data, aliasMap) {
|
|
171
212
|
* @param aliasMap
|
172
213
|
* @returns
|
173
214
|
*/
|
215
|
+
|
174
216
|
export function getTreeLevelKey(data, level, aliasMap) {
|
175
217
|
var _ref7 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
// TODO 此处可做性能优化
|
218
|
+
_ref7$key = _ref7.key,
|
219
|
+
key = _ref7$key === void 0 ? 'value' : _ref7$key,
|
220
|
+
_ref7$children = _ref7.children,
|
221
|
+
children = _ref7$children === void 0 ? 'children' : _ref7$children;
|
222
|
+
|
223
|
+
var result = []; // TODO 此处可做性能优化
|
224
|
+
|
182
225
|
loop(data, function (item, currentLevel) {
|
183
226
|
if (currentLevel + 1 <= level) {
|
184
227
|
result.push(item === null || item === void 0 ? void 0 : item[key]);
|
@@ -195,29 +238,38 @@ export function getTreeLevelKey(data, level, aliasMap) {
|
|
195
238
|
* @param aliasMap 标识
|
196
239
|
* @returns
|
197
240
|
*/
|
241
|
+
|
198
242
|
export function filterTreeData(nodes, predicate, aliasMap) {
|
199
243
|
if (!(nodes && nodes.length)) {
|
200
244
|
return {
|
201
245
|
filterTreeValue: []
|
202
246
|
};
|
203
247
|
}
|
248
|
+
|
204
249
|
var _ref8 = aliasMap !== null && aliasMap !== void 0 ? aliasMap : {},
|
205
|
-
|
206
|
-
|
250
|
+
_ref8$children = _ref8.children,
|
251
|
+
children = _ref8$children === void 0 ? 'children' : _ref8$children;
|
252
|
+
|
207
253
|
var filterTreeValue = [];
|
254
|
+
|
208
255
|
var _iterator2 = _createForOfIteratorHelper(nodes),
|
209
|
-
|
256
|
+
_step2;
|
257
|
+
|
210
258
|
try {
|
211
259
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
212
260
|
var node = _step2.value;
|
213
|
-
|
261
|
+
|
262
|
+
var others = _extends({}, node);
|
263
|
+
|
214
264
|
if (predicate(node)) {
|
215
265
|
var _node$children3;
|
266
|
+
|
216
267
|
filterTreeValue.push(_objectSpread(_objectSpread({}, others), {}, {
|
217
268
|
children: filterTreeData((_node$children3 = node[children]) !== null && _node$children3 !== void 0 ? _node$children3 : [], predicate, aliasMap).filterTreeValue
|
218
269
|
}));
|
219
270
|
} else {
|
220
271
|
var subs = filterTreeData(node[children], predicate, aliasMap);
|
272
|
+
|
221
273
|
if (subs && subs.filterTreeValue.length) {
|
222
274
|
filterTreeValue.push(_objectSpread(_objectSpread({}, others), {}, {
|
223
275
|
children: subs.filterTreeValue
|
@@ -230,6 +282,7 @@ export function filterTreeData(nodes, predicate, aliasMap) {
|
|
230
282
|
} finally {
|
231
283
|
_iterator2.f();
|
232
284
|
}
|
285
|
+
|
233
286
|
return {
|
234
287
|
filterTreeValue: filterTreeValue
|
235
288
|
};
|
@@ -238,17 +291,19 @@ export function filterTreeData(nodes, predicate, aliasMap) {
|
|
238
291
|
* 获取TreeNodeProps
|
239
292
|
* @param item
|
240
293
|
*/
|
294
|
+
|
241
295
|
export function getTreeNodeProps(item) {
|
242
296
|
var selectable = item.selectable,
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
297
|
+
checkable = item.checkable,
|
298
|
+
editable = item.editable,
|
299
|
+
draggable = item.draggable,
|
300
|
+
disabled = item.disabled,
|
301
|
+
checkboxDisabled = item.checkboxDisabled,
|
302
|
+
isLeaf = item.isLeaf,
|
303
|
+
_item$treeNodeProps = item.treeNodeProps,
|
304
|
+
treeNodeProps = _item$treeNodeProps === void 0 ? {} : _item$treeNodeProps,
|
305
|
+
others = _objectWithoutProperties(item, _excluded);
|
306
|
+
|
252
307
|
var nodeProps = _objectSpread({
|
253
308
|
selectable: selectable,
|
254
309
|
checkable: checkable,
|
@@ -258,11 +313,13 @@ export function getTreeNodeProps(item) {
|
|
258
313
|
checkboxDisabled: checkboxDisabled,
|
259
314
|
isLeaf: isLeaf
|
260
315
|
}, treeNodeProps);
|
316
|
+
|
261
317
|
return {
|
262
318
|
nodeProps: Object.fromEntries(Object.entries(nodeProps).filter(function (_ref9) {
|
263
319
|
var _ref10 = _slicedToArray(_ref9, 2),
|
264
|
-
|
265
|
-
|
320
|
+
_ = _ref10[0],
|
321
|
+
v = _ref10[1];
|
322
|
+
|
266
323
|
return v !== undefined;
|
267
324
|
})),
|
268
325
|
labelProps: others
|
@@ -1,12 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './index.scss';
|
3
|
-
import { ProTableColumnProps, ProTableActionType
|
3
|
+
import { ProTableColumnProps, ProTableActionType } from '../../typing';
|
4
4
|
declare type ProTableFilterProps = {
|
5
5
|
column: ProTableColumnProps;
|
6
6
|
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
7
|
-
switchCardView?: 'table' | 'card';
|
8
|
-
bindUrl?: ProTableProps['bindUrl'];
|
9
|
-
bindUrlProps?: ProTableProps['bindUrlProps'];
|
10
7
|
};
|
11
|
-
declare const
|
12
|
-
export default
|
8
|
+
declare const Filter: React.FC<ProTableFilterProps>;
|
9
|
+
export default Filter;
|