@teamix/pro 1.2.16 → 1.2.17
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 +72 -31
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/index.d.ts +2 -0
- package/es/actions/index.js +28 -14
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/nocode/configurators/ProTable.js +1 -0
- package/es/table/components/Filter/index.js +42 -16
- package/es/table/utils/columnRender.js +1 -1
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.js +28 -14
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/nocode/configurators/ProTable.js +1 -0
- package/lib/table/components/Filter/index.js +42 -16
- package/lib/table/utils/columnRender.js +1 -1
- package/package.json +1 -1
package/dist/pro.js
CHANGED
@@ -57960,8 +57960,8 @@ var _excluded = ["type"],
|
|
57960
57960
|
_excluded3 = ["loading"],
|
57961
57961
|
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
|
57962
57962
|
_excluded5 = ["context", "text"],
|
57963
|
-
_excluded6 = ["actions"],
|
57964
|
-
_excluded7 = ["config"],
|
57963
|
+
_excluded6 = ["key", "actions"],
|
57964
|
+
_excluded7 = ["key", "config"],
|
57965
57965
|
_excluded8 = ["type", "divider", "max", "moreText", "context", "actions", "className"];
|
57966
57966
|
|
57967
57967
|
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); }
|
@@ -58150,8 +58150,8 @@ function renderCommonActionButtonMenuItem(action, key, context) {
|
|
58150
58150
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Menu.SubMenu, {
|
58151
58151
|
key: key,
|
58152
58152
|
label: menuBtn.label || menuBtn.children
|
58153
|
-
}, menuBtn.actions.map(function (a
|
58154
|
-
return renderCommonActionButtonMenuItem(a,
|
58153
|
+
}, menuBtn.actions.map(function (a) {
|
58154
|
+
return renderCommonActionButtonMenuItem(a, a.key, context);
|
58155
58155
|
}));
|
58156
58156
|
}
|
58157
58157
|
|
@@ -58186,7 +58186,7 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
|
|
58186
58186
|
type: type,
|
58187
58187
|
label: buttonContent(label || children, icon, iconSize, context)
|
58188
58188
|
}, others), actions.map(function (action, i) {
|
58189
|
-
return renderCommonActionButtonMenuItem(action,
|
58189
|
+
return renderCommonActionButtonMenuItem(action, action.key || i, context);
|
58190
58190
|
}));
|
58191
58191
|
};
|
58192
58192
|
|
@@ -58198,7 +58198,9 @@ function formatGroupActions(actions, max, moreConfig) {
|
|
58198
58198
|
return actions;
|
58199
58199
|
}
|
58200
58200
|
|
58201
|
-
return [].concat(actions.slice(0, MAX - 1), [_objectSpread(_objectSpread({
|
58201
|
+
return [].concat(actions.slice(0, MAX - 1), [_objectSpread(_objectSpread({
|
58202
|
+
key: '__teamix_pro_action_group_more_btn'
|
58203
|
+
}, moreConfig), {}, {
|
58202
58204
|
actions: actions.slice(MAX - 1)
|
58203
58205
|
})]);
|
58204
58206
|
} // 渲染一个 button 或者 menu button
|
@@ -58244,24 +58246,36 @@ function getDefaultMoreButton(type, moreText) {
|
|
58244
58246
|
|
58245
58247
|
var MAX_ACTTIONS = 4;
|
58246
58248
|
|
58247
|
-
function
|
58249
|
+
function getKey(index, key) {
|
58250
|
+
if (key !== undefined) {
|
58251
|
+
return key;
|
58252
|
+
}
|
58253
|
+
|
58254
|
+
return "__teamix_pro_action_key_" + index;
|
58255
|
+
}
|
58256
|
+
|
58257
|
+
function getActionConfig(action, index, context) {
|
58248
58258
|
if (action.actions) {
|
58249
58259
|
var _ref = action,
|
58260
|
+
_key = _ref.key,
|
58250
58261
|
actions = _ref.actions,
|
58251
58262
|
_others = _objectWithoutPropertiesLoose(_ref, _excluded6);
|
58252
58263
|
|
58253
58264
|
return _objectSpread({
|
58254
|
-
|
58255
|
-
|
58265
|
+
key: getKey(index, _key),
|
58266
|
+
actions: actions.map(function (a, j) {
|
58267
|
+
return getActionConfig(a, j, context);
|
58256
58268
|
})
|
58257
58269
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getTargetValue)(_others, context));
|
58258
58270
|
}
|
58259
58271
|
|
58260
58272
|
var _ref2 = action,
|
58273
|
+
key = _ref2.key,
|
58261
58274
|
config = _ref2.config,
|
58262
58275
|
others = _objectWithoutPropertiesLoose(_ref2, _excluded7);
|
58263
58276
|
|
58264
58277
|
return _objectSpread({
|
58278
|
+
key: getKey(index, key),
|
58265
58279
|
config: config
|
58266
58280
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getTargetValue)(others, context));
|
58267
58281
|
}
|
@@ -58281,8 +58295,8 @@ function ProActionGroup(props) {
|
|
58281
58295
|
containerProps = _objectWithoutPropertiesLoose(props, _excluded8);
|
58282
58296
|
|
58283
58297
|
var isTypeText = type === 'text';
|
58284
|
-
var filteredActions = actions.map(function (action) {
|
58285
|
-
return getActionConfig(action, context);
|
58298
|
+
var filteredActions = actions.map(function (action, index) {
|
58299
|
+
return getActionConfig(action, index, context);
|
58286
58300
|
}).filter(function (action) {
|
58287
58301
|
return action.visible !== false;
|
58288
58302
|
});
|
@@ -58294,7 +58308,7 @@ function ProActionGroup(props) {
|
|
58294
58308
|
}, containerProps), formatedActions.map(function (actionBtn, i) {
|
58295
58309
|
var isLastOne = i === formatedActions.length - 1;
|
58296
58310
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
|
58297
|
-
key:
|
58311
|
+
key: actionBtn.key
|
58298
58312
|
}, renderCommonActionButton(actionBtn, context, isTypeText), isTypeText && divider && !isLastOne && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Divider, {
|
58299
58313
|
direction: "ver"
|
58300
58314
|
}));
|
@@ -62353,7 +62367,7 @@ _teamix_icon__WEBPACK_IMPORTED_MODULE_13__/* ["default"].setConfig */ .Z.setConf
|
|
62353
62367
|
|
62354
62368
|
// export * from './sidebar';
|
62355
62369
|
|
62356
|
-
var version = '1.2.
|
62370
|
+
var version = '1.2.16';
|
62357
62371
|
|
62358
62372
|
|
62359
62373
|
/***/ }),
|
@@ -63963,6 +63977,7 @@ var initialValues = {
|
|
63963
63977
|
},
|
63964
63978
|
mainAction: {
|
63965
63979
|
actions: [{
|
63980
|
+
key: 'action',
|
63966
63981
|
children: '操作按钮'
|
63967
63982
|
}]
|
63968
63983
|
}
|
@@ -65593,7 +65608,7 @@ var Filter = function Filter(props) {
|
|
65593
65608
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Dropdown, {
|
65594
65609
|
trigger: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_teamix_icon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
65595
65610
|
size: "small",
|
65596
|
-
type:
|
65611
|
+
type: selected.length > 0 && visible === false ? 'filter-fill' : 'filter-line',
|
65597
65612
|
className: cls({
|
65598
65613
|
icon: true,
|
65599
65614
|
'icon-selected': selected.length > 0
|
@@ -65601,7 +65616,9 @@ var Filter = function Filter(props) {
|
|
65601
65616
|
onClick: function onClick() {
|
65602
65617
|
setVisible(!visible);
|
65603
65618
|
}
|
65604
|
-
})
|
65619
|
+
}) //@ts-ignore
|
65620
|
+
,
|
65621
|
+
v2: true,
|
65605
65622
|
triggerType: ['click'],
|
65606
65623
|
align: "tl bl",
|
65607
65624
|
visible: visible,
|
@@ -65624,7 +65641,7 @@ var Filter = function Filter(props) {
|
|
65624
65641
|
btn: true
|
65625
65642
|
}),
|
65626
65643
|
onClick: function onClick() {
|
65627
|
-
var _actionRef$current2, _actionRef$current$ge4, _actionRef$current3, _actionRef$current3$g, _actionRef$current4,
|
65644
|
+
var _actionRef$current2, _actionRef$current$ge4, _actionRef$current3, _actionRef$current3$g, _actionRef$current4, _objectSpread2;
|
65628
65645
|
|
65629
65646
|
(_actionRef$current2 = actionRef.current) == null ? void 0 : _actionRef$current2.filterDataSource == null ? void 0 : _actionRef$current2.filterDataSource(column.dataIndex); // 先获取此列的param
|
65630
65647
|
|
@@ -65649,24 +65666,30 @@ var Filter = function Filter(props) {
|
|
65649
65666
|
return null;
|
65650
65667
|
}), [[column.dataIndex, param]]).filter(function (item) {
|
65651
65668
|
return item && (item == null ? void 0 : item[1]);
|
65652
|
-
}));
|
65653
|
-
var targetPageKey = 'currentPage';
|
65654
|
-
var pageInfo = (_actionRef$current4 = actionRef.current) == null ? void 0 : _actionRef$current4.pageInfo;
|
65655
|
-
|
65656
|
-
if (pageInfo && pageInfo != null && pageInfo.targetPageKey) {
|
65657
|
-
targetPageKey = pageInfo == null ? void 0 : pageInfo.targetPageKey;
|
65658
|
-
} // 再设置所有的列筛选状态
|
65669
|
+
})); // 再设置所有的列筛选状态
|
65659
65670
|
|
65660
|
-
|
65661
|
-
(_actionRef$current5 = actionRef.current) == null ? void 0 : _actionRef$current5.setFilterRules == null ? void 0 : _actionRef$current5.setFilterRules(_objectSpread(_objectSpread({}, rules), {}, (_objectSpread2 = {}, _objectSpread2[column.dataIndex] = {
|
65671
|
+
(_actionRef$current4 = actionRef.current) == null ? void 0 : _actionRef$current4.setFilterRules == null ? void 0 : _actionRef$current4.setFilterRules(_objectSpread(_objectSpread({}, rules), {}, (_objectSpread2 = {}, _objectSpread2[column.dataIndex] = {
|
65662
65672
|
rules: selected,
|
65663
65673
|
params: param
|
65664
|
-
}, _objectSpread2)));
|
65674
|
+
}, _objectSpread2)));
|
65675
|
+
|
65676
|
+
if (selected.length > 0) {
|
65677
|
+
var _actionRef$current5, _actionRef$current6, _objectSpread3, _actionRef$current7, _actionRef$current8;
|
65678
|
+
|
65679
|
+
var targetPageKey = 'currentPage';
|
65680
|
+
var pageInfo = (_actionRef$current5 = actionRef.current) == null ? void 0 : _actionRef$current5.pageInfo;
|
65665
65681
|
|
65666
|
-
|
65667
|
-
|
65682
|
+
if (pageInfo && pageInfo != null && pageInfo.targetPageKey) {
|
65683
|
+
targetPageKey = pageInfo == null ? void 0 : pageInfo.targetPageKey;
|
65684
|
+
} // 发送请求
|
65685
|
+
|
65686
|
+
|
65687
|
+
(_actionRef$current6 = actionRef.current) == null ? void 0 : _actionRef$current6.request == null ? void 0 : _actionRef$current6.request(_objectSpread(_objectSpread({}, params), {}, (_objectSpread3 = {}, _objectSpread3[targetPageKey] = 1, _objectSpread3)));
|
65688
|
+
(_actionRef$current7 = actionRef.current) == null ? void 0 : _actionRef$current7.resetPage == null ? void 0 : _actionRef$current7.resetPage(); // 清空表格选择
|
65689
|
+
|
65690
|
+
(_actionRef$current8 = actionRef.current) == null ? void 0 : _actionRef$current8.clearRowSelection == null ? void 0 : _actionRef$current8.clearRowSelection();
|
65691
|
+
}
|
65668
65692
|
|
65669
|
-
(_actionRef$current8 = actionRef.current) == null ? void 0 : _actionRef$current8.clearRowSelection == null ? void 0 : _actionRef$current8.clearRowSelection();
|
65670
65693
|
setVisible(false);
|
65671
65694
|
}
|
65672
65695
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_3__.getMessage)('ok')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
|
@@ -65684,7 +65707,25 @@ var Filter = function Filter(props) {
|
|
65684
65707
|
rules: [],
|
65685
65708
|
params: ''
|
65686
65709
|
}, _objectSpread4)));
|
65687
|
-
(_actionRef$current11 = actionRef.current) == null ? void 0 : _actionRef$current11.filterDataSource == null ? void 0 : _actionRef$current11.filterDataSource(column.dataIndex);
|
65710
|
+
(_actionRef$current11 = actionRef.current) == null ? void 0 : _actionRef$current11.filterDataSource == null ? void 0 : _actionRef$current11.filterDataSource(column.dataIndex);
|
65711
|
+
|
65712
|
+
if (selected.length > 0) {
|
65713
|
+
var _actionRef$current12, _actionRef$current13, _actionRef$current13$, _actionRef$current14, _actionRef$current15;
|
65714
|
+
|
65715
|
+
var targetPageKey = 'currentPage';
|
65716
|
+
var pageInfo = (_actionRef$current12 = actionRef.current) == null ? void 0 : _actionRef$current12.pageInfo;
|
65717
|
+
|
65718
|
+
if (pageInfo && pageInfo != null && pageInfo.targetPageKey) {
|
65719
|
+
targetPageKey = pageInfo == null ? void 0 : pageInfo.targetPageKey;
|
65720
|
+
} // 发送请求
|
65721
|
+
|
65722
|
+
|
65723
|
+
(_actionRef$current13 = actionRef.current) == null ? void 0 : _actionRef$current13.request == null ? void 0 : _actionRef$current13.request((_actionRef$current13$ = {}, _actionRef$current13$[targetPageKey] = 1, _actionRef$current13$));
|
65724
|
+
(_actionRef$current14 = actionRef.current) == null ? void 0 : _actionRef$current14.resetPage == null ? void 0 : _actionRef$current14.resetPage(); // 清空表格选择
|
65725
|
+
|
65726
|
+
(_actionRef$current15 = actionRef.current) == null ? void 0 : _actionRef$current15.clearRowSelection == null ? void 0 : _actionRef$current15.clearRowSelection();
|
65727
|
+
} // setVisible(!visible);
|
65728
|
+
|
65688
65729
|
}
|
65689
65730
|
}, (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_3__.getMessage)('reset'))))));
|
65690
65731
|
};
|
@@ -67717,7 +67758,7 @@ var renderColumnsTitle = function renderColumnsTitle(item, actionRef) {
|
|
67717
67758
|
};
|
67718
67759
|
|
67719
67760
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_teamix_utils__WEBPACK_IMPORTED_MODULE_1__.LabelIconTip, {
|
67720
|
-
label:
|
67761
|
+
label: item.title,
|
67721
67762
|
tooltip: item.tooltip,
|
67722
67763
|
icon: item.tooltipIcon
|
67723
67764
|
}), item.filters && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_Filter__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|