@zat-design/sisyphus-react 3.4.4 → 3.4.5-beta.10

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 (154) hide show
  1. package/babel.config.js +3 -0
  2. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  3. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  4. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  5. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  6. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  7. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  8. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  9. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  11. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  12. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  13. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  14. package/coverage/lcov-report/src/.umi/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  16. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  18. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  24. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  29. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  37. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  39. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  40. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  41. package/dist/index.esm.css +70 -19
  42. package/dist/less.esm.css +70 -19
  43. package/es/ProConfigProvider/index.d.ts +2 -2
  44. package/es/ProConfigProvider/index.js +0 -3
  45. package/es/ProEditTable/components/RenderField/index.js +10 -9
  46. package/es/ProEditTable/index.js +14 -3
  47. package/es/ProEditTable/propsType.d.ts +1 -0
  48. package/es/ProEditTable/utils/index.js +7 -1
  49. package/es/ProEnum/components/Group.js +7 -1
  50. package/es/ProEnum/style/index.less +3 -2
  51. package/es/ProForm/components/combination/Container/index.js +3 -2
  52. package/es/ProForm/components/combination/Container/style/index.less +5 -1
  53. package/es/ProForm/components/combination/FormList/index.js +5 -5
  54. package/es/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
  55. package/es/ProForm/components/combination/GroupCopy/component/ComRender.js +36 -0
  56. package/es/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
  57. package/es/ProForm/components/combination/GroupCopy/index.js +84 -0
  58. package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
  59. package/es/ProForm/components/combination/GroupCopy/style/index.less +131 -0
  60. package/es/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
  61. package/es/ProForm/components/combination/GroupCopy/utils.js +180 -0
  62. package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
  63. package/es/ProForm/components/combination/ProCascader/index.js +255 -0
  64. package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
  65. package/es/ProForm/components/combination/ProCascader/propsType.js +1 -0
  66. package/es/ProForm/components/combination/ProModalSelect/index.js +25 -22
  67. package/es/ProForm/components/index.d.ts +1 -2
  68. package/es/ProForm/components/index.js +1 -3
  69. package/es/ProForm/components/render/Render.js +3 -3
  70. package/es/ProForm/components/render/propsType.d.ts +4 -8
  71. package/es/ProForm/index.js +2 -2
  72. package/es/ProForm/style/index.less +1 -1
  73. package/es/ProForm/utils/index.js +1 -1
  74. package/es/ProIcon/config/index.d.ts +14 -0
  75. package/es/ProIcon/config/index.js +17 -1
  76. package/es/ProIcon/index.js +134 -26
  77. package/es/ProIcon/propsTypes.d.ts +24 -0
  78. package/es/ProIcon/utils/index.d.ts +6 -0
  79. package/es/ProIcon/utils/index.js +83 -0
  80. package/es/ProLayout/components/ProCollapse/index.js +6 -3
  81. package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
  82. package/es/ProSelect/index.js +1 -1
  83. package/es/ProStep/components/Step/index.js +5 -4
  84. package/es/ProStep/style/index.less +20 -0
  85. package/es/ProTable/utils.js +6 -3
  86. package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  87. package/es/ProThemeTools/component/PrdTools/index.js +30 -4
  88. package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
  89. package/es/ProTreeModal/index.js +11 -15
  90. package/es/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
  91. package/es/global.less +38 -2
  92. package/jest.config.js +8 -0
  93. package/lib/ProConfigProvider/index.d.ts +2 -2
  94. package/lib/ProConfigProvider/index.js +0 -3
  95. package/lib/ProEditTable/components/RenderField/index.js +9 -8
  96. package/lib/ProEditTable/index.js +14 -3
  97. package/lib/ProEditTable/propsType.d.ts +1 -0
  98. package/lib/ProEditTable/utils/index.js +7 -1
  99. package/lib/ProEnum/components/Group.js +6 -0
  100. package/lib/ProEnum/style/index.less +3 -2
  101. package/lib/ProForm/components/combination/Container/index.js +3 -2
  102. package/lib/ProForm/components/combination/Container/style/index.less +5 -1
  103. package/lib/ProForm/components/combination/FormList/index.js +5 -5
  104. package/lib/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
  105. package/lib/ProForm/components/combination/GroupCopy/component/ComRender.js +44 -0
  106. package/lib/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
  107. package/lib/ProForm/components/combination/GroupCopy/index.js +91 -0
  108. package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
  109. package/lib/ProForm/components/combination/GroupCopy/style/index.less +131 -0
  110. package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
  111. package/lib/ProForm/components/combination/GroupCopy/utils.js +187 -0
  112. package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
  113. package/lib/ProForm/components/combination/ProCascader/index.js +255 -0
  114. package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
  115. package/lib/ProForm/components/combination/ProCascader/propsType.js +5 -0
  116. package/lib/ProForm/components/combination/ProModalSelect/index.js +26 -23
  117. package/lib/ProForm/components/index.d.ts +1 -2
  118. package/lib/ProForm/components/index.js +1 -8
  119. package/lib/ProForm/components/render/Render.js +3 -3
  120. package/lib/ProForm/components/render/propsType.d.ts +4 -8
  121. package/lib/ProForm/index.js +1 -1
  122. package/lib/ProForm/style/index.less +1 -1
  123. package/lib/ProForm/utils/index.js +1 -1
  124. package/lib/ProIcon/config/index.d.ts +14 -0
  125. package/lib/ProIcon/config/index.js +18 -2
  126. package/lib/ProIcon/index.js +132 -26
  127. package/lib/ProIcon/propsTypes.d.ts +24 -0
  128. package/lib/ProIcon/utils/index.d.ts +6 -0
  129. package/lib/ProIcon/utils/index.js +90 -0
  130. package/lib/ProLayout/components/ProCollapse/index.js +6 -3
  131. package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
  132. package/lib/ProSelect/index.js +1 -1
  133. package/lib/ProStep/components/Step/index.js +5 -4
  134. package/lib/ProStep/style/index.less +20 -0
  135. package/lib/ProTable/utils.js +6 -3
  136. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  137. package/lib/ProThemeTools/component/PrdTools/index.js +30 -4
  138. package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
  139. package/lib/ProTreeModal/index.js +11 -15
  140. package/lib/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
  141. package/lib/global.less +38 -2
  142. package/package.json +6 -2
  143. package/test/__mocks__/fileMock.js +0 -0
  144. package/test/__mocks__/styleMock.js +0 -0
  145. package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
  146. package/es/ProForm/components/base/ProCascader/index.js +0 -72
  147. package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
  148. package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
  149. package/lib/ProForm/components/base/ProCascader/index.js +0 -78
  150. package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
  151. /package/es/ProForm/components/combination/{ProAddressBar → GroupCopy}/propsType.js +0 -0
  152. /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
  153. /package/lib/ProForm/components/combination/{ProAddressBar → GroupCopy}/propsType.js +0 -0
  154. /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
