wargerm 0.5.2 → 0.5.3

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/index.esm.js CHANGED
@@ -10560,7 +10560,7 @@ var ModalForm = function ModalForm(props, ref) {
10560
10560
 
10561
10561
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
10562
10562
 
10563
- var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
10563
+ var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
10564
10564
 
10565
10565
  var TabelCard = function TabelCard(props, ref) {
10566
10566
  var columns = props.columns,
@@ -10569,6 +10569,7 @@ var TabelCard = function TabelCard(props, ref) {
10569
10569
  modalFormSearch = props.modalFormSearch,
10570
10570
  search = props.search,
10571
10571
  tableAction = props.tableAction,
10572
+ fliterAction = props.fliterAction,
10572
10573
  renderTableBar = props.renderTableBar,
10573
10574
  className = props.className,
10574
10575
  style = props.style,
@@ -10773,10 +10774,13 @@ var TabelCard = function TabelCard(props, ref) {
10773
10774
 
10774
10775
  var tableActionDom = function tableActionDom(record, index) {
10775
10776
  var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
10777
+ var tableActionList = (tableAction === null || tableAction === void 0 ? void 0 : tableAction.filter(function (v) {
10778
+ return fliterAction ? fliterAction(record, v) : true;
10779
+ })) || [];
10776
10780
 
10777
- if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
10778
- var tableAction1 = tableAction.slice(0, showMoreNum);
10779
- var tableAction2 = tableAction.slice(showMoreNum);
10781
+ if (tableAction && showMoreNum > 0 && showMoreNum < tableActionList.length) {
10782
+ var tableAction1 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(0, showMoreNum);
10783
+ var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
10780
10784
  var menu = /*#__PURE__*/React.createElement(_Menu, null, tableAction2.map(function (item, i) {
10781
10785
  var _actionHandler$item$t2;
10782
10786
 
@@ -10828,7 +10832,7 @@ var TabelCard = function TabelCard(props, ref) {
10828
10832
  key: "more"
10829
10833
  }, /*#__PURE__*/React.createElement(EllipsisOutlined, null)))]);
10830
10834
  } else {
10831
- return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item, i) {
10835
+ return tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.map(function (item, i) {
10832
10836
  var _actionHandler$item$t6;
10833
10837
 
10834
10838
  var btn = actionConfig[item.type];
package/dist/index.js CHANGED
@@ -10619,7 +10619,7 @@ var ModalForm = function ModalForm(props, ref) {
10619
10619
 
10620
10620
  var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
10621
10621
 
10622
- var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
10622
+ var _excluded$h = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig", "pagination", "noBordered"];
10623
10623
 
10624
10624
  var TabelCard = function TabelCard(props, ref) {
10625
10625
  var columns = props.columns,
@@ -10628,6 +10628,7 @@ var TabelCard = function TabelCard(props, ref) {
10628
10628
  modalFormSearch = props.modalFormSearch,
10629
10629
  search = props.search,
10630
10630
  tableAction = props.tableAction,
10631
+ fliterAction = props.fliterAction,
10631
10632
  renderTableBar = props.renderTableBar,
10632
10633
  className = props.className,
10633
10634
  style = props.style,
@@ -10832,10 +10833,13 @@ var TabelCard = function TabelCard(props, ref) {
10832
10833
 
10833
10834
  var tableActionDom = function tableActionDom(record, index) {
10834
10835
  var showMoreNum = (optionColumnConfig === null || optionColumnConfig === void 0 ? void 0 : optionColumnConfig.showMoreNum) || 0;
10836
+ var tableActionList = (tableAction === null || tableAction === void 0 ? void 0 : tableAction.filter(function (v) {
10837
+ return fliterAction ? fliterAction(record, v) : true;
10838
+ })) || [];
10835
10839
 
10836
- if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
10837
- var tableAction1 = tableAction.slice(0, showMoreNum);
10838
- var tableAction2 = tableAction.slice(showMoreNum);
10840
+ if (tableAction && showMoreNum > 0 && showMoreNum < tableActionList.length) {
10841
+ var tableAction1 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(0, showMoreNum);
10842
+ var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
10839
10843
  var menu = /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'], null, tableAction2.map(function (item, i) {
10840
10844
  var _actionHandler$item$t2;
10841
10845
 
@@ -10887,7 +10891,7 @@ var TabelCard = function TabelCard(props, ref) {
10887
10891
  key: "more"
10888
10892
  }, /*#__PURE__*/React__default['default'].createElement(icons.EllipsisOutlined, null)))]);
10889
10893
  } else {
10890
- return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item, i) {
10894
+ return tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.map(function (item, i) {
10891
10895
  var _actionHandler$item$t6;
10892
10896
 
10893
10897
  var btn = actionConfig[item.type];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.5.2",
4
+ "version": "0.5.3",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",