@zat-design/sisyphus-react 3.2.2-beta.7 → 3.2.2-beta.9

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 (126) hide show
  1. package/dist/index.esm.css +41 -5
  2. package/es/ProAction/index.less +3 -0
  3. package/es/ProDownload/style/index.less +5 -2
  4. package/es/ProDrawerForm/style/index.less +17 -14
  5. package/es/ProEditLabel/style/index.less +12 -9
  6. package/es/ProEditTable/index.js +8 -4
  7. package/es/ProEditTable/style/index.less +50 -42
  8. package/es/ProEditTable/utils/config.d.ts +1 -1
  9. package/es/ProEditTable/utils/config.js +3 -3
  10. package/es/ProEnum/style/index.less +3 -0
  11. package/es/ProForm/components/base/TextArea/index.less +1 -1
  12. package/es/ProForm/components/base/TimePicker/style/index.less +1 -1
  13. package/es/ProForm/components/combination/Container/style/index.less +3 -3
  14. package/es/ProForm/components/combination/FormList/style/index.less +3 -3
  15. package/es/ProForm/components/combination/Group/style/index.less +15 -15
  16. package/es/ProForm/components/combination/ProAddressBar/style/index.less +3 -3
  17. package/es/ProForm/components/combination/ProCombination/style/index.less +2 -2
  18. package/es/ProForm/components/combination/ProModalSelect/style/index.less +29 -11
  19. package/es/ProForm/components/combination/ProNumberRange/style/index.less +10 -10
  20. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +6 -6
  21. package/es/ProForm/style/index.less +46 -44
  22. package/es/ProIcon/style/index.less +4 -1
  23. package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
  24. package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +7 -7
  25. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +28 -28
  26. package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +11 -11
  27. package/es/ProLayout/components/ProCollapse/style/index.less +24 -24
  28. package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +1 -1
  29. package/es/ProLayout/components/ProHeader/style/index.less +10 -11
  30. package/es/ProLayout/style/index.less +10 -7
  31. package/es/ProSelect/index.less +3 -0
  32. package/es/ProStep/style/index.less +3 -0
  33. package/es/ProTable/index.js +3 -3
  34. package/es/ProTable/style/index.less +68 -54
  35. package/es/ProTabs/style/index.less +14 -11
  36. package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  37. package/es/ProThemeTools/component/PrdTools/index.js +7 -6
  38. package/es/ProThemeTools/component/PrdTools/style/index.less +6 -6
  39. package/es/ProThemeTools/index.d.ts +1 -1
  40. package/es/ProThemeTools/index.js +7 -2
  41. package/es/ProThemeTools/propsType.d.ts +4 -0
  42. package/es/ProThemeTools/style/index.less +6 -3
  43. package/es/ProThemeTools/utils/index.d.ts +1 -1
  44. package/es/ProThemeTools/utils/index.js +2 -1
  45. package/es/ProTooltip/style/index.less +3 -0
  46. package/es/ProTree/components/CloseIcon.js +2 -4
  47. package/es/ProTree/style/index.less +29 -26
  48. package/es/ProTreeModal/components/CloseIcon.js +2 -4
  49. package/es/ProTreeModal/components/Trigger.d.ts +3 -0
  50. package/es/ProTreeModal/components/Trigger.js +79 -19
  51. package/es/ProTreeModal/index.js +24 -3
  52. package/es/ProTreeModal/propsType.d.ts +5 -2
  53. package/es/ProTreeModal/style/index.less +11 -8
  54. package/es/ProTreeSelect/style/index.less +25 -22
  55. package/es/ProUpload/style/index.less +7 -4
  56. package/es/ProViewer/index.js +3 -1
  57. package/es/ProViewer/style/index.less +6 -3
  58. package/es/locale/en_US.d.ts +3 -0
  59. package/es/locale/en_US.js +3 -0
  60. package/es/locale/zh_CN.d.ts +3 -0
  61. package/es/locale/zh_CN.js +3 -0
  62. package/es/style/core/compatible.less +6 -6
  63. package/es/style/theme/antd.less +170 -158
  64. package/lib/ProAction/index.less +3 -0
  65. package/lib/ProDownload/style/index.less +5 -2
  66. package/lib/ProDrawerForm/style/index.less +17 -14
  67. package/lib/ProEditLabel/style/index.less +12 -9
  68. package/lib/ProEditTable/index.js +6 -2
  69. package/lib/ProEditTable/style/index.less +50 -42
  70. package/lib/ProEditTable/utils/config.d.ts +1 -1
  71. package/lib/ProEditTable/utils/config.js +3 -3
  72. package/lib/ProEnum/style/index.less +3 -0
  73. package/lib/ProForm/components/base/TextArea/index.less +1 -1
  74. package/lib/ProForm/components/base/TimePicker/style/index.less +1 -1
  75. package/lib/ProForm/components/combination/Container/style/index.less +3 -3
  76. package/lib/ProForm/components/combination/FormList/style/index.less +3 -3
  77. package/lib/ProForm/components/combination/Group/style/index.less +15 -15
  78. package/lib/ProForm/components/combination/ProAddressBar/style/index.less +3 -3
  79. package/lib/ProForm/components/combination/ProCombination/style/index.less +2 -2
  80. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +29 -11
  81. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +10 -10
  82. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +6 -6
  83. package/lib/ProForm/style/index.less +46 -44
  84. package/lib/ProIcon/style/index.less +4 -1
  85. package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
  86. package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +7 -7
  87. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +28 -28
  88. package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +11 -11
  89. package/lib/ProLayout/components/ProCollapse/style/index.less +24 -24
  90. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +1 -1
  91. package/lib/ProLayout/components/ProHeader/style/index.less +10 -11
  92. package/lib/ProLayout/style/index.less +10 -7
  93. package/lib/ProSelect/index.less +3 -0
  94. package/lib/ProStep/style/index.less +3 -0
  95. package/lib/ProTable/index.js +3 -3
  96. package/lib/ProTable/style/index.less +68 -54
  97. package/lib/ProTabs/style/index.less +14 -11
  98. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  99. package/lib/ProThemeTools/component/PrdTools/index.js +7 -6
  100. package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
  101. package/lib/ProThemeTools/index.d.ts +1 -1
  102. package/lib/ProThemeTools/index.js +7 -2
  103. package/lib/ProThemeTools/propsType.d.ts +4 -0
  104. package/lib/ProThemeTools/style/index.less +6 -3
  105. package/lib/ProThemeTools/utils/index.d.ts +1 -1
  106. package/lib/ProThemeTools/utils/index.js +2 -1
  107. package/lib/ProTooltip/style/index.less +3 -0
  108. package/lib/ProTree/components/CloseIcon.js +2 -4
  109. package/lib/ProTree/style/index.less +29 -26
  110. package/lib/ProTreeModal/components/CloseIcon.js +2 -4
  111. package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
  112. package/lib/ProTreeModal/components/Trigger.js +74 -18
  113. package/lib/ProTreeModal/index.js +24 -3
  114. package/lib/ProTreeModal/propsType.d.ts +5 -2
  115. package/lib/ProTreeModal/style/index.less +11 -8
  116. package/lib/ProTreeSelect/style/index.less +25 -22
  117. package/lib/ProUpload/style/index.less +7 -4
  118. package/lib/ProViewer/index.js +4 -3
  119. package/lib/ProViewer/style/index.less +6 -3
  120. package/lib/locale/en_US.d.ts +3 -0
  121. package/lib/locale/en_US.js +3 -0
  122. package/lib/locale/zh_CN.d.ts +3 -0
  123. package/lib/locale/zh_CN.js +3 -0
  124. package/lib/style/core/compatible.less +6 -6
  125. package/lib/style/theme/antd.less +170 -158
  126. package/package.json +1 -1