8
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
10
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
11
  var _jsxRuntime = require("react/jsx-runtime");
@@ -12,12 +13,20 @@ var _ahooks = require("ahooks");
12
13
  var _antd = require("antd");
13
14
  var _classnames = _interopRequireDefault(require("classnames"));
14
15
  var _lodash = require("lodash");
16
+ var _reactSvg = require("react-svg");
17
+ var _react = require("react");
15
18
  var _ProConfigProvider = require("../ProConfigProvider");
16
19
  var _config2 = require("./config");
20
+ var _utils = require("./utils");
17
21
  var _locale = _interopRequireDefault(require("../locale"));
18
- var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList"];
22
+ var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap", "tooltip"];
19
23
  var ProIcon = function ProIcon(props) {
20
- var config = (0, _ProConfigProvider.useProConfig)('ProIcon') || {};
24
+ var _window, _window2;
25
+ var _useProConfig = (0, _ProConfigProvider.useProConfig)(),
26
+ state = _useProConfig.state,
27
+ dispatch = _useProConfig.dispatch;
28
+ var config = state.ProIcon,
29
+ antdTheme = state.theme;
21
30
  var _config = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), props !== null && props !== void 0 ? props : {});
22
31
  var _config$type = _config.type,
23
32
  type = _config$type === void 0 ? null : _config$type,
