@zat-design/sisyphus-react 3.1.5 → 3.2.0-beta.1

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 (256) hide show
  1. package/dist/index.esm.css +176 -251
  2. package/es/ProAction/index.js +7 -5
  3. package/es/ProAction/index.less +3 -2
  4. package/es/ProConfigProvider/index.d.ts +2 -0
  5. package/es/ProConfigProvider/index.js +23 -2
  6. package/es/ProDownload/utils.js +6 -3
  7. package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
  8. package/es/ProDrawerForm/index.js +5 -3
  9. package/es/ProDrawerForm/style/index.less +15 -11
  10. package/es/ProEditLabel/style/index.less +2 -2
  11. package/es/ProEditTable/components/ActionButton/index.js +3 -2
  12. package/es/ProEditTable/components/RenderField/index.js +2 -1
  13. package/es/ProEditTable/index.js +7 -6
  14. package/es/ProEditTable/style/index.less +15 -8
  15. package/es/ProEditTable/utils/config.d.ts +8 -8
  16. package/es/ProEditTable/utils/config.js +20 -12
  17. package/es/ProEditTable/utils/index.js +3 -2
  18. package/es/ProEnum/hooks/useEnumRequest.js +17 -10
  19. package/es/ProEnum/index.js +9 -4
  20. package/es/ProEnum/style/index.less +1 -1
  21. package/es/ProForm/components/FormFooter/index.js +16 -20
  22. package/es/ProForm/components/base/Input/index.js +4 -3
  23. package/es/ProForm/components/base/InputNumber/index.js +4 -3
  24. package/es/ProForm/components/base/RangePicker/index.js +0 -3
  25. package/es/ProForm/components/base/Select/index.js +2 -1
  26. package/es/ProForm/components/base/Switch/index.js +9 -5
  27. package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  28. package/es/ProForm/components/base/TextArea/index.js +4 -2
  29. package/es/ProForm/components/base/TextArea/index.less +1 -1
  30. package/es/ProForm/components/combination/Container/style/index.less +0 -1
  31. package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  32. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  33. package/es/ProForm/components/combination/FormList/style/index.less +20 -19
  34. package/es/ProForm/components/combination/Group/index.js +2 -2
  35. package/es/ProForm/components/combination/ProAddressBar/index.js +83 -63
  36. package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  37. package/es/ProForm/components/combination/ProModalSelect/index.js +76 -15
  38. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  39. package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  40. package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
  41. package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  42. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  43. package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  44. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  45. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  46. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
  47. package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
  48. package/es/ProForm/components/render/Render.js +4 -2
  49. package/es/ProForm/components/render/RenderFields.js +10 -6
  50. package/es/ProForm/components/render/propsType.d.ts +5 -4
  51. package/es/ProForm/index.js +14 -2
  52. package/es/ProForm/style/index.less +77 -169
  53. package/es/ProForm/utils/index.d.ts +1 -1
  54. package/es/ProForm/utils/index.js +7 -2
  55. package/es/ProForm/utils/rulesCreator.js +2 -1
  56. package/es/ProForm/utils/useRules.js +4 -3
  57. package/es/ProForm/utils/useShouldUpdate.js +16 -16
  58. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  59. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
  60. package/es/ProLayout/components/Layout/Notice/index.js +3 -2
  61. package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
  62. package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  63. package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +2 -1
  64. package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  65. package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  66. package/es/ProLayout/components/ProHeader/components/index.js +2 -1
  67. package/es/ProLayout/components/ProHeader/index.js +9 -6
  68. package/es/ProLayout/components/ProHeader/style/index.less +16 -7
  69. package/es/ProLayout/utils/index.js +1 -1
  70. package/es/ProSelect/index.d.ts +3 -3
  71. package/es/ProSelect/index.js +4 -2
  72. package/es/ProStep/components/Step/index.js +3 -1
  73. package/es/ProStep/style/index.less +0 -1
  74. package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
  75. package/es/ProTable/components/RenderColumn/index.js +41 -25
  76. package/es/ProTable/index.js +10 -8
  77. package/es/ProTable/propsType.d.ts +2 -0
  78. package/es/ProTable/style/index.less +14 -1
  79. package/es/ProTable/useAntdTable.d.ts +12 -4
  80. package/es/ProTable/useAntdTable.js +18 -6
  81. package/es/ProTable/utils.d.ts +1 -1
  82. package/es/ProTable/utils.js +258 -201
  83. package/es/ProTabs/style/index.less +1 -1
  84. package/es/ProThemeTools/component/PrdTools/index.js +1 -1
  85. package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
  86. package/es/ProThemeTools/index.d.ts +2 -2
  87. package/es/ProThemeTools/index.js +24 -17
  88. package/es/ProThemeTools/propsType.d.ts +8 -6
  89. package/es/ProThemeTools/style/index.less +2 -2
  90. package/es/ProThemeTools/utils/index.d.ts +7 -0
  91. package/es/ProThemeTools/utils/index.js +19 -1
  92. package/es/ProTree/components/ProTree.js +6 -5
  93. package/es/ProTree/components/SearchTitle.d.ts +2 -2
  94. package/es/ProTree/components/SearchTitle.js +11 -1
  95. package/es/ProTree/components/Tree.js +9 -2
  96. package/es/ProTree/style/index.less +193 -141
  97. package/es/ProTreeModal/components/List.js +0 -14
  98. package/es/ProTreeModal/components/Trigger.js +9 -3
  99. package/es/ProTreeModal/index.js +29 -13
  100. package/es/ProTreeModal/style/index.less +2 -6
  101. package/es/ProUpload/components/ButtonRender.js +5 -2
  102. package/es/ProUpload/components/DragRender.js +8 -8
  103. package/es/ProUpload/components/Example.js +3 -1
  104. package/es/ProUpload/components/ImageRender.js +8 -6
  105. package/es/ProUpload/index.js +8 -6
  106. package/es/ProUpload/style/index.less +41 -39
  107. package/es/index.d.ts +2 -1
  108. package/es/index.js +2 -1
  109. package/es/locale/en_US.d.ts +138 -0
  110. package/es/locale/en_US.js +137 -0
  111. package/es/locale/index.d.ts +13 -0
  112. package/es/locale/index.js +32 -0
  113. package/es/locale/zh_CN.d.ts +137 -0
  114. package/es/locale/zh_CN.js +136 -0
  115. package/es/old/ProEditableTable/style/index.less +1 -2
  116. package/es/style/components.less +0 -1
  117. package/es/style/core/normalize.less +1 -2
  118. package/es/style/theme/antd.less +3 -4
  119. package/es/style/theme/index.less +80 -79
  120. package/es/style/theme/tokens.less +1 -0
  121. package/lib/ProAction/index.js +7 -5
  122. package/lib/ProAction/index.less +3 -2
  123. package/lib/ProConfigProvider/index.d.ts +2 -0
  124. package/lib/ProConfigProvider/index.js +22 -2
  125. package/lib/ProDownload/utils.js +4 -3
  126. package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
  127. package/lib/ProDrawerForm/index.js +5 -3
  128. package/lib/ProDrawerForm/style/index.less +15 -11
  129. package/lib/ProEditLabel/style/index.less +2 -2
  130. package/lib/ProEditTable/components/ActionButton/index.js +3 -2
  131. package/lib/ProEditTable/components/RenderField/index.js +4 -1
  132. package/lib/ProEditTable/index.js +7 -6
  133. package/lib/ProEditTable/style/index.less +15 -8
  134. package/lib/ProEditTable/utils/config.d.ts +8 -8
  135. package/lib/ProEditTable/utils/config.js +20 -12
  136. package/lib/ProEditTable/utils/index.js +3 -2
  137. package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
  138. package/lib/ProEnum/index.js +9 -4
  139. package/lib/ProEnum/style/index.less +1 -1
  140. package/lib/ProForm/components/FormFooter/index.js +16 -19
  141. package/lib/ProForm/components/base/Input/index.js +4 -3
  142. package/lib/ProForm/components/base/InputNumber/index.js +4 -3
  143. package/lib/ProForm/components/base/RangePicker/index.js +1 -4
  144. package/lib/ProForm/components/base/Select/index.js +2 -1
  145. package/lib/ProForm/components/base/Switch/index.js +8 -5
  146. package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  147. package/lib/ProForm/components/base/TextArea/index.js +4 -2
  148. package/lib/ProForm/components/base/TextArea/index.less +1 -1
  149. package/lib/ProForm/components/combination/Container/style/index.less +0 -1
  150. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  151. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  152. package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
  153. package/lib/ProForm/components/combination/Group/index.js +2 -2
  154. package/lib/ProForm/components/combination/ProAddressBar/index.js +78 -60
  155. package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  156. package/lib/ProForm/components/combination/ProModalSelect/index.js +76 -15
  157. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  158. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  159. package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
  160. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  161. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  162. package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  163. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  164. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  165. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
  166. package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
  167. package/lib/ProForm/components/old/InputRange/index.js +0 -1
  168. package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
  169. package/lib/ProForm/components/render/Render.js +5 -2
  170. package/lib/ProForm/components/render/RenderFields.js +9 -5
  171. package/lib/ProForm/components/render/propsType.d.ts +5 -4
  172. package/lib/ProForm/index.js +14 -2
  173. package/lib/ProForm/style/index.less +77 -169
  174. package/lib/ProForm/utils/index.d.ts +1 -1
  175. package/lib/ProForm/utils/index.js +7 -2
  176. package/lib/ProForm/utils/rulesCreator.js +2 -1
  177. package/lib/ProForm/utils/useRules.js +4 -3
  178. package/lib/ProForm/utils/useShouldUpdate.js +16 -16
  179. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  180. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
  181. package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
  182. package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
  183. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  184. package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +3 -1
  185. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  186. package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  187. package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
  188. package/lib/ProLayout/components/ProHeader/index.js +9 -6
  189. package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
  190. package/lib/ProLayout/utils/index.js +1 -1
  191. package/lib/ProSelect/index.d.ts +3 -3
  192. package/lib/ProSelect/index.js +4 -2
  193. package/lib/ProStep/components/Step/index.js +3 -1
  194. package/lib/ProStep/style/index.less +0 -1
  195. package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
  196. package/lib/ProTable/components/RenderColumn/index.js +38 -24
  197. package/lib/ProTable/components/TableResizable/index.js +8 -0
  198. package/lib/ProTable/index.js +10 -8
  199. package/lib/ProTable/propsType.d.ts +2 -0
  200. package/lib/ProTable/style/index.less +14 -1
  201. package/lib/ProTable/useAntdTable.d.ts +12 -4
  202. package/lib/ProTable/useAntdTable.js +19 -6
  203. package/lib/ProTable/utils.d.ts +1 -1
  204. package/lib/ProTable/utils.js +258 -201
  205. package/lib/ProTabs/index.js +1 -0
  206. package/lib/ProTabs/style/index.less +1 -1
  207. package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
  208. package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
  209. package/lib/ProThemeTools/index.d.ts +2 -2
  210. package/lib/ProThemeTools/index.js +24 -16
  211. package/lib/ProThemeTools/propsType.d.ts +8 -6
  212. package/lib/ProThemeTools/style/index.less +2 -2
  213. package/lib/ProThemeTools/utils/index.d.ts +7 -0
  214. package/lib/ProThemeTools/utils/index.js +20 -2
  215. package/lib/ProTree/components/ProTree.js +6 -5
  216. package/lib/ProTree/components/SearchTitle.d.ts +2 -2
  217. package/lib/ProTree/components/SearchTitle.js +11 -1
  218. package/lib/ProTree/components/Tree.js +16 -2
  219. package/lib/ProTree/index.js +0 -1
  220. package/lib/ProTree/style/index.less +193 -141
  221. package/lib/ProTreeModal/components/List.js +0 -14
  222. package/lib/ProTreeModal/components/Tree.js +1 -0
  223. package/lib/ProTreeModal/components/Trigger.js +10 -3
  224. package/lib/ProTreeModal/index.js +29 -13
  225. package/lib/ProTreeModal/style/index.less +2 -6
  226. package/lib/ProUpload/components/ButtonRender.js +5 -2
  227. package/lib/ProUpload/components/DragRender.js +8 -8
  228. package/lib/ProUpload/components/Example.js +3 -1
  229. package/lib/ProUpload/components/ImageRender.js +8 -6
  230. package/lib/ProUpload/index.js +14 -5
  231. package/lib/ProUpload/style/index.less +41 -39
  232. package/lib/index.d.ts +2 -1
  233. package/lib/index.js +13 -1
  234. package/lib/locale/en_US.d.ts +138 -0
  235. package/lib/locale/en_US.js +143 -0
  236. package/lib/locale/index.d.ts +13 -0
  237. package/lib/locale/index.js +41 -0
  238. package/lib/locale/zh_CN.d.ts +137 -0
  239. package/lib/locale/zh_CN.js +142 -0
  240. package/lib/old/ProCertValidity/index.js +1 -1
  241. package/lib/old/ProEditableTable/style/index.less +1 -2
  242. package/lib/style/components.less +0 -1
  243. package/lib/style/core/normalize.less +1 -2
  244. package/lib/style/theme/antd.less +3 -4
  245. package/lib/style/theme/index.less +80 -79
  246. package/lib/style/theme/tokens.less +1 -0
  247. package/package.json +1 -1
  248. package/typings.d.ts +2 -0
  249. package/es/old/ProBackBtn/style/index.less +0 -19
  250. package/lib/old/ProBackBtn/style/index.less +0 -19
  251. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  252. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  253. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
  254. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  255. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  256. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
