@zat-design/sisyphus-react 3.1.4 → 3.1.5-beta.10

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.
Files changed (174) hide show
  1. package/.dumi/theme/builtins/Alert.tsx +19 -0
  2. package/.dumi/theme/builtins/Previewer.tsx +232 -0
  3. package/.dumi/theme/builtins/SourceCode.tsx +64 -0
  4. package/.dumi/theme/hooks/useCodeSandbox.tsx +197 -0
  5. package/.dumi/theme/hooks/useTheme.tsx +707 -0
  6. package/.dumi/theme/layouts/BasicLayout.tsx +88 -0
  7. package/.dumi/theme/layouts/components/Dark.less +157 -0
  8. package/.dumi/theme/layouts/components/Dark.tsx +78 -0
  9. package/.dumi/theme/layouts/components/Navbar.tsx +83 -0
  10. package/.dumi/theme/layouts/components/SideMenu.tsx +61 -0
  11. package/.dumi/theme/layouts/index.tsx +26 -0
  12. package/.dumi/theme/layouts/layout.less +87 -0
  13. package/.dumi/theme/typings.d.ts +7 -0
  14. package/dist/index.esm.css +122 -249
  15. package/es/ProAction/index.less +3 -2
  16. package/es/ProConfigProvider/index.d.ts +2 -0
  17. package/es/ProConfigProvider/index.js +18 -2
  18. package/es/ProDrawerForm/index.js +5 -3
  19. package/es/ProDrawerForm/style/index.less +15 -11
  20. package/es/ProEditLabel/style/index.less +2 -2
  21. package/es/ProEditTable/style/index.less +15 -8
  22. package/es/ProEditTable/utils/config.js +11 -4
  23. package/es/ProEnum/style/index.less +1 -1
  24. package/es/ProForm/components/base/RangePicker/index.js +0 -3
  25. package/es/ProForm/components/base/TextArea/index.less +1 -1
  26. package/es/ProForm/components/combination/Container/style/index.less +0 -1
  27. package/es/ProForm/components/combination/FormList/style/index.less +20 -19
  28. package/es/ProForm/components/combination/Group/index.js +2 -2
  29. package/es/ProForm/components/combination/ProAddressBar/index.js +81 -61
  30. package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  31. package/es/ProForm/components/combination/ProModalSelect/index.js +75 -13
  32. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  33. package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  34. package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  35. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  36. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  37. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
  38. package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
  39. package/es/ProForm/components/render/RenderFields.js +10 -5
  40. package/es/ProForm/components/render/propsType.d.ts +5 -4
  41. package/es/ProForm/index.js +5 -0
  42. package/es/ProForm/style/index.less +55 -169
  43. package/es/ProForm/utils/useShouldUpdate.js +16 -16
  44. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
  45. package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
  46. package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  47. package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  48. package/es/ProLayout/components/ProHeader/components/index.js +2 -1
  49. package/es/ProLayout/components/ProHeader/index.js +4 -2
  50. package/es/ProLayout/components/ProHeader/style/index.less +16 -7
  51. package/es/ProStep/style/index.less +0 -1
  52. package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
  53. package/es/ProTable/components/RenderColumn/index.js +41 -25
  54. package/es/ProTable/index.js +3 -2
  55. package/es/ProTable/propsType.d.ts +2 -0
  56. package/es/ProTable/style/index.less +14 -1
  57. package/es/ProTable/utils.d.ts +1 -1
  58. package/es/ProTable/utils.js +258 -201
  59. package/es/ProTabs/style/index.less +1 -1
  60. package/es/ProThemeTools/component/PrdTools/index.js +1 -1
  61. package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
  62. package/es/ProThemeTools/index.d.ts +2 -2
  63. package/es/ProThemeTools/index.js +24 -17
  64. package/es/ProThemeTools/propsType.d.ts +8 -6
  65. package/es/ProThemeTools/style/index.less +2 -2
  66. package/es/ProThemeTools/utils/index.d.ts +7 -0
  67. package/es/ProThemeTools/utils/index.js +19 -1
  68. package/es/ProTree/components/ProTree.js +1 -1
  69. package/es/ProTree/components/SearchTitle.d.ts +2 -2
  70. package/es/ProTree/components/SearchTitle.js +11 -1
  71. package/es/ProTree/components/Tree.js +6 -1
  72. package/es/ProTree/style/index.less +193 -141
  73. package/es/ProTreeModal/style/index.less +2 -6
  74. package/es/ProUpload/style/index.less +41 -39
  75. package/es/index.d.ts +2 -1
  76. package/es/index.js +2 -1
  77. package/es/locale/en_US.d.ts +69 -0
  78. package/es/locale/en_US.js +68 -0
  79. package/es/locale/index.d.ts +7 -0
  80. package/es/locale/index.js +21 -0
  81. package/es/locale/zh_CN.d.ts +69 -0
  82. package/es/locale/zh_CN.js +68 -0
  83. package/es/old/ProEditableTable/style/index.less +1 -2
  84. package/es/style/components.less +0 -1
  85. package/es/style/core/normalize.less +1 -1
  86. package/es/style/theme/antd.less +3 -4
  87. package/es/style/theme/index.less +80 -79
  88. package/es/style/theme/tokens.less +1 -0
  89. package/lib/ProAction/index.less +3 -2
  90. package/lib/ProConfigProvider/index.d.ts +2 -0
  91. package/lib/ProConfigProvider/index.js +17 -2
  92. package/lib/ProDrawerForm/index.js +5 -3
  93. package/lib/ProDrawerForm/style/index.less +15 -11
  94. package/lib/ProEditLabel/style/index.less +2 -2
  95. package/lib/ProEditTable/style/index.less +15 -8
  96. package/lib/ProEditTable/utils/config.js +11 -4
  97. package/lib/ProEnum/style/index.less +1 -1
  98. package/lib/ProForm/components/base/RangePicker/index.js +0 -3
  99. package/lib/ProForm/components/base/TextArea/index.less +1 -1
  100. package/lib/ProForm/components/combination/Container/style/index.less +0 -1
  101. package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
  102. package/lib/ProForm/components/combination/Group/index.js +2 -2
  103. package/lib/ProForm/components/combination/ProAddressBar/index.js +76 -58
  104. package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  105. package/lib/ProForm/components/combination/ProModalSelect/index.js +75 -13
  106. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  107. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  108. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  109. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  110. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  111. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
  112. package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
  113. package/lib/ProForm/components/render/RenderFields.js +9 -4
  114. package/lib/ProForm/components/render/propsType.d.ts +5 -4
  115. package/lib/ProForm/index.js +5 -0
  116. package/lib/ProForm/style/index.less +55 -169
  117. package/lib/ProForm/utils/useShouldUpdate.js +16 -16
  118. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
  119. package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
  120. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  121. package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  122. package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
  123. package/lib/ProLayout/components/ProHeader/index.js +4 -2
  124. package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
  125. package/lib/ProStep/style/index.less +0 -1
  126. package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
  127. package/lib/ProTable/components/RenderColumn/index.js +38 -24
  128. package/lib/ProTable/index.js +3 -2
  129. package/lib/ProTable/propsType.d.ts +2 -0
  130. package/lib/ProTable/style/index.less +14 -1
  131. package/lib/ProTable/utils.d.ts +1 -1
  132. package/lib/ProTable/utils.js +258 -201
  133. package/lib/ProTabs/style/index.less +1 -1
  134. package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
  135. package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
  136. package/lib/ProThemeTools/index.d.ts +2 -2
  137. package/lib/ProThemeTools/index.js +23 -16
  138. package/lib/ProThemeTools/propsType.d.ts +8 -6
  139. package/lib/ProThemeTools/style/index.less +2 -2
  140. package/lib/ProThemeTools/utils/index.d.ts +7 -0
  141. package/lib/ProThemeTools/utils/index.js +20 -2
  142. package/lib/ProTree/components/ProTree.js +1 -1
  143. package/lib/ProTree/components/SearchTitle.d.ts +2 -2
  144. package/lib/ProTree/components/SearchTitle.js +11 -1
  145. package/lib/ProTree/components/Tree.js +6 -1
  146. package/lib/ProTree/style/index.less +193 -141
  147. package/lib/ProTreeModal/style/index.less +2 -6
  148. package/lib/ProUpload/style/index.less +41 -39
  149. package/lib/index.d.ts +2 -1
  150. package/lib/index.js +13 -1
  151. package/lib/locale/en_US.d.ts +69 -0
  152. package/lib/locale/en_US.js +74 -0
  153. package/lib/locale/index.d.ts +7 -0
  154. package/lib/locale/index.js +28 -0
  155. package/lib/locale/zh_CN.d.ts +69 -0
  156. package/lib/locale/zh_CN.js +74 -0
  157. package/lib/old/ProEditableTable/style/index.less +1 -2
  158. package/lib/style/components.less +0 -1
  159. package/lib/style/core/normalize.less +1 -1
  160. package/lib/style/theme/antd.less +3 -4
  161. package/lib/style/theme/index.less +80 -79
  162. package/lib/style/theme/tokens.less +1 -0
  163. package/package.json +2 -2
  164. package/typings.d.ts +2 -0
  165. package/es/old/ProBackBtn/style/index.less +0 -19
  166. package/lib/old/ProBackBtn/style/index.less +0 -19
  167. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  168. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
  169. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  170. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
  171. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  172. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
  173. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  174. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