@@ -41,14 +50,24 @@ var ProIcon = function ProIcon(props) {
41
50
  children = _config.children,
42
51
  _config$mapList = _config.mapList,
43
52
  mapList = _config$mapList === void 0 ? [] : _config$mapList,
53
+ src = _config.src,
54
+ actionMap = _config.actionMap,
55
+ tooltip = _config.tooltip,
44
56
  reset = (0, _objectWithoutProperties2.default)(_config, _excluded);
57
+ // 主题色 primaryColor 用于单应用或处于组件库文档内 qiankunPrimaryColor用于主子应用
58
+ var _ref = antdTheme !== null && antdTheme !== void 0 ? antdTheme : {},
59
+ _ref$primaryColor = _ref.primaryColor,
60
+ primaryColor = _ref$primaryColor === void 0 ? '#006AFF' : _ref$primaryColor,
61
+ _ref$qiankunPrimaryCo = _ref.qiankunPrimaryColor,
62
+ qiankunPrimaryColor = _ref$qiankunPrimaryCo === void 0 ? '#006AFF' : _ref$qiankunPrimaryCo;
63
+ // 文档内部就不用判断window.top !== window.self了
64
+ var isQiankun =
65
+ // @ts-ignore
66
+ ((_window = window) === null || _window === void 0 ? void 0 : _window.__POWERED_BY_QIANKUN__) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.isMicroApp);
45
67
  // 语言
46
68
  var language = _locale.default.ProIcon.language;
47
69
  // 加载内部icon
48
- var status = (0, _ahooks.useExternal)('https://at.alicdn.com/t/c/font_4063056_jmnz9g5uycp.js');
49
- if (status !== 'ready') {
50
- return null;
51
- }
70
+ (0, _ahooks.useExternal)('https://at.alicdn.com/t/c/font_4063056_jmnz9g5uycp.js');
52
71
  var rotateStyle = rotate ? {
53
72
  msTransform: "rotate(".concat(rotate, "deg)"),
54
73
  transform: "rotate(".concat(rotate, "deg)")
@@ -60,6 +79,8 @@ var ProIcon = function ProIcon(props) {
60
79
  'pro-icon-btn': disabled
61
80
  });
62
81
  var _mode = mode || 'icon';
82
+ // 观察者实例
83
+ var observer;
63
84
  // 特殊情况,如果指定了type,并且没有接收到组件内的mode,那模式就是icon
64
85
  if (type && !props.mode) {
65
86
  _mode = 'icon';
@@ -70,6 +91,8 @@ var ProIcon = function ProIcon(props) {
70
91
  var mergedMapList = (0, _lodash.uniqBy)(mapList.concat(_config2.iconMap), targetTextFill);
71
92
  var _type = type;
72
93
  var _text = children;
94
+ // svg图标对应文本
95
+ var iconText = tooltip || '';
73
96
  var typeIsExistAndIncludeEnglish = _type && /[a-zA-Z]/.test(_type);
74
97
  // 模式为icon下,对传入的text进行指定语言-icon 映射
75
98
  if (isIconMode && !type) {
@@ -79,6 +102,7 @@ var ProIcon = function ProIcon(props) {
79
102
  });
80
103
  if (target) {
81
104
  _type = target === null || target === void 0 ? void 0 : target.type;
105
+ iconText = target[targetTextFill];
82
106
  }
83
107
  }
84
108
  }
@@ -93,33 +117,115 @@ var ProIcon = function ProIcon(props) {
93
117
  }
94
118
  }
95
119
  }
