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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) 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 +63 -18
  42. package/dist/less.esm.css +63 -18
  43. package/es/ProEditTable/components/RenderField/index.js +3 -2
  44. package/es/ProEditTable/index.js +13 -2
  45. package/es/ProEditTable/propsType.d.ts +1 -0
  46. package/es/ProEditTable/utils/index.js +7 -1
  47. package/es/ProEnum/components/Group.js +7 -1
  48. package/es/ProEnum/style/index.less +3 -2
  49. package/es/ProForm/components/combination/FormList/index.js +5 -5
  50. package/es/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
  51. package/es/ProForm/components/combination/GroupCopy/component/ComRender.js +36 -0
  52. package/es/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
  53. package/es/ProForm/components/combination/GroupCopy/index.js +84 -0
  54. package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
  55. package/es/ProForm/components/combination/GroupCopy/propsType.js +1 -0
  56. package/es/ProForm/components/combination/GroupCopy/style/index.less +131 -0
  57. package/es/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
  58. package/es/ProForm/components/combination/GroupCopy/utils.js +180 -0
  59. package/es/ProForm/components/combination/ProModalSelect/index.js +22 -18
  60. package/es/ProForm/components/index.js +1 -0
  61. package/es/ProForm/components/render/Render.js +2 -2
  62. package/es/ProForm/components/render/propsType.d.ts +1 -1
  63. package/es/ProIcon/config/index.d.ts +14 -0
  64. package/es/ProIcon/config/index.js +17 -1
  65. package/es/ProIcon/index.js +102 -20
  66. package/es/ProIcon/propsTypes.d.ts +19 -0
  67. package/es/ProIcon/utils/index.d.ts +1 -0
  68. package/es/ProIcon/utils/index.js +23 -0
  69. package/es/ProLayout/components/ProCollapse/index.js +6 -3
  70. package/es/ProStep/components/Step/index.js +5 -4
  71. package/es/ProStep/style/index.less +20 -0
  72. package/es/ProThemeTools/component/PrdTools/index.js +20 -0
  73. package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
  74. package/es/ProTreeModal/index.js +11 -15
  75. package/es/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
  76. package/es/global.less +38 -2
  77. package/jest.config.js +8 -0
  78. package/lib/ProEditTable/components/RenderField/index.js +3 -2
  79. package/lib/ProEditTable/index.js +13 -2
  80. package/lib/ProEditTable/propsType.d.ts +1 -0
  81. package/lib/ProEditTable/utils/index.js +7 -1
  82. package/lib/ProEnum/components/Group.js +6 -0
  83. package/lib/ProEnum/style/index.less +3 -2
  84. package/lib/ProForm/components/combination/FormList/index.js +5 -5
  85. package/lib/ProForm/components/combination/GroupCopy/component/ComRender.d.ts +14 -0
  86. package/lib/ProForm/components/combination/GroupCopy/component/ComRender.js +44 -0
  87. package/lib/ProForm/components/combination/GroupCopy/index.d.ts +10 -0
  88. package/lib/ProForm/components/combination/GroupCopy/index.js +91 -0
  89. package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +47 -0
  90. package/lib/ProForm/components/combination/GroupCopy/propsType.js +5 -0
  91. package/lib/ProForm/components/combination/GroupCopy/style/index.less +131 -0
  92. package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +53 -0
  93. package/lib/ProForm/components/combination/GroupCopy/utils.js +187 -0
  94. package/lib/ProForm/components/combination/ProModalSelect/index.js +23 -19
  95. package/lib/ProForm/components/render/Render.js +2 -2
  96. package/lib/ProForm/components/render/propsType.d.ts +1 -1
  97. package/lib/ProIcon/config/index.d.ts +14 -0
  98. package/lib/ProIcon/config/index.js +18 -2
  99. package/lib/ProIcon/index.js +99 -19
  100. package/lib/ProIcon/propsTypes.d.ts +19 -0
  101. package/lib/ProIcon/utils/index.d.ts +1 -0
  102. package/lib/ProIcon/utils/index.js +29 -0
  103. package/lib/ProLayout/components/ProCollapse/index.js +6 -3
  104. package/lib/ProStep/components/Step/index.js +5 -4
  105. package/lib/ProStep/style/index.less +20 -0
  106. package/lib/ProThemeTools/component/PrdTools/index.js +20 -0
  107. package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
  108. package/lib/ProTreeModal/index.js +11 -15
  109. package/lib/ProWaterMark/__snapshots__/index.test.tsx.snap +7 -0
  110. package/lib/global.less +38 -2
  111. package/package.json +6 -2
  112. package/test/__mocks__/fileMock.js +0 -0
  113. package/test/__mocks__/styleMock.js +0 -0