@@ -1,10 +1,13 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-tree {
2
5
  height: 100%; // tree auto css
3
6
 
4
- .ant-spin-nested-loading {
7
+ .@{ant-prefix}-spin-nested-loading {
5
8
  height: 100%; // tree auto css
6
9
 
7
- .ant-spin-container {
10
+ .@{ant-prefix}-spin-container {
8
11
  height: 100%; // tree auto css
9
12
  }
10
13
  }
@@ -68,19 +71,19 @@
68
71
  }
69
72
  }
70
73
 
71
- .ant-tree-checkbox {
74
+ .@{ant-prefix}-tree-checkbox {
72
75
  margin-top: 11px;
73
76
  }
74
77
 
75
- .ant-tree-switcher {
78
+ .@{ant-prefix}-tree-switcher {
76
79
  line-height: 44px;
77
80
  }
78
81
 
79
- .ant-tree-switcher-leaf-line {
82
+ .@{ant-prefix}-tree-switcher-leaf-line {
80
83
  display: none;
81
84
  }
82
85
 
83
- .ant-tree-treenode {
86
+ .@{ant-prefix}-tree-treenode {
84
87
  align-items: flex-start;
85
88
  width : 100%;
86
89
  padding : 0;
@@ -88,15 +91,15 @@
88
91
  font-size : var(--zaui-font-size);
89
92
  }
90
93
 
91
- .ant-tree-node-content-wrapper {
94
+ .@{ant-prefix}-tree-node-content-wrapper {
92
95
  min-height : 20px;
93
96
  line-height: 20px;
94
97
  }
95
98
 
96
- .ant-tree-node-content-wrapper {
99
+ .@{ant-prefix}-tree-node-content-wrapper {
97
100
  width: 100%;
98
101
 
99
- .ant-tree-title {
102
+ .@{ant-prefix}-tree-title {
100
103
  display: block;
101
104
  width : 100%;
102
105
  }
@@ -104,13 +107,13 @@
104
107
 
105
108
  // 只读状态下,是否隐藏未勾选行
106
109
  .hide-disable-node {
107
- .ant-tree-treenode.ant-tree-treenode-disabled {
110
+ .@{ant-prefix}-tree-treenode.@{ant-prefix}-tree-treenode-disabled {
108
111
  display: none;
109
112
  }
110
113
 
111
- .ant-tree-treenode-checkbox-indeterminate,
112
- .ant-tree-treenode-checkbox-checked {
113
- &.ant-tree-treenode-disabled {
114
+ .@{ant-prefix}-tree-treenode-checkbox-indeterminate,
115
+ .@{ant-prefix}-tree-treenode-checkbox-checked {
116
+ &.@{ant-prefix}-tree-treenode-disabled {
114
117
  display: flex;
115
118
  }
116
119
  }
@@ -221,17 +224,17 @@
221
224
  }
222
225
 
223
226
  // 连接线、箭头宽度
224
- .ant-tree-show-line .ant-tree-indent-unit {
227
+ .@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-indent-unit {
225
228
  width: 20px;
226
229
  }
227
230
 
228
- .ant-tree-switcher {
231
+ .@{ant-prefix}-tree-switcher {
229
232
  width : 20px;
230
233
  align-self: flex-start;
231
234
  margin-top: -4px;
232
235
  }
233
236
 
234
- .ant-tree-show-line .ant-tree-indent-unit::before {
237
+ .@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-indent-unit::before {
235
238
  right: 9px;
236
239
  }
237
240
 
@@ -244,8 +247,8 @@
244
247
  }
245
248
 
246
249
  // 去除antd白色背景
247
- .ant-tree-show-line .ant-tree-switcher,
248
- .ant-tree {
250
+ .@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-switcher,
251
+ .@{ant-prefix}-tree {
249
252
  background-color: transparent;
250
253
  }
251
254
 
@@ -264,12 +267,12 @@
264
267
  padding-top: 0px;
265
268
  min-width : 120px;
266
269
 
267
- .ant-popover-inner-content {
270
+ .@{ant-prefix}-popover-inner-content {
268
271
  padding: 0px;
269
272
  width : 100%;
270
273
  }
271
274
 
272
- .ant-popover-arrow {
275
+ .@{ant-prefix}-popover-arrow {
273
276
  display: none;
274
277
  }
275
278
 
@@ -301,8 +304,8 @@
301
304
  }
302
305
  }
303
306
 
304
- .ant-tree .ant-tree-treenode-disabled {
305
- .ant-tree-node-content-wrapper {
307
+ .@{ant-prefix}-tree .@{ant-prefix}-tree-treenode-disabled {
308
+ .@{ant-prefix}-tree-node-content-wrapper {
306
309
  color: var(--zaui-text);
307
310
  }
308
311
 
@@ -316,20 +319,20 @@
316
319
  }
317
320
 
318
321
  // 重置ant-form view模式样式ant-tree样式
319
- .pro-form.pro-form-view .ant-form-item .pro-tree * {
322
+ .pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree * {
320
323
  line-height: 1 !important;
321
324
  height : auto !important;
322
325
  min-height : auto !important;
323
326
  }
324
327
 
325
- .pro-form.pro-form-view .ant-form-item .pro-tree .ant-tree-checkbox {
328
+ .pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-checkbox {
326
329
  margin-top: var(--zaui-space-size-sm);
327
330
  }
328
331
 
329
- .pro-form.pro-form-view .ant-form-item .pro-tree .ant-tree-switcher {
332
+ .pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-switcher {
330
333
  padding-top: var(--zaui-font-size-sm);
331
334
  }
332
335
 
333
- .pro-form.pro-form-view .ant-form-item .pro-tree .ant-tree-checkbox * {
336
+ .pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-checkbox * {
334
337
  height: 16px !important;
335
338
  }
@@ -1,11 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  function CloseIcon(props) {
4
- return _jsx("span", _objectSpread(_objectSpread({
5
- className: "ant-input-suffix"
6
- }, props), {}, {
4
+ return _jsx("span", _objectSpread(_objectSpread({}, props), {}, {
7
5
  children: _jsx("span", {
8
- className: "ant-input-clear-icon pro-tree-modal-checkbox-close",
6
+ className: "pro-tree-modal-checkbox-close",
9
7
  role: "button",
10
8
  children: _jsx("span", {
11
9
  role: "img",
@@ -5,9 +5,12 @@ interface TriggerProps {
5
5
  disabled?: boolean;
6
6
  isView?: boolean;
7
7
  checkAll?: boolean;
8
+ appoint: boolean;
9
+ allValue?: string | number;
8
10
  triggerStyle?: CSSProperties;
9
11
  handleClick: () => void;
10
12
  handleClearAll: () => void;
13
+ appointChange: (appoint?: boolean) => void;
11
14
  }
12
15
  declare function Trigger(props: TriggerProps): JSX.Element;
13
16
  export default Trigger;
@@ -1,24 +1,54 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import "antd/es/input/style";
3
3
  import _Input from "antd/es/input";
4
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
+ import "antd/es/select/style";
5
+ import _Select from "antd/es/select";
6
+ import "antd/es/space/style";
7
+ import _Space from "antd/es/space";
8
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ import { useEffect } from 'react';
5
11
  import classNames from 'classnames';
6
12
  import { CloseOutlined } from '@ant-design/icons';
7
13
  import { ReactSVG } from 'react-svg';
14
+ import { useSetState } from 'ahooks';
8
15
  import locale, { formatMessage } from '../../locale';
9
16
  import viewSvg from '../../assets/view.svg';
10
17
  function Trigger(props) {
11
- var _locale$ProTreeModal, _locale$ProTreeModal2, _locale$ProTreeModal3;
12
- var checkedValues = props.checkedValues,
13
- handleClick = props.handleClick,
14
- handleClearAll = props.handleClearAll,
15
- value = props.value,
16
- checkAll = props.checkAll,
18
+ var _locale$ProTreeModal2, _locale$ProTreeModal3;
19
+ var value = props.value,
17
20
  disabled = props.disabled,
18
21
  isView = props.isView,
19
- triggerStyle = props.triggerStyle;
20
- return _jsxs(_Fragment, {
21
- children: [isView ? _jsxs("div", {
22
+ triggerStyle = props.triggerStyle,
23
+ appoint = props.appoint,
24
+ allValue = props.allValue,
25
+ checkAll = props.checkAll,
26
+ checkedValues = props.checkedValues,
27
+ handleClick = props.handleClick,
28
+ handleClearAll = props.handleClearAll,
29
+ appointChange = props.appointChange;
30
+ var _useSetState = useSetState({
31
+ mode: 'appoint'
32
+ }),
33
+ _useSetState2 = _slicedToArray(_useSetState, 2),
34
+ state = _useSetState2[0],
35
+ setState = _useSetState2[1];
36
+ useEffect(function () {
37
+ if (checkAll && appoint) {
38
+ setState({
39
+ mode: 'all'
40
+ });
41
+ }
42
+ }, [checkAll]);
43
+ var onIconClick = function onIconClick() {
44
+ if (appoint && state.mode === 'all') {
45
+ return;
46
+ }
47
+ handleClick();
48
+ };
49
+ if (isView) {
50
+ var _locale$ProTreeModal;
51
+ return _jsxs("div", {
22
52
  className: "pro-tree-modal-isView",
23
53
  children: [_jsx("div", {
24
54
  children: checkedValues.length === 0 ? '-' : checkAll ? locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.checkAll : formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTreeModal = locale.ProTreeModal) === null || _locale$ProTreeModal === void 0 ? void 0 : _locale$ProTreeModal.checkNumber, {
@@ -29,11 +59,44 @@ function Trigger(props) {
29
59
  children: _jsx(ReactSVG, {
30
60
  className: "viewSvg",
31
61
  src: viewSvg,
32
- onClick: handleClick
62
+ onClick: onIconClick
33
63
  })
34
64
  })]
35
- }) : _jsx(_Input, {
36
- className: classNames(disabled ? 'trigger-no-hover' : ''),
65
+ });
66
+ }
67
+ var onAppointChange = function onAppointChange(value) {
68
+ setState({
69
+ mode: value
70
+ });
71
+ if (value === 'all') {
72
+ appointChange === null || appointChange === void 0 ? void 0 : appointChange(true);
73
+ } else {
74
+ appointChange === null || appointChange === void 0 ? void 0 : appointChange(false);
75
+ }
76
+ };
77
+ var TriggerComponent = function TriggerComponent(props) {
78
+ if (appoint) {
79
+ return _jsxs(_Space.Compact, {
80
+ block: true,
81
+ children: [_jsxs(_Select, {
82
+ defaultValue: "appoint",
83
+ value: state.mode,
84
+ onChange: onAppointChange,
85
+ children: [_jsx(_Select.Option, {
86
+ value: "all",
87
+ children: "\u5168\u90E8"
88
+ }), _jsx(_Select.Option, {
89
+ value: "appoint",
90
+ children: "\u6307\u5B9A"
91
+ })]
92
+ }), props.children]
93
+ });
94
+ }
95
+ return props.children;
96
+ };
97
+ return _jsx(TriggerComponent, {
98
+ children: _jsx(_Input, {
99
+ className: classNames(disabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
37
100
  onClick: handleClick,
38
101
  value: checkedValues.length === 0 ? null : checkAll ? locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.checkAll : formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTreeModal2 = locale.ProTreeModal) === null || _locale$ProTreeModal2 === void 0 ? void 0 : _locale$ProTreeModal2.checkNumber, {
39
102
  num: checkedValues.length
@@ -48,16 +111,13 @@ function Trigger(props) {
48
111
  }), _jsx(ReactSVG, {
49
112
  className: "viewSvg",
50
113
  src: viewSvg,
51
- onClick: handleClick
114
+ onClick: onIconClick
52
115
  })]
53
116
  }),
54
117
  placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProTreeModal3 = locale.ProTreeModal) === null || _locale$ProTreeModal3 === void 0 ? void 0 : _locale$ProTreeModal3.select,
55
- disabled: disabled,
118
+ disabled: disabled || appoint && value === allValue,
56
119
  style: _objectSpread({}, triggerStyle)
57
- }), _jsx(_Input, {
58
- type: "hidden",
59
- value: value
60
- })]
120
+ })
61
121
  });
62
122
  }
63
123
  export default Trigger;
@@ -57,6 +57,7 @@ var ProTreeModal = function ProTreeModal(props) {
57
57
  max = props.max,
58
58
  draggable = props.draggable,
59
59
  span = props.span,
60
+ appoint = props.appoint,
60
61
  _props$fieldNames = props.fieldNames,
61
62
  fieldNames = _props$fieldNames === void 0 ? {
62
63
  label: 'label',
@@ -469,6 +470,23 @@ var ProTreeModal = function ProTreeModal(props) {
469
470
  });
470
471
  }
471
472
  };
473
+ /**
474
+ * 指定模式下的操作
475
+ * @param appoint
476
+ */
477
+ var appointChange = function appointChange(appoint) {
478
+ if (appoint) {
479
+ onChange === null || onChange === void 0 ? void 0 : onChange(allValue);
480
+ setState({
481
+ checkAll: true
482
+ });
483
+ } else {
484
+ onChange === null || onChange === void 0 ? void 0 : onChange([]);
485
+ setState({
486
+ checkAll: false
487
+ });
488
+ }
489
+ };
472
490
  /**
473
491
  * Trigger the container opened by Drawer
474
492
  * default example and you can customize trigger={<Button>打开</Button>}
@@ -484,12 +502,15 @@ var ProTreeModal = function ProTreeModal(props) {
484
502
  return _jsx(Trigger, {
485
503
  checkedValues: state.checkedValues,
486
504
  value: value,
487
- handleClick: handleClick,
488
- handleClearAll: handleClearAll,
489
505
  checkAll: state.checkAll,
490
506
  triggerStyle: style,
491
507
  disabled: disabled,
492
- isView: isView
508
+ isView: isView,
509
+ appoint: appoint,
510
+ allValue: allValue,
511
+ handleClick: handleClick,
512
+ handleClearAll: handleClearAll,
513
+ appointChange: appointChange
493
514
  });
494
515
  }, [state.checkedValues, state.checkAll, style, disabled, isView]);
495
516
  /**
@@ -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;
@@ -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
  }
@@ -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
 
@@ -8,10 +8,12 @@ import _Button from "antd/es/button";
8
8
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
9
9
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
10
10
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
11
+ var _locale$ProViewer;
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  /* eslint-disable jsx-a11y/iframe-has-title */
13
14
  import { useSetState } from 'ahooks';
14
15
  import React, { useEffect, useRef } from 'react';
16
+ import locale from '../locale';
15
17
  // 用于解析word | excel
16
18
  var officeApp = 'https://view.officeapps.live.com/op/view.aspx?src=';
17
19
  // 文件MIME类型
@@ -199,7 +201,7 @@ ProViewer.defaultProps = {
199
201
  width: '1200px',
200
202
  height: '650px',
201
203
  centered: true,
202
- title: '预览',
204
+ title: locale === null || locale === void 0 ? void 0 : (_locale$ProViewer = locale.ProViewer) === null || _locale$ProViewer === void 0 ? void 0 : _locale$ProViewer.preview,
203
205
  footer: null,
204
206
  bodyStyle: {
205
207
  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
  }
@@ -148,5 +148,8 @@ declare const _default: {
148
148
  tableStripe: string;
149
149
  reset: string;
150
150
  };
151
+ ProViewer: {
152
+ preview: string;
153
+ };
151
154
  };
152
155
  export default _default;
@@ -147,5 +147,8 @@ export default {
147
147
  tableBorder: 'Table border',
148
148
  tableStripe: 'Table zebra',
149
149
  reset: 'Reset'
150
+ },
151
+ ProViewer: {
152
+ preview: 'preview'
150
153
  }
151
154
  };
@@ -147,5 +147,8 @@ declare const _default: {
147
147
  tableStripe: string;
148
148
  reset: string;
149
149
  };
150
+ ProViewer: {
151
+ preview: string;
152
+ };
150
153
  };
151
154
  export default _default;
@@ -146,5 +146,8 @@ export default {
146
146
  tableBorder: '表格边框',
147
147
  tableStripe: '表格斑马纹',
148
148
  reset: '重置'
149
+ },
150
+ ProViewer: {
151
+ preview: '预览'
149
152
  }
150
153
  };