@zat-design/sisyphus-react 3.4.5-beta.5 → 3.4.5-beta.7

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;
@@ -66,12 +66,12 @@ var ProEditTable = function ProEditTable(_ref, ref) {
66
66
  // 判断是否在formList内
67
67
  if (namePath === null || namePath === void 0 ? void 0 : namePath.length) {
68
68
  name = [].concat(_toConsumableArray(namePath), _toConsumableArray(name.slice(1)));
69
+ disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
69
70
  }
70
71
  var tableRef = useRef(null);
71
72
  var _React$useContext = React.useContext(_ConfigProvider.ConfigContext),
72
73
  getPrefixCls = _React$useContext.getPrefixCls;
73
74
  var prefixCls = getPrefixCls();
74
- disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled;
75
75
  var _useLocalStorageState = useLocalStorageState('themeConfig'),
76
76
  _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
77
77
  themeConfig = _useLocalStorageState2[0];
@@ -94,8 +94,8 @@ var ProCascader = function ProCascader(props) {
94
94
  enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
95
95
  var realDataSource = useMemo(function () {
96
96
  var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
97
- return realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
98
- }, [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]);
99
99
  var _useRequest = _objectSpread({}, useRequest),
100
100
  service = _useRequest.service,
101
101
  _useRequest$defaultPa = _useRequest.defaultParams,
@@ -128,7 +128,7 @@ var ProCascader = function ProCascader(props) {
128
128
  value: fieldNames.value,
129
129
  children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
130
130
  });
131
- serviceData = realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
131
+ serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
132
132
  setServiceData(serviceData);
133
133
  case 9:
134
134
  case "end":
@@ -152,19 +152,19 @@ var ProCascader = function ProCascader(props) {
152
152
  if (service) {
153
153
  setDefaultLabel(getViewLabel({
154
154
  dataSource: serviceData,
155
- 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
156
156
  }));
157
157
  } else if ((realDataSource === null || realDataSource === void 0 ? void 0 : realDataSource.length) > 0) {
158
158
  setDefaultLabel(getViewLabel({
159
159
  dataSource: realDataSource,
160
- 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
161
161
  }));
162
162
  }
163
163
  }
164
164
  }, [realIsView, value, realDataSource, serviceData]);
165
165
  var handleChange = function handleChange(changeValue, selectedOptions) {
166
166
  if (onChange) {
167
- if (hasDetail && detail) {
167
+ if (isAddressMode && hasDetail && detail) {
168
168
  // 有详情地址
169
169
  var realValue = changeValue || [];
170
170
  realValue[realLevel] = detail;
@@ -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
  }
@@ -69,12 +69,12 @@ var ProEditTable = function ProEditTable(_ref, ref) {
69
69
  // 判断是否在formList内
70
70
  if (namePath === null || namePath === void 0 ? void 0 : namePath.length) {
71
71
  name = [].concat((0, _toConsumableArray2.default)(namePath), (0, _toConsumableArray2.default)(name.slice(1)));
72
+ disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
72
73
  }
73
74
  var tableRef = (0, _react.useRef)(null);
74
75
  var _React$useContext = _react.default.useContext(_antd.ConfigProvider.ConfigContext),
75
76
  getPrefixCls = _React$useContext.getPrefixCls;
76
77
  var prefixCls = getPrefixCls();
77
- disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled;
78
78
  var _useLocalStorageState = (0, _ahooks.useLocalStorageState)('themeConfig'),
79
79
  _useLocalStorageState2 = (0, _slicedToArray2.default)(_useLocalStorageState, 1),
80
80
  themeConfig = _useLocalStorageState2[0];
@@ -94,8 +94,8 @@ var ProCascader = function ProCascader(props) {
94
94
  enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
95
95
  var realDataSource = (0, _react.useMemo)(function () {
96
96
  var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
97
- return realLevel === 2 ? filterDataSource(innerDataSource, level) : innerDataSource;
98
- }, [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]);
99
99
  var _useRequest = (0, _objectSpread2.default)({}, useRequest),
100
100
  service = _useRequest.service,
101
101
  _useRequest$defaultPa = _useRequest.defaultParams,
@@ -128,7 +128,7 @@ var ProCascader = function ProCascader(props) {
128
128
  value: fieldNames.value,
129
129
  children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
130
130
  });
131
- serviceData = realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
131
+ serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level) : transFormData;
132
132
  setServiceData(serviceData);
133
133
  case 9:
134
134
  case "end":
@@ -152,19 +152,19 @@ var ProCascader = function ProCascader(props) {
152
152
  if (service) {
153
153
  setDefaultLabel(getViewLabel({
154
154
  dataSource: serviceData,
155
- 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
156
156
  }));
157
157
  } else if ((realDataSource === null || realDataSource === void 0 ? void 0 : realDataSource.length) > 0) {
158
158
  setDefaultLabel(getViewLabel({
159
159
  dataSource: realDataSource,
160
- 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
161
161
  }));
162
162
  }
163
163
  }
164
164
  }, [realIsView, value, realDataSource, serviceData]);
165
165
  var handleChange = function handleChange(changeValue, selectedOptions) {
166
166
  if (onChange) {
167
- if (hasDetail && detail) {
167
+ if (isAddressMode && hasDetail && detail) {
168
168
  // 有详情地址
169
169
  var realValue = changeValue || [];
170
170
  realValue[realLevel] = detail;
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.4.5-beta.5",
3
+ "version": "3.4.5-beta.7",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",