@@ -0,0 +1,131 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
4
+ .border-radius(@start-end: 0, @end-end: 0, @start-start: 0, @end-start: 0) {
5
+ border-start-end-radius: @start-end;
6
+ border-end-end-radius: @end-end;
7
+ border-start-start-radius: @start-start;
8
+ border-end-start-radius: @end-start;
9
+ }
10
+
11
+ .start-radius() {
12
+ border-start-start-radius: 4px;
13
+ border-end-start-radius: 4px;
14
+ }
15
+
16
+ .end-radius() {
17
+ border-start-end-radius: 4px;
18
+ border-end-end-radius: 4px;
19
+ }
20
+
21
+ .pro-group {
22
+ width: unset !important;
23
+
24
+
25
+ &.pro-group-diy-width, &.pro-group-width-auto {
26
+ .@{ant-prefix}-space .@{ant-prefix}-space-item {
27
+ width: auto;
28
+
29
+ .@{ant-prefix}-space-item {
30
+ width: auto;
31
+ }
32
+ }
33
+ }
34
+
35
+ .@{ant-prefix}-space {
36
+ width: 100%;
37
+
38
+ .@{ant-prefix}-space-item {
39
+ width: 100%;
40
+ }
41
+
42
+ .@{ant-prefix}-form-item {
43
+ margin-bottom: 0 !important;
44
+ }
45
+ }
46
+
47
+ .@{ant-prefix}-form-item-label {
48
+ display: none;
49
+ }
50
+
51
+ .@{ant-prefix}-space-compact {
52
+ flex: auto;
53
+ align-items: center;
54
+ width: 100%;
55
+
56
+ &>.@{ant-prefix}-input-number{
57
+ &:first-child{
58
+ border-end-end-radius: 0;
59
+ border-start-end-radius: 0;
60
+ }
61
+ &:last-child{
62
+ border-start-start-radius: 0;
63
+ border-end-start-radius: 0;
64
+ margin-left: -1px;
65
+ }
66
+ }
67
+
68
+ .@{ant-prefix}-form-item {
69
+ margin-bottom: 0 !important;
70
+ }
71
+
72
+ .group-separator {
73
+ margin-inline-end: -2px;
74
+ margin-inline-start: -1px;
75
+ border-start-start-radius: 0;
76
+ border-end-start-radius: 0;
77
+ padding: 0 12px;
78
+ background-color: #fff;
79
+ cursor: default;
80
+ }
81
+ .pro-modal-select {
82
+ margin-left: -1px;
83
+ .@{ant-prefix}-input{
84
+ border-start-start-radius: 0;
85
+ border-end-start-radius: 0;
86
+ }
87
+ }
88
+
89
+ // 定制内敛合并样式
90
+ .@{ant-prefix}-input-affix-wrapper,
91
+ .@{ant-prefix}-select {
92
+ .border-radius(0, 0, 0, 0);
93
+
94
+ &:nth-child(n + 2) {
95
+ margin-inline-start: -1px;
96
+ }
97
+
98
+ &:first-child {
99
+ .start-radius();
100
+ }
101
+
102
+ &:last-child {
103
+ .end-radius();
104
+ }
105
+ }
106
+
107
+ .@{ant-prefix}-select {
108
+ .@{ant-prefix}-select-selector {
109
+ .border-radius(0, 0, 0, 0);
110
+ }
111
+
112
+ &:first-child {
113
+ .@{ant-prefix}-select-selector {
114
+ .start-radius();
115
+ }
116
+ }
117
+
118
+ &:last-child {
119
+ .@{ant-prefix}-select-selector {
120
+ .end-radius();
121
+ }
122
+ }
123
+ }
124
+
125
+ // 报错样式定制
126
+ .@{ant-prefix}-input-affix-wrapper-status-error ~ .group-separator {
127
+ color: var(--ant-error-color);
128
+ border-color: var(--ant-error-color);
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,53 @@
1
+ /// <reference types="react" />
2
+ import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
3
+ import { FormInstance } from 'antd';
4
+ import { GroupColumnProps, SpaceType } from './propsType';
5
+ import { ProFormColumnProps, ReactiveFunction } from '../../render/propsType';
6
+ export type EventArgs = any[];
7
+ /**
8
+ * 插入间隔符
9
+ * @param columns 表单配置数组
10
+ * @returns
11
+ */
12
+ export declare const insertSeparator: (columns: GroupColumnProps[], space?: SpaceType) => any[];
13
+ /** 带出event的组件默认取值方法 */
14
+ export declare function defaultGetValueFromEvent(valuePropName: string, ...args: EventArgs): any;
15
+ /** 转换names */
16
+ export declare const transformNamesString: (arr: (string | string[])[]) => (string | string[])[];
17
+ interface Params {
18
+ form?: FormInstance;
19
+ index?: number;
20
+ type?: string;
21
+ namePath?: InternalNamePath;
22
+ disabled?: boolean | ReactiveFunction<any, boolean>;
23
+ show?: boolean | ReactiveFunction<any, boolean>;
24
+ component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
25
+ fieldProps?: boolean | ReactiveFunction<any, boolean>;
26
+ name?: NamePath;
27
+ }
28
+ /** 计算响应式参数的值 */
29
+ export declare const getReactiveProps: (params: Params) => {
30
+ disabled: boolean;
31
+ show: boolean;
32
+ component: any;
33
+ fieldProps: boolean;
34
+ };
35
+ type ValueTypeGetterParams = Pick<ProFormColumnProps, 'valueType' | 'switchValue' | 'toISOString'> & {
36
+ type?: any;
37
+ mode?: string;
38
+ };
39
+ /** 获取当前字段的转换函数 */
40
+ export declare const getValueTypeTrans: (params: ValueTypeGetterParams) => any;
41
+ interface ColumnsTransformerParams {
42
+ columns: GroupColumnProps[];
43
+ name?: NamePath;
44
+ names?: NamePath[];
45
+ value?: any[];
46
+ onChange: any;
47
+ namePath?: InternalNamePath;
48
+ form: FormInstance;
49
+ index?: number;
50
+ }
51
+ /** 转换columns */
52
+ export declare const transformColumns: (params: ColumnsTransformerParams) => any[];
53
+ export {};
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.defaultGetValueFromEvent = defaultGetValueFromEvent;
8
+ exports.transformNamesString = exports.transformColumns = exports.insertSeparator = exports.getValueTypeTrans = exports.getReactiveProps = void 0;
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ var _lodash = require("lodash");
13
+ var _antd = require("antd");
14
+ var _valueType = _interopRequireDefault(require("../../../utils/valueType"));
15
+ /**
16
+ * 插入间隔符
17
+ * @param columns 表单配置数组
18
+ * @returns
19
+ */
20
+ var insertSeparator = exports.insertSeparator = function insertSeparator(columns, space) {
21
+ if (!(space === null || space === void 0 ? void 0 : space.separator)) {
22
+ return columns;
23
+ }
24
+ return columns.reduce(function (result, current, index, array) {
25
+ // 将当前元素添加到结果数组中
26
+ result.push(current);
27
+ // 如果当前元素不是最后一个元素,则添加间隔符
28
+ if (index < array.length - 1) {
29
+ result.push({
30
+ component: (0, _jsxRuntime.jsx)(_antd.Button, {
31
+ className: "group-separator",
32
+ children: space.separator
33
+ }),
34
+ fieldProps: {
35
+ disabled: true
36
+ }
37
+ });
38
+ }
39
+ return result;
40
+ }, []);
41
+ };
42
+ /** 带出event的组件默认取值方法 */
43
+ function defaultGetValueFromEvent(valuePropName) {
44
+ var event = arguments.length <= 1 ? undefined : arguments[1];
45
+ if (event && event.target && (0, _typeof2.default)(event.target) === 'object' && valuePropName in event.target) {
46
+ return event.target[valuePropName];
47
+ }
48
+ return event;
49
+ }
50
+ /** 转换names */
51
+ var transformNamesString = exports.transformNamesString = function transformNamesString(arr) {
52
+ var result = arr.map(function (subArr) {
53
+ if (Array.isArray(subArr)) {
54
+ return subArr.join('_');
55
+ }
56
+ return subArr;
57
+ });
58
+ return result;
59
+ };
60
+ /** 计算响应式参数的值 */
61
+ var getReactiveProps = exports.getReactiveProps = function getReactiveProps(params) {
62
+ var form = params.form,
63
+ index = params.index,
64
+ namePath = params.namePath,
65
+ disabled = params.disabled,
66
+ show = params.show,
67
+ component = params.component,
68
+ fieldProps = params.fieldProps,
69
+ name = params.name;
70
+ var values = form.getFieldsValue(namePath || undefined);
71
+ var _disabled = (0, _lodash.isFunction)(disabled) ? disabled(values, {
72
+ form: form,
73
+ index: index,
74
+ namePath: namePath
75
+ }) : disabled;
76
+ var _show = (0, _lodash.isFunction)(show) ? show(values, {
77
+ form: form,
78
+ index: index,
79
+ namePath: namePath
80
+ }) : show;
81
+ var _component = (0, _lodash.isFunction)(component) ? component(values, {
82
+ form: form,
83
+ index: index,
84
+ namePath: namePath
85
+ }) : component;
86
+ var _fieldProps = (0, _lodash.isFunction)(fieldProps) ? fieldProps(values, {
87
+ form: form,
88
+ index: index,
89
+ namePath: namePath
90
+ }) : fieldProps;
91
+ return {
92
+ disabled: _disabled,
93
+ show: _show,
94
+ component: _component,
95
+ fieldProps: _fieldProps
96
+ };
97
+ };
98
+ /** 获取当前字段的转换函数 */
99
+ var getValueTypeTrans = exports.getValueTypeTrans = function getValueTypeTrans(params) {
100
+ var _valueTypeMap$valueTy;
101
+ var valueType = params.valueType;
102
+ var transform = (_valueTypeMap$valueTy = _valueType.default[valueType]) === null || _valueTypeMap$valueTy === void 0 ? void 0 : _valueTypeMap$valueTy.call(_valueType.default, params);
103
+ return transform;
104
+ };
105
+ /** 转换columns */
106
+ var transformColumns = exports.transformColumns = function transformColumns(params) {
107
+ var form = params.form,
108
+ columns = params.columns,
109
+ name = params.name,
110
+ names = params.names,
111
+ outerIndex = params.index,
112
+ namePath = params.namePath,
113
+ value = params.value,
114
+ internalChange = params.onChange;
115
+ return columns === null || columns === void 0 ? void 0 : columns.flatMap(function (column, index) {
116
+ var type = column.type,
117
+ valueType = column.valueType,
118
+ switchValue = column.switchValue,
119
+ toISOString = column.toISOString,
120
+ fieldProps = column.fieldProps,
121
+ getValueFromEvent = column.getValueFromEvent,
122
+ _column$valuePropName = column.valuePropName,
123
+ valuePropName = _column$valuePropName === void 0 ? 'value' : _column$valuePropName,
124
+ normalize = column.normalize,
125
+ disabled = column.disabled,
126
+ show = column.show,
127
+ component = column.component;
128
+ var _ref = fieldProps || {},
129
+ mode = _ref.mode,
130
+ onChange = _ref.onChange,
131
+ onFieldChange = _ref.onFieldChange,
132
+ comDisabled = _ref.disabled;
133
+ var _disabled = disabled !== null && disabled !== void 0 ? disabled : comDisabled;
134
+ var columnName = names ? names[index] : [].concat(name, index);
135
+ // 响应式字段
136
+ var reactiveProps = getReactiveProps({
137
+ form: form,
138
+ index: index,
139
+ type: type,
140
+ namePath: namePath,
141
+ disabled: _disabled,
142
+ show: show,
143
+ component: component,
144
+ fieldProps: fieldProps,
145
+ name: columnName
146
+ });
147
+ if (reactiveProps.show === false) return [];
148
+ var transform = getValueTypeTrans({
149
+ type: type,
150
+ valueType: valueType,
151
+ switchValue: switchValue,
152
+ toISOString: toISOString,
153
+ mode: mode
154
+ });
155
+ var newValue;
156
+ var handleChange = function handleChange() {
157
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
158
+ args[_key] = arguments[_key];
159
+ }
160
+ if (getValueFromEvent) {
161
+ newValue = getValueFromEvent.apply(void 0, args);
162
+ } else {
163
+ newValue = defaultGetValueFromEvent.apply(void 0, [valuePropName].concat(args));
164
+ }
165
+ if ((transform === null || transform === void 0 ? void 0 : transform.normalize) || normalize) {
166
+ var _transform$normalize;
167
+ // @ts-ignore
168
+ newValue = ((_transform$normalize = transform.normalize) === null || _transform$normalize === void 0 ? void 0 : _transform$normalize.call(transform, newValue)) || (normalize === null || normalize === void 0 ? void 0 : normalize(newValue));
169
+ }
170
+ internalChange === null || internalChange === void 0 ? void 0 : internalChange(newValue, args[1], index);
171
+ onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, args);
172
+ onFieldChange === null || onFieldChange === void 0 ? void 0 : onFieldChange(newValue, form.getFieldValue(namePath), {
173
+ index: outerIndex,
174
+ namePath: namePath,
175
+ form: form
176
+ });
177
+ };
178
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
179
+ name: columnName
180
+ }, reactiveProps), {}, {
181
+ fieldProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
182
+ onChange: handleChange,
183
+ value: value === null || value === void 0 ? void 0 : value[index]
184
+ })
185
+ });
186
+ });
187
+ };
@@ -15,7 +15,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  var _icons = require("@ant-design/icons");
17
17
  var _ahooks = require("ahooks");
