@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
@@ -16,20 +16,21 @@ var _react = require("react");
16
16
  var _classnames2 = _interopRequireDefault(require("classnames"));
17
17
  var _index = require("./utils/index");
18
18
  var _component = require("./component");
19
- var _excluded = ["size", "className", "cacheTime", "color", "mode", "theme", "tableBorder", "tableStripe"];
19
+ var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "tableBorder", "tableStripe", "theme"];
20
+ /* eslint-disable prefer-const */
20
21
  var defaultCacheTime = 1; // 配置保存时间为一天
21
22
  var defaultThemeConfig = {
22
23
  zauiBrand: '#006AFF',
23
24
  zauiText: '#343434',
24
- zauiFontSize: 14,
25
+ zauiFontSize: '14px',
25
26
  zauiFormAlign: 'left',
26
27
  zauiFormRequiredBefore: 'none',
27
28
  zauiFormRequiredAfter: 'inline',
28
29
  zauiSize: 1,
29
- zauiSpaceSizeLg: 32,
30
- zauiSpaceSizeMd: 16,
30
+ zauiSpaceSizeLg: '32px',
31
+ zauiSpaceSizeMd: '16px',
31
32
  zauiBigText: false,
32
- zauiBaseFontSize: 0,
33
+ zauiBaseFontSize: '0px',
33
34
  zauiTableBorder: false,
34
35
  zauiStripe: true
35
36
  };
@@ -39,17 +40,19 @@ var ProThemeTools = function ProThemeTools(_ref) {
39
40
  cacheTime = _ref.cacheTime,
40
41
  color = _ref.color,
41
42
  mode = _ref.mode,
42
- theme = _ref.theme,
43
+ iconFollowTheme = _ref.iconFollowTheme,
43
44
  _ref$tableBorder = _ref.tableBorder,
44
45
  tableBorder = _ref$tableBorder === void 0 ? false : _ref$tableBorder,
45
46
  _ref$tableStripe = _ref.tableStripe,
46
47
  tableStripe = _ref$tableStripe === void 0 ? false : _ref$tableStripe,
48
+ _ref$theme = _ref.theme,
49
+ theme = _ref$theme === void 0 ? {} : _ref$theme,
47
50
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
48
51
  var _useState = (0, _react.useState)(false),
49
52
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
53
  visible = _useState2[0],
51
54
  setVisible = _useState2[1];
52
- var _useState3 = (0, _react.useState)((0, _objectSpread2.default)({}, defaultThemeConfig)),
55
+ var _useState3 = (0, _react.useState)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultThemeConfig), (0, _index.getMapHumpCase)(theme))),
53
56
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
54
57
  state = _useState4[0],
55
58
  setState = _useState4[1];
@@ -83,9 +86,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
83
86
  };
84
87
  // 复制
85
88
  var onCopy = function onCopy() {
86
- var data = JSON.stringify(Object.fromEntries(Object.entries(state).map(function (item) {
87
- return ["@".concat((0, _index.getKebabCase)(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
88
- })));
89
+ var data = JSON.stringify((0, _index.getMapKebabCase)(state, '@'));
89
90
  var input = document.createElement('input');
90
91
  document.body.appendChild(input);
91
92
  input.setAttribute('value', data);
@@ -103,6 +104,10 @@ var ProThemeTools = function ProThemeTools(_ref) {
103
104
  var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
104
105
  // 默认时间间隔
105
106
  var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
107
+ // antd4以下版本不支持主题色的动态配置
108
+ if (!_antd.ConfigProvider.config) {
109
+ return;
110
+ }
106
111
  if (cacheTime && startTime && new Date().getTime() - startTime < duration) {
107
112
  var _localThemeConfig;
108
113
  var localThemeConfig;
@@ -114,15 +119,18 @@ var ProThemeTools = function ProThemeTools(_ref) {
114
119
 
115
120
  setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), localThemeConfig));
116
121
  (0, _index.setThemes)(cssVariables);
117
- // antd4以下版本不支持主题色的动态配置
118
- if (!_antd.ConfigProvider.config) {
119
- return;
120
- }
121
122
  _antd.ConfigProvider.config({
122
123
  theme: {
123
124
  primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
124
125
  }
125
126
  });
127
+ } else {
128
+ (0, _index.setThemes)((0, _index.getMapKebabCase)(state));
129
+ _antd.ConfigProvider.config({
130
+ theme: {
131
+ primaryColor: state === null || state === void 0 ? void 0 : state.zauiBrand
132
+ }
133
+ });
126
134
  }
127
135
  }, []);
128
136
  // 主题色动态切换
@@ -159,7 +167,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
159
167
  }, [state, cacheTime]);