@@ -6,27 +6,27 @@ import _message from "antd/es/message";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
7
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
9
- var _excluded = ["size", "className", "cacheTime", "color", "mode", "theme", "tableBorder", "tableStripe"];
9
+ var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "tableBorder", "tableStripe", "theme"];
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  /* eslint-disable prefer-const */
12
12
  import { SettingOutlined } from '@ant-design/icons';
13
13
  import { useEffect, useState } from 'react';
14
14
  import classnames from 'classnames';
15
- import { getKebabCase, setThemes, setTableNoStripe, setTableBorder } from './utils/index';
15
+ import { getKebabCase, setThemes, setTableNoStripe, setTableBorder, getMapKebabCase, getMapHumpCase } from './utils/index';
16
16
  import { PrdTools } from './component';
17
17
  var defaultCacheTime = 1; // 配置保存时间为一天
18
18
  var defaultThemeConfig = {
19
19
  zauiBrand: '#006AFF',
20
20
  zauiText: '#343434',
21
- zauiFontSize: 14,
21
+ zauiFontSize: '14px',
22
22
  zauiFormAlign: 'left',
23
23
  zauiFormRequiredBefore: 'none',
24
24
  zauiFormRequiredAfter: 'inline',
25
25
  zauiSize: 1,
26
- zauiSpaceSizeLg: 32,
27
- zauiSpaceSizeMd: 16,
26
+ zauiSpaceSizeLg: '32px',
27
+ zauiSpaceSizeMd: '16px',
28
28
  zauiBigText: false,
29
- zauiBaseFontSize: 0,
29
+ zauiBaseFontSize: '0px',
30
30
  zauiTableBorder: false,
31
31
  zauiStripe: true
32
32
  };
