@teamix/pro 1.2.30 → 1.2.34
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 +16740 -17360
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +58 -9
- package/es/common.scss +22 -0
- package/es/form/Filter/SimpleFilter.js +10 -3
- package/es/form/Filter/index.d.ts +5 -9
- package/es/form/Filter/index.js +427 -154
- package/es/form/Filter/index.scss +33 -11
- package/es/form/Filter/index2.d.ts +9 -5
- package/es/form/Filter/index2.js +154 -370
- package/es/form/Filter/index2.scss +11 -33
- package/es/form/ProForm/index.js +4 -4
- package/es/form/ProForm/index.scss +5 -0
- package/es/form/SchemaForm/index.js +4 -4
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +41 -5
- package/es/form/SchemaForm/reactions.d.ts +2 -2
- package/es/form/SchemaForm/reactions.js +13 -6
- package/es/form/index.d.ts +3 -3
- package/es/form/index.js +3 -3
- package/es/form/typing.d.ts +8 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoValueItem/index.js +38 -12
- package/es/info/components/InfoValueItem/index.scss +1 -0
- package/es/info/components/ProInfoItem/index.js +6 -3
- package/es/info/components/ProInfoItem/index.scss +9 -0
- package/es/info/components/baseInfo/index.js +4 -2
- package/es/info/components/headerInfo/index.js +2 -1
- package/es/info/components/tableInfo/index.js +2 -1
- package/es/info/index.scss +2 -0
- package/es/info/typing.d.ts +3 -0
- package/es/table/components/Filter/index.js +6 -6
- package/es/table/components/Layout/index.js +29 -23
- package/es/table/components/Layout/index.scss +7 -0
- package/es/table/components/ToolBar/Fullscreen.js +39 -15
- package/es/table/components/ToolBar/index.scss +1 -0
- package/es/table/index.js +122 -54
- package/es/table/typing.d.ts +3 -2
- package/es/table/utils/columnRender.js +2 -2
- package/es/table/utils/index.d.ts +2 -1
- package/es/table/utils/index.js +62 -113
- package/lib/actions/dialog-form.js +57 -10
- package/lib/common.scss +22 -0
- package/lib/form/Filter/SimpleFilter.js +8 -1
- package/lib/form/Filter/index.d.ts +5 -9
- package/lib/form/Filter/index.js +440 -154
- package/lib/form/Filter/index.scss +33 -11
- package/lib/form/Filter/index2.d.ts +9 -5
- package/lib/form/Filter/index2.js +154 -383
- package/lib/form/Filter/index2.scss +11 -33
- package/lib/form/ProForm/index.js +4 -4
- package/lib/form/ProForm/index.scss +5 -0
- package/lib/form/SchemaForm/index.js +4 -4
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +41 -5
- package/lib/form/SchemaForm/reactions.d.ts +2 -2
- package/lib/form/SchemaForm/reactions.js +13 -6
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +8 -8
- package/lib/form/typing.d.ts +8 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoValueItem/index.js +38 -12
- package/lib/info/components/InfoValueItem/index.scss +1 -0
- package/lib/info/components/ProInfoItem/index.js +6 -3
- package/lib/info/components/ProInfoItem/index.scss +9 -0
- package/lib/info/components/baseInfo/index.js +4 -2
- package/lib/info/components/headerInfo/index.js +2 -1
- package/lib/info/components/tableInfo/index.js +2 -1
- package/lib/info/index.scss +2 -0
- package/lib/info/typing.d.ts +3 -0
- package/lib/table/components/Filter/index.js +6 -6
- package/lib/table/components/Layout/index.js +29 -23
- package/lib/table/components/Layout/index.scss +7 -0
- package/lib/table/components/ToolBar/Fullscreen.js +37 -14
- package/lib/table/components/ToolBar/index.scss +1 -0
- package/lib/table/index.js +121 -53
- package/lib/table/typing.d.ts +3 -2
- package/lib/table/utils/columnRender.js +2 -2
- package/lib/table/utils/index.d.ts +2 -1
- package/lib/table/utils/index.js +63 -112
- package/package.json +1 -1
- package/dist/212.js +0 -155705
- package/dist/fonts/codicon.ttf +0 -0
- package/es/form/Components/SelectTable/index.d.ts +0 -24
- package/es/form/Components/SelectTable/index.js +0 -135
- package/es/form/Components/SelectTable/index.scss +0 -28
- package/es/form/Components/SelectTable/table.d.ts +0 -6
- package/es/form/Components/SelectTable/table.js +0 -64
- package/lib/form/Components/SelectTable/index.d.ts +0 -24
- package/lib/form/Components/SelectTable/index.js +0 -157
- package/lib/form/Components/SelectTable/index.scss +0 -28
- package/lib/form/Components/SelectTable/table.d.ts +0 -6
- package/lib/form/Components/SelectTable/table.js +0 -76
package/lib/table/utils/index.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.actionRefUseStateOn = actionRefUseStateOn;
|
6
7
|
exports.cloneDeep = cloneDeep;
|
7
8
|
exports.emit = emit;
|
8
9
|
exports.initActionRef = initActionRef;
|
@@ -33,128 +34,75 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
33
34
|
|
34
35
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
35
36
|
|
36
|
-
//
|
37
|
-
var
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
},
|
83
|
-
|
84
|
-
/**
|
85
|
-
* 获取筛选规则。为params
|
86
|
-
*/
|
87
|
-
getFilterRules: function getFilterRules() {
|
88
|
-
var result = {};
|
89
|
-
|
90
|
-
if (state.filterRules) {
|
91
|
-
result = Object.entries(state.filterRules).map(function (_ref) {
|
92
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
93
|
-
k = _ref2[0],
|
94
|
-
v = _ref2[1];
|
95
|
-
|
96
|
-
return _defineProperty({}, k, v.params);
|
97
|
-
}).reduce(function (acc, cur) {
|
98
|
-
acc = _objectSpread(_objectSpread({}, acc), cur);
|
99
|
-
return acc;
|
100
|
-
}, {});
|
101
|
-
}
|
37
|
+
// 所有 ProTable 组件公用一套组件内事件转发机制
|
38
|
+
var tableCallback = {}; // 组件内对全局状态的更改
|
39
|
+
|
40
|
+
var getMutations = function getMutations(actionRef) {
|
41
|
+
var _actionRef$current2, _actionRef$current2$g, _actionRef$current2$g2;
|
42
|
+
|
43
|
+
return {
|
44
|
+
setFullScreenState: function setFullScreenState(fullScreenState) {
|
45
|
+
var _actionRef$current, _actionRef$current$se;
|
46
|
+
|
47
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setState) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, 'fullScreenState', fullScreenState);
|
48
|
+
},
|
49
|
+
filterColumns: (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$g = _actionRef$current2.getState) === null || _actionRef$current2$g === void 0 ? void 0 : (_actionRef$current2$g2 = _actionRef$current2$g.call(_actionRef$current2)) === null || _actionRef$current2$g2 === void 0 ? void 0 : _actionRef$current2$g2.filterColumns,
|
50
|
+
|
51
|
+
/**
|
52
|
+
* 设置筛选列规则
|
53
|
+
* @param rules 规则
|
54
|
+
* @param dataIndex column.dataIndex
|
55
|
+
*/
|
56
|
+
setFilterRules: function setFilterRules(rules) {
|
57
|
+
var _actionRef$current3, _actionRef$current3$s;
|
58
|
+
|
59
|
+
(_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$s = _actionRef$current3.setState) === null || _actionRef$current3$s === void 0 ? void 0 : _actionRef$current3$s.call(_actionRef$current3, 'filterRules', rules);
|
60
|
+
},
|
61
|
+
|
62
|
+
/**
|
63
|
+
* 获取筛选规则。为params
|
64
|
+
*/
|
65
|
+
getFilterRules: function getFilterRules() {
|
66
|
+
var _actionRef$current4, _actionRef$current4$g;
|
67
|
+
|
68
|
+
var result = {};
|
69
|
+
var filterRules = (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$g = _actionRef$current4.getState) === null || _actionRef$current4$g === void 0 ? void 0 : _actionRef$current4$g.call(_actionRef$current4).filterRules;
|
70
|
+
|
71
|
+
if (filterRules) {
|
72
|
+
result = Object.entries(filterRules).map(function (_ref) {
|
73
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
74
|
+
k = _ref2[0],
|
75
|
+
v = _ref2[1];
|
76
|
+
|
77
|
+
return _defineProperty({}, k, v.params);
|
78
|
+
}).reduce(function (acc, cur) {
|
79
|
+
acc = _objectSpread(_objectSpread({}, acc), cur);
|
80
|
+
return acc;
|
81
|
+
}, {});
|
82
|
+
}
|
102
83
|
|
103
|
-
|
104
|
-
},
|
105
|
-
|
106
|
-
/**
|
107
|
-
* 绑定监听函数
|
108
|
-
* @param fun 监听函数
|
109
|
-
* @param state 需要监听的state
|
110
|
-
* @param name 监听名(作为销毁唯一id使用)
|
111
|
-
*/
|
112
|
-
on: function on(fun, state, name) {
|
113
|
-
if (!callback[state]) {
|
114
|
-
callback[state] = {};
|
84
|
+
return result;
|
115
85
|
}
|
116
|
-
|
117
|
-
callback[state][name] = fun;
|
118
|
-
},
|
119
|
-
off: function off(name) {
|
120
|
-
callback = Object.fromEntries(Object.entries(callback).map(function (_ref4) {
|
121
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
122
|
-
k = _ref5[0],
|
123
|
-
v = _ref5[1];
|
124
|
-
|
125
|
-
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref6) {
|
126
|
-
var _ref7 = _slicedToArray(_ref6, 1),
|
127
|
-
k = _ref7[0];
|
128
|
-
|
129
|
-
return k !== name;
|
130
|
-
}));
|
131
|
-
return [k, filterV];
|
132
|
-
}));
|
133
|
-
}
|
86
|
+
};
|
134
87
|
}; // 调用绑定的监听函数
|
135
88
|
|
136
|
-
|
137
|
-
|
138
|
-
|
89
|
+
|
90
|
+
function actionRefUseStateOn(callback, state) {
|
91
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
92
|
+
args[_key - 2] = arguments[_key];
|
139
93
|
}
|
140
94
|
|
141
95
|
if (callback[state]) {
|
142
|
-
Object.entries(callback[state]).forEach(function (
|
143
|
-
var
|
144
|
-
k =
|
145
|
-
v =
|
96
|
+
Object.entries(callback[state]).forEach(function (_ref4) {
|
97
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
98
|
+
k = _ref5[0],
|
99
|
+
v = _ref5[1];
|
146
100
|
|
147
101
|
if (v) {
|
148
102
|
v === null || v === void 0 ? void 0 : v.apply(void 0, args);
|
149
103
|
}
|
150
104
|
});
|
151
105
|
}
|
152
|
-
}; // 初始化 actionRef
|
153
|
-
|
154
|
-
|
155
|
-
function initActionRef() {
|
156
|
-
state = (0, _lodash.default)(_initState);
|
157
|
-
callback = (0, _lodash.default)(initCallback);
|
158
106
|
}
|
159
107
|
/** table 组件内监听 不对外暴露 */
|
160
108
|
|
@@ -185,13 +133,16 @@ function emit(key) {
|
|
185
133
|
}
|
186
134
|
}
|
187
135
|
|
188
|
-
function
|
189
|
-
|
190
|
-
var userAction = _objectSpread(_objectSpread({}, action), mutations);
|
136
|
+
function initActionRef(ref, action) {
|
137
|
+
var userAction = _objectSpread(_objectSpread({}, action), getMutations(ref));
|
191
138
|
|
192
139
|
ref.current = userAction;
|
193
140
|
}
|
194
141
|
|
142
|
+
function useActionType(ref, action) {
|
143
|
+
ref.current = _objectSpread(_objectSpread({}, ref.current), action);
|
144
|
+
}
|
145
|
+
|
195
146
|
function cloneDeep(obj) {
|
196
147
|
return (0, _lodash.default)(obj);
|
197
148
|
}
|