@teamix/pro 1.5.2 → 1.5.4-beta.0
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 +20285 -19928
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +2 -6
- package/es/actions/base.js +8 -21
- package/es/actions/dialog-component.js +2 -9
- package/es/actions/dialog-form.js +37 -75
- package/es/actions/dialog-info.js +1 -5
- package/es/actions/dialog.js +57 -95
- package/es/actions/index.d.ts +3 -0
- package/es/actions/index.js +71 -156
- package/es/actions/link.js +3 -5
- package/es/actions/quick.d.ts +2 -0
- package/es/actions/quick.js +26 -0
- package/es/actions/request.js +12 -27
- package/es/actions/utils.js +1 -9
- package/es/card/card-container.js +0 -5
- package/es/card/divider.js +0 -5
- package/es/card/index.js +56 -95
- package/es/card/selectable.js +4 -13
- package/es/card/tab.js +1 -10
- package/es/card/utils.js +0 -2
- package/es/form/Components/Editable/index.js +16 -55
- package/es/form/Components/FormGroup/index.d.ts +1 -0
- package/es/form/Components/FormGroup/index.js +7 -22
- package/es/form/Components/LightFilter/index.js +15 -35
- package/es/form/Components/ProField/index.js +2 -14
- package/es/form/Components/ProField/mapDateFormat.js +2 -28
- package/es/form/Components/Text/index.d.ts +1 -0
- package/es/form/Components/Text/index.js +2 -11
- package/es/form/Filter/AdvancedFilter.js +11 -26
- package/es/form/Filter/Layout.js +11 -24
- package/es/form/Filter/LightFilter.js +13 -24
- package/es/form/Filter/SimpleFilter.js +7 -21
- package/es/form/Filter/index.js +106 -171
- package/es/form/Filter/index2.js +11 -28
- package/es/form/Filter/useBindUrl.js +18 -46
- package/es/form/Filter/useSpecialProps.js +8 -13
- package/es/form/ProForm/addCascadeEffect.js +10 -32
- package/es/form/ProForm/customComponent.js +0 -5
- package/es/form/ProForm/index.js +23 -34
- package/es/form/ProForm/useAutoLayout.js +21 -42
- package/es/form/ProForm/useAutoSubmit.js +3 -8
- package/es/form/ProForm/useFieldRequest.js +0 -5
- package/es/form/ProForm/useFormDisplayValues.js +12 -28
- package/es/form/ProForm/useInitialRequest.js +0 -5
- package/es/form/SchemaForm/adapterComponent.js +0 -3
- package/es/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/es/form/SchemaForm/adapterDecorator.js +0 -8
- package/es/form/SchemaForm/adapterType.js +0 -2
- package/es/form/SchemaForm/index.js +78 -114
- package/es/form/SchemaForm/initializeArrayCards.js +0 -6
- package/es/form/SchemaForm/initializeArrayCollapse.js +0 -6
- package/es/form/SchemaForm/initializeArrayItems.js +2 -9
- package/es/form/SchemaForm/initializeArrayTable.js +21 -34
- package/es/form/SchemaForm/initializeDataSource.js +2 -6
- package/es/form/SchemaForm/initializeFormButton.js +14 -31
- package/es/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/es/form/SchemaForm/initializeFormGroup.js +10 -20
- package/es/form/SchemaForm/initializeFormStep.js +11 -23
- package/es/form/SchemaForm/initializeFormTab.js +10 -20
- package/es/form/SchemaForm/initializeReactions.js +9 -33
- package/es/form/SchemaForm/initializeRequest.js +2 -16
- package/es/form/SchemaForm/initializeRules.js +4 -22
- package/es/form/SchemaForm/initializeSelectTable.js +7 -33
- package/es/form/SchemaForm/reactions.js +19 -34
- package/es/form/docs/ActionResponse.d.ts +1 -0
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +0 -9
- package/es/form/typing.d.ts +6 -4
- package/es/form/utils.d.ts +1 -1
- package/es/form/utils.js +4 -49
- package/es/form/warning.js +2 -7
- package/es/index-without-icon.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +7 -8
- package/es/info/components/InfoGroup/index.js +21 -32
- package/es/info/components/InfoValueItem/index.js +66 -119
- package/es/info/components/ProInfoItem/index.js +13 -21
- package/es/info/components/baseInfo/index.js +14 -26
- package/es/info/components/headerInfo/index.js +8 -20
- package/es/info/components/tableInfo/index.js +20 -50
- package/es/info/index.js +53 -82
- package/es/info/utils/index.js +0 -11
- package/es/nocode/configurators/common.js +5 -6
- package/es/nocode/configurators/index.js +2 -3
- package/es/nocode/index.js +6 -6
- package/es/nocode/pages/editor.js +5 -9
- package/es/nocode/pages/index.js +4 -4
- package/es/nocode/pages/playground.js +18 -35
- package/es/nocode/pages/renderer.js +9 -42
- package/es/nocode/playground.js +10 -23
- package/es/page-header/index.d.ts +2 -2
- package/es/page-header/index.js +39 -75
- package/es/sidebar/components/sidebar-container/index.js +41 -72
- package/es/sidebar/components/tree/index.js +88 -144
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -26
- package/es/sidebar/components/tree-node/components/IconAction/index.js +9 -35
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +12 -25
- package/es/sidebar/components/tree-node/index.js +41 -83
- package/es/sidebar/index.js +69 -94
- package/es/sidebar/utils/action-ref.js +2 -7
- package/es/sidebar/utils/index.d.ts +5 -2
- package/es/sidebar/utils/index.js +41 -98
- package/es/table/components/CardView/index.js +62 -149
- package/es/table/components/Filter/index.js +42 -83
- package/es/table/components/Layout/index.js +25 -45
- package/es/table/components/LoadMore/index.js +15 -34
- package/es/table/components/Pagination/index.js +25 -58
- package/es/table/components/QuickAction/index.js +3 -11
- package/es/table/components/ToolBar/CardSwitch.js +6 -17
- package/es/table/components/ToolBar/DensityIcon.js +18 -31
- package/es/table/components/ToolBar/FilterColumnIcon.js +50 -106
- package/es/table/components/ToolBar/FullScreenIcon.js +2 -6
- package/es/table/components/ToolBar/Fullscreen.js +19 -35
- package/es/table/components/ToolBar/RefreshIcon.js +2 -5
- package/es/table/components/ToolBar/index.js +23 -45
- package/es/table/index.js +227 -401
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/table/utils/columnRender.js +32 -76
- package/es/table/utils/genProColumnToColumn.js +5 -14
- package/es/table/utils/index.js +14 -47
- package/es/table/utils/pureColumnRender.js +21 -53
- package/es/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/es/table/utils/pureGenProColumnToColumn.js +2 -10
- package/es/table/utils/useTableSelection.js +6 -33
- package/es/templates/List/index.js +2 -9
- package/es/timeline/ProTimeLineItem/index.js +24 -64
- package/es/timeline/index.js +8 -22
- package/es/timeline/typing.d.ts +1 -0
- package/es/utils/message.d.ts +2 -2
- package/es/utils/message.js +0 -5
- package/es/utils/useRealHistory.d.ts +8 -0
- package/es/utils/useRealHistory.js +23 -0
- package/lib/actions/base.js +8 -24
- package/lib/actions/confirm.js +0 -5
- package/lib/actions/danger-confirm.js +0 -5
- package/lib/actions/danger-pop-confirm.js +0 -4
- package/lib/actions/dialog-component.js +2 -15
- package/lib/actions/dialog-form.js +36 -88
- package/lib/actions/dialog-info.js +1 -10
- package/lib/actions/dialog-table.js +0 -5
- package/lib/actions/dialog.js +55 -111
- package/lib/actions/drawer-form.js +0 -3
- package/lib/actions/drawer-info.js +0 -3
- package/lib/actions/drawer-table.js +0 -3
- package/lib/actions/drawer.js +0 -4
- package/lib/actions/error.js +0 -5
- package/lib/actions/index.d.ts +3 -0
- package/lib/actions/index.js +93 -186
- package/lib/actions/link.js +3 -10
- package/lib/actions/notice.js +0 -5
- package/lib/actions/pop-confirm.js +0 -5
- package/lib/actions/quick.d.ts +2 -0
- package/lib/actions/quick.js +33 -0
- package/lib/actions/request.js +10 -32
- package/lib/actions/utils.js +1 -9
- package/lib/card/card-container.js +0 -9
- package/lib/card/divider.js +0 -7
- package/lib/card/index.js +56 -122
- package/lib/card/selectable.js +4 -20
- package/lib/card/tab.js +1 -14
- package/lib/card/utils.js +0 -6
- package/lib/field/index.js +0 -6
- package/lib/form/Components/Editable/index.js +15 -65
- package/lib/form/Components/FormGroup/index.d.ts +1 -0
- package/lib/form/Components/FormGroup/index.js +7 -28
- package/lib/form/Components/LightFilter/index.js +15 -47
- package/lib/form/Components/ProField/index.js +2 -21
- package/lib/form/Components/ProField/mapDateFormat.js +2 -32
- package/lib/form/Components/Text/index.d.ts +1 -0
- package/lib/form/Components/Text/index.js +2 -16
- package/lib/form/Filter/AdvancedFilter.js +11 -34
- package/lib/form/Filter/Layout.js +11 -33
- package/lib/form/Filter/LightFilter.js +13 -32
- package/lib/form/Filter/SimpleFilter.js +5 -27
- package/lib/form/Filter/index.js +105 -191
- package/lib/form/Filter/index2.js +11 -38
- package/lib/form/Filter/useBindUrl.js +18 -50
- package/lib/form/Filter/useSpecialProps.js +6 -13
- package/lib/form/ProForm/addCascadeEffect.js +10 -35
- package/lib/form/ProForm/customComponent.js +0 -8
- package/lib/form/ProForm/index.js +23 -57
- package/lib/form/ProForm/useAutoLayout.js +21 -45
- package/lib/form/ProForm/useAutoSubmit.js +3 -10
- package/lib/form/ProForm/useFieldRequest.js +0 -8
- package/lib/form/ProForm/useFormDisplayValues.js +12 -34
- package/lib/form/ProForm/useInitialRequest.js +0 -6
- package/lib/form/SchemaForm/adapterComponent.js +0 -6
- package/lib/form/SchemaForm/adapterDecorator.d.ts +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +0 -12
- package/lib/form/SchemaForm/adapterType.js +0 -5
- package/lib/form/SchemaForm/index.js +78 -144
- package/lib/form/SchemaForm/initializeArrayCards.js +0 -7
- package/lib/form/SchemaForm/initializeArrayCollapse.js +0 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -10
- package/lib/form/SchemaForm/initializeArrayTable.js +21 -34
- package/lib/form/SchemaForm/initializeDataSource.js +2 -8
- package/lib/form/SchemaForm/initializeFormButton.js +14 -32
- package/lib/form/SchemaForm/initializeFormCollapse.js +8 -18
- package/lib/form/SchemaForm/initializeFormGroup.js +10 -20
- package/lib/form/SchemaForm/initializeFormStep.js +11 -23
- package/lib/form/SchemaForm/initializeFormTab.js +10 -20
- package/lib/form/SchemaForm/initializeReactions.js +9 -37
- package/lib/form/SchemaForm/initializeRequest.js +2 -18
- package/lib/form/SchemaForm/initializeRules.js +4 -24
- package/lib/form/SchemaForm/initializeSelectTable.js +7 -36
- package/lib/form/SchemaForm/reactions.js +17 -37
- package/lib/form/docs/ActionResponse.d.ts +1 -0
- package/lib/form/docs/ActionResponse.js +0 -5
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +0 -25
- package/lib/form/typing.d.ts +6 -4
- package/lib/form/utils.d.ts +1 -1
- package/lib/form/utils.js +4 -61
- package/lib/form/warning.js +2 -8
- package/lib/hooks/index.js +0 -5
- package/lib/index-without-icon.js +2 -36
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -39
- package/lib/info/components/InfoGroup/index.js +21 -42
- package/lib/info/components/InfoValueItem/index.js +66 -134
- package/lib/info/components/ProInfoItem/index.js +13 -29
- package/lib/info/components/baseInfo/index.js +14 -38
- package/lib/info/components/headerInfo/index.js +8 -31
- package/lib/info/components/tableInfo/index.js +20 -62
- package/lib/info/index.js +53 -97
- package/lib/info/utils/index.js +0 -19
- package/lib/info/utils/utils.js +0 -1
- package/lib/nocode/configurators/PageHeader.js +0 -2
- package/lib/nocode/configurators/ProTable.js +0 -2
- package/lib/nocode/configurators/common.js +5 -10
- package/lib/nocode/configurators/index.js +2 -10
- package/lib/nocode/configurators/map.js +0 -5
- package/lib/nocode/index.js +0 -11
- package/lib/nocode/pages/editor.js +5 -19
- package/lib/nocode/pages/index.js +2 -9
- package/lib/nocode/pages/playground.js +18 -52
- package/lib/nocode/pages/renderer.js +9 -53
- package/lib/nocode/playground.js +10 -35
- package/lib/page-container/index.js +0 -6
- package/lib/page-header/index.d.ts +2 -2
- package/lib/page-header/index.js +38 -88
- package/lib/sidebar/components/sidebar-container/index.js +41 -84
- package/lib/sidebar/components/tree/index.js +88 -158
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +11 -34
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +9 -46
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +12 -35
- package/lib/sidebar/components/tree-node/index.js +41 -99
- package/lib/sidebar/index.js +69 -112
- package/lib/sidebar/utils/action-ref.js +2 -8
- package/lib/sidebar/utils/index.d.ts +5 -2
- package/lib/sidebar/utils/index.js +41 -106
- package/lib/skeleton/index.js +0 -6
- package/lib/table/components/CardView/index.js +62 -161
- package/lib/table/components/EmptyContent/index.js +0 -6
- package/lib/table/components/Filter/index.js +42 -93
- package/lib/table/components/Layout/index.js +25 -58
- package/lib/table/components/LoadMore/index.js +15 -44
- package/lib/table/components/Pagination/index.js +25 -68
- package/lib/table/components/QuickAction/index.js +3 -15
- package/lib/table/components/ToolBar/CardSwitch.js +6 -28
- package/lib/table/components/ToolBar/DensityIcon.js +18 -42
- package/lib/table/components/ToolBar/FilterColumnIcon.js +50 -118
- package/lib/table/components/ToolBar/FullScreenIcon.js +3 -13
- package/lib/table/components/ToolBar/Fullscreen.js +19 -42
- package/lib/table/components/ToolBar/RefreshIcon.js +3 -12
- package/lib/table/components/ToolBar/index.js +23 -63
- package/lib/table/index.js +227 -426
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/table/utils/columnRender.js +32 -89
- package/lib/table/utils/genProColumnToColumn.js +5 -19
- package/lib/table/utils/getTableProps.js +0 -2
- package/lib/table/utils/getTableSortIcons.js +0 -5
- package/lib/table/utils/index.js +12 -55
- package/lib/table/utils/pureColumnRender.js +21 -64
- package/lib/table/utils/pureGenProColumnToColumn.d.ts +1 -1
- package/lib/table/utils/pureGenProColumnToColumn.js +2 -11
- package/lib/table/utils/useTableSelection.js +6 -35
- package/lib/templates/Detail/index.js +0 -5
- package/lib/templates/Form/index.js +0 -5
- package/lib/templates/List/index.js +2 -19
- package/lib/templates/index.js +0 -6
- package/lib/timeline/ProTimeLineItem/index.js +24 -75
- package/lib/timeline/index.js +8 -33
- package/lib/timeline/typing.d.ts +1 -0
- package/lib/utils/index.js +0 -6
- package/lib/utils/message.d.ts +2 -2
- package/lib/utils/message.js +0 -10
- package/lib/utils/useRealHistory.d.ts +8 -0
- package/lib/utils/useRealHistory.js +32 -0
- package/package.json +1 -1
@@ -1,35 +1,25 @@
|
|
1
1
|
var _excluded = ["children", "title", "xIndex"],
|
2
|
-
|
3
|
-
|
2
|
+
_excluded2 = ["children"];
|
4
3
|
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; }
|
5
|
-
|
6
4
|
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; }
|
7
|
-
|
8
5
|
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; }
|
9
|
-
|
10
6
|
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; }
|
11
|
-
|
12
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; }
|
13
|
-
|
14
8
|
import React from 'react';
|
15
9
|
import cls from 'classnames';
|
16
10
|
import { observer, useFieldSchema, useField, RecursionField } from '@formily/react';
|
17
11
|
import { usePrefixCls } from '@teamix/utils';
|
18
12
|
import './index.scss';
|
19
|
-
|
20
13
|
var usePanels = function usePanels() {
|
21
14
|
var groupField = useField();
|
22
15
|
var schema = useFieldSchema();
|
23
16
|
var panels = [];
|
24
17
|
schema.mapProperties(function (schema, name) {
|
25
18
|
var _schema$xComponent;
|
26
|
-
|
27
19
|
var field = groupField.query(groupField.address.concat(name)).take();
|
28
20
|
if ((field === null || field === void 0 ? void 0 : field.display) === 'none' || (field === null || field === void 0 ? void 0 : field.display) === 'hidden') return;
|
29
|
-
|
30
21
|
if (((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.indexOf('GroupPanel')) > -1) {
|
31
22
|
var _schema$xComponentP, _schema$xComponentP2;
|
32
|
-
|
33
23
|
panels.push({
|
34
24
|
name: name,
|
35
25
|
props: _objectSpread(_objectSpread({}, schema === null || schema === void 0 ? void 0 : schema['x-component-props']), {}, {
|
@@ -42,13 +32,11 @@ var usePanels = function usePanels() {
|
|
42
32
|
});
|
43
33
|
return panels;
|
44
34
|
};
|
45
|
-
|
46
35
|
var FormGroupGroupPanel = observer(function (_ref) {
|
47
36
|
var children = _ref.children,
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
37
|
+
title = _ref.title,
|
38
|
+
xIndex = _ref.xIndex,
|
39
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
52
40
|
var prefixCls = usePrefixCls('formily-group-panel', {
|
53
41
|
base: true
|
54
42
|
});
|
@@ -62,8 +50,7 @@ var FormGroupGroupPanel = observer(function (_ref) {
|
|
62
50
|
});
|
63
51
|
var FormGroup = observer(function (_ref2) {
|
64
52
|
var children = _ref2.children,
|
65
|
-
|
66
|
-
|
53
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
67
54
|
var prefixCls = usePrefixCls('formily-group', {
|
68
55
|
base: true
|
69
56
|
});
|
@@ -72,8 +59,8 @@ var FormGroup = observer(function (_ref2) {
|
|
72
59
|
className: cls(prefixCls(), props.className)
|
73
60
|
}), panels.map(function (_ref3, index) {
|
74
61
|
var props = _ref3.props,
|
75
|
-
|
76
|
-
|
62
|
+
schema = _ref3.schema,
|
63
|
+
name = _ref3.name;
|
77
64
|
return /*#__PURE__*/React.createElement(FormGroupGroupPanel, _objectSpread({
|
78
65
|
key: index,
|
79
66
|
xIndex: index
|
@@ -83,11 +70,9 @@ var FormGroup = observer(function (_ref2) {
|
|
83
70
|
}));
|
84
71
|
}));
|
85
72
|
});
|
86
|
-
|
87
73
|
var GroupPanel = function GroupPanel(_ref4) {
|
88
74
|
var children = _ref4.children;
|
89
75
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
90
76
|
};
|
91
|
-
|
92
77
|
FormGroup.GroupPanel = GroupPanel;
|
93
78
|
export default FormGroup;
|
@@ -1,21 +1,12 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
-
|
3
2
|
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."); }
|
4
|
-
|
5
3
|
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); }
|
6
|
-
|
7
4
|
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; }
|
8
|
-
|
9
5
|
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; }
|
10
|
-
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
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; }
|
18
|
-
|
19
10
|
import React, { useState, useCallback, useContext, useEffect } from 'react';
|
20
11
|
import { observer, useFieldSchema, RecursionField, SchemaExpressionScopeContext } from '@formily/react';
|
21
12
|
import { Select, Button } from '@alicloudfe/components';
|
@@ -24,20 +15,15 @@ import cls from 'classnames';
|
|
24
15
|
import { usePrefixCls, getTargetValue } from '@teamix/utils';
|
25
16
|
import { componentMap, inputCategory } from './componentMap';
|
26
17
|
import './index.scss';
|
27
|
-
|
28
18
|
var formatComponent = function formatComponent(schema) {
|
29
19
|
var _schema$enum;
|
30
|
-
|
31
20
|
var component = schema['x-component'];
|
32
|
-
|
33
21
|
if (component === 'Checkbox' && ((_schema$enum = schema['enum']) === null || _schema$enum === void 0 ? void 0 : _schema$enum.length)) {
|
34
22
|
component = 'CheckboxGroup';
|
35
23
|
}
|
36
|
-
|
37
24
|
return componentMap[component] || component;
|
38
|
-
};
|
39
|
-
|
40
|
-
|
25
|
+
};
|
26
|
+
// 主激活区内容
|
41
27
|
var useMain = function useMain(active) {
|
42
28
|
var schema = useFieldSchema();
|
43
29
|
var main = [];
|
@@ -53,9 +39,8 @@ var useMain = function useMain(active) {
|
|
53
39
|
}
|
54
40
|
});
|
55
41
|
return main;
|
56
|
-
};
|
57
|
-
|
58
|
-
|
42
|
+
};
|
43
|
+
// 筛选项数据
|
59
44
|
var useFilterItems = function useFilterItems(filterValues, scope) {
|
60
45
|
var schema = useFieldSchema();
|
61
46
|
var filterItems = [];
|
@@ -69,31 +54,26 @@ var useFilterItems = function useFilterItems(filterValues, scope) {
|
|
69
54
|
}
|
70
55
|
});
|
71
56
|
return filterItems;
|
72
|
-
};
|
73
|
-
|
74
|
-
|
57
|
+
};
|
58
|
+
// 是否输入框类型的组件
|
75
59
|
var isInputCategory = function isInputCategory(currentSchema) {
|
76
60
|
var component = currentSchema === null || currentSchema === void 0 ? void 0 : currentSchema['x-component'];
|
77
61
|
return inputCategory.includes(component);
|
78
62
|
};
|
79
|
-
|
80
63
|
var LightFilter = observer(function (props) {
|
81
64
|
var _filterItems$, _main$;
|
82
|
-
|
83
65
|
var size = props.size,
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
66
|
+
defaultFilterValue = props.defaultFilterValue,
|
67
|
+
filterValues = props.filterValues,
|
68
|
+
onFilterChange = props.onFilterChange,
|
69
|
+
filterProps = props.filterProps,
|
70
|
+
buttonProps = props.buttonProps;
|
89
71
|
var scope = useContext(SchemaExpressionScopeContext);
|
90
72
|
var filterItems = useFilterItems(filterValues, scope);
|
91
|
-
|
92
73
|
var _useState = useState(defaultFilterValue || ((_filterItems$ = filterItems[0]) === null || _filterItems$ === void 0 ? void 0 : _filterItems$.value)),
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
74
|
+
_useState2 = _slicedToArray(_useState, 2),
|
75
|
+
active = _useState2[0],
|
76
|
+
setActive = _useState2[1];
|
97
77
|
var main = useMain(active);
|
98
78
|
var currentSchema = (_main$ = main[0]) === null || _main$ === void 0 ? void 0 : _main$.schema;
|
99
79
|
var basePrefix = usePrefixCls('', {
|
@@ -102,7 +82,7 @@ var LightFilter = observer(function (props) {
|
|
102
82
|
var prefixCls = usePrefixCls('teamix-pro-form-light-filter');
|
103
83
|
var content = main.map(function (_ref, key) {
|
104
84
|
var schema = _ref.schema,
|
105
|
-
|
85
|
+
name = _ref.name;
|
106
86
|
return /*#__PURE__*/React.createElement(RecursionField, {
|
107
87
|
key: key,
|
108
88
|
name: name,
|
@@ -1,27 +1,17 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
-
|
3
2
|
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."); }
|
4
|
-
|
5
3
|
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); }
|
6
|
-
|
7
4
|
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; }
|
8
|
-
|
9
5
|
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; }
|
10
|
-
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
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; }
|
18
|
-
|
19
10
|
import React from 'react';
|
20
11
|
import { connect, mapProps } from '@formily/react';
|
21
12
|
import { mapSize, mapStatus, mapDataSource, mapMode } from '../../utils';
|
22
13
|
import ProField from '../../../field';
|
23
14
|
import fieldTypeMap from '../../fieldTypeMap';
|
24
|
-
|
25
15
|
var componentBuilder = function componentBuilder(type) {
|
26
16
|
return connect(function (props) {
|
27
17
|
return /*#__PURE__*/React.createElement(ProField, _objectSpread(_objectSpread({}, props), {}, {
|
@@ -29,14 +19,12 @@ var componentBuilder = function componentBuilder(type) {
|
|
29
19
|
}));
|
30
20
|
}, mapProps(mapSize, mapStatus, mapDataSource, mapMode));
|
31
21
|
};
|
32
|
-
|
33
22
|
export default (function () {
|
34
23
|
var components = {};
|
35
24
|
Object.entries(fieldTypeMap).forEach(function (_ref) {
|
36
25
|
var _ref2 = _slicedToArray(_ref, 2),
|
37
|
-
|
38
|
-
|
39
|
-
|
26
|
+
name = _ref2[0],
|
27
|
+
type = _ref2[1];
|
40
28
|
components[name] = componentBuilder(type);
|
41
29
|
});
|
42
30
|
return components;
|
@@ -1,65 +1,46 @@
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
-
|
3
2
|
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."); }
|
4
|
-
|
5
3
|
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); }
|
6
|
-
|
7
4
|
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; }
|
8
|
-
|
9
5
|
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; }
|
10
|
-
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
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; }
|
18
|
-
|
19
10
|
import { isEmpty } from '@formily/shared';
|
20
11
|
import { isArr, isFn } from '@teamix/utils';
|
21
12
|
import Moment from 'moment';
|
22
|
-
|
23
13
|
var moment = function moment(date, format) {
|
24
14
|
return Moment((date === null || date === void 0 ? void 0 : date.toDate) ? date.toDate() : date, format);
|
25
15
|
};
|
26
|
-
|
27
16
|
var momentable = function momentable(value, format) {
|
28
17
|
return Array.isArray(value) ? value.map(function (val) {
|
29
18
|
return moment(val, format);
|
30
19
|
}) : value ? moment(value, format) : value;
|
31
20
|
};
|
32
|
-
|
33
21
|
var formatMomentValue = function formatMomentValue(value, format, placeholder) {
|
34
22
|
var formatDate = function formatDate(date, format) {
|
35
23
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
36
24
|
if (!date) return placeholder;
|
37
|
-
|
38
25
|
if (isArr(format)) {
|
39
26
|
var _format = format[i];
|
40
|
-
|
41
27
|
if (isFn(_format)) {
|
42
28
|
return _format(date);
|
43
29
|
}
|
44
|
-
|
45
30
|
if (isEmpty(_format)) {
|
46
31
|
return date;
|
47
32
|
}
|
48
|
-
|
49
33
|
return moment(date).format(_format);
|
50
34
|
} else {
|
51
35
|
if (isFn(format)) {
|
52
36
|
return format(date);
|
53
37
|
}
|
54
|
-
|
55
38
|
if (isEmpty(format)) {
|
56
39
|
return date;
|
57
40
|
}
|
58
|
-
|
59
41
|
return moment(date).format(format);
|
60
42
|
}
|
61
43
|
};
|
62
|
-
|
63
44
|
if (isArr(value)) {
|
64
45
|
return value.map(function (val, index) {
|
65
46
|
return formatDate(val, format, index);
|
@@ -68,11 +49,9 @@ var formatMomentValue = function formatMomentValue(value, format, placeholder) {
|
|
68
49
|
return value ? formatDate(value, format) : value || placeholder;
|
69
50
|
}
|
70
51
|
};
|
71
|
-
|
72
52
|
var mapDateFormatDatePicker2 = function mapDateFormatDatePicker2(type) {
|
73
53
|
var getDefaultFormat = function getDefaultFormat(props) {
|
74
54
|
var _type = props['type'] || type;
|
75
|
-
|
76
55
|
if (_type === 'month') {
|
77
56
|
return 'YYYY-MM';
|
78
57
|
} else if (_type === 'quarter') {
|
@@ -82,10 +61,8 @@ var mapDateFormatDatePicker2 = function mapDateFormatDatePicker2(type) {
|
|
82
61
|
} else if (_type === 'week') {
|
83
62
|
return 'YYYY-wo';
|
84
63
|
}
|
85
|
-
|
86
64
|
return props['showTime'] ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD';
|
87
65
|
};
|
88
|
-
|
89
66
|
return function (props) {
|
90
67
|
var format = props['format'] || getDefaultFormat(props);
|
91
68
|
var _onChange = props.onChange;
|
@@ -100,13 +77,10 @@ var mapDateFormatDatePicker2 = function mapDateFormatDatePicker2(type) {
|
|
100
77
|
});
|
101
78
|
};
|
102
79
|
};
|
103
|
-
|
104
80
|
var mapDateFormat = function mapDateFormat(props, field) {
|
105
81
|
var _ref = field.component || [],
|
106
|
-
|
107
|
-
|
108
|
-
|
82
|
+
_ref2 = _slicedToArray(_ref, 1),
|
83
|
+
component = _ref2[0];
|
109
84
|
return {};
|
110
85
|
};
|
111
|
-
|
112
86
|
export default mapDateFormat;
|
@@ -1,29 +1,20 @@
|
|
1
1
|
var _excluded = ["children", "className"];
|
2
|
-
|
3
2
|
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
|
-
|
5
3
|
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
|
-
|
7
4
|
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
|
-
|
9
5
|
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
|
-
|
11
6
|
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
|
-
|
13
7
|
import React from 'react';
|
14
8
|
import cls from 'classnames';
|
15
9
|
import { usePrefixCls } from '@teamix/utils';
|
16
10
|
import './index.scss';
|
17
|
-
|
18
11
|
var Text = function Text(_ref) {
|
19
12
|
var children = _ref.children,
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
className = _ref.className,
|
14
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
23
15
|
var prefixCls = usePrefixCls('teamix-pro-form-text');
|
24
16
|
return /*#__PURE__*/React.createElement("span", _objectSpread({
|
25
17
|
className: cls(prefixCls(), className)
|
26
18
|
}, otherProps), children);
|
27
19
|
};
|
28
|
-
|
29
20
|
export default Text;
|
@@ -1,27 +1,15 @@
|
|
1
1
|
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
|
2
|
-
|
3
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
|
-
|
5
3
|
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
|
-
|
7
4
|
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); }
|
8
|
-
|
9
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
10
|
-
|
11
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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
|
-
|
17
9
|
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
|
-
|
19
10
|
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
|
-
|
21
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; }
|
22
|
-
|
23
12
|
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; }
|
24
|
-
|
25
13
|
import React, { memo, useEffect, useMemo } from 'react';
|
26
14
|
import { usePrefixCls, getMessage, cls, isBool } from '@teamix/utils';
|
27
15
|
import ProForm from '../ProForm';
|
@@ -29,21 +17,19 @@ import { mergeArrayValue } from '../utils';
|
|
29
17
|
/**
|
30
18
|
* 高级筛选
|
31
19
|
*/
|
32
|
-
|
33
20
|
var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
34
21
|
var schema = props.schema,
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
22
|
+
onSubmit = props.onSubmit,
|
23
|
+
onReset = props.onReset,
|
24
|
+
layout = props.layout,
|
25
|
+
labelAlign = props.labelAlign,
|
26
|
+
wrapperAlign = props.wrapperAlign,
|
27
|
+
labelCol = props.labelCol,
|
28
|
+
wrapperCol = props.wrapperCol,
|
29
|
+
breakpoints = props.breakpoints,
|
30
|
+
gridProps = props.gridProps,
|
31
|
+
forceClear = props.forceClear,
|
32
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
47
33
|
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-advanced');
|
48
34
|
var gridSchema = useMemo(function () {
|
49
35
|
return [{
|
@@ -89,7 +75,6 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
89
75
|
}, [schema, onReset]);
|
90
76
|
useEffect(function () {
|
91
77
|
var _otherProps$form;
|
92
|
-
|
93
78
|
otherProps === null || otherProps === void 0 ? void 0 : (_otherProps$form = otherProps.form) === null || _otherProps$form === void 0 ? void 0 : _otherProps$form.clearFormGraph('AdvancedFilterReset');
|
94
79
|
}, [onReset]);
|
95
80
|
var getTeamixLayout = useMemo(function () {
|
package/es/form/Filter/Layout.js
CHANGED
@@ -1,44 +1,32 @@
|
|
1
1
|
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; }
|
2
|
-
|
3
2
|
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; }
|
4
|
-
|
5
3
|
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; }
|
6
|
-
|
7
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
8
|
-
|
9
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."); }
|
10
|
-
|
11
6
|
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); }
|
12
|
-
|
13
7
|
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; }
|
14
|
-
|
15
8
|
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; }
|
16
|
-
|
17
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
|
-
|
19
10
|
import React, { useCallback, useState } from 'react';
|
20
11
|
import { Button, Badge } from '@alicloudfe/components';
|
21
12
|
import TeamixIcon from '@teamix/icon';
|
22
13
|
import { usePrefixCls, getMessage, isValid, cls } from '@teamix/utils';
|
23
14
|
import './layout.scss';
|
24
|
-
|
25
15
|
var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
26
16
|
var className = _ref.className,
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
17
|
+
addonBefore = _ref.addonBefore,
|
18
|
+
addonAfter = _ref.addonAfter,
|
19
|
+
inlineContent = _ref.inlineContent,
|
20
|
+
panelContent = _ref.panelContent,
|
21
|
+
count = _ref.count,
|
22
|
+
expand = _ref.expand,
|
23
|
+
onExpand = _ref.onExpand,
|
24
|
+
children = _ref.children;
|
35
25
|
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-layout');
|
36
|
-
|
37
26
|
var _useState = useState(!!expand),
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
28
|
+
visible = _useState2[0],
|
29
|
+
setVisible = _useState2[1];
|
42
30
|
var onClick = useCallback(function () {
|
43
31
|
setVisible(!visible);
|
44
32
|
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!visible);
|
@@ -77,5 +65,4 @@ var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
|
77
65
|
className: prefixCls('children')
|
78
66
|
}, children));
|
79
67
|
};
|
80
|
-
|
81
68
|
export { QueryFilterLayout };
|
@@ -1,15 +1,9 @@
|
|
1
1
|
var _excluded = ["form", "schema", "onSubmit", "onChange", "defaultFilterValue", "filterValues", "activeFilterValueRef"];
|
2
|
-
|
3
2
|
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
|
-
|
5
3
|
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
|
-
|
7
4
|
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
|
-
|
9
5
|
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
|
-
|
11
6
|
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
|
-
|
13
7
|
import React, { memo, useMemo, useCallback, useRef, useEffect } from 'react';
|
14
8
|
import { observable } from '@formily/reactive';
|
15
9
|
import { usePrefixCls, cls } from '@teamix/utils';
|
@@ -17,19 +11,16 @@ import ProForm from '../ProForm';
|
|
17
11
|
/**
|
18
12
|
* 轻量筛选
|
19
13
|
*/
|
20
|
-
|
21
14
|
var LightFilter = /*#__PURE__*/memo(function (props) {
|
22
15
|
var _schema$;
|
23
|
-
|
24
16
|
var form = props.form,
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
17
|
+
schema = props.schema,
|
18
|
+
onSubmit = props.onSubmit,
|
19
|
+
onChange = props.onChange,
|
20
|
+
defaultFilterValue = props.defaultFilterValue,
|
21
|
+
filterValues = props.filterValues,
|
22
|
+
activeFilterValueRef = props.activeFilterValueRef,
|
23
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
33
24
|
var filterValue = useRef(defaultFilterValue || (schema === null || schema === void 0 ? void 0 : (_schema$ = schema[0]) === null || _schema$ === void 0 ? void 0 : _schema$.name));
|
34
25
|
var prefixCls = usePrefixCls('teamix-pro-form-query-filter-light');
|
35
26
|
var lightFilterObs = useMemo(function () {
|
@@ -41,22 +32,20 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
41
32
|
if (activeFilterValueRef) {
|
42
33
|
activeFilterValueRef.current = filterValue.current;
|
43
34
|
}
|
44
|
-
}, []);
|
45
|
-
|
35
|
+
}, []);
|
36
|
+
// 筛选提交切换
|
46
37
|
var onFilterChange = useCallback(function (value) {
|
47
38
|
filterValue.current = value;
|
48
|
-
|
49
39
|
if (activeFilterValueRef) {
|
50
40
|
activeFilterValueRef.current = value;
|
51
41
|
}
|
52
|
-
}, [form]);
|
53
|
-
|
42
|
+
}, [form]);
|
43
|
+
// 实际输出onFilter
|
54
44
|
var onFilter = useCallback(function () {
|
55
45
|
var _Object$keys;
|
56
|
-
|
57
46
|
var key = filterValue.current;
|
58
|
-
var value = form.values[key];
|
59
|
-
|
47
|
+
var value = form.values[key];
|
48
|
+
// 删除旧值
|
60
49
|
(_Object$keys = Object.keys(form.values)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (item) {
|
61
50
|
if (item !== key) {
|
62
51
|
form.setValuesIn(item, undefined);
|