120
+ var svgProps = {
121
+ className: proIconClassNames,
122
+ fill: 'currentColor',
123
+ style: (0, _objectSpread2.default)((0, _objectSpread2.default)({
124
+ width: size,
125
+ height: size
126
+ }, rotateStyle), style)
127
+ };
96
128
  var RenderIcon = (0, _jsxRuntime.jsx)("span", (0, _objectSpread2.default)((0, _objectSpread2.default)({
97
129
  className: "anticon",
98
130
  style: {
99
131
  color: color
100
132
  }
101
133
  }, reset), {}, {
102
- children: (0, _jsxRuntime.jsx)("svg", {
103
- className: proIconClassNames,
104
- "aria-hidden": "true",
105
- onClick: onClick,
106
- fill: "currentColor",
107
- style: (0, _objectSpread2.default)((0, _objectSpread2.default)({
108
- width: size,
109
- height: size
110
- }, rotateStyle), style),
111
- children: (0, _jsxRuntime.jsx)("use", {
112
- xlinkHref: "#icon-".concat(_type)
113
- })
134
+ children: (0, _jsxRuntime.jsx)(_antd.Tooltip, {
135
+ title: iconText,
136
+ children: !src ? (0, _jsxRuntime.jsx)("svg", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, svgProps), {}, {
137
+ onClick: onClick,
138
+ "aria-hidden": "true",
139
+ children: (0, _jsxRuntime.jsx)("use", {
140
+ xlinkHref: "#icon-".concat(_type)
141
+ })
142
+ })) : (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, svgProps), {}, {
143
+ // @ts-ignore
144
+ onClick: onClick,
145
+ "aria-hidden": "true",
146
+ src: src,
147
+ beforeInjection: function beforeInjection(svg) {
148
+ (0, _utils.onBeforeInjection)({
149
+ svg: svg,
150
+ actionMap: actionMap,
151
+ primaryColor: isQiankun ? qiankunPrimaryColor : primaryColor
152
+ });
153
+ }
154
+ }))
114
155
  })
115
156
  }));
116
- return !isExtendButtonMode ? RenderIcon : (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
117
- type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
118
- className: proIconClassNames,
119
- disabled: disabled,
120
- icon: isIconMode ? RenderIcon : null
121
- }, reset), buttonProps), {}, {
122
- children: _text
123
- }));
157
+ var _RenderIcon = (0, _react.useMemo)(function () {
158
+ return RenderIcon;
159
+ }, [primaryColor, qiankunPrimaryColor]);
160
+ (0, _react.useEffect)(function () {
161
+ // 处于主子应用情况下才会执行下方逻辑,主题色的变更以主框架的为准
162
+ if (actionMap && isQiankun) {
163
+ observer = new MutationObserver(function (mutationsList) {
164
+ var targetEntries = mutationsList[0];
165
+ if (targetEntries) {
166
+ if (targetEntries && targetEntries.target) {
167
+ var _Object$values, _Object$values$find, _Object$values$find$v3, _targetEntries$target, _targetEntries$target2;
168
+ var _Object$values$find$v = // @ts-ignore
169
+ (_Object$values = Object.values((_targetEntries$target = targetEntries === null || targetEntries === void 0 ? void 0 : (_targetEntries$target2 = targetEntries.target) === null || _targetEntries$target2 === void 0 ? void 0 : _targetEntries$target2.attributes) !== null && _targetEntries$target !== void 0 ? _targetEntries$target : {})) === null || _Object$values === void 0 ? void 0 : (_Object$values$find = _Object$values.find(function (item) {
170
+ return item.nodeName === 'style';
171
+ })
172
+ // @ts-ignore
173
+ ) === null || _Object$values$find === void 0 ? void 0 : (_Object$values$find$v3 = _Object$values$find.value) === null || _Object$values$find$v3 === void 0 ? void 0 : _Object$values$find$v3.match(/--zaui-brand:(.*?);/),
174
+ _Object$values$find$v2 = (0, _slicedToArray2.default)(_Object$values$find$v, 2),
175
+ label = _Object$values$find$v2[0],
176
+ value = _Object$values$find$v2[1];
177
+ if (label && value) {
178
+ if (qiankunPrimaryColor !== value) {
179
+ dispatch({
180
+ type: 'set',
181
+ payload: {
182
+ theme: {
183
+ primaryColor: primaryColor,
184
+ qiankunPrimaryColor: value === null || value === void 0 ? void 0 : value.trim()
185
+ }
186
+ }
187
+ });
188
+ }
189
+ }
190
+ }
191
+ }
192
+ });
193
+ var zaAccessibilityTarget = document.documentElement;
194
+ if (window.parent === window) {
195
+ // 在最顶层的window环境中,可以直接使用document
196
+ zaAccessibilityTarget = document.documentElement;
197
+ } else {
198
+ // 向上遍历直到找到主应用的window
199
+ var currentWindow = window;
200
+ while (currentWindow.parent !== currentWindow) {
201
+ // @ts-ignore
202
+ currentWindow = currentWindow.parent;
203
+ }
204
+ zaAccessibilityTarget = currentWindow.document.documentElement;
205
+ }
206
+ observer.observe(zaAccessibilityTarget, {
207
+ attributes: true,
208
+ attributeFilter: ['style']
209
+ });
210
+ }
211
+ }, []);
212
+ (0, _react.useEffect)(function () {
213
+ return function () {
214
+ if (observer) {
215
+ observer.disconnect();
216
+ }
217
+ };
218
+ }, []);
219
+ return !isExtendButtonMode ? _RenderIcon : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
220
+ title: tooltip,
221
+ children: (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
222
+ type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
223
+ className: proIconClassNames,
224
+ disabled: disabled,
225
+ icon: isIconMode ? RenderIcon : null
226
+ }, reset), buttonProps), {}, {
227
+ children: _text
228
+ }))
229
+ });
124
230
  };
