@zat-design/sisyphus-react 3.13.6-beta.1 → 3.13.6-beta.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.
@@ -1,45 +1,19 @@
1
1
  import "antd/es/tooltip/style";
2
2
  import _Tooltip from "antd/es/tooltip";
3
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
5
- import { useEffect, useState } from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
6
4
  var AdaptiveTooltip = function AdaptiveTooltip(_ref) {
7
5
  var children = _ref.children;
8
- var _useState = useState('right'),
9
- _useState2 = _slicedToArray(_useState, 2),
10
- placement = _useState2[0],
11
- setPlacement = _useState2[1];
12
- useEffect(function () {
13
- var handleResize = function handleResize() {
14
- var tooltipElement = document.getElementById('adaptive-tooltip');
15
- if (tooltipElement) {
16
- var boundingRect = tooltipElement.getBoundingClientRect();
17
- var windowWidth = window.innerWidth;
18
- if (windowWidth - boundingRect.right < 150) {
19
- setPlacement('left');
20
- } else {
21
- setPlacement('right');
22
- }
23
- }
24
- };
25
- window.addEventListener('resize', handleResize);
26
- handleResize();
27
- return function () {
28
- window.removeEventListener('resize', handleResize);
29
- };
30
- }, [children]);
31
6
  return _jsx(_Tooltip, {
32
- placement: placement,
7
+ placement: "rightTop",
33
8
  title: _jsx("div", {
34
9
  onMouseDown: function onMouseDown(e) {
35
10
  return e.stopPropagation();
36
11
  },
37
12
  children: children
38
13
  }),
39
- id: "adaptive-tooltip",
40
- children: _jsxs("span", {
14
+ children: _jsx("span", {
41
15
  className: "pro-tree-wrap-ellipse",
42
- children: [" ", children]
16
+ children: children
43
17
  })
44
18
  });
45
19
  };
@@ -75,7 +75,6 @@ var ProTree = function ProTree(props) {
75
75
  showExpand = _props$showExpand === void 0 ? false : _props$showExpand,
76
76
  defaultExpandAll = props.defaultExpandAll,
77
77
  other = _objectWithoutProperties(props, _excluded);
78
- var fieldNameLabel = fieldNames.label;
79
78
  var fieldNameValue = fieldNames.value;
80
79
  var _useSetState = useSetState({
81
80
  open: false,
@@ -12,20 +12,22 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
12
12
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
13
  import "antd/es/tree-select/style";
14
14
  import _TreeSelect from "antd/es/tree-select";
15
- var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className", "checkStrictly", "checkable"],
15
+ var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "placeholder", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className", "checkStrictly", "checkable"],
16
16
  _excluded2 = ["children"];
17
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
18
  /* eslint-disable react/no-danger */
19
19
  /* eslint-disable react/jsx-closing-tag-location */
20
20
  import { useDeepCompareEffect, useRequest as useRequestFunc, useSetState } from 'ahooks';
21
21
  import classnames from 'classnames';
22
- import { useImperativeHandle, forwardRef } from 'react';
22
+ import { useImperativeHandle, forwardRef, useCallback } from 'react';
23
23
  import { cloneDeep, debounce } from 'lodash';
24
+ import locale from '../../../locale';
24
25
  import { useProConfig } from '../../../ProConfigProvider';
25
26
  import Container from '../../../ProForm/components/Container';
26
27
  import AdaptiveTooltip from '../AdaptiveTooltip';
27
28
  var SHOW_PARENT = _TreeSelect.SHOW_PARENT;
28
29
  export var ProTreeSelect = function ProTreeSelect(props, ref) {
30
+ var _useRequest$options;
29
31
  // 全局属性配置在ConfigProvider
30
32
  var _ref = useProConfig('ProTreeSelect') || {},
31
33
  _ref$fieldNames = _ref.fieldNames,
@@ -50,6 +52,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
50
52
  useRequest = props.useRequest,
51
53
  transformResponse = props.transformResponse,
52
54
  fieldNames = props.fieldNames,
55
+ placeholder = props.placeholder,
53
56
  _props$tooltip = props.tooltip,
54
57
  tooltip = _props$tooltip === void 0 ? false : _props$tooltip,
55
58
  _props$showSearch = props.showSearch,
@@ -168,11 +171,26 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
168
171
  origDataSource: resultData || []
169
172
  });
170
173
  };
174
+ var successTransformDataHandle = useCallback(function (res) {
175
+ if (transformResponse && typeof transformResponse === 'function') {
176
+ return transformResponse(res);
177
+ }
178
+ var _ref4 = res || {},
179
+ _ref4$status = _ref4.status,
180
+ status = _ref4$status === void 0 ? 200 : _ref4$status,
181
+ msg = _ref4.message,
182
+ data = _ref4.data;
183
+ if (status !== 200) {
184
+ _message.error(msg);
185
+ return;
186
+ }
187
+ return data;
188
+ }, []);
171
189
  // 配置了异步数据源,拉取枚举数据逻辑 如果有code不掉接口从local里根据code取值
172
190
  var fetchFunction = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread({
173
191
  manual: true,
192
+ debounceWait: 300,
174
193
  onSuccess: function onSuccess(data) {
175
- // 用户配置了处理枚举函数
176
194
  if (transformResponse && typeof transformResponse === 'function') {
177
195
  var responseData = transformResponse(data);
178
196
  var resultData = transferDataSource(responseData, showCodeName);
@@ -181,16 +199,33 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
181
199
  origDataSource: resultData
182
200
  });
183
201
  } else {
184
- defaultOnSuccessFun(data);
202
+ defaultOnSuccessFun(fetchFunction.data);
185
203
  }
186
- },
187
- debounceWait: 300
204
+ }
188
205
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options));
206
+ var cacheList = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.cacheKey) ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
189
207
  useImperativeHandle(ref, function () {
190
208
  return {
191
209
  useRequestRef: fetchFunction
192
210
  };
193
211
  });
