@teamix/pro 1.3.7 → 1.3.8
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.js +30 -9
- package/dist/pro.min.js +1 -1
- package/es/form/Filter/LightFilter.js +12 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/sidebar/components/tree/index.js +5 -1
- package/lib/form/Filter/LightFilter.js +14 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/sidebar/components/tree/index.js +5 -1
- package/package.json +2 -2
@@ -12,8 +12,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
12
12
|
|
13
13
|
import React, { memo, useMemo, useCallback, useRef, useEffect } from 'react';
|
14
14
|
import cls from 'classnames';
|
15
|
+
import { observable } from '@formily/reactive';
|
15
16
|
import { usePrefixCls } from '@teamix/utils';
|
16
17
|
import ProForm from '../ProForm';
|
18
|
+
var lightFilterObs = observable({
|
19
|
+
onFilter: function onFilter() {}
|
20
|
+
});
|
17
21
|
/**
|
18
22
|
* 轻量筛选
|
19
23
|
*/
|
@@ -69,7 +73,7 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
69
73
|
filterValues: filterValues,
|
70
74
|
onFilterChange: onFilterChange,
|
71
75
|
buttonProps: {
|
72
|
-
onClick: onFilter
|
76
|
+
onClick: "{{lightFilterObs.onFilter}}"
|
73
77
|
}
|
74
78
|
},
|
75
79
|
children: schema
|
@@ -81,8 +85,14 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
81
85
|
}
|
82
86
|
}
|
83
87
|
}];
|
84
|
-
}, [schema,
|
88
|
+
}, [schema, onFilterChange, defaultFilterValue]);
|
89
|
+
useEffect(function () {
|
90
|
+
lightFilterObs.onFilter = onFilter;
|
91
|
+
}, [onChange]);
|
85
92
|
return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
|
93
|
+
scope: _objectSpread(_objectSpread({}, otherProps === null || otherProps === void 0 ? void 0 : otherProps.scope), {}, {
|
94
|
+
lightFilterObs: lightFilterObs
|
95
|
+
}),
|
86
96
|
form: form,
|
87
97
|
className: cls(prefixCls, props.className),
|
88
98
|
schema: LightSchema,
|
package/es/index.d.ts
CHANGED
@@ -26,5 +26,5 @@ export * from './table';
|
|
26
26
|
export * from './sidebar';
|
27
27
|
export * from './utils';
|
28
28
|
export * from './timeline';
|
29
|
-
declare const version = "1.3.
|
29
|
+
declare const version = "1.3.8";
|
30
30
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -31,6 +31,6 @@ export * from './sidebar';
|
|
31
31
|
export * from './utils'; // export * from './sidebar';
|
32
32
|
|
33
33
|
export * from './timeline';
|
34
|
-
var version = '1.3.
|
34
|
+
var version = '1.3.8';
|
35
35
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
36
36
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils };
|
@@ -121,7 +121,11 @@ var ProSidebarTree = function ProSidebarTree(props) {
|
|
121
121
|
|
122
122
|
useEffect(function () {
|
123
123
|
setDefaultExpandedKeys();
|
124
|
-
}, []); //
|
124
|
+
}, []); // 监听 selectedKeys,用于受控
|
125
|
+
|
126
|
+
useEffect(function () {
|
127
|
+
setSelectedKeys(selectedKeysProp);
|
128
|
+
}, [selectedKeysProp]); // 更新外部传入的 dataSource
|
125
129
|
|
126
130
|
useUpdateEffect(function () {
|
127
131
|
setDataSource(processDataSource(dataSourceProp !== null && dataSourceProp !== void 0 ? dataSourceProp : []));
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
|
14
|
+
var _reactive = require("@formily/reactive");
|
15
|
+
|
14
16
|
var _utils = require("@teamix/utils");
|
15
17
|
|
16
18
|
var _ProForm = _interopRequireDefault(require("../ProForm"));
|
@@ -33,9 +35,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
33
35
|
|
34
36
|
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; }
|
35
37
|
|
38
|
+
var lightFilterObs = (0, _reactive.observable)({
|
39
|
+
onFilter: function onFilter() {}
|
40
|
+
});
|
36
41
|
/**
|
37
42
|
* 轻量筛选
|
38
43
|
*/
|
44
|
+
|
39
45
|
var LightFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
40
46
|
var _schema$;
|
41
47
|
|
@@ -87,7 +93,7 @@ var LightFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
87
93
|
filterValues: filterValues,
|
88
94
|
onFilterChange: onFilterChange,
|
89
95
|
buttonProps: {
|
90
|
-
onClick: onFilter
|
96
|
+
onClick: "{{lightFilterObs.onFilter}}"
|
91
97
|
}
|
92
98
|
},
|
93
99
|
children: schema
|
@@ -99,8 +105,14 @@ var LightFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
99
105
|
}
|
100
106
|
}
|
101
107
|
}];
|
102
|
-
}, [schema,
|
108
|
+
}, [schema, onFilterChange, defaultFilterValue]);
|
109
|
+
(0, _react.useEffect)(function () {
|
110
|
+
lightFilterObs.onFilter = onFilter;
|
111
|
+
}, [onChange]);
|
103
112
|
return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread({}, otherProps), {}, {
|
113
|
+
scope: _objectSpread(_objectSpread({}, otherProps === null || otherProps === void 0 ? void 0 : otherProps.scope), {}, {
|
114
|
+
lightFilterObs: lightFilterObs
|
115
|
+
}),
|
104
116
|
form: form,
|
105
117
|
className: (0, _classnames.default)(prefixCls, props.className),
|
106
118
|
schema: LightSchema,
|
package/lib/index.d.ts
CHANGED
@@ -26,5 +26,5 @@ export * from './table';
|
|
26
26
|
export * from './sidebar';
|
27
27
|
export * from './utils';
|
28
28
|
export * from './timeline';
|
29
|
-
declare const version = "1.3.
|
29
|
+
declare const version = "1.3.8";
|
30
30
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -145,7 +145,11 @@ var ProSidebarTree = function ProSidebarTree(props) {
|
|
145
145
|
|
146
146
|
(0, _react.useEffect)(function () {
|
147
147
|
setDefaultExpandedKeys();
|
148
|
-
}, []); //
|
148
|
+
}, []); // 监听 selectedKeys,用于受控
|
149
|
+
|
150
|
+
(0, _react.useEffect)(function () {
|
151
|
+
setSelectedKeys(selectedKeysProp);
|
152
|
+
}, [selectedKeysProp]); // 更新外部传入的 dataSource
|
149
153
|
|
150
154
|
(0, _hooks.useUpdateEffect)(function () {
|
151
155
|
setDataSource(processDataSource(dataSourceProp !== null && dataSourceProp !== void 0 ? dataSourceProp : []));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teamix/pro",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.8",
|
4
4
|
"description": "TeamixPro大包",
|
5
5
|
"keywords": [
|
6
6
|
"aliyun",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"dependencies": {
|
39
39
|
"@formily/core": "2.0.15",
|
40
40
|
"@formily/react": "2.0.15",
|
41
|
-
"@teamix/formily": "2.0.15",
|
41
|
+
"@teamix/formily": "2.0.15-1",
|
42
42
|
"@teamix/hooks": "^0.1.0",
|
43
43
|
"@teamix/pop-confirm": "^1.2.4",
|
44
44
|
"@teamix/pro-field": "^1.0.0",
|