125
231
  var _default = exports.default = ProIcon;
@@ -6,7 +6,21 @@ interface iconMap {
6
6
  'text-cn'?: string;
7
7
  'text-en'?: string;
8
8
  }
9
+ interface themeMap {
10
+ [key: string]: string[];
11
+ }
12
+ interface actionMap {
13
+ themeMap?: themeMap;
14
+ themeFillMap?: themeMap;
15
+ gradation?: string[];
16
+ fill?: string[];
17
+ }
9
18
  export interface ProIconProps {
19
+ /**
20
+ * @description 本地import引入
21
+ * @default ""
22
+ */
23
+ src?: string;
10
24
  /**
11
25
  * @description 图标的名称
12
26
  * @default -
@@ -40,6 +54,11 @@ export interface ProIconProps {
40
54
  * @default false
41
55
  */
42
56
  disabled?: boolean;
57
+ /**
58
+ * @description 提示
59
+ * @default -
60
+ */
61
+ tooltip?: string | React.ReactNode;
43
62
  /**
44
63
  * @description 是否跟随主题色
45
64
  * @default false
@@ -75,5 +94,10 @@ export interface ProIconProps {
75
94
  * @default 项目内认默映射
76
95
  */
77
96
  mapList?: iconMap[];
97
+ /**
98
+ * @description svg变更操作表 请到 ProThemeTools 主题配置查看示例
99
+ * @default
100
+ */
101
+ actionMap?: actionMap;
78
102
  }
79
103
  export {};