212
+ // 设置cacheKey后使用缓存的数据
213
+ useDeepCompareEffect(function () {
214
+ var _useRequest$options2;
215
+ if (fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.cacheKey) {
216
+ if (transformResponse && typeof transformResponse === 'function') {
217
+ var responseData = transformResponse(fetchFunction.data);
218
+ // debugger;
219
+ var resultData = transferDataSource(responseData, showCodeName);
220
+ setState({
221
+ selectList: countChild(resultData),
222
+ origDataSource: resultData
223
+ });
224
+ } else {
225
+ defaultOnSuccessFun(fetchFunction.data);
226
+ }
227
+ }
228
+ }, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
194
229
  useDeepCompareEffect(function () {
195
230
  if (enumCode) {
196
231
  var dictEnum = dics[enumCode] || [];
@@ -212,17 +247,21 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
212
247
  if (enumCode || dataSource) {
213
248
  return undefined;
214
249
  }
250
+ // 如果配置手动加载,不执行请求
251
+ var _ref5 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
252
+ defaultParams = _ref5.defaultParams,
253
+ manual = _ref5.manual;
215
254
  // disabled 状态时,不查询接口
216
255
  if (defaultDisableValue || !useRequest) {
217
256
  return undefined;
218
257
  }
219
- // 如果配置手动加载,不执行请求
220
- var _ref4 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
221
- defaultParams = _ref4.defaultParams;
258
+ if (manual || (cacheList === null || cacheList === void 0 ? void 0 : cacheList.length)) {
259
+ return;
260
+ }
222
261
  var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
223
262
  // 执行用户配置的枚举服务,拉取枚举数据进行更新
224
263
  fetchFunction.run(params);
225
- }, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, defaultDisableValue]);
264
+ }, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options, defaultDisableValue]);
226
265
  // disable默认值
227
266
  if (defaultDisableValue) {
228
267
  return _jsx("span", {
@@ -399,7 +438,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
399
438
  return sourceList;
400
439
  }
401
440
  var searchTreeEvent = debounce(/*#__PURE__*/function () {
402
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
441
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
403
442
  var result;
404
443
  return _regeneratorRuntime().wrap(function _callee$(_context) {
405
444
  while (1) switch (_context.prev = _context.next) {
@@ -424,7 +463,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
424
463
  }, _callee);
425
464
  }));
426
465
  return function (_x) {
427
- return _ref5.apply(this, arguments);
466
+ return _ref6.apply(this, arguments);
428
467
  };
429
468
  }(), 500);
