@zat-design/sisyphus-react 3.13.22 → 3.13.23-beta.1

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.
@@ -2,6 +2,7 @@ import "antd/es/button/style";
2
2
  import _Button from "antd/es/button";
3
3
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
4
4
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
+ import { isFunction } from 'lodash';
5
6
  import EmptyImg from "../../../../../assets/empty.png";
6
7
  import locale from "../../../../../locale";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -65,6 +66,13 @@ var Empty = _ref => {
65
66
  var getBtnText = () => {
66
67
  return emptyBtnText || (addConfig === null || addConfig === void 0 ? void 0 : addConfig.label) || locale.ProForm.formListActions[6];
67
68
  };
69
+ var show = true;
70
+ if ((addConfig === null || addConfig === void 0 ? void 0 : addConfig.show) !== undefined) {
71
+ show = isFunction(addConfig.show) ? addConfig.show(form.getFieldValue(namePath), {
72
+ namePath,
73
+ form
74
+ }) : !!addConfig.show;
75
+ }
68
76
  return /*#__PURE__*/_jsxs("div", {
69
77
  className: "pro-form-list-empty",
70
78
  children: [/*#__PURE__*/_jsx("img", {
@@ -73,7 +81,7 @@ var Empty = _ref => {
73
81
  alt: "Empty"
74
82
  }), /*#__PURE__*/_jsx("div", {
75
83
  className: "pro-form-list-empty-content",
76
- children: disabled ? locale.ProForm.noData : /*#__PURE__*/_jsxs(_Fragment, {
84
+ children: disabled || !show ? locale.ProForm.noData : /*#__PURE__*/_jsxs(_Fragment, {
77
85
  children: [locale.ProForm.noData, !disabled && /*#__PURE__*/_jsxs(_Fragment, {
78
86
  children: ["\uFF0C", /*#__PURE__*/_jsx(_Button, {
79
87
  type: "link",
@@ -9,6 +9,7 @@ require("antd/es/button/style");
9
9
  var _button = _interopRequireDefault(require("antd/es/button"));
10
10
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
11
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
+ var _lodash = require("lodash");
12
13
  var _empty = _interopRequireDefault(require("../../../../../assets/empty.png"));
13
14
  var _locale = _interopRequireDefault(require("../../../../../locale"));
14
15
  var _jsxRuntime = require("react/jsx-runtime");
@@ -70,6 +71,13 @@ var Empty = _ref => {
70
71
  var getBtnText = () => {
71
72
  return emptyBtnText || (addConfig === null || addConfig === void 0 ? void 0 : addConfig.label) || _locale.default.ProForm.formListActions[6];
72
73
  };
74
+ var show = true;
75
+ if ((addConfig === null || addConfig === void 0 ? void 0 : addConfig.show) !== undefined) {
76
+ show = (0, _lodash.isFunction)(addConfig.show) ? addConfig.show(form.getFieldValue(namePath), {
77
+ namePath,
78
+ form
79
+ }) : !!addConfig.show;
80
+ }
73
81
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
74
82
  className: "pro-form-list-empty",
75
83
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -78,7 +86,7 @@ var Empty = _ref => {
78
86
  alt: "Empty"
79
87
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
80
88
  className: "pro-form-list-empty-content",
81
- children: disabled ? _locale.default.ProForm.noData : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
89
+ children: disabled || !show ? _locale.default.ProForm.noData : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
82
90
  children: [_locale.default.ProForm.noData, !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
83
91
  children: ["\uFF0C", /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
84
92
  type: "link",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.13.22",
3
+ "version": "3.13.23-beta.1",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=18.19.0"