wargerm 0.5.1 → 0.5.4

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.
@@ -20,5 +20,5 @@ declare type Props = {
20
20
  sliderTabs?: IsliderTabs;
21
21
  style?: Record<string, string>;
22
22
  };
23
- declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
23
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>>;
24
24
  export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
package/dist/index.esm.js CHANGED
@@ -8351,7 +8351,7 @@ function Table(_ref) {
8351
8351
  }
8352
8352
  }, _callee);
8353
8353
  }))();
8354
- }, [params, pageParams, pagination, tableList, formSearch, columns]);
8354
+ }, [JSON.stringify(params), JSON.stringify(pageParams), JSON.stringify(pagination), JSON.stringify(tableList), formSearch, JSON.stringify(columns)]);
8355
8355
 
8356
8356
  var onFormSubmit = function onFormSubmit(values) {
8357
8357
  onSubmit && onSubmit(values);
@@ -9561,6 +9561,7 @@ var Index$c = function Index(_ref, ref) {
9561
9561
  className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
9562
9562
  }, (sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.renderTab) ? sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.renderTab : sliderTabs === null || sliderTabs === void 0 ? void 0 : (_sliderTabs$tabs = sliderTabs.tabs) === null || _sliderTabs$tabs === void 0 ? void 0 : _sliderTabs$tabs.map(function (item, index) {
9563
9563
  return /*#__PURE__*/React.createElement("div", {
9564
+ key: index,
9564
9565
  className: "tab ".concat(index == activeTab ? "active ".concat(sliderTabs.activeTabClassName || '') : '', " ").concat(sliderTabs.tabClassName || '')
9565
9566
  }, /*#__PURE__*/React.createElement("span", {
9566
9567
  onClick: function onClick() {
@@ -9571,7 +9572,7 @@ var Index$c = function Index(_ref, ref) {
9571
9572
  }))));
9572
9573
  };
9573
9574
 
9574
- var index$2 = /*#__PURE__*/forwardRef(Index$c);
9575
+ var index$2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(Index$c));
9575
9576
 
9576
9577
  var controlShow = function controlShow(f1, f2, value, timer) {
9577
9578
  f1(value);
@@ -10559,7 +10560,7 @@ var ModalForm = function ModalForm(props, ref) {
10559
10560
 
10560
10561
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
10561
10562
 
10562
- 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"];
10563
10564
 
10564
10565
  var TabelCard = function TabelCard(props, ref) {
10565
10566
  var columns = props.columns,
@@ -10568,6 +10569,7 @@ var TabelCard = function TabelCard(props, ref) {
10568
10569
  modalFormSearch = props.modalFormSearch,
10569
10570
  search = props.search,
10570
10571
  tableAction = props.tableAction,
10572
+ fliterAction = props.fliterAction,
10571
10573
  renderTableBar = props.renderTableBar,
10572
10574
  className = props.className,
10573
10575
  style = props.style,
@@ -10772,10 +10774,13 @@ var TabelCard = function TabelCard(props, ref) {
10772
10774
 
10773
10775
  var tableActionDom = function tableActionDom(record, index) {
10774
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
+ })) || [];
10775
10780
 
10776
- if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
10777
- var tableAction1 = tableAction.slice(0, showMoreNum);
10778
- 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);
10779
10784
  var menu = /*#__PURE__*/React.createElement(_Menu, null, tableAction2.map(function (item, i) {
10780
10785
  var _actionHandler$item$t2;
10781
10786
 
@@ -10827,7 +10832,7 @@ var TabelCard = function TabelCard(props, ref) {
10827
10832
  key: "more"
10828
10833
  }, /*#__PURE__*/React.createElement(EllipsisOutlined, null)))]);
10829
10834
  } else {
10830
- 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) {
10831
10836
  var _actionHandler$item$t6;
10832
10837
 
10833
10838
  var btn = actionConfig[item.type];
package/dist/index.js CHANGED
@@ -8410,7 +8410,7 @@ function Table(_ref) {
8410
8410
  }
8411
8411
  }, _callee);
8412
8412
  }))();
8413
- }, [params, pageParams, pagination, tableList, formSearch, columns]);
8413
+ }, [JSON.stringify(params), JSON.stringify(pageParams), JSON.stringify(pagination), JSON.stringify(tableList), formSearch, JSON.stringify(columns)]);
8414
8414
 
8415
8415
  var onFormSubmit = function onFormSubmit(values) {
8416
8416
  onSubmit && onSubmit(values);
@@ -9620,6 +9620,7 @@ var Index$c = function Index(_ref, ref) {
9620
9620
  className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
9621
9621
  }, (sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.renderTab) ? sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.renderTab : sliderTabs === null || sliderTabs === void 0 ? void 0 : (_sliderTabs$tabs = sliderTabs.tabs) === null || _sliderTabs$tabs === void 0 ? void 0 : _sliderTabs$tabs.map(function (item, index) {
9622
9622
  return /*#__PURE__*/React__default['default'].createElement("div", {
9623
+ key: index,
9623
9624
  className: "tab ".concat(index == activeTab ? "active ".concat(sliderTabs.activeTabClassName || '') : '', " ").concat(sliderTabs.tabClassName || '')
9624
9625
  }, /*#__PURE__*/React__default['default'].createElement("span", {
9625
9626
  onClick: function onClick() {
@@ -9630,7 +9631,7 @@ var Index$c = function Index(_ref, ref) {
9630
9631
  }))));
9631
9632
  };
9632
9633
 
9633
- var index$2 = /*#__PURE__*/React.forwardRef(Index$c);
9634
+ var index$2 = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Index$c));
9634
9635
 
9635
9636
  var controlShow = function controlShow(f1, f2, value, timer) {
9636
9637
  f1(value);
@@ -10618,7 +10619,7 @@ var ModalForm = function ModalForm(props, ref) {
10618
10619
 
10619
10620
  var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
10620
10621
 
10621
- 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"];
10622
10623
 
10623
10624
  var TabelCard = function TabelCard(props, ref) {
10624
10625
  var columns = props.columns,
@@ -10627,6 +10628,7 @@ var TabelCard = function TabelCard(props, ref) {
10627
10628
  modalFormSearch = props.modalFormSearch,
10628
10629
  search = props.search,
10629
10630
  tableAction = props.tableAction,
10631
+ fliterAction = props.fliterAction,
10630
10632
  renderTableBar = props.renderTableBar,
10631
10633
  className = props.className,
10632
10634
  style = props.style,
@@ -10831,10 +10833,13 @@ var TabelCard = function TabelCard(props, ref) {
10831
10833
 
10832
10834
  var tableActionDom = function tableActionDom(record, index) {
10833
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
+ })) || [];
10834
10839
 
10835
- if (tableAction && showMoreNum > 0 && showMoreNum < tableAction.length) {
10836
- var tableAction1 = tableAction.slice(0, showMoreNum);
10837
- 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);
10838
10843
  var menu = /*#__PURE__*/React__default['default'].createElement(_Menu__default['default'], null, tableAction2.map(function (item, i) {
10839
10844
  var _actionHandler$item$t2;
10840
10845
 
@@ -10886,7 +10891,7 @@ var TabelCard = function TabelCard(props, ref) {
10886
10891
  key: "more"
10887
10892
  }, /*#__PURE__*/React__default['default'].createElement(icons.EllipsisOutlined, null)))]);
10888
10893
  } else {
10889
- 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) {
10890
10895
  var _actionHandler$item$t6;
10891
10896
 
10892
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.1",
4
+ "version": "0.5.4",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",