@zat-design/sisyphus-react 3.4.5-beta.4 → 3.4.5-beta.6

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.
@@ -686,7 +686,10 @@
686
686
  display: none !important;
687
687
  }
688
688
  .pro-collapse.pro-collapse-no-title .pro-collapse-level2 .ant-collapse-header {
689
- display: block !important;
689
+ display: -webkit-box !important;
690
+ display: -webkit-flex !important;
691
+ display: -ms-flexbox !important;
692
+ display: flex !important;
690
693
  }
691
694
  .pro-collapse.ant-collapse .pro-collapse-panel {
692
695
  margin-bottom: 16px;
package/dist/less.esm.css CHANGED
@@ -686,7 +686,10 @@
686
686
  display: none !important;
687
687
  }
688
688
  .pro-collapse.pro-collapse-no-title .pro-collapse-level2 .ant-collapse-header {
689
- display: block !important;
689
+ display: -webkit-box !important;
690
+ display: -webkit-flex !important;
691
+ display: -ms-flexbox !important;
692
+ display: flex !important;
690
693
  }
691
694
  .pro-collapse.ant-collapse .pro-collapse-panel {
692
695
  margin-bottom: 16px;
@@ -32,7 +32,6 @@ var filterDataSource = function filterDataSource(dataSource, level) {
32
32
  var getViewLabel = function getViewLabel(_ref) {
33
33
  var dataSource = _ref.dataSource,
34
34
  value = _ref.value;
35
- // const cascaderValue = hasDetail ? value?.slice(0, level) : value;
36
35
  var viewLabel = [];
37
36
  // 根据dataSource得到label数组,查看模式展示需要
38
37
  value === null || value === void 0 ? void 0 : value.forEach(function (value, index) {
@@ -94,16 +93,13 @@ var ProCascader = function ProCascader(props) {
94
93
  _ref5$ = _ref5[0],
95
94
  enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
96
95
  var realDataSource = useMemo(function () {
97
- console.log(enumDataSource);
98
96
  var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
99
- return realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
100
- }, [addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
97
+ return isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
98
+ }, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
101
99
  var _useRequest = _objectSpread({}, useRequest),
102
100
  service = _useRequest.service,
103
101
  _useRequest$defaultPa = _useRequest.defaultParams,
104
- defaultParams = _useRequest$defaultPa === void 0 ? {} : _useRequest$defaultPa,
105
- _useRequest$parentKey = _useRequest.parentKey,
106
- parentKey = _useRequest$parentKey === void 0 ? 'parentCode' : _useRequest$parentKey;
102
+ defaultParams = _useRequest$defaultPa === void 0 ? {} : _useRequest$defaultPa;
107
103
  var _useState = useState([]),
108
104
  _useState2 = _slicedToArray(_useState, 2),
109
105
  serviceData = _useState2[0],
@@ -132,7 +128,7 @@ var ProCascader = function ProCascader(props) {
132
128
  value: fieldNames.value,
133
129
  children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
134
130
  });
135
- serviceData = realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
131
+ serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
136
132
  setServiceData(serviceData);
137
133
  case 9:
138
134
  case "end":
@@ -156,19 +152,19 @@ var ProCascader = function ProCascader(props) {
156
152
  if (service) {
157
153
  setDefaultLabel(getViewLabel({
158
154
  dataSource: serviceData,
159
- value: hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
155
+ value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
160
156
  }));
161
157
  } else if ((realDataSource === null || realDataSource === void 0 ? void 0 : realDataSource.length) > 0) {
162
158
  setDefaultLabel(getViewLabel({
163
159
  dataSource: realDataSource,
164
- value: hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
160
+ value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
165
161
  }));
166
162
  }
167
163
  }
168
164
  }, [realIsView, value, realDataSource, serviceData]);
169
165
  var handleChange = function handleChange(changeValue, selectedOptions) {
170
166
  if (onChange) {
171
- if (hasDetail && detail) {
167
+ if (isAddressMode && hasDetail && detail) {
172
168
  // 有详情地址
173
169
  var realValue = changeValue || [];
174
170
  realValue[realLevel] = detail;
@@ -341,7 +341,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
341
341
  case 16:
342
342
  _context2.prev = 16;
343
343
  _context2.t0 = _context2["catch"](0);
344
- console.log('error', _context2.t0);
344
+ console.warn('error', _context2.t0);
345
345
  case 19:
346
346
  case "end":
347
347
  return _context2.stop();
@@ -670,9 +670,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
670
670
  labelInValue: labelInValue,
671
671
  dataSource: options,
672
672
  scrollFollowParent: false,
673
- onClick: function onClick() {
674
- // 没有值的时候,初始化点击默认查询前五十条
675
- if (!value && isInit || !(options === null || options === void 0 ? void 0 : options.length)) {
673
+ onFocus: function onFocus() {
674
+ if (useRequest) {
676
675
  var _useRequest$options9;
677
676
  var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams) || {};
678
677
  var params = withPagination ? {
@@ -4,7 +4,7 @@ import "antd/es/tooltip/style";
4
4
  import _Tooltip from "antd/es/tooltip";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
- var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap"];
7
+ var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap", "tooltip"];
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { useExternal } from 'ahooks';
10
10
  import classNames from 'classnames';
@@ -45,6 +45,7 @@ var ProIcon = function ProIcon(props) {
45
45
  mapList = _config$mapList === void 0 ? [] : _config$mapList,
46
46
  src = _config.src,
47
47
  actionMap = _config.actionMap,
48
+ tooltip = _config.tooltip,
48
49
  reset = _objectWithoutProperties(_config, _excluded);
49
50
  // 主题色
50
51
  var _ref = antdTheme !== null && antdTheme !== void 0 ? antdTheme : {},
@@ -76,7 +77,7 @@ var ProIcon = function ProIcon(props) {
76
77
  var _type = type;
77
78
  var _text = children;
78
79
  // svg图标对应文本
79
- var iconText = '';
80
+ var iconText = tooltip || '';
80
81
  var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
81
82
  // 模式为icon下,对传入的text进行指定语言-icon 映射
82
83
  if (isIconMode && !type) {
@@ -141,13 +142,16 @@ var ProIcon = function ProIcon(props) {
141
142
  var _RenderIcon = useMemo(function () {
142
143
  return RenderIcon;
143
144
  }, [primaryColor]);
144
- return !isExtendButtonMode ? _RenderIcon : _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({
145
- type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
146
- className: proIconClassNames,
147
- disabled: disabled,
148
- icon: isIconMode ? RenderIcon : null
149
- }, reset), buttonProps), {}, {
150
- children: _text
151
- }));
145
+ return !isExtendButtonMode ? _RenderIcon : _jsx(_Tooltip, {
146
+ title: tooltip,
147
+ children: _jsx(_Button, _objectSpread(_objectSpread(_objectSpread({
148
+ type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
149
+ className: proIconClassNames,
150
+ disabled: disabled,
151
+ icon: isIconMode ? RenderIcon : null
152
+ }, reset), buttonProps), {}, {
153
+ children: _text
154
+ }))
155
+ });
152
156
  };
153
157
  export default ProIcon;
@@ -54,6 +54,11 @@ export interface ProIconProps {
54
54
  * @default false
55
55
  */
56
56
  disabled?: boolean;
57
+ /**
58
+ * @description 提示
59
+ * @default -
60
+ */
61
+ tooltip?: string | React.ReactNode;
57
62
  /**
58
63
  * @description 是否跟随主题色
59
64
  * @default false
@@ -16,7 +16,7 @@
16
16
  }
17
17
  .pro-collapse-level2{
18
18
  .@{ant-prefix}-collapse-header {
19
- display: block !important;
19
+ display: flex !important;
20
20
  }
21
21
  }
22
22
  }
@@ -239,7 +239,7 @@ export var ProSelect = function ProSelect(props, ref) {
239
239
  if (!isObject(value)) {
240
240
  return undefined;
241
241
  }
242
- return value === null || value === void 0 ? void 0 : value[code];
242
+ return (value === null || value === void 0 ? void 0 : value[code]) || (value === null || value === void 0 ? void 0 : value.value);
243
243
  }
244
244
  if (labelInValue && selectProps.mode) {
245
245
  // 对传入的值做一些基础判断
@@ -32,7 +32,6 @@ var filterDataSource = function filterDataSource(dataSource, level) {
32
32
  var getViewLabel = function getViewLabel(_ref) {
33
33
  var dataSource = _ref.dataSource,
34
34
  value = _ref.value;
35
- // const cascaderValue = hasDetail ? value?.slice(0, level) : value;
36
35
  var viewLabel = [];
37
36
  // 根据dataSource得到label数组,查看模式展示需要
38
37
  value === null || value === void 0 ? void 0 : value.forEach(function (value, index) {
@@ -94,16 +93,13 @@ var ProCascader = function ProCascader(props) {
94
93
  _ref5$ = _ref5[0],
95
94
  enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
96
95
  var realDataSource = (0, _react.useMemo)(function () {
97
- console.log(enumDataSource);
98
96
  var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
99
- return realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
100
- }, [addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
97
+ return isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
98
+ }, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
101
99
  var _useRequest = (0, _objectSpread2.default)({}, useRequest),
102
100
  service = _useRequest.service,
103
101
  _useRequest$defaultPa = _useRequest.defaultParams,
104
- defaultParams = _useRequest$defaultPa === void 0 ? {} : _useRequest$defaultPa,
105
- _useRequest$parentKey = _useRequest.parentKey,
106
- parentKey = _useRequest$parentKey === void 0 ? 'parentCode' : _useRequest$parentKey;
102
+ defaultParams = _useRequest$defaultPa === void 0 ? {} : _useRequest$defaultPa;
107
103
  var _useState = (0, _react.useState)([]),
108
104
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
109
105
  serviceData = _useState2[0],
@@ -132,7 +128,7 @@ var ProCascader = function ProCascader(props) {
132
128
  value: fieldNames.value,
133
129
  children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
134
130
  });
135
- serviceData = realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
131
+ serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
136
132
  setServiceData(serviceData);
137
133
  case 9:
138
134
  case "end":
@@ -156,19 +152,19 @@ var ProCascader = function ProCascader(props) {
156
152
  if (service) {
157
153
  setDefaultLabel(getViewLabel({
158
154
  dataSource: serviceData,
159
- value: hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
155
+ value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
160
156
  }));
161
157
  } else if ((realDataSource === null || realDataSource === void 0 ? void 0 : realDataSource.length) > 0) {
162
158
  setDefaultLabel(getViewLabel({
163
159
  dataSource: realDataSource,
164
- value: hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
160
+ value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
165
161
  }));
166
162
  }
167
163
  }
168
164
  }, [realIsView, value, realDataSource, serviceData]);
169
165
  var handleChange = function handleChange(changeValue, selectedOptions) {
170
166
  if (onChange) {
171
- if (hasDetail && detail) {
167
+ if (isAddressMode && hasDetail && detail) {
172
168
  // 有详情地址
173
169
  var realValue = changeValue || [];
174
170
  realValue[realLevel] = detail;
@@ -338,7 +338,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
338
338
  case 16:
339
339
  _context2.prev = 16;
340
340
  _context2.t0 = _context2["catch"](0);
341
- console.log('error', _context2.t0);
341
+ console.warn('error', _context2.t0);
342
342
  case 19:
343
343
  case "end":
344
344
  return _context2.stop();
@@ -667,9 +667,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
667
667
  labelInValue: labelInValue,
668
668
  dataSource: options,
669
669
  scrollFollowParent: false,
670
- onClick: function onClick() {
671
- // 没有值的时候,初始化点击默认查询前五十条
672
- if (!value && isInit || !(options === null || options === void 0 ? void 0 : options.length)) {
670
+ onFocus: function onFocus() {
671
+ if (useRequest) {
673
672
  var _useRequest$options9;
674
673
  var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams) || {};
675
674
  var params = withPagination ? {
@@ -18,7 +18,7 @@ var _ProConfigProvider = require("../ProConfigProvider");
18
18
  var _config2 = require("./config");
19
19
  var _utils = require("./utils");
20
20
  var _locale = _interopRequireDefault(require("../locale"));
21
- var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap"];
21
+ var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap", "tooltip"];
22
22
  var ProIcon = function ProIcon(props) {
23
23
  var _useProConfig = (0, _ProConfigProvider.useProConfig)(),
24
24
  state = _useProConfig.state;
@@ -49,6 +49,7 @@ var ProIcon = function ProIcon(props) {
49
49
  mapList = _config$mapList === void 0 ? [] : _config$mapList,
50
50
  src = _config.src,
51
51
  actionMap = _config.actionMap,
52
+ tooltip = _config.tooltip,
52
53
  reset = (0, _objectWithoutProperties2.default)(_config, _excluded);
53
54
  // 主题色
54
55
  var _ref = antdTheme !== null && antdTheme !== void 0 ? antdTheme : {},
@@ -80,7 +81,7 @@ var ProIcon = function ProIcon(props) {
80
81
  var _type = type;
81
82
  var _text = children;
82
83
  // svg图标对应文本
83
- var iconText = '';
84
+ var iconText = tooltip || '';
84
85
  var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
85
86
  // 模式为icon下,对传入的text进行指定语言-icon 映射
86
87
  if (isIconMode && !type) {
@@ -145,13 +146,16 @@ var ProIcon = function ProIcon(props) {
145
146
  var _RenderIcon = (0, _react.useMemo)(function () {
146
147
  return RenderIcon;
147
148
  }, [primaryColor]);
148
- return !isExtendButtonMode ? _RenderIcon : (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
149
- type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
150
- className: proIconClassNames,
151
- disabled: disabled,
152
- icon: isIconMode ? RenderIcon : null
153
- }, reset), buttonProps), {}, {
154
- children: _text
155
- }));
149
+ return !isExtendButtonMode ? _RenderIcon : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
150
+ title: tooltip,
151
+ children: (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
152
+ type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
153
+ className: proIconClassNames,
154
+ disabled: disabled,
155
+ icon: isIconMode ? RenderIcon : null
156
+ }, reset), buttonProps), {}, {
157
+ children: _text
158
+ }))
159
+ });
156
160
  };
157
161
  var _default = exports.default = ProIcon;
@@ -54,6 +54,11 @@ export interface ProIconProps {
54
54
  * @default false
55
55
  */
56
56
  disabled?: boolean;
57
+ /**
58
+ * @description 提示
59
+ * @default -
60
+ */
61
+ tooltip?: string | React.ReactNode;
57
62
  /**
58
63
  * @description 是否跟随主题色
59
64
  * @default false
@@ -16,7 +16,7 @@
16
16
  }
17
17
  .pro-collapse-level2{
18
18
  .@{ant-prefix}-collapse-header {
19
- display: block !important;
19
+ display: flex !important;
20
20
  }
21
21
  }
22
22
  }
@@ -240,7 +240,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
240
240
  if (!(0, _lodash.isObject)(value)) {
241
241
  return undefined;
242
242
  }
243
- return value === null || value === void 0 ? void 0 : value[code];
243
+ return (value === null || value === void 0 ? void 0 : value[code]) || (value === null || value === void 0 ? void 0 : value.value);
244
244
  }
245
245
  if (labelInValue && selectProps.mode) {
246
246
  // 对传入的值做一些基础判断
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.4.5-beta.4",
3
+ "version": "3.4.5-beta.6",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",