@zat-design/sisyphus-react 3.2.2 → 3.3.0-beta.2

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 (212) hide show
  1. package/README.md +7 -0
  2. package/dist/index.esm.css +82 -37
  3. package/es/ProAction/index.less +3 -0
  4. package/es/ProDownload/index.js +9 -6
  5. package/es/ProDownload/style/index.less +5 -2
  6. package/es/ProDrawerForm/index.js +1 -15
  7. package/es/ProDrawerForm/style/index.less +76 -73
  8. package/es/ProEditLabel/style/index.less +12 -9
  9. package/es/ProEditTable/components/RenderField/index.js +6 -4
  10. package/es/ProEditTable/index.js +34 -20
  11. package/es/ProEditTable/style/index.less +57 -47
  12. package/es/ProEditTable/utils/config.d.ts +1 -1
  13. package/es/ProEditTable/utils/config.js +3 -3
  14. package/es/ProEnum/style/index.less +3 -0
  15. package/es/ProForm/components/base/DatePicker/index.d.ts +2 -2
  16. package/es/ProForm/components/base/DatePicker/index.js +5 -8
  17. package/es/ProForm/components/base/RangePicker/index.d.ts +3 -2
  18. package/es/ProForm/components/base/RangePicker/index.js +3 -5
  19. package/es/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
  20. package/es/ProForm/components/base/TextArea/index.less +4 -3
  21. package/es/ProForm/components/base/TimePicker/index.js +3 -3
  22. package/es/ProForm/components/base/TimePicker/style/index.less +4 -1
  23. package/es/ProForm/components/combination/Container/style/index.less +6 -3
  24. package/es/ProForm/components/combination/FormList/style/index.less +20 -24
  25. package/es/ProForm/components/combination/Group/style/index.less +18 -15
  26. package/es/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
  27. package/es/ProForm/components/combination/ProCombination/style/index.less +5 -2
  28. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -1
  29. package/es/ProForm/components/combination/ProModalSelect/index.js +22 -24
  30. package/es/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
  31. package/es/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
  32. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
  33. package/es/ProForm/components/combination/ProRangeLimit/index.js +6 -6
  34. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +2 -2
  35. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +2 -2
  36. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
  37. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -4
  38. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
  39. package/es/ProForm/components/old/ProCertValidity/index.js +16 -16
  40. package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +4 -4
  41. package/es/ProForm/components/render/RenderFields.js +4 -5
  42. package/es/ProForm/style/index.less +46 -44
  43. package/es/ProIcon/style/index.less +4 -1
  44. package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
  45. package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
  46. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
  47. package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
  48. package/es/ProLayout/components/Layout/Menu/style/index.less +2 -0
  49. package/es/ProLayout/components/Layout/Notice/style/index.less +3 -0
  50. package/es/ProLayout/components/ProCollapse/style/index.less +27 -24
  51. package/es/ProLayout/components/ProFooter/style/index.less +11 -7
  52. package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
  53. package/es/ProLayout/components/ProHeader/index.js +4 -4
  54. package/es/ProLayout/components/ProHeader/style/index.less +12 -11
  55. package/es/ProLayout/style/index.less +10 -7
  56. package/es/ProSelect/index.less +3 -0
  57. package/es/ProStep/index.js +2 -2
  58. package/es/ProStep/style/index.less +3 -0
  59. package/es/ProTable/index.js +15 -7
  60. package/es/ProTable/style/index.less +76 -54
  61. package/es/ProTable/utils.d.ts +1 -1
  62. package/es/ProTable/utils.js +52 -33
  63. package/es/ProTabs/style/index.less +25 -23
  64. package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  65. package/es/ProThemeTools/component/PrdTools/index.js +7 -6
  66. package/es/ProThemeTools/component/PrdTools/style/index.less +6 -6
  67. package/es/ProThemeTools/index.d.ts +1 -1
  68. package/es/ProThemeTools/index.js +7 -2
  69. package/es/ProThemeTools/propsType.d.ts +4 -0
  70. package/es/ProThemeTools/style/index.less +6 -3
  71. package/es/ProThemeTools/utils/index.d.ts +1 -1
  72. package/es/ProThemeTools/utils/index.js +2 -1
  73. package/es/ProTooltip/style/index.less +3 -0
  74. package/es/ProTree/components/CloseIcon.js +2 -4
  75. package/es/ProTree/components/ProTree.js +27 -11
  76. package/es/ProTree/components/Tree.js +1 -1
  77. package/es/ProTree/propsType.d.ts +2 -2
  78. package/es/ProTree/style/index.less +29 -26
  79. package/es/ProTree/utils.d.ts +6 -0
  80. package/es/ProTree/utils.js +11 -0
  81. package/es/ProTreeModal/components/CloseIcon.js +2 -4
  82. package/es/ProTreeModal/components/Trigger.d.ts +3 -0
  83. package/es/ProTreeModal/components/Trigger.js +79 -19
  84. package/es/ProTreeModal/index.js +38 -6
  85. package/es/ProTreeModal/propsType.d.ts +5 -2
  86. package/es/ProTreeModal/style/index.less +11 -8
  87. package/es/ProTreeSelect/index.js +6 -4
  88. package/es/ProTreeSelect/propsType.d.ts +2 -0
  89. package/es/ProTreeSelect/style/index.less +25 -22
  90. package/es/ProUpload/components/DragRender.js +7 -4
  91. package/es/ProUpload/components/ImageRender.js +5 -1
  92. package/es/ProUpload/index.js +11 -7
  93. package/es/ProUpload/style/index.less +13 -4
  94. package/es/ProViewer/index.js +3 -1
  95. package/es/ProViewer/style/index.less +6 -3
  96. package/es/locale/en_US.d.ts +4 -0
  97. package/es/locale/en_US.js +5 -1
  98. package/es/locale/index.js +2 -2
  99. package/es/locale/zh_CN.d.ts +4 -0
  100. package/es/locale/zh_CN.js +6 -2
  101. package/es/old/ProCertValidity/index.js +16 -16
  102. package/es/old/ProCertValidity/propsType.d.ts +4 -4
  103. package/es/old/ProEditableTable/utils.d.ts +5 -5
  104. package/es/old/ProEditableTable/utils.js +5 -5
  105. package/es/style/core/compatible.less +6 -6
  106. package/es/style/theme/antd.less +272 -253
  107. package/lib/ProAction/index.less +3 -0
  108. package/lib/ProDownload/index.js +9 -6
  109. package/lib/ProDownload/style/index.less +5 -2
  110. package/lib/ProDrawerForm/index.js +0 -14
  111. package/lib/ProDrawerForm/style/index.less +76 -73
  112. package/lib/ProEditLabel/style/index.less +12 -9
  113. package/lib/ProEditTable/components/RenderField/index.js +6 -4
  114. package/lib/ProEditTable/index.js +32 -18
  115. package/lib/ProEditTable/style/index.less +57 -47
  116. package/lib/ProEditTable/utils/config.d.ts +1 -1
  117. package/lib/ProEditTable/utils/config.js +3 -3
  118. package/lib/ProEnum/style/index.less +3 -0
  119. package/lib/ProForm/components/base/DatePicker/index.d.ts +2 -2
  120. package/lib/ProForm/components/base/DatePicker/index.js +5 -8
  121. package/lib/ProForm/components/base/RangePicker/index.d.ts +3 -2
  122. package/lib/ProForm/components/base/RangePicker/index.js +4 -4
  123. package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
  124. package/lib/ProForm/components/base/TextArea/index.less +4 -3
  125. package/lib/ProForm/components/base/TimePicker/index.js +3 -3
  126. package/lib/ProForm/components/base/TimePicker/style/index.less +4 -1
  127. package/lib/ProForm/components/combination/Container/style/index.less +6 -3
  128. package/lib/ProForm/components/combination/FormList/style/index.less +20 -24
  129. package/lib/ProForm/components/combination/Group/style/index.less +18 -15
  130. package/lib/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
  131. package/lib/ProForm/components/combination/ProCombination/style/index.less +5 -2
  132. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +7 -1
  133. package/lib/ProForm/components/combination/ProModalSelect/index.js +22 -24
  134. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
  135. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
  136. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
  137. package/lib/ProForm/components/combination/ProRangeLimit/index.js +6 -6
  138. package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +2 -2
  139. package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +2 -2
  140. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
  141. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -4
  142. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
  143. package/lib/ProForm/components/old/ProCertValidity/index.js +16 -16
  144. package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +4 -4
  145. package/lib/ProForm/components/render/RenderFields.js +4 -5
  146. package/lib/ProForm/style/index.less +46 -44
  147. package/lib/ProIcon/style/index.less +4 -1
  148. package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
  149. package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
  150. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
  151. package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
  152. package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -0
  153. package/lib/ProLayout/components/Layout/Notice/style/index.less +3 -0
  154. package/lib/ProLayout/components/ProCollapse/style/index.less +27 -24
  155. package/lib/ProLayout/components/ProFooter/style/index.less +11 -7
  156. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
  157. package/lib/ProLayout/components/ProHeader/index.js +4 -4
  158. package/lib/ProLayout/components/ProHeader/style/index.less +12 -11
  159. package/lib/ProLayout/style/index.less +10 -7
  160. package/lib/ProSelect/index.less +3 -0
  161. package/lib/ProStep/index.js +1 -1
  162. package/lib/ProStep/style/index.less +3 -0
  163. package/lib/ProTable/index.js +14 -6
  164. package/lib/ProTable/style/index.less +76 -54
  165. package/lib/ProTable/utils.d.ts +1 -1
  166. package/lib/ProTable/utils.js +52 -33
  167. package/lib/ProTabs/style/index.less +25 -23
  168. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  169. package/lib/ProThemeTools/component/PrdTools/index.js +7 -6
  170. package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
  171. package/lib/ProThemeTools/index.d.ts +1 -1
  172. package/lib/ProThemeTools/index.js +7 -2
  173. package/lib/ProThemeTools/propsType.d.ts +4 -0
  174. package/lib/ProThemeTools/style/index.less +6 -3
  175. package/lib/ProThemeTools/utils/index.d.ts +1 -1
  176. package/lib/ProThemeTools/utils/index.js +2 -1
  177. package/lib/ProTooltip/style/index.less +3 -0
  178. package/lib/ProTree/components/CloseIcon.js +2 -4
  179. package/lib/ProTree/components/ProTree.js +26 -10
  180. package/lib/ProTree/components/Tree.js +1 -1
  181. package/lib/ProTree/propsType.d.ts +2 -2
  182. package/lib/ProTree/style/index.less +29 -26
  183. package/lib/ProTree/utils.d.ts +6 -0
  184. package/lib/ProTree/utils.js +12 -0
  185. package/lib/ProTreeModal/components/CloseIcon.js +2 -4
  186. package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
  187. package/lib/ProTreeModal/components/Trigger.js +74 -18
  188. package/lib/ProTreeModal/index.js +38 -6
  189. package/lib/ProTreeModal/propsType.d.ts +5 -2
  190. package/lib/ProTreeModal/style/index.less +11 -8
  191. package/lib/ProTreeSelect/index.js +6 -4
  192. package/lib/ProTreeSelect/propsType.d.ts +2 -0
  193. package/lib/ProTreeSelect/style/index.less +25 -22
  194. package/lib/ProUpload/components/DragRender.js +7 -4
  195. package/lib/ProUpload/components/ImageRender.js +5 -1
  196. package/lib/ProUpload/index.js +11 -7
  197. package/lib/ProUpload/style/index.less +13 -4
  198. package/lib/ProViewer/index.js +4 -3
  199. package/lib/ProViewer/style/index.less +6 -3
  200. package/lib/locale/en_US.d.ts +4 -0
  201. package/lib/locale/en_US.js +5 -1
  202. package/lib/locale/index.js +2 -2
  203. package/lib/locale/zh_CN.d.ts +4 -0
  204. package/lib/locale/zh_CN.js +6 -2
  205. package/lib/old/ProCertValidity/index.js +16 -16
  206. package/lib/old/ProCertValidity/propsType.d.ts +4 -4
  207. package/lib/old/ProEditableTable/utils.d.ts +5 -5
  208. package/lib/old/ProEditableTable/utils.js +5 -5
  209. package/lib/style/core/compatible.less +6 -6
  210. package/lib/style/theme/antd.less +272 -253
  211. package/package.json +3 -2
  212. package/typings.d.ts +0 -6