430
469
  function findTreeNode(treeList, nodeValue) {
@@ -565,6 +604,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
565
604
  onClick: nodeChangeEvent,
566
605
  className: cls,
567
606
  children: _jsx(_TreeSelect, _objectSpread(_objectSpread({
607
+ placeholder: placeholder || locale.ProForm.treeSelectPlaceholder,
568
608
  maxTagPlaceholder: function maxTagPlaceholder(rest) {
569
609
  var _rest = rest.map(function (tag) {
570
610
  var _tag$label, _tag$label$props, _tag$label2, _tag$label2$props, _tag$label2$props$chi, _tag$label2$props$chi2, _tag$label2$props$chi3, _tag$label3, _tag$label3$props, _tag$label3$props$dan;
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  unfold: string;
26
26
  packUp: string;
27
27
  inputPlaceholder: string;
28
+ treeSelectPlaceholder: string;
28
29
  selectPlaceHolder: string;
29
30
  switchText: string[];
30
31
  ruleStartEndText: string[];
@@ -25,6 +25,7 @@ export default {
25
25
  unfold: 'Unfold',
26
26
  packUp: 'PackUp',
27
27
  inputPlaceholder: 'Please enter',
28
+ treeSelectPlaceholder: 'Please select',
28
29
  selectPlaceHolder: 'Please select',
29
30
  switchText: ['Yes', 'No'],
30
31
  ruleStartEndText: ['start value', 'end value'],
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  unfold: string;
26
26
  packUp: string;
27
27
  inputPlaceholder: string;
28
+ treeSelectPlaceholder: string;
28
29
  selectPlaceHolder: string;
29
30
  switchText: string[];
30
31
  ruleStartEndText: string[];
@@ -25,6 +25,7 @@ export default {
25
25
  unfold: '展开',
26
26
  packUp: '收起',
27
27
  inputPlaceholder: '请输入',
28
+ treeSelectPlaceholder: '请选择',
28
29
  selectPlaceHolder: '请选择',
29
30
  switchText: ['是', '否'],
30
31
  ruleStartEndText: ['起始值', '截止值'],
@@ -1,51 +1,24 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
7
  var _jsxRuntime = require("react/jsx-runtime");
10
8
  var _antd = require("antd");
11
- var _react = require("react");
12
9
  var AdaptiveTooltip = function AdaptiveTooltip(_ref) {
13
10
  var children = _ref.children;
14
- var _useState = (0, _react.useState)('right'),
15
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
16
- placement = _useState2[0],
17
- setPlacement = _useState2[1];
18
- (0, _react.useEffect)(function () {
19
- var handleResize = function handleResize() {
20
- var tooltipElement = document.getElementById('adaptive-tooltip');
21
- if (tooltipElement) {
22
- var boundingRect = tooltipElement.getBoundingClientRect();
23
- var windowWidth = window.innerWidth;
24
- if (windowWidth - boundingRect.right < 150) {
25
- setPlacement('left');
26
- } else {
27
- setPlacement('right');
28
- }
29
- }
30
- };
31
- window.addEventListener('resize', handleResize);
32
- handleResize();
33
- return function () {
34
- window.removeEventListener('resize', handleResize);
35
- };
36
- }, [children]);
37
11
  return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
38
- placement: placement,
12
+ placement: "rightTop",
39
13
  title: (0, _jsxRuntime.jsx)("div", {
40
14
  onMouseDown: function onMouseDown(e) {
41
15
  return e.stopPropagation();
42
16
  },
43
17
  children: children
44
18
  }),
45
- id: "adaptive-tooltip",
46
- children: (0, _jsxRuntime.jsxs)("span", {
19
+ children: (0, _jsxRuntime.jsx)("span", {
47
20
  className: "pro-tree-wrap-ellipse",
48
- children: [" ", children]
21
+ children: children
49
22
  })
50
23
  });
51
24
  };
@@ -75,7 +75,6 @@ var ProTree = function ProTree(props) {
75
75
  showExpand = _props$showExpand === void 0 ? false : _props$showExpand,
76
76
  defaultExpandAll = props.defaultExpandAll,
77
77
  other = (0, _objectWithoutProperties2.default)(props, _excluded);
78
- var fieldNameLabel = fieldNames.label;
79
78
  var fieldNameValue = fieldNames.value;
80
79
  var _useSetState = (0, _ahooks.useSetState)({
81
80
  open: false,
@@ -17,15 +17,17 @@ var _antd = require("antd");
17
17
  var _classnames3 = _interopRequireDefault(require("classnames"));
18
18
  var _react = require("react");
19
19
  var _lodash = require("lodash");
20
+ var _locale = _interopRequireDefault(require("../../../locale"));
20
21
  var _ProConfigProvider = require("../../../ProConfigProvider");
21
22
  var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
22
23
  var _AdaptiveTooltip = _interopRequireDefault(require("../AdaptiveTooltip"));
23
- var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className", "checkStrictly", "checkable"],
24
+ var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "placeholder", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className", "checkStrictly", "checkable"],
24
25
  _excluded2 = ["children"];
25
26
  /* eslint-disable react/no-danger */
26
27
  /* eslint-disable react/jsx-closing-tag-location */
27
28
  var SHOW_PARENT = _antd.TreeSelect.SHOW_PARENT;
28
29
  var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
30
+ var _useRequest$options;
29
31
  // 全局属性配置在ConfigProvider
30
32
  var _ref = (0, _ProConfigProvider.useProConfig)('ProTreeSelect') || {},
31
33
  _ref$fieldNames = _ref.fieldNames,
@@ -50,6 +52,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
50
52
  useRequest = props.useRequest,
51
53
  transformResponse = props.transformResponse,
52
54
  fieldNames = props.fieldNames,
55
+ placeholder = props.placeholder,
53
56
  _props$tooltip = props.tooltip,
54
57
  tooltip = _props$tooltip === void 0 ? false : _props$tooltip,
55
58
  _props$showSearch = props.showSearch,
@@ -168,11 +171,26 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
168
171
  origDataSource: resultData || []
169
172
  });
170
173
  };
174
+ var successTransformDataHandle = (0, _react.useCallback)(function (res) {
175
+ if (transformResponse && typeof transformResponse === 'function') {
176
+ return transformResponse(res);
177
+ }
178
+ var _ref4 = res || {},
179
+ _ref4$status = _ref4.status,
180
+ status = _ref4$status === void 0 ? 200 : _ref4$status,
181
+ msg = _ref4.message,
182
+ data = _ref4.data;
183
+ if (status !== 200) {
184
+ _antd.message.error(msg);
185
+ return;
186
+ }
187
+ return data;
188
+ }, []);
171
189
  // 配置了异步数据源,拉取枚举数据逻辑 如果有code不掉接口从local里根据code取值
172
190
  var fetchFunction = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)({
173
191
  manual: true,
192
+ debounceWait: 300,
174
193
  onSuccess: function onSuccess(data) {
175
- // 用户配置了处理枚举函数
176
194
  if (transformResponse && typeof transformResponse === 'function') {
177
195
  var responseData = transformResponse(data);
178
196
  var resultData = transferDataSource(responseData, showCodeName);
@@ -181,16 +199,33 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
181
199
  origDataSource: resultData
182
200
  });
183
201
  } else {
184
- defaultOnSuccessFun(data);
202
+ defaultOnSuccessFun(fetchFunction.data);
185
203
  }
186
- },
187
- debounceWait: 300
204
+ }
188
205
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options));
206
+ var cacheList = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.cacheKey) ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
189
207
  (0, _react.useImperativeHandle)(ref, function () {
190
208
  return {
191
209
  useRequestRef: fetchFunction
192
210
  };
193
211
  });
212
+ // 设置cacheKey后使用缓存的数据
213
+ (0, _ahooks.useDeepCompareEffect)(function () {
214
+ var _useRequest$options2;
215
+ if (fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.cacheKey) {
216
+ if (transformResponse && typeof transformResponse === 'function') {
217
+ var responseData = transformResponse(fetchFunction.data);
218
+ // debugger;
219
+ var resultData = transferDataSource(responseData, showCodeName);
220
+ setState({
221
+ selectList: countChild(resultData),
222
+ origDataSource: resultData
223
+ });
224
+ } else {
225
+ defaultOnSuccessFun(fetchFunction.data);
226
+ }
227
+ }
228
+ }, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
194
229
  (0, _ahooks.useDeepCompareEffect)(function () {
195
230
  if (enumCode) {
196
231
  var dictEnum = dics[enumCode] || [];
@@ -212,17 +247,21 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
212
247
  if (enumCode || dataSource) {
213
248
  return undefined;
214
249
  }
250
+ // 如果配置手动加载,不执行请求
251
+ var _ref5 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
252
+ defaultParams = _ref5.defaultParams,
253
+ manual = _ref5.manual;
215
254
  // disabled 状态时,不查询接口
216
255
  if (defaultDisableValue || !useRequest) {
217
256
  return undefined;
218
257
  }
219
- // 如果配置手动加载,不执行请求
220
- var _ref4 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
221
- defaultParams = _ref4.defaultParams;
258
+ if (manual || (cacheList === null || cacheList === void 0 ? void 0 : cacheList.length)) {
259
+ return;
260
+ }
222
261
  var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
223
262
  // 执行用户配置的枚举服务,拉取枚举数据进行更新
224
263
  fetchFunction.run(params);
225
- }, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, defaultDisableValue]);
264
+ }, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options, defaultDisableValue]);
226
265
  // disable默认值
227
266
  if (defaultDisableValue) {
228
267
  return (0, _jsxRuntime.jsx)("span", {
@@ -399,7 +438,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
399
438
  return sourceList;
400
439
  }
401
440
  var searchTreeEvent = (0, _lodash.debounce)(/*#__PURE__*/function () {
402
- var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(searchVal) {
441
+ var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(searchVal) {
403
442
  var result;
404
443
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
405
444
  while (1) switch (_context.prev = _context.next) {
@@ -424,7 +463,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
424
463
  }, _callee);
425
464
  }));
426
465
  return function (_x) {
427
- return _ref5.apply(this, arguments);
466
+ return _ref6.apply(this, arguments);
428
467
  };
429
468
  }(), 500);
430
469
  function findTreeNode(treeList, nodeValue) {
@@ -565,6 +604,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
565
604
  onClick: nodeChangeEvent,
566
605
  className: cls,
567
606
  children: (0, _jsxRuntime.jsx)(_antd.TreeSelect, (0, _objectSpread2.default)((0, _objectSpread2.default)({
607
+ placeholder: placeholder || _locale.default.ProForm.treeSelectPlaceholder,
568
608
  maxTagPlaceholder: function maxTagPlaceholder(rest) {
569
609
  var _rest = rest.map(function (tag) {
570
610
  var _tag$label, _tag$label$props, _tag$label2, _tag$label2$props, _tag$label2$props$chi, _tag$label2$props$chi2, _tag$label2$props$chi3, _tag$label3, _tag$label3$props, _tag$label3$props$dan;
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  unfold: string;
26
26
  packUp: string;
27
27
  inputPlaceholder: string;
28
+ treeSelectPlaceholder: string;
28
29
  selectPlaceHolder: string;
29
30
  switchText: string[];
30
31
  ruleStartEndText: string[];
@@ -31,6 +31,7 @@ var _default = exports.default = {
31
31
  unfold: 'Unfold',
32
32
  packUp: 'PackUp',
33
33
  inputPlaceholder: 'Please enter',
34
+ treeSelectPlaceholder: 'Please select',
34
35
  selectPlaceHolder: 'Please select',
35
36
  switchText: ['Yes', 'No'],
36
37
  ruleStartEndText: ['start value', 'end value'],
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  unfold: string;
26
26
  packUp: string;
27
27
  inputPlaceholder: string;
28
+ treeSelectPlaceholder: string;
28
29
  selectPlaceHolder: string;
29
30
  switchText: string[];
30
31
  ruleStartEndText: string[];
@@ -31,6 +31,7 @@ var _default = exports.default = {
31
31
  unfold: '展开',
32
32
  packUp: '收起',
33
33
  inputPlaceholder: '请输入',
34
+ treeSelectPlaceholder: '请选择',
34
35
  selectPlaceHolder: '请选择',
35
36
  switchText: ['是', '否'],
36
37
  ruleStartEndText: ['起始值', '截止值'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.13.6-beta.1",
3
+ "version": "3.13.6-beta.3",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",