@@ -36,17 +36,19 @@ var ProThemeTools = function ProThemeTools(_ref) {
36
36
  cacheTime = _ref.cacheTime,
37
37
  color = _ref.color,
38
38
  mode = _ref.mode,
39
- theme = _ref.theme,
39
+ iconFollowTheme = _ref.iconFollowTheme,
40
40
  _ref$tableBorder = _ref.tableBorder,
41
41
  tableBorder = _ref$tableBorder === void 0 ? false : _ref$tableBorder,
42
42
  _ref$tableStripe = _ref.tableStripe,
43
43
  tableStripe = _ref$tableStripe === void 0 ? false : _ref$tableStripe,
44
+ _ref$theme = _ref.theme,
45
+ theme = _ref$theme === void 0 ? {} : _ref$theme,
44
46
  props = _objectWithoutProperties(_ref, _excluded);
45
47
  var _useState = useState(false),
46
48
  _useState2 = _slicedToArray(_useState, 2),
47
49
  visible = _useState2[0],
48
50
  setVisible = _useState2[1];
49
- var _useState3 = useState(_objectSpread({}, defaultThemeConfig)),
51
+ var _useState3 = useState(_objectSpread(_objectSpread({}, defaultThemeConfig), getMapHumpCase(theme))),
50
52
  _useState4 = _slicedToArray(_useState3, 2),
51
53
  state = _useState4[0],
52
54
  setState = _useState4[1];
@@ -80,9 +82,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
80
82
  };
81
83
  // 复制