@@ -7,25 +7,51 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _jsxRuntime = require("react/jsx-runtime");
12
+ var _react = require("react");
11
13
  var _classnames = _interopRequireDefault(require("classnames"));
12
14
  var _antd = require("antd");
13
15
  var _icons = require("@ant-design/icons");
14
16
  var _reactSvg = require("react-svg");
17
+ var _ahooks = require("ahooks");
15
18
  var _locale = _interopRequireWildcard(require("../../locale"));
16
19
  var _view = _interopRequireDefault(require("../../assets/view.svg"));
17
20
  function Trigger(props) {
18
- var _locale$ProTreeModal, _locale$ProTreeModal2, _locale$ProTreeModal3;
19
- var checkedValues = props.checkedValues,
20
- handleClick = props.handleClick,
21
- handleClearAll = props.handleClearAll,
22
- value = props.value,
23
- checkAll = props.checkAll,
21
+ var _locale$ProTreeModal2, _locale$ProTreeModal3;
22
+ var value = props.value,
24
23
  disabled = props.disabled,
25
24
  isView = props.isView,
26
- triggerStyle = props.triggerStyle;
27
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
28
- children: [isView ? (0, _jsxRuntime.jsxs)("div", {
25
+ triggerStyle = props.triggerStyle,
26
+ appoint = props.appoint,
27
+ allValue = props.allValue,
28
+ checkAll = props.checkAll,
29
+ checkedValues = props.checkedValues,
30
+ handleClick = props.handleClick,
31
+ handleClearAll = props.handleClearAll,
32
+ appointChange = props.appointChange;
33
+ var _useSetState = (0, _ahooks.useSetState)({
34
+ mode: 'appoint'
35
+ }),
36
+ _useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
37
+ state = _useSetState2[0],
38
+ setState = _useSetState2[1];
39
+ (0, _react.useEffect)(function () {
40
+ if (checkAll && appoint) {
41
+ setState({
42
+ mode: 'all'
43
+ });
44
+ }
45
+ }, [checkAll]);
46
+ var onIconClick = function onIconClick() {
47
+ if (appoint && state.mode === 'all') {
48
+ return;
49
+ }
50
+ handleClick();
51
+ };
52
+ if (isView) {
53
+ var _locale$ProTreeModal;
54
+ return (0, _jsxRuntime.jsxs)("div", {
29
55
  className: "pro-tree-modal-isView",
30
56
  children: [(0, _jsxRuntime.jsx)("div", {
31
57
  children: checkedValues.length === 0 ? '-' : checkAll ? _locale.default === null || _locale.default === void 0 ? void 0 : _locale.default.ProTreeModal.checkAll : (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTreeModal = _locale.default.ProTreeModal) === null || _locale$ProTreeModal === void 0 ? void 0 : _locale$ProTreeModal.checkNumber, {
@@ -36,11 +62,44 @@ function Trigger(props) {
36
62
  children: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
37
63
  className: "viewSvg",
38
64
  src: _view.default,
39
- onClick: handleClick
65
+ onClick: onIconClick
40
66
  })
41
67
  })]
42
- }) : (0, _jsxRuntime.jsx)(_antd.Input, {
43
- className: (0, _classnames.default)(disabled ? 'trigger-no-hover' : ''),
68
+ });
69
+ }
70
+ var onAppointChange = function onAppointChange(value) {
71
+ setState({
72
+ mode: value
73
+ });
74
+ if (value === 'all') {
75
+ appointChange === null || appointChange === void 0 ? void 0 : appointChange(true);
76
+ } else {
77
+ appointChange === null || appointChange === void 0 ? void 0 : appointChange(false);
78
+ }
79
+ };
80
+ var TriggerComponent = function TriggerComponent(props) {
81
+ if (appoint) {
82
+ return (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
83
+ block: true,
84
+ children: [(0, _jsxRuntime.jsxs)(_antd.Select, {
85
+ defaultValue: "appoint",
86
+ value: state.mode,
87
+ onChange: onAppointChange,
88
+ children: [(0, _jsxRuntime.jsx)(_antd.Select.Option, {
89
+ value: "all",
90
+ children: "\u5168\u90E8"
91
+ }), (0, _jsxRuntime.jsx)(_antd.Select.Option, {
92
+ value: "appoint",
93
+ children: "\u6307\u5B9A"
94
+ })]
95
+ }), props.children]
96
+ });
97
+ }
98
+ return props.children;
99
+ };
100
+ return (0, _jsxRuntime.jsx)(TriggerComponent, {
101
+ children: (0, _jsxRuntime.jsx)(_antd.Input, {
102
+ className: (0, _classnames.default)(disabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
44
103
  onClick: handleClick,
45
104
  value: checkedValues.length === 0 ? null : checkAll ? _locale.default === null || _locale.default === void 0 ? void 0 : _locale.default.ProTreeModal.checkAll : (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTreeModal2 = _locale.default.ProTreeModal) === null || _locale$ProTreeModal2 === void 0 ? void 0 : _locale$ProTreeModal2.checkNumber, {
46
105
  num: checkedValues.length
@@ -55,16 +114,13 @@ function Trigger(props) {
55
114
  }), (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
56
115
  className: "viewSvg",
57
116
  src: _view.default,
58
- onClick: handleClick
117
+ onClick: onIconClick
59
118
  })]
60
119
  }),
61
120
  placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTreeModal3 = _locale.default.ProTreeModal) === null || _locale$ProTreeModal3 === void 0 ? void 0 : _locale$ProTreeModal3.select,
62
- disabled: disabled,
121
+ disabled: disabled || appoint && value === allValue,
63
122
  style: (0, _objectSpread2.default)({}, triggerStyle)
64
- }), (0, _jsxRuntime.jsx)(_antd.Input, {
65
- type: "hidden",
66
- value: value
67
- })]
123
+ })
68
124
  });