@@ -29,7 +29,7 @@
29
29
  width : 4px;
30
30
  height : 14px;
31
31
  background : var(--zaui-brand, #006aff);
32
- border-radius: 2px;
32
+ border-radius: var(zaui-border-radius-card, 2px);
33
33
  }
34
34
  }
35
35
 
@@ -49,7 +49,7 @@
49
49
  margin-right : 34px;
50
50
 
51
51
  span {
52
- font-size : 14px;
52
+ font-size : var(--zaui-font-size, 14px);
53
53
  vertical-align: -7px;
54
54
  }
55
55
 
@@ -145,7 +145,7 @@
145
145
  left : 4px;
146
146
  z-index : 1;
147
147
  color : var(--zaui-text, #343434);
148
- font-size: 16px;
148
+ font-size: var(--zaui-font-size-lg, 16px);
149
149
  transform: translateZ(100px);
150
150
 
151
151
  &:hover {
@@ -1,11 +1,11 @@
1
1
  import type { ProThemeToolsProps } from './propsType';
2
2
  declare const ProThemeTools: {
3
- ({ size, className, cacheTime, color, mode, theme, tableBorder, tableStripe, ...props }: ProThemeToolsProps): JSX.Element;
3
+ ({ size, className, cacheTime, color, mode, iconFollowTheme, tableBorder, tableStripe, theme, ...props }: ProThemeToolsProps): JSX.Element;
4
4
  defaultProps: {
5
5
  size: number;
6
6
  mode: string;
7
7
  color: string;
8
- theme: boolean;
8
+ iconFollowTheme: boolean;
9
9
  cacheTime: boolean;
10
10
  };
11
11
  setThemes: (themes: import("./utils/index").ThemesProps, themeMapping?: import("./utils/index").ThemesProps) => boolean;
@@ -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
@@ -22,11 +22,12 @@ import { cloneDeep, isFunction } from 'lodash';
22
22
  import { ReactSVG } from 'react-svg';
23
23
  import { useProConfig } from '../../ProConfigProvider';
24
24
  import { TreeView } from './index';
25
+ import locale from '../../locale';
25
26
  import { getFlatTreeData, getChildrenKeys, findTreeNodeByKey, getAllKeys } from '../utils';
26
27
  import searchSVG from '../../assets/input-search.svg';
27
28
  import '../style/index.less';
28
29
  var ProTree = function ProTree(props) {
29
- var _props$otherProps, _props$otherProps2, _state$innerExpandKey2, _state$innerExpandKey3;
30
+ var _props$otherProps, _props$otherProps2, _locale$ProTree, _state$innerExpandKey2, _state$innerExpandKey3, _locale$ProTree2, _locale$ProTree3, _locale$ProTree4;
30
31
  var _useProConfig = useProConfig('ProEnum'),
31
32
  _useProConfig$dics = _useProConfig.dics,
32
33
  dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
@@ -85,7 +86,7 @@ var ProTree = function ProTree(props) {
85
86
  checkAll: false,
86
87
  allKeys: [],
87
88
  clickShowLoading: false,
88
- innerExpandKeys: []
89
+ innerExpandKeys: props === null || props === void 0 ? void 0 : props.expandedKeys
89
90
  }),
90
91
  _useSetState2 = _slicedToArray(_useSetState, 2),
91
92
  state = _useSetState2[0],
@@ -388,7 +389,7 @@ var ProTree = function ProTree(props) {
388
389
  disabled: disabled,
389
390
  allowClear: true,
390
391
  value: state.searchStr,
391
- placeholder: placeholder || '请输入',
392
+ placeholder: placeholder || (locale === null || locale === void 0 ? void 0 : (_locale$ProTree = locale.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.inputPlaceholder),
392
393
  className: "pro-tree-search",
393
394
  onChange: onSearch,
394
395
  prefix: _jsx(ReactSVG, {
@@ -406,7 +407,7 @@ var ProTree = function ProTree(props) {
406
407
  children: [_jsx("div", {
407
408
  className: "expand-icon",
408
409
  children: _jsx(CaretDownOutlined, {})
409
- }), (state === null || state === void 0 ? void 0 : (_state$innerExpandKey3 = state.innerExpandKeys) === null || _state$innerExpandKey3 === void 0 ? void 0 : _state$innerExpandKey3.length) ? '全部收起' : '全部展开']
410
+ }), (state === null || state === void 0 ? void 0 : (_state$innerExpandKey3 = state.innerExpandKeys) === null || _state$innerExpandKey3 === void 0 ? void 0 : _state$innerExpandKey3.length) ? locale === null || locale === void 0 ? void 0 : (_locale$ProTree2 = locale.ProTree) === null || _locale$ProTree2 === void 0 ? void 0 : _locale$ProTree2.unExpand : locale === null || locale === void 0 ? void 0 : (_locale$ProTree3 = locale.ProTree) === null || _locale$ProTree3 === void 0 ? void 0 : _locale$ProTree3.expand]
410
411
  })]
411
412
  })]
