@zat-design/sisyphus-react 3.2.2-beta.8 → 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 (116) hide show
  1. package/dist/index.esm.css +38 -2
  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 +9 -9
  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/style/index.less +6 -3
  57. package/es/style/core/compatible.less +6 -6
  58. package/es/style/theme/antd.less +168 -156
  59. package/lib/ProAction/index.less +3 -0
  60. package/lib/ProDownload/style/index.less +5 -2
  61. package/lib/ProDrawerForm/style/index.less +17 -14
  62. package/lib/ProEditLabel/style/index.less +12 -9
  63. package/lib/ProEditTable/index.js +6 -2
  64. package/lib/ProEditTable/style/index.less +50 -42
  65. package/lib/ProEditTable/utils/config.d.ts +1 -1
  66. package/lib/ProEditTable/utils/config.js +3 -3
  67. package/lib/ProEnum/style/index.less +3 -0
  68. package/lib/ProForm/components/base/TextArea/index.less +1 -1
  69. package/lib/ProForm/components/base/TimePicker/style/index.less +1 -1
  70. package/lib/ProForm/components/combination/Container/style/index.less +3 -3
  71. package/lib/ProForm/components/combination/FormList/style/index.less +3 -3
  72. package/lib/ProForm/components/combination/Group/style/index.less +15 -15
  73. package/lib/ProForm/components/combination/ProAddressBar/style/index.less +3 -3
  74. package/lib/ProForm/components/combination/ProCombination/style/index.less +2 -2
  75. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +29 -11
  76. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +10 -10
  77. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +6 -6
  78. package/lib/ProForm/style/index.less +46 -44
  79. package/lib/ProIcon/style/index.less +4 -1
  80. package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
  81. package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +7 -7
  82. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +28 -28
  83. package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +11 -11
  84. package/lib/ProLayout/components/ProCollapse/style/index.less +24 -24
  85. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +1 -1
  86. package/lib/ProLayout/components/ProHeader/style/index.less +9 -9
  87. package/lib/ProLayout/style/index.less +10 -7
  88. package/lib/ProSelect/index.less +3 -0
  89. package/lib/ProStep/style/index.less +3 -0
  90. package/lib/ProTable/index.js +3 -3
  91. package/lib/ProTable/style/index.less +68 -54
  92. package/lib/ProTabs/style/index.less +14 -11
  93. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  94. package/lib/ProThemeTools/component/PrdTools/index.js +7 -6
  95. package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
  96. package/lib/ProThemeTools/index.d.ts +1 -1
  97. package/lib/ProThemeTools/index.js +7 -2
  98. package/lib/ProThemeTools/propsType.d.ts +4 -0
  99. package/lib/ProThemeTools/style/index.less +6 -3
  100. package/lib/ProThemeTools/utils/index.d.ts +1 -1
  101. package/lib/ProThemeTools/utils/index.js +2 -1
  102. package/lib/ProTooltip/style/index.less +3 -0
  103. package/lib/ProTree/components/CloseIcon.js +2 -4
  104. package/lib/ProTree/style/index.less +29 -26
  105. package/lib/ProTreeModal/components/CloseIcon.js +2 -4
  106. package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
  107. package/lib/ProTreeModal/components/Trigger.js +74 -18
  108. package/lib/ProTreeModal/index.js +24 -3
  109. package/lib/ProTreeModal/propsType.d.ts +5 -2
  110. package/lib/ProTreeModal/style/index.less +11 -8
  111. package/lib/ProTreeSelect/style/index.less +25 -22
  112. package/lib/ProUpload/style/index.less +7 -4
  113. package/lib/ProViewer/style/index.less +6 -3
  114. package/lib/style/core/compatible.less +6 -6
  115. package/lib/style/theme/antd.less +168 -156
  116. package/package.json +1 -1