69
125
  }
70
126
  var _default = exports.default = Trigger;
@@ -58,6 +58,7 @@ var ProTreeModal = function ProTreeModal(props) {
58
58
  max = props.max,
59
59
  draggable = props.draggable,
60
60
  span = props.span,
61
+ appoint = props.appoint,
61
62
  _props$fieldNames = props.fieldNames,
62
63
  fieldNames = _props$fieldNames === void 0 ? {
63
64
  label: 'label',
@@ -78,6 +79,7 @@ var ProTreeModal = function ProTreeModal(props) {
78
79
  var _useSetState = (0, _ahooks.useSetState)({
79
80
  open: false,
80
81
  checkedValues: [],
82
+ beforeClearAllValues: [],
81
83
  treeData: [],
82
84
  treeViewData: [],
83
85
  originalTreeData: [],
@@ -264,6 +266,7 @@ var ProTreeModal = function ProTreeModal(props) {
264
266
  }) : [];
265
267
  setState({
266
268
  checkedValues: _checkedValues,
269
+ beforeClearAllValues: state.checkedValues,
267
270
  treeViewData: [],
268
271
  checkAll: false
269
272
  });
@@ -272,9 +275,18 @@ var ProTreeModal = function ProTreeModal(props) {
272
275
  * Drawer close
273
276
  */
274
277
  var handleClose = function handleClose() {
275
- setState({
276
- open: false
277
- });
278
+ var _state$beforeClearAll;
279
+ if ((_state$beforeClearAll = state.beforeClearAllValues) === null || _state$beforeClearAll === void 0 ? void 0 : _state$beforeClearAll.length) {
280
+ setState({
281
+ open: false,
282
+ checkedValues: state.beforeClearAllValues,
283
+ beforeClearAllValues: []
284
+ });
285
+ } else {
286
+ setState({
287
+ open: false
288
+ });
289
+ }
278
290
  openChange === null || openChange === void 0 ? void 0 : openChange(false);
279
291
  };
280
292
  /**
@@ -459,6 +471,23 @@ var ProTreeModal = function ProTreeModal(props) {
459
471
  });
460
472
  }
461
473
  };
474
+ /**
475
+ * 指定模式下的操作
476
+ * @param appoint
477
+ */
478
+ var appointChange = function appointChange(appoint) {
479
+ if (appoint) {
480
+ onChange === null || onChange === void 0 ? void 0 : onChange(allValue);
481
+ setState({
482
+ checkAll: true
483
+ });
484
+ } else {
485
+ onChange === null || onChange === void 0 ? void 0 : onChange([]);
486
+ setState({
487
+ checkAll: false
488
+ });
489
+ }
490
+ };
462
491
  /**
463
492
  * Trigger the container opened by Drawer
464
493
  * default example and you can customize trigger={<Button>打开</Button>}
@@ -474,12 +503,15 @@ var ProTreeModal = function ProTreeModal(props) {
474
503
  return (0, _jsxRuntime.jsx)(_components.Trigger, {
475
504
  checkedValues: state.checkedValues,
476
505
  value: value,
477
- handleClick: handleClick,
478
- handleClearAll: handleClearAll,
479
506
  checkAll: state.checkAll,
480
507
  triggerStyle: style,
481
508
  disabled: disabled,
482
- isView: isView
509
+ isView: isView,
510
+ appoint: appoint,
511
+ allValue: allValue,
512
+ handleClick: handleClick,
513
+ handleClearAll: handleClearAll,
514
+ appointChange: appointChange
483
515
  });
484
516
  }, [state.checkedValues, state.checkAll, style, disabled, isView]);
485
517
  /**
@@ -21,6 +21,7 @@ export interface FieldNamesType {
21
21
  value: string;
22
22
  children?: string;
23
23
  }
24
+ export type TreeModalMode = 'tree' | 'list' | 'Cascader' | 'Tree' | 'List';
24
25
  export interface ProTreeModalProps {
25
26
  /** value */
26
27
  value?: AllValueType | string[];
@@ -30,8 +31,10 @@ export interface ProTreeModalProps {
30
31
  open?: boolean;
31
32
  /** 列表时候一行放几个 */
32
33
  span?: number;
33
- /** 展示类型、默认list 列表展示形式 */
34
- mode?: 'tree' | 'list' | 'Cascader' | 'Tree' | 'List';
34
+ /** 展示类型、默认list 列表展示形式、appoint 指定模式展示形式会不一样 */
35
+ mode?: TreeModalMode;
36
+ /** 是否开启指定模式 */
37
+ appoint?: boolean;
35
38
  /** 开启后、提交给后端 [{ label:xx, value: ""}] 形式 */
36
39
  labelInValue?: boolean;
37
40
  /** 查看模式、同 disabled 一样 */
@@ -1,4 +1,7 @@
1
- .pro-tree-modal-container .ant-modal-content .ant-modal-body {
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
4
+ .pro-tree-modal-container .@{ant-prefix}-modal-content .@{ant-prefix}-modal-body {
2
5
  max-height: 498px;
3
6
  }
4
7
 
@@ -13,16 +16,16 @@
13
16
  height : 482px;
14
17
  margin-bottom : calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
15
18
 
16
- .ant-tree-checkbox {
19
+ .@{ant-prefix}-tree-checkbox {
17
20
  margin-top: 2px;
18
21
  }
19
22
 
20
- .ant-tree-switcher {
23
+ .@{ant-prefix}-tree-switcher {
21
24
  width : 20px;
22
25
  line-height: 20px;
23
26
  }
24
27
 
25
- .ant-tree-treenode {
28
+ .@{ant-prefix}-tree-treenode {
26
29
  width : 100%;
27
30
  padding : 0;
28
31
  padding-bottom: var(--zaui-font-size-sm, 12px);
@@ -31,12 +34,12 @@
31
34
  line-height : 20px;
32
35
  }
33
36
 
34
- .ant-tree-node-content-wrapper {
37
+ .@{ant-prefix}-tree-node-content-wrapper {
35
38
  min-height : 20px;
36
39
  line-height: 20px;
37
40
  }
38
41
 
39
- .ant-tree-node-content-wrapper {
42
+ .@{ant-prefix}-tree-node-content-wrapper {
40
43
  width: 100%;
41
44
  }
42
45
  }
@@ -113,7 +116,7 @@
113
116
  color: #616161;
114
117
  }
115
118
 
116
- .ant-btn-link {
119
+ .@{ant-prefix}-btn-link {
117
120
  padding: 0;
118
121
  }
119
122
  }
@@ -223,7 +226,7 @@
223
226
  margin-top: 0;
224
227
  }
225
228
 
226
- .ant-tag {
229
+ .@{ant-prefix}-tag {
227
230
  display : flex;
228
231
  align-items : center;
229
232
  justify-content: space-between;
@@ -17,7 +17,7 @@ var _react = require("react");
17
17
  var _lodash = require("lodash");
18
18
  var _ProConfigProvider = require("../ProConfigProvider");
19
19
  var _Container = _interopRequireDefault(require("../ProForm/components/Container"));
20
- var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "treeDefaultExpandAll", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className"],
20
+ var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className"],
21
21
  _excluded2 = ["children"];
22
22
  var SHOW_PARENT = _antd.TreeSelect.SHOW_PARENT;
23
23
  var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
@@ -51,8 +51,9 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
51
51
  filterTreeNode = props.filterTreeNode,
52
52
  _props$treeNodeFilter = props.treeNodeFilterProp,
53
53
  treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'label' : _props$treeNodeFilter,
54
- _props$treeDefaultExp = props.treeDefaultExpandAll,
55
- treeDefaultExpandAll = _props$treeDefaultExp === void 0 ? true : _props$treeDefaultExp,
54
+ _props$defaultExpandA = props.defaultExpandAll,
55
+ defaultExpandAll = _props$defaultExpandA === void 0 ? true : _props$defaultExpandA,
56
+ expandedKeys = props.expandedKeys,
56
57
  _props$treeCheckable = props.treeCheckable,
57
58
  treeCheckable = _props$treeCheckable === void 0 ? true : _props$treeCheckable,
58
59
  _onSearch = props.onSearch,
@@ -477,7 +478,8 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
477
478
  disabled: disabled,
478
479
  showSearch: showSearch,
479
480
  // filterTreeNode: filterTreeNodeEvent,
480
- treeDefaultExpandAll: treeDefaultExpandAll,
481
+ treeDefaultExpandAll: defaultExpandAll,
482
+ treeExpandedKeys: expandedKeys,
481
483
  treeCheckable: treeCheckable,
482
484
  showCheckedStrategy: SHOW_PARENT,
483
485
  value: value,
@@ -69,6 +69,8 @@ export interface PropTreeSelectProps extends Omit<TreeSelectProps, 'onSearch'> {
69
69
  service: Service<any, any>;
70
70
  options?: Options<any, any>;
71
71
  };
72
+ defaultExpandAll?: boolean;
73
+ expandedKeys?: any[];
72
74
  }
73
75
  export interface ProSelectAction {
74
76
  /** 获取发生请求的 useRequest 的 ref */
@@ -1,13 +1,16 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-tree-select{
2
- .ant-select-selector{
5
+ .@{ant-prefix}-select-selector{
3
6
  // 单选树选择结果框里title不用待后缀
4
7
  .check-mark-icon{
5
8
  display: none;
6
9
  }
7
10
  }
8
- .ant-select.ant-select-single.ant-select-show-arrow:not(.ant-select-show-search){
9
- &.ant-select-open{
10
- .ant-select-arrow{
11
+ .@{ant-prefix}-select.@{ant-prefix}-select-single.@{ant-prefix}-select-show-arrow:not(.@{ant-prefix}-select-show-search){
12
+ &.@{ant-prefix}-select-open{
13
+ .@{ant-prefix}-select-arrow{
11
14
  transition: transform 300ms ease-in-out;
12
15
  transform: rotate(180deg);
13
16
  }
@@ -15,20 +18,20 @@
15
18
  }
16
19
  }
17
20
  .pro-tree-select-drop-down-container{
18
- &.ant-select-dropdown{
21
+ &.@{ant-prefix}-select-dropdown{
19
22
  .highlight-search-text{
20
23
  color: @zaui-brand;
21
24
  }
22
- .ant-select-tree-list-holder-inner{
25
+ .@{ant-prefix}-select-tree-list-holder-inner{
23
26
  position: relative!important;
24
27
  }
25
- &.ant-tree-select-dropdown{
28
+ &.@{ant-prefix}-tree-select-dropdown{
26
29
  width: auto!important;
27
30
  padding: 0px;
28
31
  }
29
32
  &.singal-tree,&.checkable-tree{
30
- .ant-select-tree{
31
- .ant-select-tree-treenode{
33
+ .@{ant-prefix}-select-tree{
34
+ .@{ant-prefix}-select-tree-treenode{
32
35
  padding-top: var(--zaui-space-size-xs);
33
36
  padding-bottom: var(--zaui-space-size-xs);
34
37
  }
@@ -39,8 +42,8 @@
39
42
  }
40
43
  // 单选
41
44
  &.signal-tree{
42
- .ant-select-tree{
43
- .ant-select-tree-treenode{
45
+ .@{ant-prefix}-select-tree{
46
+ .@{ant-prefix}-select-tree-treenode{
44
47
  position: relative;
45
48
  padding-right: 50px;
46
49
  padding-left: 7px;
@@ -56,19 +59,19 @@
56
59
  background-color: @zaui-brand;
57
60
  opacity: 0.1;
58
61
  }
59
- &.ant-select-tree-treenode-selected:after{
62
+ &.@{ant-prefix}-select-tree-treenode-selected:after{
60
63
  display: block;
61
64
  }
62
65
  }
63
- .ant-select-tree-node-content-wrapper{
66
+ .@{ant-prefix}-select-tree-node-content-wrapper{
64
67
  background-color: transparent;
65
- &.ant-select-tree-node-selected{
68
+ &.@{ant-prefix}-select-tree-node-selected{
66
69
  .check-mark-icon{
67
70
  display: block;
68
71
  }
69
72
  }
70
73
  }
71
- .ant-select-tree-treenode:hover{
74
+ .@{ant-prefix}-select-tree-treenode:hover{
72
75
  background-color: #f5f5f5;
73
76
  }
74
77
  .check-option-text{
@@ -84,20 +87,20 @@
84
87
  }
85
88
  // 复选
86
89
  &.checkable-tree{
87
- .ant-select-tree{
88
- .ant-select-tree-treenode{
90
+ .@{ant-prefix}-select-tree{
91
+ .@{ant-prefix}-select-tree-treenode{
89
92
  padding-left: 7px;
90
93
  }
91
- .ant-select-tree-treenode:hover{
94
+ .@{ant-prefix}-select-tree-treenode:hover{
92
95
  background-color: #f5f5f5;
93
96
  }
94
- .ant-select-tree-node-content-wrapper{
97
+ .@{ant-prefix}-select-tree-node-content-wrapper{
95
98
  padding-right: var(--zaui-space-size-md);
96
99
  }
97
- .ant-select-tree-node-content-wrapper:hover{
100
+ .@{ant-prefix}-select-tree-node-content-wrapper:hover{
98
101
  background-color: transparent;
99
102
  }
100
- .ant-select-tree-checkbox{
103
+ .@{ant-prefix}-select-tree-checkbox{
101
104
  margin-top: var(--zaui-space-size-xs);
102
105
  align-self: stretch;
103
106
  }
@@ -105,7 +108,7 @@
105
108
  }
106
109
  // 数据小于10条
107
110
  &.ten-count-tree-node{
108
- .ant-select-tree-switcher-noop{
111
+ .@{ant-prefix}-select-tree-switcher-noop{
109
112
  width: var(--zaui-space-size-xs);
110
113
  }
111
114
  }
@@ -17,7 +17,7 @@ var _DraggableUploadListItem = require("./DraggableUploadListItem");
17
17
  var _locale = _interopRequireDefault(require("../../locale"));
18
18
  var Dragger = _antd.Upload.Dragger;
19
19
  var DragRender = function DragRender(props) {
20
- var _locale$ProUpload3, _locale$ProUpload4, _locale$ProUpload5;
20
+ var _locale$ProUpload3, _locale$ProUpload4, _locale$ProUpload5, _locale$ProUpload6;
21
21
  var isView = props.isView,
22
22
  baseUploadProps = props.baseUploadProps,
23
23
  disabled = props.disabled,
@@ -138,13 +138,16 @@ var DragRender = function DragRender(props) {
138
138
  children: [(0, _jsxRuntime.jsx)("i", {
139
139
  className: "icon-upload",
140
140
  children: (0, _jsxRuntime.jsx)(_icons.CloudUploadOutlined, {})
141
- }), (0, _jsxRuntime.jsx)("p", {
141
+ }), (0, _jsxRuntime.jsxs)("p", {
142
142
  className: "dragger-txt",
143
- children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload3 = _locale.default.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.draggerTips
143
+ children: [_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload3 = _locale.default.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.draggerTips, (0, _jsxRuntime.jsxs)("span", {
144
+ className: "click-txt",
145
+ children: [_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload4 = _locale.default.ProUpload) === null || _locale$ProUpload4 === void 0 ? void 0 : _locale$ProUpload4.draggerBtnTxt, " "]
146
+ })]
144
147
  })]
145
148
  }), (0, _jsxRuntime.jsxs)("p", {
146
149
  className: "file-ext",
147
- children: [_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload4 = _locale.default.ProUpload) === null || _locale$ProUpload4 === void 0 ? void 0 : _locale$ProUpload4.draggerFileExt, "\uFF1A", extExt.length > 0 ? extExt.join('、') : "".concat(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload5 = _locale.default.ProUpload) === null || _locale$ProUpload5 === void 0 ? void 0 : _locale$ProUpload5.draggerLimitless)]
150
+ children: [_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload5 = _locale.default.ProUpload) === null || _locale$ProUpload5 === void 0 ? void 0 : _locale$ProUpload5.draggerFileExt, "\uFF1A", extExt.length > 0 ? extExt.join('、') : "".concat(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProUpload6 = _locale.default.ProUpload) === null || _locale$ProUpload6 === void 0 ? void 0 : _locale$ProUpload6.draggerLimitless)]
148
151
  })]
149
152
  }), (0, _jsxRuntime.jsx)("div", {
150
153
  className: "dragger-file-show",
@@ -27,7 +27,7 @@ var _locale = _interopRequireDefault(require("../../locale"));
27
27
  * @Author: wangshengqiang
28
28
  * @Date: 2023-07-27 20:13:07
29
29
  * @LastEditors: wangshengqiang
30
- * @LastEditTime: 2023-11-07 19:01:07
30
+ * @LastEditTime: 2023-11-15 17:57:53
31
31
  * @Description: 图片类型
32
32
  *
33
33
  */
@@ -250,8 +250,12 @@ var ImageRender = function ImageRender(props) {
250
250
  }), (0, _jsxRuntime.jsx)(_antd.Modal, {
251
251
  title: previewImg === null || previewImg === void 0 ? void 0 : previewImg.name,
252
252
  width: "600",
253
+ style: {
254
+ width: '400px'
255
+ },
253
256
  open: !!(previewImg === null || previewImg === void 0 ? void 0 : previewImg.url),
254
257
  // showType="Modal"
258
+ wrapClassName: "proupload-modal-preview",
255
259
  onCancel: handlePreviewCancel,
256
260
  footer: false,
257
261
  children: (0, _jsxRuntime.jsx)("img", {
@@ -15,6 +15,7 @@ var _antd = require("antd");
15
15
  var _lodash = require("lodash");
16
16
  var _core = require("@dnd-kit/core");
17
17
  var _sortable = require("@dnd-kit/sortable");
18
+ var _ProConfigProvider = require("../ProConfigProvider");
18
19
  var _DragRender = _interopRequireDefault(require("./components/DragRender"));
19
20
  var _ButtonRender = _interopRequireDefault(require("./components/ButtonRender"));
20
21
  var _ImageRender = _interopRequireDefault(require("./components/ImageRender"));
@@ -24,7 +25,7 @@ var _excluded = ["value", "size", "action", "maxCount", "headerRender", "footerR
24
25
  /*
25
26
  * @Author: wangshengqiang
26
27
  * @Date: 2023-02-03 14:18:59
27
- * @LastEditTime: 2023-11-07 18:49:49
28
+ * @LastEditTime: 2023-11-14 18:32:13
28
29
  * @LastEditors: wangshengqiang
29
30
  * @Description: 上传控件
30
31
  */
@@ -79,6 +80,9 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
79
80
  distance: 10
80
81
  }
81
82
  });
83
+ var _ref = (0, _ProConfigProvider.useProConfig)('ProUpload') || {},
84
+ headers = _ref.headers;
85
+ residueProps.headers = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), residueProps.headers);
82
86
  var extExt = accept ? accept.split(',').map(function (i) {
83
87
  return i.toLocaleUpperCase();
84
88
  }) : [];
@@ -146,9 +150,9 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
146
150
  * @description: 文件列表变化
147
151
  * @return {*}
148
152
  */
149
- var handleFileChange = function handleFileChange(_ref) {
150
- var file = _ref.file,
151
- fileList = _ref.fileList;
153
+ var handleFileChange = function handleFileChange(_ref2) {
154
+ var file = _ref2.file,
155
+ fileList = _ref2.fileList;
152
156
  if (!file.status && action && !ref) {
153
157
  var nFileList = fileList.filter(function (f) {
154
158
  return f.uid !== file.uid;
@@ -217,9 +221,9 @@ var ProUpload = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
217
221
  }
218
222
  return footerRender;
219
223
  };
220
- var onDragEnd = function onDragEnd(_ref2) {
221
- var active = _ref2.active,
222
- over = _ref2.over;
224
+ var onDragEnd = function onDragEnd(_ref3) {
225
+ var active = _ref3.active,
226
+ over = _ref3.over;
223
227
  if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
224
228
  setFileList(function (prev) {
225
229
  var activeIndex = prev.findIndex(function (i) {
@@ -1,3 +1,6 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-upload {
2
5
  // display: inline-flex;
3
6
 
@@ -8,7 +11,7 @@
8
11
  border-radius: var(--zaui-border-radius, 4px);
9
12
  padding : var(--zaui-space-size-sm, 8px);
10
13
 
11
- .ant-upload.ant-upload-drag {
14
+ .@{ant-prefix}-upload.@{ant-prefix}-upload-drag {
12
15
  background-color: var(--zaui-base-bg, #fff);
13
16
  }
14
17
 
@@ -158,8 +161,8 @@
158
161
  position: relative;
159
162
  display : inline-flex;
160
163
 
161
- .ant-upload-list-picture-card-container,
162
- .ant-upload-select-picture-card {
164
+ .@{ant-prefix}-upload-list-picture-card-container,
165
+ .@{ant-prefix}-upload-select-picture-card {
163
166
  width : 126px;
164
167
  height: 126px;
165
168
  }
@@ -271,7 +274,7 @@
271
274
  }
272
275
 
273
276
  .pro-upload-image {
274
- .ant-space-item {
277
+ .@{ant-prefix}-space-item {
275
278
  display: inline-flex;
276
279
  }
277
280
 
@@ -319,3 +322,9 @@
319
322
  align-items : center;
320
323
  justify-content: center;
321
324
  }
325
+
326
+ .proupload-modal-preview {
327
+ .ant-modal {
328
+ width: 600px;
329
+ }
330
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
@@ -14,8 +14,9 @@ var _jsxRuntime = require("react/jsx-runtime");
14
14
  var _ahooks = require("ahooks");
15
15
  var _antd = require("antd");
16
16
  var _react = _interopRequireWildcard(require("react"));
17
+ var _locale = _interopRequireDefault(require("../locale"));
18
+ var _locale$ProViewer;
17
19
  /* eslint-disable jsx-a11y/iframe-has-title */
18
-
19
20
  // 用于解析word | excel
20
21
  var officeApp = 'https://view.officeapps.live.com/op/view.aspx?src=';
21
22
  // 文件MIME类型
@@ -203,7 +204,7 @@ ProViewer.defaultProps = {
203
204
  width: '1200px',
204
205
  height: '650px',
205
206
  centered: true,
206
- title: '预览',
207
+ title: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProViewer = _locale.default.ProViewer) === null || _locale$ProViewer === void 0 ? void 0 : _locale$ProViewer.preview,
207
208
  footer: null,
208
209
  bodyStyle: {
209
210
  padding: 0
@@ -1,7 +1,10 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-viewer {
2
- .ant-image {
3
- .ant-image-img,
4
- .ant-image-mask-info {
5
+ .@{ant-prefix}-image {
6
+ .@{ant-prefix}-image-img,
7
+ .@{ant-prefix}-image-mask-info {
5
8
  display: none;
6
9
  }
7
10
  }
@@ -101,6 +101,7 @@ declare const _default: {
101
101
  ProModalSelect: {
102
102
  checkMsg: string;
103
103
  select: string;
104
+ total: string;
104
105
  };
105
106
  ProSelect: {
106
107
  checkMsg: string;
@@ -148,5 +149,8 @@ declare const _default: {
148
149
  tableStripe: string;
149
150
  reset: string;
150
151
  };
152
+ ProViewer: {
153
+ preview: string;
154
+ };
151
155
  };
152
156
  export default _default;