@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.
Files changed (97) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +16740 -17360
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog-form.js +58 -9
  6. package/es/common.scss +22 -0
  7. package/es/form/Filter/SimpleFilter.js +10 -3
  8. package/es/form/Filter/index.d.ts +5 -9
  9. package/es/form/Filter/index.js +427 -154
  10. package/es/form/Filter/index.scss +33 -11
  11. package/es/form/Filter/index2.d.ts +9 -5
  12. package/es/form/Filter/index2.js +154 -370
  13. package/es/form/Filter/index2.scss +11 -33
  14. package/es/form/ProForm/index.js +4 -4
  15. package/es/form/ProForm/index.scss +5 -0
  16. package/es/form/SchemaForm/index.js +4 -4
  17. package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
  18. package/es/form/SchemaForm/initializeRequest.js +41 -5
  19. package/es/form/SchemaForm/reactions.d.ts +2 -2
  20. package/es/form/SchemaForm/reactions.js +13 -6
  21. package/es/form/index.d.ts +3 -3
  22. package/es/form/index.js +3 -3
  23. package/es/form/typing.d.ts +8 -2
  24. package/es/index.d.ts +1 -1
  25. package/es/index.js +1 -1
  26. package/es/info/components/InfoValueItem/index.js +38 -12
  27. package/es/info/components/InfoValueItem/index.scss +1 -0
  28. package/es/info/components/ProInfoItem/index.js +6 -3
  29. package/es/info/components/ProInfoItem/index.scss +9 -0
  30. package/es/info/components/baseInfo/index.js +4 -2
  31. package/es/info/components/headerInfo/index.js +2 -1
  32. package/es/info/components/tableInfo/index.js +2 -1
  33. package/es/info/index.scss +2 -0
  34. package/es/info/typing.d.ts +3 -0
  35. package/es/table/components/Filter/index.js +6 -6
  36. package/es/table/components/Layout/index.js +29 -23
  37. package/es/table/components/Layout/index.scss +7 -0
  38. package/es/table/components/ToolBar/Fullscreen.js +39 -15
  39. package/es/table/components/ToolBar/index.scss +1 -0
  40. package/es/table/index.js +122 -54
  41. package/es/table/typing.d.ts +3 -2
  42. package/es/table/utils/columnRender.js +2 -2
  43. package/es/table/utils/index.d.ts +2 -1
  44. package/es/table/utils/index.js +62 -113
  45. package/lib/actions/dialog-form.js +57 -10
  46. package/lib/common.scss +22 -0
  47. package/lib/form/Filter/SimpleFilter.js +8 -1
  48. package/lib/form/Filter/index.d.ts +5 -9
  49. package/lib/form/Filter/index.js +440 -154
  50. package/lib/form/Filter/index.scss +33 -11
  51. package/lib/form/Filter/index2.d.ts +9 -5
  52. package/lib/form/Filter/index2.js +154 -383
  53. package/lib/form/Filter/index2.scss +11 -33
  54. package/lib/form/ProForm/index.js +4 -4
  55. package/lib/form/ProForm/index.scss +5 -0
  56. package/lib/form/SchemaForm/index.js +4 -4
  57. package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
  58. package/lib/form/SchemaForm/initializeRequest.js +41 -5
  59. package/lib/form/SchemaForm/reactions.d.ts +2 -2
  60. package/lib/form/SchemaForm/reactions.js +13 -6
  61. package/lib/form/index.d.ts +3 -3
  62. package/lib/form/index.js +8 -8
  63. package/lib/form/typing.d.ts +8 -2
  64. package/lib/index.d.ts +1 -1
  65. package/lib/index.js +1 -1
  66. package/lib/info/components/InfoValueItem/index.js +38 -12
  67. package/lib/info/components/InfoValueItem/index.scss +1 -0
  68. package/lib/info/components/ProInfoItem/index.js +6 -3
  69. package/lib/info/components/ProInfoItem/index.scss +9 -0
  70. package/lib/info/components/baseInfo/index.js +4 -2
  71. package/lib/info/components/headerInfo/index.js +2 -1
  72. package/lib/info/components/tableInfo/index.js +2 -1
  73. package/lib/info/index.scss +2 -0
  74. package/lib/info/typing.d.ts +3 -0
  75. package/lib/table/components/Filter/index.js +6 -6
  76. package/lib/table/components/Layout/index.js +29 -23
  77. package/lib/table/components/Layout/index.scss +7 -0
  78. package/lib/table/components/ToolBar/Fullscreen.js +37 -14
  79. package/lib/table/components/ToolBar/index.scss +1 -0
  80. package/lib/table/index.js +121 -53
  81. package/lib/table/typing.d.ts +3 -2
  82. package/lib/table/utils/columnRender.js +2 -2
  83. package/lib/table/utils/index.d.ts +2 -1
  84. package/lib/table/utils/index.js +63 -112
  85. package/package.json +1 -1
  86. package/dist/212.js +0 -155705
  87. package/dist/fonts/codicon.ttf +0 -0
  88. package/es/form/Components/SelectTable/index.d.ts +0 -24
  89. package/es/form/Components/SelectTable/index.js +0 -135
  90. package/es/form/Components/SelectTable/index.scss +0 -28
  91. package/es/form/Components/SelectTable/table.d.ts +0 -6
  92. package/es/form/Components/SelectTable/table.js +0 -64
  93. package/lib/form/Components/SelectTable/index.d.ts +0 -24
  94. package/lib/form/Components/SelectTable/index.js +0 -157
  95. package/lib/form/Components/SelectTable/index.scss +0 -28
  96. package/lib/form/Components/SelectTable/table.d.ts +0 -6
  97. package/lib/form/Components/SelectTable/table.js +0 -76
@@ -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
- // 组件内全局状态 每次初始化 ActionRef 会重新深拷贝对象
37
- var state = {
38
- fullScreenState: false,
39
- filterRules: {},
40
- filterColumns: []
41
- };
42
-
43
- var _initState = (0, _lodash.default)(state); // state监听事件 每次初始化 ActionRef 会重新深拷贝对象
44
-
45
-
46
- var callback = {
47
- fullScreenState: {}
48
- };
49
- var initCallback = (0, _lodash.default)(callback); // 所有 ProTable 组件公用一套组件内事件转发机制
50
-
51
- var tableCallback = {}; // 组件内监听事件
52
- // 组件内对全局状态的更改
53
-
54
- var mutations = {
55
- getState: function getState() {
56
- return state;
57
- },
58
- setState: function setState(key, value) {
59
- state[key] = value;
60
- useOn(key, value);
61
-
62
- if (mutations.hasOwnProperty(key)) {
63
- mutations[key] = value;
64
- }
65
- },
66
- initState: function initState() {
67
- state = (0, _lodash.default)(_initState);
68
- },
69
- filterColumns: state.filterColumns,
70
- setFullScreenState: function setFullScreenState(fullScreenState) {
71
- state.fullScreenState = fullScreenState;
72
- useOn('fullScreenState', fullScreenState);
73
- },
74
-
75
- /**
76
- * 设置筛选列规则
77
- * @param rules 规则
78
- * @param dataIndex column.dataIndex
79
- */
80
- setFilterRules: function setFilterRules(rules) {
81
- state.filterRules = rules;
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
- return result;
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
- var useOn = function useOn(state) {
137
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
138
- args[_key - 1] = arguments[_key];
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 (_ref8) {
143
- var _ref9 = _slicedToArray(_ref8, 2),
144
- k = _ref9[0],
145
- v = _ref9[1];
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 useActionType(ref, action) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.30",
3
+ "version": "1.2.34",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",