160
168
  var cls = (0, _classnames2.default)((0, _defineProperty2.default)({
161
169
  'pro-theme-tools': true,
162
- 'pro-theme-tools-follow': theme
170
+ 'pro-theme-tools-follow': iconFollowTheme
163
171
  }, className, className));
164
172
  return (0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
165
173
  className: cls
@@ -188,7 +196,7 @@ ProThemeTools.defaultProps = {
188
196
  size: 24,
189
197
  mode: 'prd',
190
198
  color: '#343434',
191
- theme: false,
199
+ iconFollowTheme: false,
192
200
  cacheTime: false
193
201
  };
194
202
  ProThemeTools.setThemes = _index.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
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.setThemes = exports.setTableNoStripe = exports.setTableBorder = exports.replaceObject = exports.getKebabCase = void 0;
7
+ exports.setThemes = exports.setTableNoStripe = exports.setTableBorder = exports.replaceObject = exports.getMapKebabCase = exports.getMapHumpCase = exports.getKebabCase = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _antd = require("antd");
10
10
  /** 主题配置mapping */
@@ -47,7 +47,7 @@ var setThemes = exports.setThemes = function setThemes(themes, themeMapping) {
47
47
  document.documentElement.style.setProperty("--".concat(item[0]), item[1]);
48
48
  });
49
49
  };
