@zat-design/sisyphus-react 3.3.0-beta.13 → 3.3.0-beta.15

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.
@@ -4,8 +4,6 @@ import _message from "antd/es/message";
4
4
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
5
  import _typeof from "@babel/runtime/helpers/esm/typeof";
6
6
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
7
- /* eslint-disable no-empty */
8
- /* eslint-disable prefer-promise-reject-errors */
9
7
  import { isFunction, get } from 'lodash';
10
8
  import locale from '../locale';
11
9
  var stringify = function stringify(data) {
@@ -145,13 +145,13 @@ var ActionButton = function ActionButton(props) {
145
145
  align: "start",
146
146
  className: "pro-form-list-action",
147
147
  children: actionProps === null || actionProps === void 0 ? void 0 : actionProps.map(function (item) {
148
- if (item.show === false) return _jsx(_Fragment, {});
148
+ if (item.show === false) return _jsx("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
149
149
  if (isFunction(item.show) && !item.show(form.getFieldValue(namePath), {
150
150
  namePath: namePath,
151
151
  index: index,
152
152
  form: form
153
153
  })) {
154
- return _jsx(_Fragment, {});
154
+ return _jsx("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
155
155
  }
156
156
  var label = item.label,
157
157
  onClick = item.onClick,
@@ -62,7 +62,7 @@ var FormList = function FormList(props, ref) {
62
62
  var handleDragEnd = function handleDragEnd(drag) {
63
63
  var active = drag.active,
64
64
  over = drag.over;
65
- if (active.id !== over.id) {
65
+ if (_fields.length > 1 && active.id !== over.id) {
66
66
  var activeIndex = _fields.findIndex(function (item) {
67
67
  return item.key === active.id;
68
68
  });
@@ -367,7 +367,9 @@ var Render = function Render(props) {
367
367
  if (type === 'FormList') {
368
368
  lastComponentProps.disabled = lastDisabled;
369
369
  var lessMode = lastComponentProps.mode === 'less';
370
- child = _jsx(_Form.List, _objectSpread(_objectSpread({}, _otherFormItemProps), {}, {
370
+ child = _jsx(_Form.List, _objectSpread(_objectSpread({
371
+ name: _otherFormItemProps.name
372
+ }, omit(_otherFormItemProps, ['rules'])), {}, {
371
373
  children: function children(fields, operation, meta) {
372
374
  return _jsx(AutoComponent, _objectSpread(_objectSpread({}, omit(lastComponentProps, ['onFieldChange', 'disabledStrictly'])), {}, {
373
375
  otherProps: otherProps,
@@ -47,23 +47,31 @@ export var useForm = function useForm(originForm) {
47
47
  };
48
48
  var _validateFields = /*#__PURE__*/function () {
49
49
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
50
- var values, _values;
50
+ var _len,
51
+ rest,
52
+ _key,
53
+ values,
54
+ _values,
55
+ _args = arguments;
51
56
  return _regeneratorRuntime().wrap(function _callee$(_context) {
52
57
  while (1) switch (_context.prev = _context.next) {
53
58
  case 0:
54
- _context.next = 2;
55
- return validateFields(nameList);
56
- case 2:
59
+ for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
60
+ rest[_key - 1] = _args[_key];
61
+ }
62
+ _context.next = 3;
63
+ return validateFields.apply(void 0, [nameList].concat(rest));
64
+ case 3:
57
65
  values = _context.sent;
58
66
  if (!nameList) {
59
- _context.next = 5;
67
+ _context.next = 6;
60
68
  break;
61
69
  }
62
70
  return _context.abrupt("return", values);
63
- case 5:
71
+ case 6:
64
72
  _values = _getFieldsValue();
65
73
  return _context.abrupt("return", _values);
66
- case 7:
74
+ case 8:
67
75
  case "end":
68
76
  return _context.stop();
69
77
  }
@@ -79,6 +79,8 @@ function Trigger(props) {
79
79
  return _jsxs(_Space.Compact, {
80
80
  block: true,
81
81
  children: [_jsxs(_Select, {
82
+ disabled: disabled,
83
+ className: classNames(disabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
82
84
  defaultValue: "appoint",
83
85
  value: state.mode,
84
86
  onChange: onAppointChange,
@@ -65,9 +65,9 @@ var ProTreeModal = function ProTreeModal(props) {
65
65
  children: 'children'
66
66
  } : _props$fieldNames,
67
67
  _props$disabled = props.disabled,
68
- disabled = _props$disabled === void 0 ? props.disabled || (props === null || props === void 0 ? void 0 : (_props$otherProps = props.otherProps) === null || _props$otherProps === void 0 ? void 0 : _props$otherProps.isView) || false : _props$disabled,
68
+ disabled = _props$disabled === void 0 ? props.disabled || props.isView || (props === null || props === void 0 ? void 0 : (_props$otherProps = props.otherProps) === null || _props$otherProps === void 0 ? void 0 : _props$otherProps.isView) || false : _props$disabled,
69
69
  _props$isView = props.isView,
70
- isView = _props$isView === void 0 ? (props === null || props === void 0 ? void 0 : (_props$otherProps2 = props.otherProps) === null || _props$otherProps2 === void 0 ? void 0 : _props$otherProps2.isView) || false : _props$isView,
70
+ isView = _props$isView === void 0 ? props.isView || (props === null || props === void 0 ? void 0 : (_props$otherProps2 = props.otherProps) === null || _props$otherProps2 === void 0 ? void 0 : _props$otherProps2.isView) || false : _props$isView,
71
71
  transformResponse = props.transformResponse,
72
72
  optionRender = props.optionRender,
73
73
  openChange = props.openChange,
@@ -169,7 +169,7 @@ var ProTreeModal = function ProTreeModal(props) {
169
169
  allKeys = state.allKeys,
170
170
  originalTreeData = state.originalTreeData;
171
171
  var treeViewData = [];
172
- if (allValue && typeof value === 'string') {
172
+ if (allValue && typeof value === 'string' && allValue === value) {
173
173
  if (modeType === LIST) {
174
174
  checkedValues = treeData.map(function (item) {
175
175
  return item[fieldNameValue];
@@ -30,8 +30,6 @@ var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"
30
30
  var _utils = require("../../../ProForm/utils");
31
31
  var _locale = _interopRequireDefault(require("../../../locale"));
32
32
  var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className"];
33
- /* eslint-disable prefer-destructuring */
34
- /* eslint-disable prefer-const */
35
33
  var RenderField = function RenderField(_ref) {
36
34
  var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4, _classNames;
37
35
  var value = _ref.text,
@@ -14,7 +14,7 @@ var _moment = _interopRequireDefault(require("moment"));
14
14
  var _ProConfigProvider = require("../../../../ProConfigProvider");
15
15
  var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
16
16
  var _Container = _interopRequireDefault(require("../../Container"));
17
- var _excluded = ["format", "otherProps", "separator"]; // @ts-check
17
+ var _excluded = ["format", "otherProps", "separator"];
18
18
  var AntRangePicker = _antd.DatePicker.RangePicker;
19
19
  var RangePicker = function RangePicker(props) {
20
20
  var _props$format = props.format,
@@ -146,13 +146,13 @@ var ActionButton = function ActionButton(props) {
146
146
  align: "start",
147
147
  className: "pro-form-list-action",
148
148
  children: actionProps === null || actionProps === void 0 ? void 0 : actionProps.map(function (item) {
149
- if (item.show === false) return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
149
+ if (item.show === false) return (0, _jsxRuntime.jsx)("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
150
150
  if ((0, _lodash.isFunction)(item.show) && !item.show(form.getFieldValue(namePath), {
151
151
  namePath: namePath,
152
152
  index: index,
153
153
  form: form
154
154
  })) {
155
- return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
155
+ return (0, _jsxRuntime.jsx)("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
156
156
  }
157
157
  var label = item.label,
158
158
  onClick = item.onClick,
@@ -68,7 +68,7 @@ var FormList = function FormList(props, ref) {
68
68
  var handleDragEnd = function handleDragEnd(drag) {
69
69
  var active = drag.active,
70
70
  over = drag.over;
71
- if (active.id !== over.id) {
71
+ if (_fields.length > 1 && active.id !== over.id) {
72
72
  var activeIndex = _fields.findIndex(function (item) {
73
73
  return item.key === active.id;
74
74
  });
@@ -13,6 +13,7 @@ var _antd = require("antd");
13
13
  var _classnames = _interopRequireDefault(require("classnames"));
14
14
  /* eslint-disable @typescript-eslint/no-shadow */
15
15
  /* eslint-disable no-param-reassign */
16
+
16
17
  var positiveInteger = {
17
18
  formatter: function formatter(value) {
18
19
  return value.replace(/[^0-9]/g, '');
@@ -11,7 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  var _antd = require("antd");
12
12
  var _moment = _interopRequireDefault(require("moment"));
13
13
  var _react = require("react");
14
- var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"]; // @ts-nocheck
14
+ var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"];
15
15
  var RangePicker = _antd.DatePicker.RangePicker;
16
16
  var defaultFormatDate = 'YYYY-MM-DD';
17
17
  var defaultPopupContainer = function defaultPopupContainer(triggerNode) {
@@ -28,7 +28,6 @@ var _useChanged3 = require("../../utils/useChanged");
28
28
  var _tip = _interopRequireDefault(require("../../../assets/tip.svg"));
29
29
  var _useRules = _interopRequireDefault(require("../../utils/useRules"));
30
30
  var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className", "rules", "required", "labelRequired", "tooltip"];
31
- /* eslint-disable prefer-destructuring */
32
31
  // 这个组件只管渲染, 参数的整理在外部处理
33
32
  var Render = function Render(props) {
34
33
  var _classNames, _otherProps$names2;
@@ -365,7 +364,9 @@ var Render = function Render(props) {
365
364
  if (type === 'FormList') {
366
365
  lastComponentProps.disabled = lastDisabled;
367
366
  var lessMode = lastComponentProps.mode === 'less';
368
- child = (0, _jsxRuntime.jsx)(_antd.Form.List, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _otherFormItemProps), {}, {
367
+ child = (0, _jsxRuntime.jsx)(_antd.Form.List, (0, _objectSpread2.default)((0, _objectSpread2.default)({
368
+ name: _otherFormItemProps.name
369
+ }, (0, _lodash.omit)(_otherFormItemProps, ['rules'])), {}, {
369
370
  children: function children(fields, operation, meta) {
370
371
  return (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, ['onFieldChange', 'disabledStrictly'])), {}, {
371
372
  otherProps: otherProps,
@@ -53,23 +53,31 @@ var useForm = exports.useForm = function useForm(originForm) {
53
53
  };
54
54
  var _validateFields = /*#__PURE__*/function () {
55
55
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nameList) {
56
- var values, _values;
56
+ var _len,
57
+ rest,
58
+ _key,
59
+ values,
60
+ _values,
61
+ _args = arguments;
57
62
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
58
63
  while (1) switch (_context.prev = _context.next) {
59
64
  case 0:
60
- _context.next = 2;
61
- return validateFields(nameList);
62
- case 2:
65
+ for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
66
+ rest[_key - 1] = _args[_key];
67
+ }
68
+ _context.next = 3;
69
+ return validateFields.apply(void 0, [nameList].concat(rest));
70
+ case 3:
63
71
  values = _context.sent;
64
72
  if (!nameList) {
65
- _context.next = 5;
73
+ _context.next = 6;
66
74
  break;
67
75
  }
68
76
  return _context.abrupt("return", values);
69
- case 5:
77
+ case 6:
70
78
  _values = _getFieldsValue();
71
79
  return _context.abrupt("return", _values);
72
- case 7:
80
+ case 8:
73
81
  case "end":
74
82
  return _context.stop();
75
83
  }
@@ -15,14 +15,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
15
15
  var _index = require("../../index");
16
16
  var _utils = require("../../utils");
17
17
  var _excluded = ["onDrag", "width", "minwidth"];
18
- /*
19
- * @Author: chongyang wanchongyang@zhongan.io
20
- * @Date: 2023-02-23 17:47:46
21
- * @LastEditors: chongyang wanchongyang@zhongan.io
22
- * @LastEditTime: 2023-03-07 20:18:22
23
- * @FilePath: /za-material-warehouse/src/ProTable/TableResizable.tsx
24
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
25
- */
26
18
  var ResizableTitle = function ResizableTitle(props) {
27
19
  var _restProps$className;
28
20
  var onDrag = props.onDrag,
@@ -17,7 +17,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
17
17
  var _lodash = require("lodash");
18
18
  var _components = require("./components");
19
19
  var _excluded = ["style", "className", "dataSource", "onChange", "transformResponse", "useRequest", "tabSearch", "mode"];
20
- /* eslint-disable @typescript-eslint/consistent-type-assertions */
21
20
  var ProTabs = function ProTabs(props, ref) {
22
21
  var style = props.style,
23
22
  className = props.className,
@@ -18,7 +18,6 @@ var _index = require("./utils/index");
18
18
  var _component = require("./component");
19
19
  var _locale = _interopRequireDefault(require("../locale"));
20
20
  var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "prefixCls", "tableBorder", "tableStripe", "theme"];
21
- /* eslint-disable prefer-const */
22
21
  var defaultCacheTime = 1; // 配置保存时间为一天
23
22
  var defaultThemeConfig = {
24
23
  zauiBrand: '#006AFF',
@@ -18,13 +18,6 @@ var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
18
18
  var _utils = require("../utils");
19
19
  var _locale = _interopRequireDefault(require("../../locale"));
20
20
  var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode"];
21
- /*
22
- *@Date: 2023-07-25 13:49:35
23
- *@LastEditTime: 2023-07-25 13:49:35
24
- *@Author: liudongliang
25
- *@Description: 树每行节点渲染组件,复选时阻止点击事件冒泡,只有点击树节点文本会向上触发onSelect事件
26
- */
27
- /* eslint-disable no-plusplus */
28
21
  var tagsBgColors = ['rgba(0, 106, 255,0.16)', 'rgba(0, 196, 74,0.16)', 'rgba(255, 140, 0,0.16)', 'rgba(255, 80, 80,0.16)', 'rgba(97, 97, 97, 0.16)'];
29
22
  var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
30
23
  function List(props) {
@@ -16,6 +16,7 @@ var _ProTreeSelect = _interopRequireDefault(require("../ProTreeSelect"));
16
16
  *@Author: liudongliang
17
17
  *@Description: ProTree组件,集成了tree和treeSelect
18
18
  */
19
+
19
20
  var ProTreeHandle = function ProTreeHandle(props) {
20
21
  var _props$mode = props.mode,
21
22
  mode = _props$mode === void 0 ? 'tree' : _props$mode;
@@ -16,7 +16,6 @@ var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
16
16
  var _CloseIcon = _interopRequireDefault(require("./CloseIcon"));
17
17
  var _utils = require("../utils");
18
18
  var _excluded = ["checkedValues", "disabled", "treeData", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "handleFilterClose", "optionRender"];
19
- /* eslint-disable no-plusplus */
20
19
  var tagsBgColors = ['rgba(0, 106, 255,0.16)', 'rgba(0, 196, 74,0.16)', 'rgba(255, 140, 0,0.16)', 'rgba(255, 80, 80,0.16)', 'rgba(97, 97, 97, 0.16)'];
21
20
  var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
22
21
  function List(props, ref) {
@@ -82,6 +82,8 @@ function Trigger(props) {
82
82
  return (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
83
83
  block: true,
84
84
  children: [(0, _jsxRuntime.jsxs)(_antd.Select, {
85
+ disabled: disabled,
86
+ className: (0, _classnames.default)(disabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
85
87
  defaultValue: "appoint",
86
88
  value: state.mode,
87
89
  onChange: onAppointChange,
@@ -66,9 +66,9 @@ var ProTreeModal = function ProTreeModal(props) {
66
66
  children: 'children'
67
67
  } : _props$fieldNames,
68
68
  _props$disabled = props.disabled,
69
- disabled = _props$disabled === void 0 ? props.disabled || (props === null || props === void 0 ? void 0 : (_props$otherProps = props.otherProps) === null || _props$otherProps === void 0 ? void 0 : _props$otherProps.isView) || false : _props$disabled,
69
+ disabled = _props$disabled === void 0 ? props.disabled || props.isView || (props === null || props === void 0 ? void 0 : (_props$otherProps = props.otherProps) === null || _props$otherProps === void 0 ? void 0 : _props$otherProps.isView) || false : _props$disabled,
70
70
  _props$isView = props.isView,
71
- isView = _props$isView === void 0 ? (props === null || props === void 0 ? void 0 : (_props$otherProps2 = props.otherProps) === null || _props$otherProps2 === void 0 ? void 0 : _props$otherProps2.isView) || false : _props$isView,
71
+ isView = _props$isView === void 0 ? props.isView || (props === null || props === void 0 ? void 0 : (_props$otherProps2 = props.otherProps) === null || _props$otherProps2 === void 0 ? void 0 : _props$otherProps2.isView) || false : _props$isView,
72
72
  transformResponse = props.transformResponse,
73
73
  optionRender = props.optionRender,
74
74
  openChange = props.openChange,
@@ -170,7 +170,7 @@ var ProTreeModal = function ProTreeModal(props) {
170
170
  allKeys = state.allKeys,
171
171
  originalTreeData = state.originalTreeData;
172
172
  var treeViewData = [];
173
- if (allValue && typeof value === 'string') {
173
+ if (allValue && typeof value === 'string' && allValue === value) {
174
174
  if (modeType === LIST) {
175
175
  checkedValues = treeData.map(function (item) {
176
176
  return item[fieldNameValue];
@@ -22,13 +22,6 @@ var _ImageRender = _interopRequireDefault(require("./components/ImageRender"));
22
22
  var _uitls = require("./uitls");
23
23
  var _locale = _interopRequireDefault(require("../locale"));
24
24
  var _excluded = ["value", "size", "action", "maxCount", "headerRender", "footerRender", "disabled", "uploadType", "buttonProps", "accept", "extraTipText", "beforeUpload", "onChange", "onDownload", "onPreview", "onRemove", "method", "className", "dataParams", "name", "showExampleContent", "showUploadList", "otherProps", "transformResponse", "exampleTitle", "exampleContent", "exampleModalProps", "buttonText", "afterRender", "fieldNames"];
25
- /*
26
- * @Author: wangshengqiang
27
- * @Date: 2023-02-03 14:18:59
28
- * @LastEditTime: 2023-11-14 18:32:13
29
- * @LastEditors: wangshengqiang
30
- * @Description: 上传控件
31
- */
32
25
  var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
33
26
  var _locale$ProUpload;
34
27
  var _useState = (0, _react.useState)([]),
@@ -16,7 +16,6 @@ var _antd = require("antd");
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _locale = _interopRequireDefault(require("../locale"));
18
18
  var _locale$ProViewer;
19
- /* eslint-disable jsx-a11y/iframe-has-title */
20
19
  // 用于解析word | excel
21
20
  var officeApp = 'https://view.officeapps.live.com/op/view.aspx?src=';
22
21
  // 文件MIME类型
@@ -11,7 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  var _antd = require("antd");
12
12
  var _moment = _interopRequireDefault(require("moment"));
13
13
  var _react = require("react");
14
- var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"]; // @ts-nocheck
14
+ var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"];
15
15
  var RangePicker = _antd.DatePicker.RangePicker;
16
16
  var defaultFormatDate = 'YYYY-MM-DD';
17
17
  var defaultPopupContainer = function defaultPopupContainer(triggerNode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.3.0-beta.13",
3
+ "version": "3.3.0-beta.15",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",