@pisell/materials 1.0.650 → 1.0.652
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +5 -5
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -15
- package/es/components/dataSourceComponents/dataSourceForm/group/index.js +12 -5
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +3 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +12 -26
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +2 -2
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.less +1 -0
- package/es/components/dataSourceComponents/fields/Upload/index.js +35 -1
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.js +11 -4
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +3 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +0 -11
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.less +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.js +25 -1
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useMemo, useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { Col, Row } from 'antd';
|
|
4
|
+
import { useSize } from "ahooks";
|
|
3
5
|
import useFormSetting from "../provider/hooks/useFormSetting";
|
|
4
6
|
import usePisellConfig from "../../../pisell-config-provider/hooks/usePisellConfig";
|
|
5
7
|
import "./index.less";
|
|
6
|
-
import { Col, Row } from 'antd';
|
|
7
8
|
/**
|
|
8
9
|
* @title: 表单分组组件
|
|
9
10
|
* @description: 用于在表单中划分分组,支持标题、描述、背景色等配置
|
|
@@ -19,6 +20,8 @@ var FormGroup = function FormGroup(props) {
|
|
|
19
20
|
showBackgroundColor = props.showBackgroundColor,
|
|
20
21
|
propsBackgroundColor = props.backgroundColor,
|
|
21
22
|
children = props.children;
|
|
23
|
+
var ref = useRef(null);
|
|
24
|
+
var size = useSize(ref);
|
|
22
25
|
var _useFormSetting = useFormSetting(),
|
|
23
26
|
formSettingGroupInfoPosition = _useFormSetting.groupInfoPosition;
|
|
24
27
|
var _usePisellConfig = usePisellConfig(),
|
|
@@ -27,8 +30,11 @@ var FormGroup = function FormGroup(props) {
|
|
|
27
30
|
// 根据平台判断分组信息位置 默认移动端为top
|
|
28
31
|
var groupInfoPosition = useMemo(function () {
|
|
29
32
|
var isMobile = platform === 'h5';
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
if (isMobile || ((size === null || size === void 0 ? void 0 : size.width) || 0) < 500) {
|
|
34
|
+
return 'top';
|
|
35
|
+
}
|
|
36
|
+
return formSettingGroupInfoPosition;
|
|
37
|
+
}, [platform, formSettingGroupInfoPosition, size === null || size === void 0 ? void 0 : size.width]);
|
|
32
38
|
|
|
33
39
|
// 根据配置决定背景色是否生效
|
|
34
40
|
var backgroundColor = showBackgroundColor ? propsBackgroundColor : undefined;
|
|
@@ -51,7 +57,8 @@ var FormGroup = function FormGroup(props) {
|
|
|
51
57
|
className: classNames('pisell-lowcode-data-source-form-group', {
|
|
52
58
|
'pisell-lowcode-data-source-form-group-top': groupInfoPosition === 'top',
|
|
53
59
|
'pisell-lowcode-data-source-form-group-side': groupInfoPosition === 'side'
|
|
54
|
-
})
|
|
60
|
+
}),
|
|
61
|
+
ref: ref
|
|
55
62
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
56
63
|
style: {
|
|
57
64
|
flex: 1
|
|
@@ -35,7 +35,7 @@ export declare const isValidDomain: (value: string) => boolean;
|
|
|
35
35
|
* @Date: 2024-11-23 17:14:25
|
|
36
36
|
*/
|
|
37
37
|
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>, overlayProps?: {
|
|
38
|
-
otherFormItemProps?: Record<string, any> | ((props: Record<string, any>) => Record<string, any>) | undefined;
|
|
38
|
+
otherFormItemProps?: Record<string, any> | ((props: Record<string, any>, others?: Record<string, any>) => Record<string, any>) | undefined;
|
|
39
39
|
innerProps?: Record<string, any> | undefined;
|
|
40
40
|
} | undefined) => React.FC<P & WithFormItemProps>;
|
|
41
41
|
export declare const withDataSource: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
@@ -359,7 +359,9 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
359
359
|
}, [hideLabel, propsLabelCol]);
|
|
360
360
|
var otherFormItemProps = useMemo(function () {
|
|
361
361
|
if (isFunction(overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.otherFormItemProps)) {
|
|
362
|
-
return overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.otherFormItemProps(otherProps
|
|
362
|
+
return overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.otherFormItemProps(otherProps, {
|
|
363
|
+
rules: rules
|
|
364
|
+
});
|
|
363
365
|
}
|
|
364
366
|
return (overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.otherFormItemProps) || {};
|
|
365
367
|
}, [overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.otherFormItemProps, otherProps]);
|
|
@@ -35,7 +35,7 @@ import useEngineContext from "../../../../hooks/useEngineContext";
|
|
|
35
35
|
import { getText } from "../../../../locales";
|
|
36
36
|
import { DEFAULT_MAX_COUNT, SUPPORTED_LANGUAGES } from "./constants";
|
|
37
37
|
import { useIsShop } from "../../hooks/usePlatform";
|
|
38
|
-
import { getPointSuffix,
|
|
38
|
+
import { getPointSuffix, getFileType, getMediaMetadata, getFileMetadataParams, getDefaultFileList, createMultilingualData, createMultilingualFileList, isValueEqual, getBaseTime } from "./utils";
|
|
39
39
|
import { uploadFile } from "./shopUploadServe";
|
|
40
40
|
|
|
41
41
|
// @ts-ignore
|
|
@@ -59,7 +59,6 @@ var BaseUpload = function BaseUpload(props) {
|
|
|
59
59
|
propsMediaUploadUrl = props.mediaUploadUrl,
|
|
60
60
|
propsGetHeaders = props.getHeaders,
|
|
61
61
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
62
|
-
console.log(typeMaxSizeMap, 'typeMaxSizeMap');
|
|
63
62
|
var isShop = useIsShop();
|
|
64
63
|
var _useState = useState([]),
|
|
65
64
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -314,7 +313,7 @@ var BaseUpload = function BaseUpload(props) {
|
|
|
314
313
|
}, []);
|
|
315
314
|
var beforeUpload = useCallback( /*#__PURE__*/function () {
|
|
316
315
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, newFileList) {
|
|
317
|
-
var currentFileCount, fileType, typeMaxSize, _maxSize, pointSuffix,
|
|
316
|
+
var currentFileCount, fileType, typeMaxSize, _maxSize, pointSuffix, metadata, cover, restMetadata;
|
|
318
317
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
319
318
|
while (1) switch (_context.prev = _context.next) {
|
|
320
319
|
case 0:
|
|
@@ -342,42 +341,29 @@ var BaseUpload = function BaseUpload(props) {
|
|
|
342
341
|
typeError.run(getText('pisell-upload-setting-type-error')(pointSuffix));
|
|
343
342
|
return _context.abrupt("return", Upload.LIST_IGNORE);
|
|
344
343
|
case 12:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
maxCount: maxCount || DEFAULT_MAX_COUNT,
|
|
348
|
-
valueLength: fileList.length + currentFileCount,
|
|
349
|
-
multiple: !!multiple
|
|
350
|
-
}), success = _checkFileCount.success, message = _checkFileCount.message;
|
|
351
|
-
if (success) {
|
|
352
|
-
_context.next = 16;
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
countError.run(message);
|
|
356
|
-
return _context.abrupt("return", Upload.LIST_IGNORE);
|
|
357
|
-
case 16:
|
|
358
|
-
_context.prev = 16;
|
|
359
|
-
_context.next = 19;
|
|
344
|
+
_context.prev = 12;
|
|
345
|
+
_context.next = 15;
|
|
360
346
|
return getMediaMetadata(file);
|
|
361
|
-
case
|
|
347
|
+
case 15:
|
|
362
348
|
metadata = _context.sent;
|
|
363
349
|
if (metadata) {
|
|
364
350
|
cover = metadata.cover, restMetadata = _objectWithoutProperties(metadata, _excluded2);
|
|
365
351
|
file.metadata = restMetadata;
|
|
366
352
|
file.cover = cover;
|
|
367
353
|
}
|
|
368
|
-
_context.next =
|
|
354
|
+
_context.next = 22;
|
|
369
355
|
break;
|
|
370
|
-
case
|
|
371
|
-
_context.prev =
|
|
372
|
-
_context.t0 = _context["catch"](
|
|
356
|
+
case 19:
|
|
357
|
+
_context.prev = 19;
|
|
358
|
+
_context.t0 = _context["catch"](12);
|
|
373
359
|
console.error('获取媒体元数据失败:', _context.t0);
|
|
374
|
-
case
|
|
360
|
+
case 22:
|
|
375
361
|
return _context.abrupt("return", file);
|
|
376
|
-
case
|
|
362
|
+
case 23:
|
|
377
363
|
case "end":
|
|
378
364
|
return _context.stop();
|
|
379
365
|
}
|
|
380
|
-
}, _callee, null, [[
|
|
366
|
+
}, _callee, null, [[12, 19]]);
|
|
381
367
|
}));
|
|
382
368
|
return function (_x2, _x3) {
|
|
383
369
|
return _ref3.apply(this, arguments);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { Image } from 'antd';
|
|
2
|
+
import { Image, Space } from 'antd';
|
|
3
3
|
import { isArr, isString } from '@pisell/utils';
|
|
4
4
|
import useTranslationOriginal from "../../../../hooks/useTranslationOriginal";
|
|
5
5
|
|
|
@@ -29,7 +29,7 @@ var UploadReadPretty = function UploadReadPretty(props) {
|
|
|
29
29
|
if (!normalizedValue.length) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
return /*#__PURE__*/React.createElement(
|
|
32
|
+
return /*#__PURE__*/React.createElement(Space, null, normalizedValue.map(function (item, index) {
|
|
33
33
|
return /*#__PURE__*/React.createElement(Image, {
|
|
34
34
|
key: "".concat(String(item), "-").concat(index),
|
|
35
35
|
className: "pisell-upload-read-pretty",
|
|
@@ -1,4 +1,38 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
1
7
|
import { withFormItem } from "../../dataSourceForm/utils";
|
|
2
8
|
import UploadWithMode from "./WithMode";
|
|
3
|
-
|
|
9
|
+
import { checkFileCount } from "./utils";
|
|
10
|
+
import { DEFAULT_MAX_COUNT } from "./constants";
|
|
11
|
+
var Upload = withFormItem(UploadWithMode, {
|
|
12
|
+
otherFormItemProps: function otherFormItemProps(props, others) {
|
|
13
|
+
var rule = {};
|
|
14
|
+
if (props.multiple) {
|
|
15
|
+
rule = {
|
|
16
|
+
validator: function validator(_, value) {
|
|
17
|
+
var _checkFileCount = checkFileCount({
|
|
18
|
+
minCount: props.minCount || 0,
|
|
19
|
+
maxCount: props.maxCount || DEFAULT_MAX_COUNT,
|
|
20
|
+
valueLength: value.length,
|
|
21
|
+
multiple: !!props.multiple
|
|
22
|
+
}),
|
|
23
|
+
success = _checkFileCount.success,
|
|
24
|
+
message = _checkFileCount.message;
|
|
25
|
+
if (!success) {
|
|
26
|
+
return Promise.reject(new Error(message));
|
|
27
|
+
} else {
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
rules: [].concat(_toConsumableArray((others === null || others === void 0 ? void 0 : others.rules) || []), [rule])
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
4
38
|
export default Upload;
|
|
@@ -34,10 +34,11 @@ __export(group_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(group_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_ahooks = require("ahooks");
|
|
37
39
|
var import_useFormSetting = __toESM(require("../provider/hooks/useFormSetting"));
|
|
38
40
|
var import_usePisellConfig = __toESM(require("../../../pisell-config-provider/hooks/usePisellConfig"));
|
|
39
41
|
var import_index = require("./index.less");
|
|
40
|
-
var import_antd = require("antd");
|
|
41
42
|
var FormGroup = (props) => {
|
|
42
43
|
const {
|
|
43
44
|
title,
|
|
@@ -48,12 +49,17 @@ var FormGroup = (props) => {
|
|
|
48
49
|
backgroundColor: propsBackgroundColor,
|
|
49
50
|
children
|
|
50
51
|
} = props;
|
|
52
|
+
const ref = (0, import_react.useRef)(null);
|
|
53
|
+
const size = (0, import_ahooks.useSize)(ref);
|
|
51
54
|
const { groupInfoPosition: formSettingGroupInfoPosition } = (0, import_useFormSetting.default)();
|
|
52
55
|
const { platform } = (0, import_usePisellConfig.default)();
|
|
53
56
|
const groupInfoPosition = (0, import_react.useMemo)(() => {
|
|
54
57
|
const isMobile = platform === "h5";
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
if (isMobile || ((size == null ? void 0 : size.width) || 0) < 500) {
|
|
59
|
+
return "top";
|
|
60
|
+
}
|
|
61
|
+
return formSettingGroupInfoPosition;
|
|
62
|
+
}, [platform, formSettingGroupInfoPosition, size == null ? void 0 : size.width]);
|
|
57
63
|
const backgroundColor = showBackgroundColor ? propsBackgroundColor : void 0;
|
|
58
64
|
const wrapperStyle = (0, import_react.useMemo)(() => {
|
|
59
65
|
return {
|
|
@@ -72,7 +78,8 @@ var FormGroup = (props) => {
|
|
|
72
78
|
className: (0, import_classnames.default)("pisell-lowcode-data-source-form-group", {
|
|
73
79
|
"pisell-lowcode-data-source-form-group-top": groupInfoPosition === "top",
|
|
74
80
|
"pisell-lowcode-data-source-form-group-side": groupInfoPosition === "side"
|
|
75
|
-
})
|
|
81
|
+
}),
|
|
82
|
+
ref
|
|
76
83
|
},
|
|
77
84
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { flex: 1 }, gutter: 16 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: groupInfoPosition === "top" ? 24 : 6 }, (propsShowTitle && title || propsShowDescription && description) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-data-source-form-group-info" }, propsShowTitle && title && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-data-source-form-group-title" }, title), propsShowDescription && description && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-data-source-form-group-description" }, description))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: groupInfoPosition === "top" ? 24 : 18 }, /* @__PURE__ */ import_react.default.createElement(
|
|
78
85
|
"div",
|
|
@@ -35,7 +35,7 @@ export declare const isValidDomain: (value: string) => boolean;
|
|
|
35
35
|
* @Date: 2024-11-23 17:14:25
|
|
36
36
|
*/
|
|
37
37
|
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>, overlayProps?: {
|
|
38
|
-
otherFormItemProps?: Record<string, any> | ((props: Record<string, any>) => Record<string, any>) | undefined;
|
|
38
|
+
otherFormItemProps?: Record<string, any> | ((props: Record<string, any>, others?: Record<string, any>) => Record<string, any>) | undefined;
|
|
39
39
|
innerProps?: Record<string, any> | undefined;
|
|
40
40
|
} | undefined) => React.FC<P & WithFormItemProps>;
|
|
41
41
|
export declare const withDataSource: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
@@ -420,7 +420,9 @@ var withFormItem = (WrappedComponent, overlayProps) => {
|
|
|
420
420
|
}, [hideLabel, propsLabelCol]);
|
|
421
421
|
const otherFormItemProps = (0, import_react.useMemo)(() => {
|
|
422
422
|
if ((0, import_utils.isFunction)(overlayProps == null ? void 0 : overlayProps.otherFormItemProps)) {
|
|
423
|
-
return overlayProps == null ? void 0 : overlayProps.otherFormItemProps(otherProps
|
|
423
|
+
return overlayProps == null ? void 0 : overlayProps.otherFormItemProps(otherProps, {
|
|
424
|
+
rules
|
|
425
|
+
});
|
|
424
426
|
}
|
|
425
427
|
return (overlayProps == null ? void 0 : overlayProps.otherFormItemProps) || {};
|
|
426
428
|
}, [overlayProps == null ? void 0 : overlayProps.otherFormItemProps, otherProps]);
|
|
@@ -69,7 +69,6 @@ var BaseUpload = (props) => {
|
|
|
69
69
|
getHeaders: propsGetHeaders,
|
|
70
70
|
...restProps
|
|
71
71
|
} = props;
|
|
72
|
-
console.log(typeMaxSizeMap, "typeMaxSizeMap");
|
|
73
72
|
const isShop = (0, import_usePlatform.useIsShop)();
|
|
74
73
|
const [fileList, setFileList] = (0, import_react.useState)([]);
|
|
75
74
|
const [previewImage, setPreviewImage] = (0, import_react.useState)("");
|
|
@@ -342,16 +341,6 @@ var BaseUpload = (props) => {
|
|
|
342
341
|
typeError.run((0, import_locales.getText)("pisell-upload-setting-type-error")(pointSuffix));
|
|
343
342
|
return import_antd.Upload.LIST_IGNORE;
|
|
344
343
|
}
|
|
345
|
-
const { success, message } = (0, import_utils2.checkFileCount)({
|
|
346
|
-
minCount: minCount || 0,
|
|
347
|
-
maxCount: maxCount || import_constants.DEFAULT_MAX_COUNT,
|
|
348
|
-
valueLength: fileList.length + currentFileCount,
|
|
349
|
-
multiple: !!multiple
|
|
350
|
-
});
|
|
351
|
-
if (!success) {
|
|
352
|
-
countError.run(message);
|
|
353
|
-
return import_antd.Upload.LIST_IGNORE;
|
|
354
|
-
}
|
|
355
344
|
try {
|
|
356
345
|
const metadata = await (0, import_utils2.getMediaMetadata)(file);
|
|
357
346
|
if (metadata) {
|
|
@@ -59,7 +59,7 @@ var UploadReadPretty = (props) => {
|
|
|
59
59
|
if (!normalizedValue.length) {
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, normalizedValue.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
63
63
|
import_antd.Image,
|
|
64
64
|
{
|
|
65
65
|
key: `${String(item)}-${index}`,
|
|
@@ -34,5 +34,29 @@ __export(Upload_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Upload_exports);
|
|
35
35
|
var import_utils = require("../../dataSourceForm/utils");
|
|
36
36
|
var import_WithMode = __toESM(require("./WithMode"));
|
|
37
|
-
var
|
|
37
|
+
var import_utils2 = require("./utils");
|
|
38
|
+
var import_constants = require("./constants");
|
|
39
|
+
var Upload = (0, import_utils.withFormItem)(import_WithMode.default, {
|
|
40
|
+
otherFormItemProps: (props, others) => {
|
|
41
|
+
let rule = {};
|
|
42
|
+
if (props.multiple) {
|
|
43
|
+
rule = {
|
|
44
|
+
validator(_, value) {
|
|
45
|
+
const { success, message } = (0, import_utils2.checkFileCount)({
|
|
46
|
+
minCount: props.minCount || 0,
|
|
47
|
+
maxCount: props.maxCount || import_constants.DEFAULT_MAX_COUNT,
|
|
48
|
+
valueLength: value.length,
|
|
49
|
+
multiple: !!props.multiple
|
|
50
|
+
});
|
|
51
|
+
if (!success) {
|
|
52
|
+
return Promise.reject(new Error(message));
|
|
53
|
+
} else {
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return { rules: [...(others == null ? void 0 : others.rules) || [], rule] };
|
|
60
|
+
}
|
|
61
|
+
});
|
|
38
62
|
var Upload_default = Upload;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.652",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
73
73
|
"react-window": "^1.8.10",
|
|
74
74
|
"styled-components": "^6.0.0-rc.3",
|
|
75
|
-
"@pisell/icon": "0.0.10",
|
|
76
75
|
"@pisell/date-picker": "1.0.115",
|
|
76
|
+
"@pisell/icon": "0.0.10",
|
|
77
77
|
"@pisell/utils": "1.0.43"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|