50
- // JS实现驼峰命名与横线命名的转换
50
+ /** JS实现驼峰命名与横线命名的转换 */
51
51
  var getKebabCase = exports.getKebabCase = function getKebabCase(str) {
52
52
  var temp = str.replace(/[A-Z]/g, function (i) {
53
53
  return "-".concat(i.toLowerCase());
@@ -58,6 +58,24 @@ var getKebabCase = exports.getKebabCase = function getKebabCase(str) {
58
58
 
59
59
  return temp;
60
60
  };
61
+ /** JS实现对象驼峰命名与横线命名的转换 */
62
+ var getMapKebabCase = exports.getMapKebabCase = function getMapKebabCase(obj) {
63
+ var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
64
+ return Object.fromEntries(Object.entries(obj).map(function (item) {
65
+ return ["".concat(prefix).concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
66
+ }));
67
+ };
68
+ /** JS实现对象横线命名与驼峰命名的转换 */
69
+ var getMapHumpCase = exports.getMapHumpCase = function getMapHumpCase() {
70
+ var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
71
+ return Object.keys(obj).reduce(function (acc, key) {
72
+ var transformedKey = key.replace(/-(\w)/g, function (_, letter) {
73
+ return letter.toUpperCase();
74
+ });
75
+ acc[transformedKey] = obj[key];
76
+ return acc;
77
+ }, {});
78
+ };
61
79
  /**
62
80
  * 设置表格斑马纹
63
81
  * @param stripe boolean
@@ -21,12 +21,13 @@ var _lodash = require("lodash");
21
21
  var _reactSvg = require("react-svg");
22
22
  var _ProConfigProvider = require("../../ProConfigProvider");
23
23
  var _index = require("./index");
24
+ var _locale = _interopRequireDefault(require("../../locale"));
24
25
  var _utils = require("../utils");
25
26
  var _inputSearch = _interopRequireDefault(require("../../assets/input-search.svg"));
26
27
  require("../style/index.less");
27
28
  var _excluded = ["value", "onChange", "dataSource", "mode", "code", "useRequest", "allValue", "showCodeName", "checkStrictly", "tags", "placeholder", "labelInValue", "fieldNames", "disabled", "isView", "transformResponse", "optionRender", "onSelect", "loading", "style", "className", "showSearch", "title", "footer", "expandedKeys", "showExpand", "selectKey"];
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 = (0, _ProConfigProvider.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 = (0, _slicedToArray2.default)(_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.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree = _locale.default.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.inputPlaceholder),
392
393
  className: "pro-tree-search",
393
394
  onChange: onSearch,
394
395
  prefix: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
@@ -406,7 +407,7 @@ var ProTree = function ProTree(props) {
406
407
  children: [(0, _jsxRuntime.jsx)("div", {
407
408
  className: "expand-icon",
408
409
  children: (0, _jsxRuntime.jsx)(_icons.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.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree2 = _locale.default.ProTree) === null || _locale$ProTree2 === void 0 ? void 0 : _locale$ProTree2.unExpand : _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree3 = _locale.default.ProTree) === null || _locale$ProTree3 === void 0 ? void 0 : _locale$ProTree3.expand]
410
411
  })]
411
412
  })]
412
413
  }), (0, _jsxRuntime.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.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree4 = _locale.default.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;
@@ -35,9 +35,19 @@ function SearchTitle(props) {
35
35
  style: style,
36
36
  children: strTitle
37
37
  });
38
+ var titleTips = index > -1 ? (0, _jsxRuntime.jsxs)("span", {
39
+ style: style,
40
+ children: [beforeStr, searchStr ? (0, _jsxRuntime.jsx)("span", {
41
+ className: "pro-tree-modal-search-value",
42
+ children: searchStr
43
+ }) : null, afterStr]
44
+ }) : (0, _jsxRuntime.jsx)("span", {
45
+ style: style,
46
+ children: strTitle
47
+ });
38
48
  if (classEllipse) {
39
49
  return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
40
- title: title,
50
+ title: titleTips,
41
51
  placement: "rightTop",
42
52
  children: title
43
53
  });
@@ -16,10 +16,19 @@ var _ahooks = require("ahooks");
16
16
  var _icons = require("@ant-design/icons");
17
17
  var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
18
18
  var _utils = require("../utils");
19
+ var _locale = _interopRequireDefault(require("../../locale"));
19
20
  var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode"];
21
+ /*
22
+ *@Date: 2023-07-25 13:49:35
23
+ *@LastEditTime: 2023-07-25 13:49:35
24
+ *@Author: liudongliang
25
+ *@Description: 树每行节点渲染组件,复选时阻止点击事件冒泡,只有点击树节点文本会向上触发onSelect事件
26
+ */
27
+ /* eslint-disable no-plusplus */
20
28
  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)'];
21
29
  var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
22
30
  function List(props) {
31
+ var _locale$ProTree;
23
32
  var checkedValues = props.checkedValues,
24
33
  disabled = props.disabled,
25
34
  searchStr = props.searchStr,
@@ -98,8 +107,13 @@ function List(props) {
98
107
  });
99
108
  }
100
109
  }, [selectedKey]);
101
- var onSelect = function onSelect(val, item) {
110
+ var onSelect = function onSelect(value, item) {
102
111
  var _props$onSelect;
112
+ var val = value;
113
+ if (value === currentClickTreeNode) {
114
+ // 如果当前点击了已经选中节点,那么取消选择
115
+ val = '';
116
+ }
103
117
  setState({
104
118
  currentClickTreeNode: val
105
119
  });
@@ -335,7 +349,7 @@ function List(props) {
335
349
  blockNode: true
336
350
  })) : (0, _jsxRuntime.jsx)("div", {
337
351
  className: "empty-tree",
338
- children: "\u8BF6\u5440\uFF0C\u6CA1\u6709\u627E\u5230\u60A8\u8981\u67E5\u8BE2\u7684\u5185\u5BB9"
352
+ children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTree = _locale.default.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.emptyTips
339
353
  })
340
354
  });
341
355
  }
@@ -16,7 +16,6 @@ var _ProTreeSelect = _interopRequireDefault(require("../ProTreeSelect"));
16
16
  *@Author: liudongliang
17
17
  *@Description: ProTree组件,集成了tree和treeSelect
18
18
  */
19
-
20
19
  var ProTreeHandle = function ProTreeHandle(props) {
21
20
  var _props$mode = props.mode,
22
21
  mode = _props$mode === void 0 ? 'tree' : _props$mode;