@hw-component/form 1.8.2 → 1.8.3

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/config.js CHANGED
@@ -4,6 +4,9 @@ import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
4
4
  import moment from 'moment';
5
5
  import { fileToBase64 } from './Upload/util.js';
6
6
 
7
+ var rangeStartDay = function rangeStartDay(day) {
8
+ return moment().subtract(day, "days").startOf("days");
9
+ };
7
10
  var baseConfig = {
8
11
  fieldNames: {
9
12
  label: "label",
@@ -26,9 +29,15 @@ var baseConfig = {
26
29
  }
27
30
  },
28
31
  dateRanges: {
29
- 最近三天: [moment().subtract(2, "days").startOf("days"), moment()],
30
- 最近七天: [moment().subtract(6, "days").startOf("days"), moment()],
31
- 最近三十天: [moment().subtract(29, "days").startOf("days"), moment()]
32
+ 最近三天: function 最近三天() {
33
+ return [rangeStartDay(2), moment()];
34
+ },
35
+ 最近七天: function 最近七天() {
36
+ return [rangeStartDay(6), moment()];
37
+ },
38
+ 最近三十天: function 最近三十天() {
39
+ return [rangeStartDay(29), moment()];
40
+ }
32
41
  },
33
42
  uploadProps: {
34
43
  exFiles: ["JPG", "PNG", "JPEG", "GIF"],
package/lib/config.js CHANGED
@@ -5,6 +5,9 @@ var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
5
5
  var moment = require('moment');
6
6
  var util = require('./Upload/util.js');
7
7
 
8
+ var rangeStartDay = function rangeStartDay(day) {
9
+ return moment().subtract(day, "days").startOf("days");
10
+ };
8
11
  var baseConfig = {
9
12
  fieldNames: {
10
13
  label: "label",
@@ -27,9 +30,15 @@ var baseConfig = {
27
30
  }
28
31
  },
29
32
  dateRanges: {
30
- 最近三天: [moment().subtract(2, "days").startOf("days"), moment()],
31
- 最近七天: [moment().subtract(6, "days").startOf("days"), moment()],
32
- 最近三十天: [moment().subtract(29, "days").startOf("days"), moment()]
33
+ 最近三天: function 最近三天() {
34
+ return [rangeStartDay(2), moment()];
35
+ },
36
+ 最近七天: function 最近七天() {
37
+ return [rangeStartDay(6), moment()];
38
+ },
39
+ 最近三十天: function 最近三十天() {
40
+ return [rangeStartDay(29), moment()];
41
+ }
33
42
  },
34
43
  uploadProps: {
35
44
  exFiles: ["JPG", "PNG", "JPEG", "GIF"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -3,7 +3,7 @@ import Input from "antd/es/input/Input";
3
3
  import Upload from "../index";
4
4
  import type { IUploadRefModal, IUrlUploadProps } from "../modal";
5
5
  import TypeEle from "../MediaTypeEle/TypeEle";
6
- import { useEffect, useRef, useState } from "react";
6
+ import { useRef, useState } from "react";
7
7
  import type { RcFile, UploadFile } from "antd/es/upload/interface";
8
8
  import { useDefaultExFiles } from "./hooks";
9
9
  const { Text } = Typography;
@@ -1,6 +1,9 @@
1
1
  import moment from "moment";
2
2
  import type { IFormConfigContextProps } from "./Form/modal";
3
3
  import { fileToBase64 } from "./Upload/util";
4
+ const rangeStartDay=(day:number)=>{
5
+ return moment().subtract(day, "days").startOf("days")
6
+ }
4
7
  export const baseConfig: IFormConfigContextProps = {
5
8
  fieldNames: {
6
9
  label: "label",
@@ -23,9 +26,15 @@ export const baseConfig: IFormConfigContextProps = {
23
26
  },
24
27
  },
25
28
  dateRanges: {
26
- 最近三天: [moment().subtract(2, "days").startOf("days"), moment()],
27
- 最近七天: [moment().subtract(6, "days").startOf("days"), moment()],
28
- 最近三十天: [moment().subtract(29, "days").startOf("days"), moment()],
29
+ 最近三天: ()=>{
30
+ return [rangeStartDay(2), moment()]
31
+ },
32
+ 最近七天: ()=>{
33
+ return [rangeStartDay(6),moment()]
34
+ },
35
+ 最近三十天:()=>{
36
+ return [rangeStartDay(29), moment()]
37
+ },
29
38
  },
30
39
  uploadProps: {
31
40
  exFiles: ["JPG", "PNG", "JPEG", "GIF"],
@@ -70,6 +70,11 @@ const formData = (options) => {
70
70
  name:"name",
71
71
  label:"输入框"
72
72
  },
73
+ {
74
+ name:"url",
75
+ type:"urlUpload",
76
+ label:"文本"
77
+ },
73
78
  ];
74
79
  };
75
80
  function Ttta({ form }) {
@@ -33,6 +33,10 @@ export default () => {
33
33
  }}
34
34
  isList
35
35
  />
36
+ <HSelect
37
+ value={1}
38
+ options={null}
39
+ />
36
40
  </Space>
37
41
  );
38
42
  };
@@ -24,13 +24,12 @@ export default () => {
24
24
  maxCount={3}
25
25
  maxSize={Number.MAX_SAFE_INTEGER}
26
26
  />
27
- <HUrlUpload
27
+ <HUpload
28
28
  value={files1}
29
29
  mediaType={MediaTypeEnum.file}
30
30
  showUploadList={{
31
31
  showPreviewIcon: false,
32
32
  }}
33
- exFiles={["TXT", "EXE"]}
34
33
  onChange={setFiles1}
35
34
  />
36
35
  </Space>