@@ -1,17 +1,20 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-tabs {
2
- .ant-tabs .ant-tabs-nav-list .ant-tabs-tab {
5
+ .@{ant-prefix}-tabs .@{ant-prefix}-tabs-nav-list .@{ant-prefix}-tabs-tab {
3
6
  padding: 0 !important;
4
7
  }
5
8
 
6
- .ant-tabs-top > .ant-tabs-nav::before,
7
- .ant-tabs-bottom > .ant-tabs-nav::before,
8
- .ant-tabs-top > div > .ant-tabs-nav::before,
9
- .ant-tabs-bottom > div > .ant-tabs-nav::before {
9
+ .@{ant-prefix}-tabs-top > .@{ant-prefix}-tabs-nav::before,
10
+ .@{ant-prefix}-tabs-bottom > .@{ant-prefix}-tabs-nav::before,
11
+ .@{ant-prefix}-tabs-top > div > .@{ant-prefix}-tabs-nav::before,
12
+ .@{ant-prefix}-tabs-bottom > div > .@{ant-prefix}-tabs-nav::before {
10
13
  border: none;
11
14
  }
12
15
 
13
- .ant-tabs-nav-list {
14
- .ant-tabs-tab {
16
+ .@{ant-prefix}-tabs-nav-list {
17
+ .@{ant-prefix}-tabs-tab {
15
18
  &:first-child {
16
19
  .pro-tabs-card {
17
20
  border-left: 1px solid var(--zaui-line, #dddddd);
@@ -20,13 +23,13 @@
20
23
  }
21
24
  }
22
25
 
23
- .ant-tabs-tab-active {
26
+ .@{ant-prefix}-tabs-tab-active {
24
27
  .pro-tabs-card {
25
28
  background: var(--ant-primary-color-active-deprecated-f-30, rgba(230, 247, 255, 0.3));
26
29
  }
27
30
  }
28
31
 
29
- .ant-tabs-ink-bar {
32
+ .@{ant-prefix}-tabs-ink-bar {
30
33
  top: 0;
31
34
  height: 3px !important;
32
35
  }
@@ -66,13 +69,13 @@
66
69
 
67
70
  .pro-tabs-tab {
68
71
  .pro-tabs-card {
69
- .ant-tag {
72
+ .@{ant-prefix}-tag {
70
73
  margin-right: 0;
71
74
  padding: 0 var(--zaui-space-size-xs, 4px);
72
75
  border-radius: 10px;
73
76
  }
74
77
 
75
- .ant-space-item {
78
+ .@{ant-prefix}-space-item {
76
79
  display: flex;
77
80
  }
78
81
  }
@@ -1,3 +1,3 @@
1
1
  import type { DevToolsPropsType } from '../../propsType';
2
- declare const PrdTools: ({ onReset, onClose, setState, visible, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
2
+ declare const PrdTools: ({ onReset, onClose, setState, visible, state, tableBorder, tableStripe, prefixCls, }: DevToolsPropsType) => JSX.Element;
3
3
  export default PrdTools;
@@ -27,7 +27,8 @@ var PrdTools = function PrdTools(_ref) {
27
27
  visible = _ref.visible,
28
28
  state = _ref.state,
29
29
  tableBorder = _ref.tableBorder,
30
- tableStripe = _ref.tableStripe;
30
+ tableStripe = _ref.tableStripe,
31
+ prefixCls = _ref.prefixCls;
31
32
  var _useState = (0, _react.useState)([{
32
33
  color: '#006AFF',
33
34
  active: true
@@ -150,18 +151,18 @@ var PrdTools = function PrdTools(_ref) {
150
151
  var after = e.target.value === 'left' ? 'inline' : 'none';
151
152
  var before = e.target.value === 'right' ? 'inline' : 'none';
152
153
  // 遍历添加className
153
- var formItemLabels = document.querySelectorAll('.ant-form-item-label');
154
+ var formItemLabels = document.querySelectorAll(".".concat(prefixCls, "-form-item-label"));
154
155
  // 遍历元素列表,为每个元素添加新的 class
155
156
  formItemLabels.forEach(function (label) {
156
157
  var _label$classList, _label$classList$valu, _label$classList2, _label$classList2$val;
157
158
  if (!label) {
158
159
  return false;
159
160
  }
160
- if (e.target.value === 'left' && !((_label$classList = label.classList) === null || _label$classList === void 0 ? void 0 : (_label$classList$valu = _label$classList.value) === null || _label$classList$valu === void 0 ? void 0 : _label$classList$valu.includes('ant-form-item-label-left'))) {
161
- label.classList.add('ant-form-item-label-left');
161
+ if (e.target.value === 'left' && !((_label$classList = label.classList) === null || _label$classList === void 0 ? void 0 : (_label$classList$valu = _label$classList.value) === null || _label$classList$valu === void 0 ? void 0 : _label$classList$valu.includes("".concat(prefixCls, "-form-item-label-left")))) {
162
+ label.classList.add("".concat(prefixCls, "-form-item-label-left"));
162
163
  }
163
- if (e.target.value === 'right' && ((_label$classList2 = label.classList) === null || _label$classList2 === void 0 ? void 0 : (_label$classList2$val = _label$classList2.value) === null || _label$classList2$val === void 0 ? void 0 : _label$classList2$val.includes('ant-form-item-label-left'))) {
164
- label.classList.remove('ant-form-item-label-left');
164
+ if (e.target.value === 'right' && ((_label$classList2 = label.classList) === null || _label$classList2 === void 0 ? void 0 : (_label$classList2$val = _label$classList2.value) === null || _label$classList2$val === void 0 ? void 0 : _label$classList2$val.includes("".concat(prefixCls, "-form-item-label-left")))) {
165
+ label.classList.remove("".concat(prefixCls, "-form-item-label-left"));
165
166
  }
166
167
  });
167
168
  setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
@@ -1,17 +1,17 @@
1
1
  .pro-theme-prd-tools-drawer {
2
- .ant-drawer-header {
2
+ .@{ant-prefix}-drawer-header {
3
3
  border-bottom: none;
4
4
  }
5
5
 
6
- .ant-drawer-title {
6
+ .@{ant-prefix}-drawer-title {
7
7
  font-size: var(--zaui-font-size-xl, 18px);
8
8
  }
9
9
 
10
- .ant-drawer-body {
10
+ .@{ant-prefix}-drawer-body {
11
11
  padding: 0 32px 32px;
12
12
  }
13
13
 
14
- .ant-space-vertical {
14
+ .@{ant-prefix}-space-vertical {
15
15
  gap: var(--zaui-space-size-sm, 8px) !important;
16
16
  }
17
17
 
@@ -118,12 +118,12 @@
118
118
  }
119
119
  }
120
120
 
121
- .ant-radio-button-wrapper {
121
+ .@{ant-prefix}-radio-button-wrapper {
122
122
  padding: 0 28px;
123
123
  }
124
124
 
125
125
  .pro-theme-tools-form {
126
- .ant-radio-button-wrapper {
126
+ .@{ant-prefix}-radio-button-wrapper {
127
127
  padding: 0 42px;
128
128
  }
129
129
  }
@@ -1,6 +1,6 @@
1
1
  import type { ProThemeToolsProps } from './propsType';
2
2
  declare const ProThemeTools: {
3
- ({ size, className, cacheTime, color, mode, iconFollowTheme, tableBorder, tableStripe, theme, ...props }: ProThemeToolsProps): JSX.Element;
3
+ ({ size, className, cacheTime, color, mode, iconFollowTheme, prefixCls, tableBorder, tableStripe, theme, ...props }: ProThemeToolsProps): JSX.Element;
4
4
  defaultProps: {
5
5
  size: number;
6
6
  mode: string;
@@ -17,7 +17,7 @@ var _classnames2 = _interopRequireDefault(require("classnames"));
17
17
  var _index = require("./utils/index");
18
18
  var _component = require("./component");
19
19
  var _locale = _interopRequireDefault(require("../locale"));
20
- var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "tableBorder", "tableStripe", "theme"];
20
+ var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "prefixCls", "tableBorder", "tableStripe", "theme"];
21
21
  /* eslint-disable prefer-const */
22
22
  var defaultCacheTime = 1; // 配置保存时间为一天
23
23
  var defaultThemeConfig = {
@@ -42,6 +42,8 @@ var ProThemeTools = function ProThemeTools(_ref) {
42
42
  color = _ref.color,
43
43
  mode = _ref.mode,
44
44
  iconFollowTheme = _ref.iconFollowTheme,
45
+ _ref$prefixCls = _ref.prefixCls,
46
+ prefixCls = _ref$prefixCls === void 0 ? 'ant' : _ref$prefixCls,
45
47
  _ref$tableBorder = _ref.tableBorder,
46
48
  tableBorder = _ref$tableBorder === void 0 ? false : _ref$tableBorder,
47
49
  _ref$tableStripe = _ref.tableStripe,
@@ -121,6 +123,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
121
123
  setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), localThemeConfig));
122
124
  (0, _index.setThemes)(cssVariables);
123
125
  _antd.ConfigProvider.config({
126
+ prefixCls: prefixCls,
124
127
  theme: {
125
128
  primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
126
129
  }
@@ -128,6 +131,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
128
131
  } else {
129
132
  (0, _index.setThemes)((0, _index.getMapKebabCase)(state));
130
133
  _antd.ConfigProvider.config({
134
+ prefixCls: prefixCls,
131
135
  theme: {
132
136
  primaryColor: state === null || state === void 0 ? void 0 : state.zauiBrand
133
137
  }
@@ -150,7 +154,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
150
154
  }, [zauiBrand]);
151
155
  // 斑马纹设置
152
156
  (0, _react.useEffect)(function () {
153
- (0, _index.setTableNoStripe)(zauiStripe);
157
+ (0, _index.setTableNoStripe)(zauiStripe, prefixCls);
154
158
  }, [zauiStripe]);
155
159
  // 表格边框设置
156
160
  (0, _react.useEffect)(function () {
@@ -182,6 +186,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
182
186
  showDrawer();
183
187
  }
184
188
  }), (0, _jsxRuntime.jsx)(_component.PrdTools, {
189
+ prefixCls: prefixCls,
185
190
  onReset: onReset,
186
191
  onClose: onClose,
187
192
  onCopy: onCopy,
@@ -9,6 +9,8 @@ export interface DevToolsPropsType {
9
9
  tableBorder?: boolean;
10
10
  /** 是否有斑马纹 */
11
11
  tableStripe?: boolean;
12
+ /** 统一样式前缀, 默认ant */
13
+ prefixCls?: string;
12
14
  }
13
15
  export interface ProThemeToolsProps {
14
16
  size?: number;
@@ -23,6 +25,8 @@ export interface ProThemeToolsProps {
23
25
  tableBorder?: boolean;
24
26
  /** 是否有斑马纹 */
25
27
  tableStripe?: boolean;
28
+ /** 统一样式前缀, 默认ant */
29
+ prefixCls?: string;
26
30
  [key: string]: any;
27
31
  }
28
32
  export interface LocalThemeConfigPropsType {
@@ -1,3 +1,6 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  @import '../component/PrdTools/style/index.less';
2
5
 
3
6
  .pro-theme-tools {
@@ -19,11 +22,11 @@
19
22
  }
20
23
 
21
24
  .pro-theme-tools-drawer {
22
- .ant-drawer-body {
25
+ .@{ant-prefix}-drawer-body {
23
26
  padding: 32px;
24
27
  }
25
28
 
26
- .ant-space-vertical {
29
+ .@{ant-prefix}-space-vertical {
27
30
  gap: var(--zaui-space-size-sm, 8px) !important;
28
31
  }
29
32
 
@@ -49,7 +52,7 @@
49
52
  margin-bottom: var(--zaui-space-size-md, 16px);
50
53
  }
51
54
 
52
- .ant-radio-button-wrapper {
55
+ .@{ant-prefix}-radio-button-wrapper {
53
56
  padding: 0 12px;
54
57
  }
55
58
  }
@@ -23,7 +23,7 @@ export declare const getMapHumpCase: (obj?: {}) => {};
23
23
  * 设置表格斑马纹
24
24
  * @param stripe boolean
25
25
  */
26
- export declare const setTableNoStripe: (stripe: boolean) => void;
26
+ export declare const setTableNoStripe: (stripe: boolean, prefixCls?: string) => void;
27
27
  /**
28
28
  * 设置表格边框
29
29
  * @param border boolean
@@ -81,8 +81,9 @@ var getMapHumpCase = exports.getMapHumpCase = function getMapHumpCase() {
81
81
  * @param stripe boolean
82
82
  */
83
83
  var setTableNoStripe = exports.setTableNoStripe = function setTableNoStripe(stripe) {
84
+ var prefixCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ant';
84
85
  var proTables = document.querySelectorAll('.pro-table');
85
- var antTables = document.querySelectorAll('.ant-table');
86
+ var antTables = document.querySelectorAll(".".concat(prefixCls, "-table"));
86
87
  if (!proTables.length) {
87
88
  return;
88
89
  }
@@ -1,3 +1,6 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-tooltip {
2
5
  cursor: pointer;
3
6
 
@@ -8,11 +8,9 @@ exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
10
  function CloseIcon(props) {
11
- return (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({
12
- className: "ant-input-suffix"
13
- }, props), {}, {
11
+ return (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
14
12
  children: (0, _jsxRuntime.jsx)("span", {
15
- className: "ant-input-clear-icon pro-tree-modal-checkbox-close",
13
+ className: "pro-tree-modal-checkbox-close",
16
14
  role: "button",
17
15
  children: (0, _jsxRuntime.jsx)("span", {
18
16
  role: "img",
@@ -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
  }
@@ -8,11 +8,9 @@ exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
10
  function CloseIcon(props) {
11
- return (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({
12
- className: "ant-input-suffix"
13
- }, props), {}, {
11
+ return (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
14
12
  children: (0, _jsxRuntime.jsx)("span", {
15
- className: "ant-input-clear-icon pro-tree-modal-checkbox-close",
13
+ className: "pro-tree-modal-checkbox-close",
16
14
  role: "button",
17
15
  children: (0, _jsxRuntime.jsx)("span", {
18
16
  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;
@@ -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',
@@ -470,6 +471,23 @@ var ProTreeModal = function ProTreeModal(props) {
470
471
  });
471
472
  }
472
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
+ };
473
491
  /**
474
492
  * Trigger the container opened by Drawer
475
493
  * default example and you can customize trigger={<Button>打开</Button>}
@@ -485,12 +503,15 @@ var ProTreeModal = function ProTreeModal(props) {
485
503
  return (0, _jsxRuntime.jsx)(_components.Trigger, {
486
504
  checkedValues: state.checkedValues,
487
505
  value: value,
488
- handleClick: handleClick,
489
- handleClearAll: handleClearAll,
490
506
  checkAll: state.checkAll,
491
507
  triggerStyle: style,
492
508
  disabled: disabled,
493
- isView: isView
509
+ isView: isView,
510
+ appoint: appoint,
511
+ allValue: allValue,
512
+ handleClick: handleClick,
513
+ handleClearAll: handleClearAll,
514
+ appointChange: appointChange
494
515
  });
495
516
  }, [state.checkedValues, state.checkAll, style, disabled, isView]);
496
517
  /**