@hw-component/form 1.9.1 → 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.
@@ -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
@@ -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;
@@ -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
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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;
@@ -26,6 +26,7 @@ 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,