@hw-component/form 1.8.9 → 1.9.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.
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 Index$2 from '../Upload/UrlUpload/index.js';
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: Index$2,
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
- declare const Index: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, ...props }: IUrlUploadProps) => JSX.Element;
3
- export default Index;
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;
@@ -26,7 +26,7 @@ import TypeEle from '../MediaTypeEle/TypeEle.js';
26
26
  import { useState, useRef } from 'react';
27
27
  import { useDefaultExFiles } from './hooks.js';
28
28
 
29
- var _excluded = ["placeholder", "value", "onChange", "mediaType", "inputHelper", "style", "exFiles"];
29
+ var _excluded = ["placeholder", "value", "onChange", "mediaType", "inputHelper", "style", "exFiles", "spaceSize"];
30
30
  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; }
31
31
  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; }
32
32
  var Text = Typography.Text;
@@ -49,6 +49,8 @@ var Index = function Index(_ref) {
49
49
  _ref$style = _ref.style,
50
50
  style = _ref$style === void 0 ? {} : _ref$style,
51
51
  exFiles = _ref.exFiles,
52
+ _ref$spaceSize = _ref.spaceSize,
53
+ spaceSize = _ref$spaceSize === void 0 ? 6 : _ref$spaceSize,
52
54
  props = _objectWithoutProperties(_ref, _excluded);
53
55
  var maxCount = props.maxCount;
54
56
  var defaultExFiles = useDefaultExFiles({
@@ -126,7 +128,7 @@ var Index = function Index(_ref) {
126
128
  style: _objectSpread({
127
129
  width: "100%"
128
130
  }, style),
129
- size: "middle",
131
+ size: spaceSize,
130
132
  children: [jsx(Input, {
131
133
  placeholder: placeholder,
132
134
  onBlur: onBlur,
@@ -155,6 +157,13 @@ var Index = function Index(_ref) {
155
157
  })]
156
158
  });
157
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
+ };
158
167
 
159
- export { Index as default };
168
+ export { HUrlUpload as default };
160
169
  // powered by hdj
@@ -30,4 +30,5 @@ export interface IUrlUploadProps extends IUpLoadProps {
30
30
  placeholder?: string;
31
31
  mediaType?: MediaTypeEnum;
32
32
  inputHelper?: React.ReactNode;
33
+ spaceSize?: number;
33
34
  }
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
- declare const Index: ({ placeholder, value, onChange, mediaType, inputHelper, style, exFiles, ...props }: IUrlUploadProps) => JSX.Element;
3
- export default Index;
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;
@@ -29,7 +29,7 @@ var TypeEle = require('../MediaTypeEle/TypeEle.js');
29
29
  var React = require('react');
30
30
  var hooks = require('./hooks.js');
31
31
 
32
- var _excluded = ["placeholder", "value", "onChange", "mediaType", "inputHelper", "style", "exFiles"];
32
+ var _excluded = ["placeholder", "value", "onChange", "mediaType", "inputHelper", "style", "exFiles", "spaceSize"];
33
33
  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; }
34
34
  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; }
35
35
  var Text = antd.Typography.Text;
@@ -52,6 +52,8 @@ var Index = function Index(_ref) {
52
52
  _ref$style = _ref.style,
53
53
  style = _ref$style === void 0 ? {} : _ref$style,
54
54
  exFiles = _ref.exFiles,
55
+ _ref$spaceSize = _ref.spaceSize,
56
+ spaceSize = _ref$spaceSize === void 0 ? 6 : _ref$spaceSize,
55
57
  props = _objectWithoutProperties(_ref, _excluded);
56
58
  var maxCount = props.maxCount;
57
59
  var defaultExFiles = hooks.useDefaultExFiles({
@@ -129,7 +131,7 @@ var Index = function Index(_ref) {
129
131
  style: _objectSpread({
130
132
  width: "100%"
131
133
  }, style),
132
- size: "middle",
134
+ size: spaceSize,
133
135
  children: [jsxRuntime.jsx(Input, {
134
136
  placeholder: placeholder,
135
137
  onBlur: onBlur,
@@ -158,6 +160,13 @@ var Index = function Index(_ref) {
158
160
  })]
159
161
  });
160
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
+ };
161
170
 
162
- exports.default = Index;
171
+ exports.default = HUrlUpload;
163
172
  // powered by h
@@ -30,4 +30,5 @@ export interface IUrlUploadProps extends IUpLoadProps {
30
30
  placeholder?: string;
31
31
  mediaType?: MediaTypeEnum;
32
32
  inputHelper?: React.ReactNode;
33
+ spaceSize?: number;
33
34
  }
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.8.9",
3
+ "version": "1.9.1",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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;
@@ -23,6 +24,7 @@ const Index = ({
23
24
  inputHelper,
24
25
  style = {},
25
26
  exFiles,
27
+ spaceSize=6,
26
28
  ...props
27
29
  }: IUrlUploadProps) => {
28
30
  const { maxCount } = props;
@@ -89,7 +91,7 @@ const Index = ({
89
91
  <Space
90
92
  direction={"vertical"}
91
93
  style={{ width: "100%", ...style }}
92
- size={"middle"}
94
+ size={spaceSize}
93
95
  >
94
96
  <Input
95
97
  placeholder={placeholder}
@@ -115,4 +117,9 @@ const Index = ({
115
117
  </Space>
116
118
  );
117
119
  };
118
- export default Index;
120
+ export default {
121
+ Component: Index,
122
+ placeholder: ({ label }: HItemProps) => {
123
+ return `请输入${label}文件地址`
124
+ },
125
+ };
@@ -33,4 +33,5 @@ export interface IUrlUploadProps extends IUpLoadProps {
33
33
  placeholder?: string;
34
34
  mediaType?: MediaTypeEnum;
35
35
  inputHelper?: React.ReactNode;
36
+ spaceSize?:number
36
37
  }
@@ -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;
@@ -32,6 +32,9 @@ export default () => {
32
32
  }}
33
33
  onChange={setFiles1}
34
34
  />
35
+ <HUrlUpload
36
+ inputHelper="测试"
37
+ />
35
38
  </Space>
36
39
  );
37
40
  };