@@ -0,0 +1,6 @@
1
+ export declare const recurseGetNodes: (type: any, node: any, queue: any) => void;
2
+ export declare const onBeforeInjection: ({ svg, actionMap, primaryColor }: {
3
+ svg: any;
4
+ actionMap: any;
5
+ primaryColor: any;
6
+ }) => void;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.recurseGetNodes = exports.onBeforeInjection = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _config = require("../config");
10
+ var recurseGetNodes = exports.recurseGetNodes = function recurseGetNodes(type, node, queue) {
11
+ switch (type) {
12
+ // 渐变
13
+ case 'gradation':
14
+ if (node.nodeName === 'stop' && node.getAttribute('stop-color')) {
15
+ queue.push(node);
16
+ }
17
+ break;
18
+ // 填充
19
+ case 'fill':
20
+ if (node.getAttribute && node.getAttribute('fill')) {
21
+ queue.push(node);
22
+ }
23
+ break;
24
+ default:
25
+ break;
26
+ }
27
+ if (node.childNodes) {
28
+ for (var i = 0; i < node.childNodes.length; i++) {
29
+ recurseGetNodes(type, node.childNodes[i], queue);
30
+ }
31
+ }
32
+ };
33
+ var onBeforeInjection = exports.onBeforeInjection = function onBeforeInjection(_ref) {
34
+ var svg = _ref.svg,
35
+ actionMap = _ref.actionMap,
36
+ primaryColor = _ref.primaryColor;
37
+ if (actionMap && svg) {
38
+ var _actionMap$themeMap, _actionMap$themeFillM, _actionMap$gradation, _actionMap$fill;
39
+ // 项目内置的四种主题匹配渐变色
40
+ var mergeThemeMap = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _config.themeMap), (_actionMap$themeMap = actionMap.themeMap) !== null && _actionMap$themeMap !== void 0 ? _actionMap$themeMap : {});
41
+ // 项目内置的四种双色匹配fill
42
+ var mergeFillThemeMap = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _config.themeFillMap), (_actionMap$themeFillM = actionMap.themeFillMap) !== null && _actionMap$themeFillM !== void 0 ? _actionMap$themeFillM : {});
43
+ var _gradList = mergeThemeMap[primaryColor];
44
+ var _fillList = mergeFillThemeMap[primaryColor];
45
+ // 渐变操作序列
46
+ var gradList = (_actionMap$gradation = actionMap === null || actionMap === void 0 ? void 0 : actionMap.gradation) !== null && _actionMap$gradation !== void 0 ? _actionMap$gradation : _gradList;
47
+ // 填充操作序列
48
+ var fillList = (_actionMap$fill = actionMap === null || actionMap === void 0 ? void 0 : actionMap.fill) !== null && _actionMap$fill !== void 0 ? _actionMap$fill : _fillList;
49
+ // 节点收集
50
+ var nodeMap = {
51
+ // 渐变色节点收集
52
+ gradation: [],
53
+ // 具有fill属性的节点收集
54
+ fill: []
55
+ };
56
+ // 目前只支持处理渐变及fill填充
57
+ var types = Reflect.ownKeys(nodeMap !== null && nodeMap !== void 0 ? nodeMap : {});
58
+ types.forEach(function (typeKey) {
59
+ recurseGetNodes(typeKey, svg, nodeMap[typeKey]);
60
+ });
61
+ if ((gradList === null || gradList === void 0 ? void 0 : gradList.length) > 0) {
62
+ nodeMap.gradation.forEach(function (item, index) {
63
+ // 下一步准备替换的
64
+ var nextStr = gradList[index];
65
+ // 属性原本的值
66
+ var originStr = item.getAttribute('stop-color');
67
+ if (nextStr && originStr !== nextStr) {
68
+ item.setAttribute('stop-color', nextStr);
69
+ }
70
+ });
71
+ }
72
+ if ((fillList === null || fillList === void 0 ? void 0 : fillList.length) > 0) {
73
+ nodeMap.fill.forEach(function (item, index) {
74
+ // 默认接收的
75
+ var receiveStr = fillList[index];
76
+ // 下一步准备替换的
77
+ var nextFillStr = receiveStr === 'theme' ? primaryColor : receiveStr;
78
+ // 属性原本的值
79
+ var originFill = item.getAttribute('fill');
80
+ // 如果包含url(则是内链,不作替换处理
81
+ if (!(originFill && originFill.includes('url(')) && nextFillStr) {
82
+ // 不同才替换
83
+ if (originFill !== nextFillStr) {
84
+ item.setAttribute('fill', nextFillStr);
85
+ }
86
+ }
87
+ });
88
+ }
89
+ }
90
+ };
@@ -12,9 +12,9 @@ var _react = require("react");
12
12
  var _antd = require("antd");
13
13
  var _icons = require("@ant-design/icons");
14
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
- var _reactSvg = require("react-svg");
16
15
  var _lodash = require("lodash");
17
16
  var _fold = _interopRequireDefault(require("../../../assets/fold.svg"));
17
+ var _index = _interopRequireDefault(require("../../../ProIcon/index"));
18
18
  var Panel = _antd.Collapse.Panel;