18
- var _umi = require("umi");
19
18
  var _antd = require("antd");
20
19
  var _lodash = require("lodash");
21
20
  var _reactSvg = require("react-svg");
@@ -23,7 +22,7 @@ var _react = _interopRequireWildcard(require("react"));
23
22
  var _index = require("../../../../index");
24
23
  var _Container = _interopRequireDefault(require("../../Container"));
25
24
  var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
26
- var _useRequestList2 = _interopRequireDefault(require("./hooks/useRequestList"));
25
+ var _useRequestList3 = _interopRequireDefault(require("./hooks/useRequestList"));
27
26
  var _locale = _interopRequireDefault(require("../../../../locale"));
28
27
  var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "defaultOne"],
29
28
  _excluded2 = ["onOk"],
@@ -124,17 +123,22 @@ var ProModalSelect = function ProModalSelect(props, ref) {
124
123
  form = _Form$useForm2[0];
125
124
  var selectedRows = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || _selectedRows;
126
125
  var selectedRowKeys = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || _selectedRowKeys;
127
- var _useUmiRequest = (0, _umi.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
126
+ var _useRequestList = (0, _useRequestList3.default)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
127
+ withPagination: withPagination,
128
+ transformParams: transformParams,
129
+ transformResponse: transformResponse
130
+ }, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
128
131
  manual: true,
129
- onSuccess: function onSuccess(data) {
130
- var list = withPagination ? data === null || data === void 0 ? void 0 : data.list : data;
132
+ onSuccess: function onSuccess(res) {
133
+ var _res$data;
134
+ var list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
131
135
  setState({
132
136
  options: list
133
137
  });
134
138
  }
135
139
  })),
