@zat-design/sisyphus-react 4.0.14 → 4.0.16
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.
- package/es/ProAction/propsType.d.ts +0 -1
- package/es/ProDownload/propsType.d.ts +0 -1
- package/es/ProEditLabel/propsType.d.ts +0 -5
- package/es/ProEnum/hooks/useEnum.d.ts +5 -5
- package/es/ProEnum/propsType.d.ts +2 -9
- package/es/ProEnum/utils/index.d.ts +3 -3
- package/es/ProForm/components/FormFooter/propsType.d.ts +0 -5
- package/es/ProForm/components/combination/Container/propsType.d.ts +0 -4
- package/es/ProForm/components/combination/FormList/propsType.d.ts +0 -8
- package/es/ProForm/components/combination/Group/propsType.d.ts +0 -5
- package/es/ProForm/components/combination/Group/utils/index.d.ts +14 -14
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +0 -5
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -4
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -6
- package/es/ProForm/components/combination/ProTimeLimit/index.js +1 -5
- package/es/ProForm/components/render/propsType.d.ts +10 -10
- package/es/ProForm/propsType.d.ts +0 -8
- package/es/ProForm/propsType.js +0 -4
- package/es/ProIcon/propsTypes.d.ts +0 -1
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +1 -3
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +0 -1
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +0 -4
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +1 -1
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +0 -1
- package/es/ProLayout/components/TabsManager/propTypes.js +1 -2
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +4 -1
- package/es/ProLayout/components/TabsManager/utils/index.js +7 -0
- package/es/ProLayout/propTypes.d.ts +0 -4
- package/es/ProLayout/propTypes.js +0 -2
- package/es/ProSelect/index.js +45 -7
- package/es/ProSelect/propsType.d.ts +0 -4
- package/es/ProTable/propsType.d.ts +0 -4
- package/es/ProTabs/components/Card/index.d.ts +2 -2
- package/es/ProTabs/propType.d.ts +0 -4
- package/es/ProThemeTools/propsType.d.ts +0 -2
- package/es/ProTooltip/propsType.d.ts +0 -1
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -2
- package/es/ProTree/propsType.d.ts +0 -2
- package/es/ProTreeModal/propsType.d.ts +0 -2
- package/es/ProUpload/propsType.d.ts +0 -5
- package/es/index.d.ts +14 -14
- package/es/index.js +27 -1
- package/lib/ProAction/propsType.d.ts +0 -1
- package/lib/ProDownload/propsType.d.ts +0 -1
- package/lib/ProEditLabel/propsType.d.ts +0 -5
- package/lib/ProEnum/hooks/useEnum.d.ts +5 -5
- package/lib/ProEnum/propsType.d.ts +2 -9
- package/lib/ProEnum/utils/index.d.ts +3 -3
- package/lib/ProForm/components/FormFooter/propsType.d.ts +0 -5
- package/lib/ProForm/components/combination/Container/propsType.d.ts +0 -4
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +0 -8
- package/lib/ProForm/components/combination/Group/propsType.d.ts +0 -5
- package/lib/ProForm/components/combination/Group/utils/index.d.ts +14 -14
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +0 -5
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -4
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -6
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +1 -4
- package/lib/ProForm/components/render/propsType.d.ts +10 -10
- package/lib/ProForm/propsType.d.ts +0 -8
- package/lib/ProForm/propsType.js +0 -4
- package/lib/ProIcon/propsTypes.d.ts +0 -1
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +1 -3
- package/lib/ProLayout/components/ProFooter/PropTypes.d.ts +0 -1
- package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +0 -4
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +1 -1
- package/lib/ProLayout/components/TabsManager/propTypes.d.ts +0 -1
- package/lib/ProLayout/components/TabsManager/propTypes.js +1 -2
- package/lib/ProLayout/components/TabsManager/utils/index.d.ts +4 -1
- package/lib/ProLayout/components/TabsManager/utils/index.js +7 -0
- package/lib/ProLayout/propTypes.d.ts +0 -4
- package/lib/ProLayout/propTypes.js +0 -2
- package/lib/ProSelect/index.js +45 -7
- package/lib/ProSelect/propsType.d.ts +0 -4
- package/lib/ProTable/propsType.d.ts +0 -4
- package/lib/ProTabs/components/Card/index.d.ts +2 -2
- package/lib/ProTabs/propType.d.ts +0 -4
- package/lib/ProThemeTools/propsType.d.ts +0 -2
- package/lib/ProTooltip/propsType.d.ts +0 -1
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +0 -2
- package/lib/ProTree/propsType.d.ts +0 -2
- package/lib/ProTreeModal/propsType.d.ts +0 -2
- package/lib/ProUpload/propsType.d.ts +0 -5
- package/lib/index.d.ts +14 -14
- package/package.json +1 -1
package/lib/ProSelect/index.js
CHANGED
|
@@ -32,7 +32,22 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
34
34
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
35
|
-
var Option = _antd.Select.Option
|
|
35
|
+
var Option = _antd.Select.Option,
|
|
36
|
+
OptGroup = _antd.Select.OptGroup;
|
|
37
|
+
|
|
38
|
+
/** 将 selectList(扁平或分组)转为扁平选项列表,用于查找、回显、defaultOne */
|
|
39
|
+
function flattenOptions(list) {
|
|
40
|
+
if (!Array.isArray(list) || !list.length) return [];
|
|
41
|
+
var out = [];
|
|
42
|
+
list.forEach(item => {
|
|
43
|
+
if (Array.isArray(item.options)) {
|
|
44
|
+
out.push(...item.options);
|
|
45
|
+
} else {
|
|
46
|
+
out.push(item);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
36
51
|
var ProSelect = (props, ref) => {
|
|
37
52
|
var _selectProps$showCode, _useRequest$options3, _locale$ProSelect;
|
|
38
53
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProSelect') || {},
|
|
@@ -132,16 +147,17 @@ var ProSelect = (props, ref) => {
|
|
|
132
147
|
}
|
|
133
148
|
}));
|
|
134
149
|
var cacheList = useRequest !== null && useRequest !== void 0 && (_useRequest$options3 = useRequest.options) !== null && _useRequest$options3 !== void 0 && _useRequest$options3.cacheKey ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
|
|
150
|
+
var flatOptions = flattenOptions(selectList);
|
|
135
151
|
var getValueObject = input => {
|
|
136
152
|
if (Array.isArray(input) && input.length) {
|
|
137
153
|
var resArr = [];
|
|
138
154
|
input.forEach(i => {
|
|
139
|
-
var res =
|
|
155
|
+
var res = flatOptions.find(item => item[code] === i);
|
|
140
156
|
if (res) resArr.push(res);
|
|
141
157
|
});
|
|
142
158
|
return resArr;
|
|
143
159
|
}
|
|
144
|
-
return
|
|
160
|
+
return flatOptions.find(item => item[code] === input);
|
|
145
161
|
};
|
|
146
162
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
147
163
|
getValueObject,
|
|
@@ -187,11 +203,11 @@ var ProSelect = (props, ref) => {
|
|
|
187
203
|
}
|
|
188
204
|
}, [defaultOne, value, isDefaultOne, selectList, code, onChange]);
|
|
189
205
|
var transToLabel = value => {
|
|
190
|
-
if (!
|
|
206
|
+
if (!flatOptions.length) {
|
|
191
207
|
return viewEmpty;
|
|
192
208
|
}
|
|
193
209
|
var labelList = value.map(v => {
|
|
194
|
-
var option =
|
|
210
|
+
var option = flatOptions.find(item => {
|
|
195
211
|
if (labelInValue) {
|
|
196
212
|
return item[code] === v[code];
|
|
197
213
|
}
|
|
@@ -203,7 +219,7 @@ var ProSelect = (props, ref) => {
|
|
|
203
219
|
return '-';
|
|
204
220
|
});
|
|
205
221
|
var record = value.map(v => {
|
|
206
|
-
return
|
|
222
|
+
return flatOptions.find(item => {
|
|
207
223
|
if (labelInValue) {
|
|
208
224
|
return item[code] === v[code];
|
|
209
225
|
}
|
|
@@ -302,7 +318,7 @@ var ProSelect = (props, ref) => {
|
|
|
302
318
|
}
|
|
303
319
|
// 只有当 dataSource 只有一个值时才默认回填(只返回值,不进行状态更新)
|
|
304
320
|
if (defaultOne && !value && !isDefaultOne && (selectList === null || selectList === void 0 ? void 0 : selectList.length) === 1) {
|
|
305
|
-
var option =
|
|
321
|
+
var option = flatOptions[0];
|
|
306
322
|
// selectList 可能是异步回来的值
|
|
307
323
|
if (option) {
|
|
308
324
|
return option === null || option === void 0 ? void 0 : option[code];
|
|
@@ -336,6 +352,7 @@ var ProSelect = (props, ref) => {
|
|
|
336
352
|
showSearch: true,
|
|
337
353
|
filterOption: (0, _lodash.isFunction)(_onSearch) ? false : (input, option) => {
|
|
338
354
|
var _option$children;
|
|
355
|
+
if ((option === null || option === void 0 ? void 0 : option.value) == null) return false;
|
|
339
356
|
var value = (0, _lodash.isString)(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 || (_option$children = option.children) === null || _option$children === void 0 || (_option$children = _option$children.props) === null || _option$children === void 0 ? void 0 : _option$children.title;
|
|
340
357
|
return value.toLowerCase().includes(input.toLowerCase());
|
|
341
358
|
},
|
|
@@ -351,6 +368,27 @@ var ProSelect = (props, ref) => {
|
|
|
351
368
|
var itemValue = item[code];
|
|
352
369
|
var itemKey = itemValue != null ? `${itemValue}-${index}` : `option-${index}`;
|
|
353
370
|
var optionValue = itemValue != null ? itemValue : undefined;
|
|
371
|
+
var groupOpts = item.options;
|
|
372
|
+
if (Array.isArray(groupOpts)) {
|
|
373
|
+
var _item$label;
|
|
374
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(OptGroup, {
|
|
375
|
+
label: item[label],
|
|
376
|
+
children: groupOpts.map(opt => /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
|
|
377
|
+
label: opt[label],
|
|
378
|
+
value: opt[code],
|
|
379
|
+
record: opt,
|
|
380
|
+
disabled: !!opt.disabled,
|
|
381
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TooltipOption, {
|
|
382
|
+
title: OptionRender ? OptionRender(opt) : selectProps.showCodeName ? `${opt[code]}-${opt[label]}` : opt[label],
|
|
383
|
+
children: OptionRender ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
384
|
+
children: OptionRender(opt)
|
|
385
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
386
|
+
children: selectProps.showCodeName ? `${opt[code]}-${opt[label]}` : opt[label]
|
|
387
|
+
})
|
|
388
|
+
})
|
|
389
|
+
}, opt[code]))
|
|
390
|
+
}, (_item$label = item[label]) !== null && _item$label !== void 0 ? _item$label : `group-${index}`);
|
|
391
|
+
}
|
|
354
392
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
|
|
355
393
|
label: item[label],
|
|
356
394
|
value: optionValue,
|
|
@@ -158,7 +158,3 @@ export interface ResponseDataType {
|
|
|
158
158
|
*/
|
|
159
159
|
code?: number;
|
|
160
160
|
}
|
|
161
|
-
export type DataOption = DataOptionType;
|
|
162
|
-
export type PropSelectProps = PropSelectType;
|
|
163
|
-
export type ProSelectAction = ProSelectActionType;
|
|
164
|
-
export type ResponseData = ResponseDataType;
|
|
@@ -754,8 +754,4 @@ export interface ProTableUseAntdTableType<I, R> {
|
|
|
754
754
|
allSelected: boolean;
|
|
755
755
|
[key: string]: any;
|
|
756
756
|
}
|
|
757
|
-
export type ProTableProps<T = any> = ProTableType<T>;
|
|
758
|
-
export type ProTableColumn = ProTableColumnType;
|
|
759
|
-
export type ProTableSummaryProps = ProTableSummaryType;
|
|
760
|
-
export type UseAntdTableState<I, R> = ProTableUseAntdTableType<I, R>;
|
|
761
757
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Card: (props:
|
|
1
|
+
import { CardType } from '../../propType';
|
|
2
|
+
declare const Card: (props: CardType) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Card;
|
|
@@ -92,7 +92,3 @@ export interface ProTabsType extends Omit<TabsProps, 'items' | 'onChange'> {
|
|
|
92
92
|
size?: 'small' | 'middle' | 'large';
|
|
93
93
|
[key: string]: any;
|
|
94
94
|
}
|
|
95
|
-
export type ProTabsProps = ProTabsType;
|
|
96
|
-
export type ProTabsItemsProps = ProTabsItemType;
|
|
97
|
-
export type ProTabsAction = ProTabsActionType;
|
|
98
|
-
export type CardProps = CardType;
|
|
@@ -262,8 +262,3 @@ export interface DraggableUploadListItemType {
|
|
|
262
262
|
*/
|
|
263
263
|
children: React.ReactNode;
|
|
264
264
|
}
|
|
265
|
-
export type UploadFileRes = UploadFileResType;
|
|
266
|
-
export type ExampleModalProps = ExampleModalType;
|
|
267
|
-
export type fieldNamesProps = FieldNamesType;
|
|
268
|
-
export type ProUploadProps = ProUploadType;
|
|
269
|
-
export type DraggableUploadListItemProps = DraggableUploadListItemType;
|
package/lib/index.d.ts
CHANGED
|
@@ -28,20 +28,20 @@ export * from './ProConfigProvider';
|
|
|
28
28
|
export * from './locale';
|
|
29
29
|
export { default as ProBackBtn } from './ProLayout/components/ProHeader/components/ProBackBtn';
|
|
30
30
|
export type { ProConfigProviderType } from './ProConfigProvider';
|
|
31
|
-
export type { ProFormType,
|
|
31
|
+
export type { ProFormType, ProFormColumnType } from './ProForm/propsType';
|
|
32
32
|
export type { ProFormComponentType } from './ProForm/components';
|
|
33
|
-
export type { ProTableType, ProTableColumnType, ProTableSummaryType, ProTableUseAntdTableType
|
|
34
|
-
export type { ProUploadType
|
|
35
|
-
export type { ProTabsType, ProTabsItemType
|
|
36
|
-
export type { BreadcrumbColumnType, SubDescribeColumnType, DescribeColumnType, ProHeaderType,
|
|
37
|
-
export type {
|
|
38
|
-
export type { ProTooltipType
|
|
39
|
-
export type { ProIconType
|
|
40
|
-
export type { ProTreeType, ProTreeSelectType
|
|
41
|
-
export type { ProTreeModalType, ProTreeModalActionType
|
|
42
|
-
export type { ProEditTableType, ProEditTableColumnType, ProEditTableSummaryColumnType, ProEditTableSummaryConfigType, ProEditTableActionType,
|
|
43
|
-
export type { ProStepType, ProStepContextType, ProStepItemType
|
|
44
|
-
export type { ProDrawerFormType
|
|
45
|
-
export type { ProModalSelectType, ProModalSelectConfigType
|
|
33
|
+
export type { ProTableType, ProTableColumnType, ProTableSummaryType, ProTableUseAntdTableType } from './ProTable/propsType';
|
|
34
|
+
export type { ProUploadType } from './ProUpload/propsType';
|
|
35
|
+
export type { ProTabsType, ProTabsItemType } from './ProTabs/propType';
|
|
36
|
+
export type { BreadcrumbColumnType, SubDescribeColumnType, DescribeColumnType, ProHeaderType, } from './ProLayout/components/ProHeader/PropTypes';
|
|
37
|
+
export type { ProLayoutType } from './ProLayout/propTypes';
|
|
38
|
+
export type { ProTooltipType } from './ProTooltip/propsType';
|
|
39
|
+
export type { ProIconType } from './ProIcon/propsTypes';
|
|
40
|
+
export type { ProTreeType, ProTreeSelectType } from './ProTree/propsType';
|
|
41
|
+
export type { ProTreeModalType, ProTreeModalActionType } from './ProTreeModal/propsType';
|
|
42
|
+
export type { ProEditTableType, ProEditTableColumnType, ProEditTableSummaryColumnType, ProEditTableSummaryConfigType, ProEditTableActionType, } from './ProEditTable/propsType';
|
|
43
|
+
export type { ProStepType, ProStepContextType, ProStepItemType } from './ProStep/propsType';
|
|
44
|
+
export type { ProDrawerFormType } from './ProDrawerForm/propsType';
|
|
45
|
+
export type { ProModalSelectType, ProModalSelectConfigType } from './ProForm/components/combination/ProModalSelect/propsType';
|
|
46
46
|
export type { ProStepTabType, ProStepTabResultType } from './ProStepTab/propsType';
|
|
47
47
|
export * from './tokens';
|