19
19
  var ProCollapse = function ProCollapse(props) {
20
20
  var title = props.title,
@@ -79,8 +79,11 @@ var ProCollapse = function ProCollapse(props) {
79
79
  align: "center",
80
80
  children: [(0, _jsxRuntime.jsx)("div", {
81
81
  className: "pro-collapse-icon",
82
- children: (0, _lodash.isBoolean)(icon) ? (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
83
- src: _fold.default
82
+ children: (0, _lodash.isBoolean)(icon) ? (0, _jsxRuntime.jsx)(_index.default, {
83
+ src: _fold.default,
84
+ actionMap: {
85
+ fill: []
86
+ }
84
87
  }) : icon
85
88
  }), title]
86
89
  });
@@ -16,7 +16,7 @@
16
16
  }
17
17
  .pro-collapse-level2{
18
18
  .@{ant-prefix}-collapse-header {
19
- display: block !important;
19
+ display: flex !important;
20
20
  }
21
21
  }
22
22
  }
@@ -240,7 +240,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
240
240
  if (!(0, _lodash.isObject)(value)) {
241
241
  return undefined;
242
242
  }
243
- return value === null || value === void 0 ? void 0 : value[code];
243
+ return (value === null || value === void 0 ? void 0 : value[code]) || (value === null || value === void 0 ? void 0 : value.value);
244
244
  }