136
- run = _useUmiRequest.run;
137
- var _useRequestList = (0, _useRequestList2.default)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
140
+ run = _useRequestList.run;
141
+ var _useRequestList2 = (0, _useRequestList3.default)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
138
142
  withPagination: withPagination,
139
143
  transformParams: transformParams,
140
144
  transformResponse: transformResponse
@@ -142,13 +146,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
142
146
  manual: true,
143
147
  ready: ((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne) && !readOnly || visible
144
148
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
145
- data = _useRequestList.data,
146
- loading = _useRequestList.loading,
147
- pagination = _useRequestList.pagination,
148
- onSearch = _useRequestList.onSearch,
149
- onReset = _useRequestList.onReset,
150
- runAsync = _useRequestList.runAsync,
151
- mutate = _useRequestList.mutate;
149
+ data = _useRequestList2.data,
150
+ loading = _useRequestList2.loading,
151
+ pagination = _useRequestList2.pagination,
152
+ onSearch = _useRequestList2.onSearch,
153
+ onReset = _useRequestList2.onReset,
154
+ runAsync = _useRequestList2.runAsync,
155
+ mutate = _useRequestList2.mutate;
152
156
  var defaultOptionRender = function defaultOptionRender(rowData) {
153
157
  return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
154
158
  };
@@ -420,7 +424,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
420
424
  // 初始化回显,当传入initParams时,前端用来回险
421
425
  var getInitValues = /*#__PURE__*/function () {
422
426
  var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
423
- var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
427
+ var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data2, _data2, nextSelectRowKeys;
424
428
  return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
425
429
  while (1) switch (_context4.prev = _context4.next) {
426
430
  case 0:
@@ -449,7 +453,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
449
453
  if (transformResponse) {
450
454
  list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
451
455
  } else {
452
- list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
456
+ list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
453
457
  }
454
458
  _data2 = isMultiple ? list : (_list = list) === null || _list === void 0 ? void 0 : _list[0];
455
459
  if (_data2) {
@@ -486,7 +490,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
486
490
  var getDefaultOneValues = /*#__PURE__*/function () {
487
491
  var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
488
492
  var _useRequest$options4, _useRequest$options5;
489
- var queryBean, page, params, res, _list2, list, _res$data2, _data3, nextSelectRowKeys;
493
+ var queryBean, page, params, res, _list2, list, _res$data3, _data3, nextSelectRowKeys;
490
494
  return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
491
495
  while (1) switch (_context5.prev = _context5.next) {
492
496
  case 0:
@@ -508,7 +512,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
508
512
  if (transformResponse) {
509
513
  list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
510
514
  } else {
511
- list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
515
+ list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list : res === null || res === void 0 ? void 0 : res.data;
512
516
  }
513
517
  _data3 = isMultiple ? list : (_list2 = list) === null || _list2 === void 0 ? void 0 : _list2[0];
514
518
  nextSelectRowKeys = isMultiple ? value : [value];
@@ -667,7 +671,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
667
671
  // 没有值的时候,初始化点击默认查询前五十条
668
672
  if (!value && isInit || !(options === null || options === void 0 ? void 0 : options.length)) {
669
673
  var _useRequest$options9;
670
- var queryBean = useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams;
674
+ var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams) || {};
671
675
  var params = withPagination ? {
672
676
  pageNum: 1,
673
677
  pageSize: 50,
@@ -153,9 +153,9 @@ var Render = function Render(props) {
153
153
  Object.assign(otherFormItemProps, transforms, {
154
154
  names: otherProps.names
155
155
  }, internalRule, {
156
- required: typeof labelRequired === 'boolean' ? labelRequired : _required || (rules === null || rules === void 0 ? void 0 : rules.some(function (item) {
156
+ required: typeof labelRequired === 'boolean' ? labelRequired : _required || Array.isArray(rules) && (rules === null || rules === void 0 ? void 0 : rules.some(function (item) {
157
157
  return item === null || item === void 0 ? void 0 : item.required;
158
- }))
158
+ })) || false
159
159
  }, otherProps.isView && !requiredOnView ? {
160
160
  required: false
161
161
  } : null, (0, _objectSpread2.default)({}, (0, _index.isTrim)(type, trim, (0, _ProConfigProvider.useProConfig)())), // 优先取传进来的,其次取ProConfigProvider配置的
@@ -52,7 +52,7 @@ interface ControlProps {
52
52
  /**
53
53
  * 扩展函数的参数
54
54
  */
55
- type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
55
+ export type FunctionArgs<Values, R = any> = (value: any, record: any, { form, index, namePath, option, selectedOptions, dateString, }: {
56
56
  form: FormInstance<Values>;
57
57
  index?: number;
58
58
  namePath?: NamePath;
@@ -3,3 +3,17 @@ export declare const iconMap: {
3
3
  'text-cn': string;
4
4
  'text-en': string;
5
5
  }[];
6
+ export declare const themeMap: {
7
+ '#006AFF': string[];
8
+ '#00BC70': string[];
9
+ '#FF8C16': string[];
10
+ '#A00F20': string[];
11
+ '#31AF96': string[];
12
+ };
13
+ export declare const themeFillMap: {
14
+ '#006AFF': string[];
15
+ '#00BC70': string[];
16
+ '#FF8C16': string[];
17
+ '#A00F20': string[];
18
+ '#31AF96': string[];
19
+ };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.iconMap = void 0;
6
+ exports.themeMap = exports.themeFillMap = exports.iconMap = void 0;
7
7
  var iconMap = exports.iconMap = [{
8
8
  type: 'view',
9
9
  'text-cn': '查看',
@@ -260,4 +260,20 @@ var iconMap = exports.iconMap = [{
260
260
  type: 'tiaozhengxuhao',
261
261
  'text-cn': '调整序号',
262
262
  'text-en': 'adjust order'
263
- }];
263
+ }];
264
+ // 渐变色icon预设
265
+ var themeMap = exports.themeMap = {
266
+ '#006AFF': ['#ADDDFF', '#5FB3D8', '#4181FF'],
267
+ '#00BC70': ['#FFFFFF', '#54DFA7', '#00BC70'],
268
+ '#FF8C16': ['#FFFFFF', '#FFA74E', '#FF8C17'],
269
+ '#A00F20': ['#FFFFFF', '#E47B7B', '#A00E20'],
270
+ '#31AF96': ['#5FD8C7', '#5FD8C7', '#31AF96']
271
+ };
272
+ // 双色icon预设
273
+ var themeFillMap = exports.themeFillMap = {
274
+ '#006AFF': ['none', '#87F1FC', 'black', '#4181FF'],
275
+ '#00BC70': ['none', '#05FFEC', 'black', '#00BC70'],
276
+ '#FF8C16': ['none', '#FED736', 'black', '#FF8C17'],
277
+ '#A00F20': ['none', '#FD8357', 'black', '#A00E20'],
278
+ '#31AF96': ['none', '#BBF392', 'black', '#31AF96']
279
+ };