82
84
  var onCopy = function onCopy() {
83
- var data = JSON.stringify(Object.fromEntries(Object.entries(state).map(function (item) {
84
- return ["@".concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
85
- })));
85
+ var data = JSON.stringify(getMapKebabCase(state, '@'));
86
86
  var input = document.createElement('input');
87
87
  document.body.appendChild(input);
88
88
  input.setAttribute('value', data);
@@ -100,6 +100,10 @@ var ProThemeTools = function ProThemeTools(_ref) {
100
100
  var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
101
101
  // 默认时间间隔
102
102
  var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
103
+ // antd4以下版本不支持主题色的动态配置
104
+ if (!_ConfigProvider.config) {
105
+ return;
106
+ }
103
107
  if (cacheTime && startTime && new Date().getTime() - startTime < duration) {
104
108
  var _localThemeConfig;
105
109
  var localThemeConfig;
@@ -111,15 +115,18 @@ var ProThemeTools = function ProThemeTools(_ref) {
111
115
 
112
116
  setState(_objectSpread(_objectSpread({}, state), localThemeConfig));
113
117
  setThemes(cssVariables);
114
- // antd4以下版本不支持主题色的动态配置
115
- if (!_ConfigProvider.config) {
116
- return;
117
- }
118
118
  _ConfigProvider.config({
119
119
  theme: {
120
120
  primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
121
121
  }
122
122
  });
123
+ } else {
124
+ setThemes(getMapKebabCase(state));
125
+ _ConfigProvider.config({
126
+ theme: {
127
+ primaryColor: state === null || state === void 0 ? void 0 : state.zauiBrand
128
+ }
129
+ });
123
130
  }
124
131
  }, []);
125
132
  // 主题色动态切换
@@ -156,7 +163,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
156
163
  }, [state, cacheTime]);
157
164
  var cls = classnames(_defineProperty({
158
165
  'pro-theme-tools': true,
159
- 'pro-theme-tools-follow': theme
166
+ 'pro-theme-tools-follow': iconFollowTheme
160
167
  }, className, className));
