@hw-component/form 1.9.0 → 1.9.2
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/Form/config.js +2 -2
- package/es/Upload/UrlUpload/index.d.ts +6 -2
- package/es/Upload/UrlUpload/index.js +8 -1
- package/es/Upload/index.js +3 -2
- package/es/Upload/modal.d.ts +1 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/Upload/UrlUpload/index.d.ts +6 -2
- package/lib/Upload/UrlUpload/index.js +8 -1
- package/lib/Upload/index.js +3 -2
- package/lib/Upload/modal.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Upload/UrlUpload/index.tsx +7 -1
- package/src/components/Upload/index.tsx +2 -1
- package/src/components/Upload/modal.ts +1 -0
- package/src/components/index.tsx +1 -1
- package/src/pages/Upload/index.tsx +4 -0
package/es/Form/config.js
CHANGED
|
@@ -12,7 +12,7 @@ import HDatePicker from '../TDPicker/index.js';
|
|
|
12
12
|
import HRangePicker from '../TDPicker/RangePicker.js';
|
|
13
13
|
import HTimePicker from '../TDPicker/TimePicker.js';
|
|
14
14
|
import HUpload from '../Upload/index.js';
|
|
15
|
-
import
|
|
15
|
+
import HUrlUpload from '../Upload/UrlUpload/index.js';
|
|
16
16
|
import HSubmit from '../Submit/index.js';
|
|
17
17
|
import TextArea from '../TextArea/index.js';
|
|
18
18
|
import ColorInput from '../Input/ColorInput/index.js';
|
|
@@ -40,7 +40,7 @@ var componentConfig = {
|
|
|
40
40
|
timePicker: HTimePicker,
|
|
41
41
|
input: HInput,
|
|
42
42
|
upload: HUpload,
|
|
43
|
-
urlUpload:
|
|
43
|
+
urlUpload: HUrlUpload,
|
|
44
44
|
submit: HSubmit,
|
|
45
45
|
textArea: TextArea,
|
|
46
46
|
colorInput: ColorInput,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { IUrlUploadProps } from "../modal";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { HItemProps } from "@/components/Form/modal";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
Component: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, spaceSize, ...props }: IUrlUploadProps) => JSX.Element;
|
|
5
|
+
placeholder: ({ label }: HItemProps) => string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -157,6 +157,13 @@ var Index = function Index(_ref) {
|
|
|
157
157
|
})]
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
|
+
var HUrlUpload = {
|
|
161
|
+
Component: Index,
|
|
162
|
+
placeholder: function placeholder(_ref2) {
|
|
163
|
+
var label = _ref2.label;
|
|
164
|
+
return "\u8BF7\u8F93\u5165".concat(label, "\u6587\u4EF6\u5730\u5740");
|
|
165
|
+
}
|
|
166
|
+
};
|
|
160
167
|
|
|
161
|
-
export {
|
|
168
|
+
export { HUrlUpload as default };
|
|
162
169
|
// powered by hdj
|
package/es/Upload/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { Upload } from 'antd';
|
|
|
21
21
|
import Btn from './Btn.js';
|
|
22
22
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
23
23
|
|
|
24
|
-
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl"];
|
|
24
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn"];
|
|
25
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
26
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
27
|
var Index = function Index(_ref, ref) {
|
|
@@ -40,6 +40,7 @@ var Index = function Index(_ref, ref) {
|
|
|
40
40
|
maxSize = _ref.maxSize,
|
|
41
41
|
addFormat = _ref.addFormat,
|
|
42
42
|
thumbUrl = _ref.thumbUrl,
|
|
43
|
+
hideAddBtn = _ref.hideAddBtn,
|
|
43
44
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
45
|
var matchProps = useProps({
|
|
45
46
|
request: request,
|
|
@@ -131,7 +132,7 @@ var Index = function Index(_ref, ref) {
|
|
|
131
132
|
return false;
|
|
132
133
|
}
|
|
133
134
|
}, props), {}, {
|
|
134
|
-
children: jsx(Btn, {
|
|
135
|
+
children: hideAddBtn ? null : jsx(Btn, {
|
|
135
136
|
value: relVal,
|
|
136
137
|
maxCount: maxCount,
|
|
137
138
|
listType: listType
|
package/es/Upload/modal.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange"> {
|
|
|
17
17
|
maxSize?: number;
|
|
18
18
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
19
19
|
thumbUrl?: string;
|
|
20
|
+
hideAddBtn?: boolean;
|
|
20
21
|
}
|
|
21
22
|
export interface IMediaTypeEleProps {
|
|
22
23
|
file?: UploadFile;
|
package/es/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const HSelect: import("react").ForwardRefExoticComponent<import("
|
|
|
10
10
|
export declare const HInput: ({ copy, value, addonAfter, ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
11
11
|
export declare const HSelectInput: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
12
12
|
export declare const HUpload: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
13
|
-
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
13
|
+
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, spaceSize, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
14
14
|
export declare const HButtonInput: import("react").FC<import("./Input/modal").HButtonInputProps>;
|
|
15
15
|
export declare const HCheckBox: import("react").FC<import("./CheckboxGroup/modal").HCheckboxProps>;
|
|
16
16
|
export declare const HSwitch: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
package/es/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var HSelect = componentConfig.select;
|
|
|
14
14
|
var HInput = componentConfig.input;
|
|
15
15
|
var HSelectInput = componentConfig.selectInput;
|
|
16
16
|
var HUpload = componentConfig.upload;
|
|
17
|
-
var HUrlUpload = componentConfig.urlUpload;
|
|
17
|
+
var HUrlUpload = componentConfig.urlUpload.Component;
|
|
18
18
|
var HButtonInput = componentConfig.buttonInput;
|
|
19
19
|
var HCheckBox = componentConfig.checkBox;
|
|
20
20
|
var HSwitch = componentConfig.switch;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { IUrlUploadProps } from "../modal";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { HItemProps } from "@/components/Form/modal";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
Component: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, spaceSize, ...props }: IUrlUploadProps) => JSX.Element;
|
|
5
|
+
placeholder: ({ label }: HItemProps) => string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -160,6 +160,13 @@ var Index = function Index(_ref) {
|
|
|
160
160
|
})]
|
|
161
161
|
});
|
|
162
162
|
};
|
|
163
|
+
var HUrlUpload = {
|
|
164
|
+
Component: Index,
|
|
165
|
+
placeholder: function placeholder(_ref2) {
|
|
166
|
+
var label = _ref2.label;
|
|
167
|
+
return "\u8BF7\u8F93\u5165".concat(label, "\u6587\u4EF6\u5730\u5740");
|
|
168
|
+
}
|
|
169
|
+
};
|
|
163
170
|
|
|
164
|
-
exports.default =
|
|
171
|
+
exports.default = HUrlUpload;
|
|
165
172
|
// powered by h
|
package/lib/Upload/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var antd = require('antd');
|
|
|
24
24
|
var Btn = require('./Btn.js');
|
|
25
25
|
var HFormConnect = require('../Form/HFormConnect.js');
|
|
26
26
|
|
|
27
|
-
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl"];
|
|
27
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn"];
|
|
28
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
30
30
|
var Index = function Index(_ref, ref) {
|
|
@@ -43,6 +43,7 @@ var Index = function Index(_ref, ref) {
|
|
|
43
43
|
maxSize = _ref.maxSize,
|
|
44
44
|
addFormat = _ref.addFormat,
|
|
45
45
|
thumbUrl = _ref.thumbUrl,
|
|
46
|
+
hideAddBtn = _ref.hideAddBtn,
|
|
46
47
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
47
48
|
var matchProps = propsMaker.useProps({
|
|
48
49
|
request: request,
|
|
@@ -134,7 +135,7 @@ var Index = function Index(_ref, ref) {
|
|
|
134
135
|
return false;
|
|
135
136
|
}
|
|
136
137
|
}, props), {}, {
|
|
137
|
-
children: jsxRuntime.jsx(Btn.default, {
|
|
138
|
+
children: hideAddBtn ? null : jsxRuntime.jsx(Btn.default, {
|
|
138
139
|
value: relVal,
|
|
139
140
|
maxCount: maxCount,
|
|
140
141
|
listType: listType
|
package/lib/Upload/modal.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange"> {
|
|
|
17
17
|
maxSize?: number;
|
|
18
18
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
19
19
|
thumbUrl?: string;
|
|
20
|
+
hideAddBtn?: boolean;
|
|
20
21
|
}
|
|
21
22
|
export interface IMediaTypeEleProps {
|
|
22
23
|
file?: UploadFile;
|
package/lib/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const HSelect: import("react").ForwardRefExoticComponent<import("
|
|
|
10
10
|
export declare const HInput: ({ copy, value, addonAfter, ...props }: import("./Input/modal").HInputProps<any>) => JSX.Element;
|
|
11
11
|
export declare const HSelectInput: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
12
12
|
export declare const HUpload: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
13
|
-
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
13
|
+
export declare const HUrlUpload: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, spaceSize, ...props }: import("./Upload/modal").IUrlUploadProps) => JSX.Element;
|
|
14
14
|
export declare const HButtonInput: import("react").FC<import("./Input/modal").HButtonInputProps>;
|
|
15
15
|
export declare const HCheckBox: import("react").FC<import("./CheckboxGroup/modal").HCheckboxProps>;
|
|
16
16
|
export declare const HSwitch: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
package/lib/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var HSelect = config.default.select;
|
|
|
15
15
|
var HInput = config.default.input;
|
|
16
16
|
var HSelectInput = config.default.selectInput;
|
|
17
17
|
var HUpload = config.default.upload;
|
|
18
|
-
var HUrlUpload = config.default.urlUpload;
|
|
18
|
+
var HUrlUpload = config.default.urlUpload.Component;
|
|
19
19
|
var HButtonInput = config.default.buttonInput;
|
|
20
20
|
var HCheckBox = config.default.checkBox;
|
|
21
21
|
var HSwitch = config.default.switch;
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import TypeEle from "../MediaTypeEle/TypeEle";
|
|
|
6
6
|
import { useRef, useState } from "react";
|
|
7
7
|
import type { RcFile, UploadFile } from "antd/es/upload/interface";
|
|
8
8
|
import { useDefaultExFiles } from "./hooks";
|
|
9
|
+
import {HItemProps} from "@/components/Form/modal";
|
|
9
10
|
const { Text } = Typography;
|
|
10
11
|
const mkSubFileList = (fileList: UploadFile[], maxCount = 1) => {
|
|
11
12
|
const len = fileList.length;
|
|
@@ -116,4 +117,9 @@ const Index = ({
|
|
|
116
117
|
</Space>
|
|
117
118
|
);
|
|
118
119
|
};
|
|
119
|
-
export default
|
|
120
|
+
export default {
|
|
121
|
+
Component: Index,
|
|
122
|
+
placeholder: ({ label }: HItemProps) => {
|
|
123
|
+
return `请输入${label}文件地址`
|
|
124
|
+
},
|
|
125
|
+
};
|
|
@@ -26,6 +26,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
26
26
|
maxSize,
|
|
27
27
|
addFormat,
|
|
28
28
|
thumbUrl,
|
|
29
|
+
hideAddBtn,
|
|
29
30
|
...props
|
|
30
31
|
},
|
|
31
32
|
ref
|
|
@@ -114,7 +115,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
114
115
|
}}
|
|
115
116
|
{...props}
|
|
116
117
|
>
|
|
117
|
-
<Btn value={relVal} maxCount={maxCount} listType={listType} />
|
|
118
|
+
{hideAddBtn?null: <Btn value={relVal} maxCount={maxCount} listType={listType} />}
|
|
118
119
|
</Upload>
|
|
119
120
|
<Preview
|
|
120
121
|
visible={visible}
|
|
@@ -18,6 +18,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange"> {
|
|
|
18
18
|
maxSize?: number;
|
|
19
19
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
20
20
|
thumbUrl?: string;
|
|
21
|
+
hideAddBtn?:boolean;
|
|
21
22
|
}
|
|
22
23
|
export interface IMediaTypeEleProps {
|
|
23
24
|
file?: UploadFile;
|
package/src/components/index.tsx
CHANGED
|
@@ -14,7 +14,7 @@ export const HSelect = FormConfig.select;
|
|
|
14
14
|
export const HInput = FormConfig.input;
|
|
15
15
|
export const HSelectInput = FormConfig.selectInput;
|
|
16
16
|
export const HUpload = FormConfig.upload;
|
|
17
|
-
export const HUrlUpload = FormConfig.urlUpload;
|
|
17
|
+
export const HUrlUpload = FormConfig.urlUpload.Component;
|
|
18
18
|
export const HButtonInput = FormConfig.buttonInput;
|
|
19
19
|
export const HCheckBox = FormConfig.checkBox;
|
|
20
20
|
export const HSwitch = FormConfig.switch;
|
|
@@ -26,12 +26,16 @@ export default () => {
|
|
|
26
26
|
/>
|
|
27
27
|
<HUpload
|
|
28
28
|
value={files1}
|
|
29
|
+
hideAddBtn={false}
|
|
29
30
|
mediaType={MediaTypeEnum.file}
|
|
30
31
|
showUploadList={{
|
|
31
32
|
showPreviewIcon: false,
|
|
32
33
|
}}
|
|
33
34
|
onChange={setFiles1}
|
|
34
35
|
/>
|
|
36
|
+
<HUrlUpload
|
|
37
|
+
inputHelper="测试"
|
|
38
|
+
/>
|
|
35
39
|
</Space>
|
|
36
40
|
);
|
|
37
41
|
};
|