412
413
  }), _jsx("div", {
@@ -435,7 +436,7 @@ var ProTree = function ProTree(props) {
435
436
  checked: state.checkAll,
436
437
  disabled: disabled,
437
438
  onChange: handleAllCheck,
438
- children: "\u5168\u9009"
439
+ children: locale === null || locale === void 0 ? void 0 : (_locale$ProTree4 = locale.ProTree) === null || _locale$ProTree4 === void 0 ? void 0 : _locale$ProTree4.all
439
440
  }) : null
440
441
  }), footer]
441
442
  })]
@@ -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
  });
@@ -19,9 +19,11 @@ import { useSetState } from 'ahooks';
19
19
  import { CaretDownOutlined } from '@ant-design/icons';
20
20
  import SearchTitle from './SearchTitle';
21
21
  import { filterCheckedNodes, getParentKey } from '../utils';
22
+ import locale from '../../locale';
22
23
  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)'];
23
24
  var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
24
25
  function List(props) {
26
+ var _locale$ProTree;
25
27
  var checkedValues = props.checkedValues,
26
28
  disabled = props.disabled,
27
29
  searchStr = props.searchStr,
@@ -100,8 +102,13 @@ function List(props) {
100
102
  });
101
103
  }
102
104
  }, [selectedKey]);
103
- var onSelect = function onSelect(val, item) {
105
+ var onSelect = function onSelect(value, item) {
104
106
  var _props$onSelect;
107
+ var val = value;
108
+ if (value === currentClickTreeNode) {
109
+ // 如果当前点击了已经选中节点,那么取消选择
110
+ val = '';
111
+ }
105
112
  setState({
106
113
  currentClickTreeNode: val
107
114
  });
@@ -337,7 +344,7 @@ function List(props) {
337
344
  blockNode: true
338
345
  })) : _jsx("div", {
339
346
  className: "empty-tree",
340
- children: "\u8BF6\u5440\uFF0C\u6CA1\u6709\u627E\u5230\u60A8\u8981\u67E5\u8BE2\u7684\u5185\u5BB9"
347
+ children: locale === null || locale === void 0 ? void 0 : (_locale$ProTree = locale.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.emptyTips
341
348
  })
342
349
  });
343
350
  }