161
168
  return _jsxs("div", _objectSpread(_objectSpread({
162
169
  className: cls
@@ -185,7 +192,7 @@ ProThemeTools.defaultProps = {
185
192
  size: 24,
186
193
  mode: 'prd',
187
194
  color: '#343434',
188
- theme: false,
195
+ iconFollowTheme: false,
189
196
  cacheTime: false
190
197
  };
191
198
  ProThemeTools.setThemes = setThemes;
@@ -15,8 +15,10 @@ export interface ProThemeToolsProps {
15
15
  color?: string;
16
16
  mode?: 'dev' | 'prd';
17
17
  cacheTime?: number | boolean;
18
- /** 是否跟随主题色 */
19
- theme?: boolean;
18
+ /** 主题配置信息 */
19
+ theme?: any;
20
+ /** icon是否跟随主题色 */
21
+ iconFollowTheme?: boolean;
20
22
  /** 是否有表格边框 */
21
23
  tableBorder?: boolean;
22
24
  /** 是否有斑马纹 */
@@ -26,18 +28,18 @@ export interface ProThemeToolsProps {
26
28
  export interface LocalThemeConfigPropsType {
27
29
  zauiBrand?: string;
28
30
  zauiText?: string;
29
- zauiFontSize?: number;
31
+ zauiFontSize?: string;
30
32
  zauiFormAlign?: string;
31
33
  zauiFormRequiredAfter?: string;
32
34
  zauiFormRequiredBefore?: string;
33
35
  zauiSize?: number;
34
- zauiSpaceSizeLg?: number;
35
- zauiSpaceSizeMd?: number;
36
+ zauiSpaceSizeLg?: string;
37
+ zauiSpaceSizeMd?: string;
36
38
  /** 大字号模式 */
37
39
  zauiBigText?: boolean;
38
40
  /** 是否有表格边框 */
39
41
  zauiTableBorder?: boolean;
40
42
  /** 是否有斑马纹 */
41
43
  zauiStripe?: boolean;
42
- zauiBaseFontSize?: number;
44
+ zauiBaseFontSize?: string;
43
45
  }
@@ -13,7 +13,7 @@
13
13
  color: var(--zaui-brand, #006aff);
14
14
 
15
15
  svg {
16
- font-size: 24px;
16
+ font-size: var(--zaui-font-size-lg-title, 24px)
17
17
  }
18
18
  }
19
19
  }
@@ -52,4 +52,4 @@
52
52
  .ant-radio-button-wrapper {
53
53
  padding: 0 12px;
54
54
  }
55
- }
55
+ }
@@ -11,7 +11,14 @@ export declare const replaceObject: (themes: ThemesProps, themeMapping: ThemesPr
11
11
  * 设置主题变量
12
12
  */
13
13
  export declare const setThemes: (themes: ThemesProps, themeMapping?: ThemesProps) => boolean;
14
+ /** JS实现驼峰命名与横线命名的转换 */
14
15
  export declare const getKebabCase: (str: string) => string;
16
+ /** JS实现对象驼峰命名与横线命名的转换 */
17
+ export declare const getMapKebabCase: (obj: any, prefix?: string) => {
18
+ [k: string]: unknown;
19
+ };
20
+ /** JS实现对象横线命名与驼峰命名的转换 */
21
+ export declare const getMapHumpCase: (obj?: {}) => {};
15
22
  /**
16
23
  * 设置表格斑马纹
17
24
  * @param stripe boolean
@@ -41,7 +41,7 @@ export var setThemes = function setThemes(themes, themeMapping) {
41
41
  document.documentElement.style.setProperty("--".concat(item[0]), item[1]);
42
42
  });
43
43
  };
44
- // JS实现驼峰命名与横线命名的转换
44
+ /** JS实现驼峰命名与横线命名的转换 */
45
45
  export var getKebabCase = function getKebabCase(str) {
46
46
  var temp = str.replace(/[A-Z]/g, function (i) {
47
47
  return "-".concat(i.toLowerCase());
@@ -52,6 +52,24 @@ export var getKebabCase = function getKebabCase(str) {
52
52
 
53
53
  return temp;
54
54
  };
55
+ /** JS实现对象驼峰命名与横线命名的转换 */
56
+ export var getMapKebabCase = function getMapKebabCase(obj) {
57
+ var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
58
+ return Object.fromEntries(Object.entries(obj).map(function (item) {
59
+ return ["".concat(prefix).concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
60
+ }));
61
+ };
62
+ /** JS实现对象横线命名与驼峰命名的转换 */
63
+ export var getMapHumpCase = function getMapHumpCase() {
64
+ var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
65
+ return Object.keys(obj).reduce(function (acc, key) {
66
+ var transformedKey = key.replace(/-(\w)/g, function (_, letter) {
67
+ return letter.toUpperCase();
68
+ });
69
+ acc[transformedKey] = obj[key];
70
+ return acc;
71
+ }, {});
72
+ };
55
73
  /**
56
74
  * 设置表格斑马纹
57
75
  * @param stripe boolean
@@ -85,7 +85,7 @@ var ProTree = function ProTree(props) {
85
85
  checkAll: false,
86
86
  allKeys: [],
87
87
  clickShowLoading: false,
88
- innerExpandKeys: []
88
+ innerExpandKeys: props === null || props === void 0 ? void 0 : props.expandedKeys
89
89
  }),
90
90
  _useSetState2 = _slicedToArray(_useSetState, 2),
91
91
  state = _useSetState2[0],
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  declare function SearchTitle(props: {
3
- searchStr: string;
4
- label: string;
3
+ searchStr?: string;
4
+ label?: string;
5
5
  showEllipse?: boolean;
6
6
  ellipseWidth?: string;
7
7
  }): JSX.Element;
@@ -30,9 +30,19 @@ function SearchTitle(props) {
30
30
  style: style,
31
31
  children: strTitle
32
32
  });
33
+ var titleTips = index > -1 ? _jsxs("span", {
34
+ style: style,
35
+ children: [beforeStr, searchStr ? _jsx("span", {
36
+ className: "pro-tree-modal-search-value",
37
+ children: searchStr
38
+ }) : null, afterStr]
39
+ }) : _jsx("span", {
40
+ style: style,
41
+ children: strTitle
42
+ });
33
43
  if (classEllipse) {
34
44
  return _jsx(_Tooltip, {
35
- title: title,
45
+ title: titleTips,
36
46
  placement: "rightTop",
37
47
  children: title
38
48
  });
@@ -100,8 +100,13 @@ function List(props) {
100
100
  });
101
101
  }
102
102
  }, [selectedKey]);
103
- var onSelect = function onSelect(val, item) {
103
+ var onSelect = function onSelect(value, item) {
104
104
  var _props$onSelect;
105
+ var val = value;
106
+ if (value === currentClickTreeNode) {
107
+ // 如果当前点击了已经选中节点,那么取消选择
108
+ val = '';
109
+ }
105
110
  setState({
106
111
  currentClickTreeNode: val
107
112
  });