245
245
  if (labelInValue && selectProps.mode) {
246
246
  // 对传入的值做一些基础判断
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _lodash = require("lodash");
14
- var _reactSvg = require("react-svg");
14
+ var _index = _interopRequireDefault(require("../../../ProIcon/index"));
15
15
  var _catalog = _interopRequireDefault(require("../../../assets/catalog.svg"));
16
16
  var _Anchor = _interopRequireDefault(require("../Anchor"));
17
17
  var _locale = _interopRequireDefault(require("../../../locale"));
@@ -67,10 +67,11 @@ var Step = exports.Step = function Step(_ref) {
67
67
  onMouseLeave: handleMouseLeave,
68
68
  children: [(0, _jsxRuntime.jsxs)("div", {
69
69
  className: "step-menu",
70
- children: [(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
70
+ children: [(0, _jsxRuntime.jsx)(_index.default, {
71
+ src: _catalog.default,
71
72
  className: "menu-icon",
72
- src: _catalog.default
73
- }), onOff && (0, _jsxRuntime.jsx)("div", {
73
+ actionMap: {}
74
+ }), true && (0, _jsxRuntime.jsx)("div", {
74
75
  children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProStep = _locale.default.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
75
76
  })]
76
77
  }), options.map(function (item) {
@@ -27,6 +27,26 @@
27
27
  height: 48px;
28
28
  font-size: var(--zaui-font-size-lg, 16px);
29
29
  border-bottom: 1px solid var(--zaui-line, #dddddd);
30
+ > .anticon {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ width: 48px;
35
+ height: 24px;
36
+ > .menu-icon {
37
+ width: auto !important;
38
+ height: auto !important;
39
+ font-size: var(--zaui-font-size-lg-title, 24px);
40
+ fill: var(--zaui-brand, #006aff);
41
+ > div {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ width: 48px;
46
+ height: 24px;
47
+ }
48
+ }
49
+ }
30
50
 
31
51
  > .menu-icon {
32
52
  font-size: var(--zaui-font-size-lg-title, 24px);
@@ -276,19 +276,22 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
276
276
  'varied-cell': originalValue !== undefined,
277
277
  'empty-cell': isEmpty
278
278
  });
279
- var renderValue = (0, _jsxRuntime.jsx)(_ProForm.default.ProAddressBar, {
279
+ var renderValue = (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
280
280
  isView: true,
281
+ mode: "address",
281
282
  code: code,
282
283
  value: realValue
283
284
  });
284
- var originalRenderValue = (0, _jsxRuntime.jsx)(_ProForm.default.ProAddressBar, {
285
+ var originalRenderValue = (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
285
286
  isView: true,
287
+ mode: "address",
286
288
  code: code,
287
289
  value: originalRealValue
288
290
  });
289
- return (0, _jsxRuntime.jsx)(_ProForm.default.ProAddressBar, {
291
+ return (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
290
292
  className: className,
291
293
  isView: true,
294
+ mode: "address",
292
295
  code: code,
293
296
  value: realValue,
294
297
  tooltip: originalValue !== undefined ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -1,3 +1,3 @@
1
1
  import type { DevToolsPropsType } from '../../propsType';
2
- declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, prefixCls, }: DevToolsPropsType) => JSX.Element;
2
+ declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
3
3
  export default PrdTools;
@@ -28,12 +28,10 @@ var PrdTools = function PrdTools(_ref) {
28
28
  open = _ref.open,
29
29
  state = _ref.state,
30
30
  tableBorder = _ref.tableBorder,
31
- tableStripe = _ref.tableStripe,
32
- prefixCls = _ref.prefixCls;
31
+ tableStripe = _ref.tableStripe;
33
32
  var _useProConfig = (0, _ProConfigProvider.useProConfig)(),
34
33
  config = _useProConfig.state,
35
34
  dispatch = _useProConfig.dispatch;
36
- var ProForm = config.ProForm;
37
35
  var _useState = (0, _react.useState)([{
38
36
  color: '#006AFF',
39
37
  active: true
@@ -46,6 +44,9 @@ var PrdTools = function PrdTools(_ref) {
46
44
  }, {
47
45
  color: '#A00F20',
48
46
  active: false
47
+ }, {
48
+ color: '#31AF96',
49
+ active: false
49
50
  }]),
50
51
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
51
52
  active = _useState2[0],
@@ -57,6 +58,7 @@ var PrdTools = function PrdTools(_ref) {
57
58
  _ref2$zauiBrand = _ref2.zauiBrand,
58
59
  zauiBrand = _ref2$zauiBrand === void 0 ? '#006AFF' : _ref2$zauiBrand;
59
60
  if (zauiBrand) {
61
+ var _config$theme;
60
62
  var newArray = active.map(function (activeItem) {
61
63
  activeItem.active = false;
62
64
  return {
@@ -65,6 +67,15 @@ var PrdTools = function PrdTools(_ref) {
65
67
  };
66
68
  });
67
69
  setActive(newArray);
70
+ dispatch({
71
+ type: 'set',
72
+ payload: {
73
+ theme: {
74
+ primaryColor: zauiBrand,
75
+ qiankunPrimaryColor: config === null || config === void 0 ? void 0 : (_config$theme = config.theme) === null || _config$theme === void 0 ? void 0 : _config$theme.qiankunPrimaryColor
76
+ }
77
+ }
78
+ });
68
79
  }
69
80
  }, []);
70
81
  return (0, _jsxRuntime.jsxs)(NewDrawer, {
@@ -105,6 +116,15 @@ var PrdTools = function PrdTools(_ref) {
105
116
  (0, _index.setThemes)({
106
117
  'zaui-brand': item.color
107
118
  });
119
+ dispatch({
120
+ type: 'set',
121
+ payload: {
122
+ theme: {
123
+ primaryColor: item.color,
124
+ qiankunPrimaryColor: item.color
125
+ }
126
+ }
127
+ });
108
128
  },
109
129
  children: item.active ? (0, _jsxRuntime.jsx)(_icons.CheckOutlined, {}) : null
110
130
  }, item.color);
@@ -151,8 +171,14 @@ var PrdTools = function PrdTools(_ref) {
151
171
  }), (0, _jsxRuntime.jsx)("div", {
152
172
  className: "pro-theme-tools-item",
153
173
  children: (0, _jsxRuntime.jsxs)(_antd.Radio.Group, {
154
- value: ProForm === null || ProForm === void 0 ? void 0 : ProForm.labelAlign,
174
+ value: state.zauiFormAlign,
155
175
  onChange: function onChange(e) {
176
+ setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
177
+ zauiFormAlign: e.target.value
178
+ }));
179
+ (0, _index.setThemes)({
180
+ 'zaui-form-align': e.target.value
181
+ });
156
182
  dispatch({
157
183
  type: 'setWithLocal',
158
184
  payload: {