@guo514360255/antd-lib 1.4.36 → 1.5.0
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.
|
@@ -19,5 +19,5 @@ export interface CustomUploadProps {
|
|
|
19
19
|
};
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}
|
|
22
|
-
declare const CustomUpload: ({ value, onChange, isDragger, children,
|
|
22
|
+
declare const CustomUpload: ({ value, onChange, isDragger, children, ...rest }: CustomUploadProps) => JSX.Element;
|
|
23
23
|
export default CustomUpload;
|
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["value", "onChange", "isDragger", "children"
|
|
7
|
+
var _excluded = ["value", "onChange", "isDragger", "children"];
|
|
8
8
|
/*
|
|
9
9
|
* @Author: 郭郭
|
|
10
10
|
* @Date: 2025/9/15
|
|
@@ -21,8 +21,6 @@ var CustomUpload = function CustomUpload(_ref) {
|
|
|
21
21
|
onChange = _ref.onChange,
|
|
22
22
|
isDragger = _ref.isDragger,
|
|
23
23
|
children = _ref.children,
|
|
24
|
-
_ref$isCustomUpload = _ref.isCustomUpload,
|
|
25
|
-
isCustomUpload = _ref$isCustomUpload === void 0 ? false : _ref$isCustomUpload,
|
|
26
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
25
|
var props = (rest === null || rest === void 0 ? void 0 : rest.fieldProps) || rest;
|
|
28
26
|
var _useState = useState([]),
|
|
@@ -86,15 +84,15 @@ var CustomUpload = function CustomUpload(_ref) {
|
|
|
86
84
|
}
|
|
87
85
|
return _context2.abrupt("return");
|
|
88
86
|
case 3:
|
|
89
|
-
if (!(props && props.maxCount && value.length >= props.maxCount)) {
|
|
87
|
+
if (!(props !== null && props !== void 0 && props.maxCount && value.length >= (props === null || props === void 0 ? void 0 : props.maxCount))) {
|
|
90
88
|
_context2.next = 6;
|
|
91
89
|
break;
|
|
92
90
|
}
|
|
93
|
-
messageApi.warning("\u6700\u591A\u4E0A\u4F20".concat(props.maxCount, "\u4E2A\u6587\u4EF6"));
|
|
91
|
+
messageApi.warning("\u6700\u591A\u4E0A\u4F20".concat(props === null || props === void 0 ? void 0 : props.maxCount, "\u4E2A\u6587\u4EF6"));
|
|
94
92
|
return _context2.abrupt("return");
|
|
95
93
|
case 6:
|
|
96
94
|
_context2.prev = 6;
|
|
97
|
-
if (!isCustomUpload) {
|
|
95
|
+
if (!(props !== null && props !== void 0 && props.isCustomUpload)) {
|
|
98
96
|
formData = new FormData();
|
|
99
97
|
formData.append('file', file);
|
|
100
98
|
formData.append('biz', props === null || props === void 0 ? void 0 : props.biz);
|
|
@@ -105,7 +103,7 @@ var CustomUpload = function CustomUpload(_ref) {
|
|
|
105
103
|
break;
|
|
106
104
|
}
|
|
107
105
|
_context2.next = 12;
|
|
108
|
-
return request(!isCustomUpload ? formData : file);
|
|
106
|
+
return request(!(props !== null && props !== void 0 && props.isCustomUpload) ? formData : file);
|
|
109
107
|
case 12:
|
|
110
108
|
_yield$request = _context2.sent;
|
|
111
109
|
url = _yield$request.url;
|
package/dist/FormItem/index.d.ts
CHANGED
package/dist/FormItem/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
5
|
var _excluded = ["value", "onChange"];
|
|
4
6
|
/*
|
|
@@ -7,9 +9,12 @@ var _excluded = ["value", "onChange"];
|
|
|
7
9
|
* @Description:
|
|
8
10
|
*/
|
|
9
11
|
import { valueEnumTransform } from "../utils/util";
|
|
12
|
+
import { Editor, Toolbar } from '@wangeditor/editor-for-react';
|
|
13
|
+
import '@wangeditor/editor/dist/css/style.css';
|
|
10
14
|
import { Checkbox, ColorPicker, DatePicker, Input, InputNumber, Radio, Select, TreeSelect } from 'antd';
|
|
11
|
-
import React from 'react';
|
|
15
|
+
import React, { useState } from 'react';
|
|
12
16
|
var FormItem = function FormItem(_ref) {
|
|
17
|
+
var _rest$fieldProps, _rest$fieldProps2, _rest$fieldProps3;
|
|
13
18
|
var value = _ref.value,
|
|
14
19
|
_onChange = _ref.onChange,
|
|
15
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -24,9 +29,43 @@ var FormItem = function FormItem(_ref) {
|
|
|
24
29
|
color: ColorPicker,
|
|
25
30
|
date: DatePicker
|
|
26
31
|
};
|
|
32
|
+
var _useState = useState(null),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
editor = _useState2[0],
|
|
35
|
+
setEditor = _useState2[1];
|
|
36
|
+
var _useState3 = useState(value || ''),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
html = _useState4[0],
|
|
39
|
+
setHtml = _useState4[1];
|
|
27
40
|
var placeholder = rest.defaultPlaceholder || ['input', 'inputNumber', 'textArea'].includes(rest.type) ? '请输入' : '请选择';
|
|
28
41
|
var FieldComponent = comField[rest.type || 'input'];
|
|
29
|
-
|
|
42
|
+
var toolbarConfig = {};
|
|
43
|
+
var editorConfig = {
|
|
44
|
+
placeholder: '请输入内容...',
|
|
45
|
+
MENU_CONF: _objectSpread({}, (rest === null || rest === void 0 || (_rest$fieldProps = rest.fieldProps) === null || _rest$fieldProps === void 0 ? void 0 : _rest$fieldProps.editorConfig) || {})
|
|
46
|
+
};
|
|
47
|
+
return rest.type === 'editor' ? /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
style: {
|
|
49
|
+
border: '1px solid #cecece'
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Toolbar, _extends({
|
|
52
|
+
defaultConfig: toolbarConfig,
|
|
53
|
+
mode: "default",
|
|
54
|
+
editor: editor
|
|
55
|
+
}, (rest === null || rest === void 0 || (_rest$fieldProps2 = rest.fieldProps) === null || _rest$fieldProps2 === void 0 ? void 0 : _rest$fieldProps2.toolbar) || {})), /*#__PURE__*/React.createElement(Editor, _extends({
|
|
56
|
+
defaultConfig: editorConfig,
|
|
57
|
+
onCreated: setEditor,
|
|
58
|
+
mode: "default",
|
|
59
|
+
value: html,
|
|
60
|
+
onChange: function onChange(editor) {
|
|
61
|
+
var htmlText = editor.getHtml();
|
|
62
|
+
setHtml(htmlText);
|
|
63
|
+
_onChange === null || _onChange === void 0 || _onChange(htmlText);
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
height: '300px'
|
|
67
|
+
}
|
|
68
|
+
}, (rest === null || rest === void 0 || (_rest$fieldProps3 = rest.fieldProps) === null || _rest$fieldProps3 === void 0 ? void 0 : _rest$fieldProps3.editor) || {}))) : /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
30
69
|
value: value,
|
|
31
70
|
onChange: function onChange(e) {
|
|
32
71
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(['treeSelect', 'select', 'checkbox', 'color', 'date'].includes(rest.type) ? e : !rest.type || ['input', 'inputNumber'].includes(rest.type) ? e : e.target.value);
|
package/dist/compontent.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ interface CustomColumnProps extends ProColumns {
|
|
|
26
26
|
| 'color'
|
|
27
27
|
| 'date'
|
|
28
28
|
| 'tag'
|
|
29
|
+
| 'editor'
|
|
29
30
|
| 'list';
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -68,6 +69,11 @@ interface CustomColumnProps extends ProColumns {
|
|
|
68
69
|
*/
|
|
69
70
|
isCrop?: boolean;
|
|
70
71
|
|
|
72
|
+
/**
|
|
73
|
+
* 是否自定义上传
|
|
74
|
+
*/
|
|
75
|
+
isCustomUpload?: boolean;
|
|
76
|
+
|
|
71
77
|
[key: string]: any;
|
|
72
78
|
};
|
|
73
79
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guo514360255/antd-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "react design 5 lib",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.28.4",
|
|
49
|
+
"@wangeditor/editor": "^5.1.23",
|
|
50
|
+
"@wangeditor/editor-for-react": "^1.0.6",
|
|
49
51
|
"crypto-js": "^4.2.0",
|
|
50
52
|
"js-cookie": "^3.0.5",
|
|
51
53
|
"lodash": "^4.17.21",
|
|
@@ -53,14 +55,19 @@
|
|
|
53
55
|
"zustand": "^5.0.9"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
58
|
+
"@ant-design/icons": "^6.1.0",
|
|
59
|
+
"@ant-design/pro-components": "^2.8.10",
|
|
60
|
+
"@ant-design/pro-table": "^3.x",
|
|
56
61
|
"@commitlint/cli": "^17.1.2",
|
|
57
62
|
"@commitlint/config-conventional": "^17.1.0",
|
|
58
63
|
"@types/crypto-js": "^4.2.2",
|
|
59
64
|
"@types/js-cookie": "^3.0.6",
|
|
60
|
-
"@types/lodash": "^4.
|
|
65
|
+
"@types/lodash": "^4.14.191",
|
|
61
66
|
"@types/react": "18.2.0",
|
|
62
67
|
"@types/react-dom": "18.2.0",
|
|
63
68
|
"@umijs/lint": "^4.0.0",
|
|
69
|
+
"antd": "^5.x",
|
|
70
|
+
"antd-img-crop": "^4.27.0",
|
|
64
71
|
"dumi": "^2.4.13",
|
|
65
72
|
"eslint": "^8.23.0",
|
|
66
73
|
"father": "^4.1.0",
|