@hw-component/form 1.10.16 → 1.10.19
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/TDPicker/hooks.js +4 -2
- package/es/TDPicker/index.js +2 -3
- package/es/Text/index.js +1 -1
- package/lib/TDPicker/hooks.js +4 -2
- package/lib/TDPicker/index.js +2 -3
- package/lib/Text/index.js +1 -1
- package/package.json +1 -1
- package/src/components/TDPicker/hooks.ts +2 -2
- package/src/components/TDPicker/index.tsx +3 -3
- package/src/components/Text/index.tsx +1 -1
- package/src/pages/DatePicker/index.tsx +2 -3
- package/src/pages/Upload/index.tsx +5 -7
package/es/TDPicker/hooks.js
CHANGED
|
@@ -5,7 +5,8 @@ import moment from 'moment';
|
|
|
5
5
|
|
|
6
6
|
var useTimeVal = function useTimeVal(_ref) {
|
|
7
7
|
var value = _ref.value,
|
|
8
|
-
format = _ref.format
|
|
8
|
+
_ref$format = _ref.format,
|
|
9
|
+
format = _ref$format === void 0 ? "X" : _ref$format;
|
|
9
10
|
return useMemo(function () {
|
|
10
11
|
if (!value || !format) {
|
|
11
12
|
return value;
|
|
@@ -40,7 +41,8 @@ var timeProvider = function timeProvider(value, showTime, showSecond) {
|
|
|
40
41
|
return value;
|
|
41
42
|
};
|
|
42
43
|
var useTimeChange = function useTimeChange(_ref3) {
|
|
43
|
-
var format = _ref3.format,
|
|
44
|
+
var _ref3$format = _ref3.format,
|
|
45
|
+
format = _ref3$format === void 0 ? "X" : _ref3$format,
|
|
44
46
|
onChange = _ref3.onChange,
|
|
45
47
|
showTime = _ref3.showTime,
|
|
46
48
|
_ref3$showSecond = _ref3.showSecond,
|
package/es/TDPicker/index.js
CHANGED
|
@@ -17,8 +17,7 @@ var Index = function Index(_ref) {
|
|
|
17
17
|
onChange = _ref.onChange,
|
|
18
18
|
_ref$showTime = _ref.showTime,
|
|
19
19
|
showTime = _ref$showTime === void 0 ? true : _ref$showTime,
|
|
20
|
-
|
|
21
|
-
format = _ref$format === void 0 ? "X" : _ref$format,
|
|
20
|
+
format = _ref.format,
|
|
22
21
|
_disabledDate = _ref.disabledDate,
|
|
23
22
|
addFormat = _ref.addFormat,
|
|
24
23
|
_ref$style = _ref.style,
|
|
@@ -84,7 +83,7 @@ var Index = function Index(_ref) {
|
|
|
84
83
|
value: timeVal,
|
|
85
84
|
onChange: change,
|
|
86
85
|
showTime: propsShowTime,
|
|
87
|
-
format: pickerFormat,
|
|
86
|
+
format: format || pickerFormat,
|
|
88
87
|
style: {
|
|
89
88
|
flex: 1
|
|
90
89
|
},
|
package/es/Text/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var HText = (function (_ref) {
|
|
|
17
17
|
size = _ref$size === void 0 ? 0 : _ref$size,
|
|
18
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
var text = useMemo(function () {
|
|
20
|
-
if (typeof value === "undefined" || value === null) {
|
|
20
|
+
if (typeof value === "undefined" || value === null || (value === null || value === void 0 ? void 0 : value.trim()) === "") {
|
|
21
21
|
return "-";
|
|
22
22
|
}
|
|
23
23
|
return value;
|
package/lib/TDPicker/hooks.js
CHANGED
|
@@ -6,7 +6,8 @@ var moment = require('moment');
|
|
|
6
6
|
|
|
7
7
|
var useTimeVal = function useTimeVal(_ref) {
|
|
8
8
|
var value = _ref.value,
|
|
9
|
-
format = _ref.format
|
|
9
|
+
_ref$format = _ref.format,
|
|
10
|
+
format = _ref$format === void 0 ? "X" : _ref$format;
|
|
10
11
|
return React.useMemo(function () {
|
|
11
12
|
if (!value || !format) {
|
|
12
13
|
return value;
|
|
@@ -41,7 +42,8 @@ var timeProvider = function timeProvider(value, showTime, showSecond) {
|
|
|
41
42
|
return value;
|
|
42
43
|
};
|
|
43
44
|
var useTimeChange = function useTimeChange(_ref3) {
|
|
44
|
-
var format = _ref3.format,
|
|
45
|
+
var _ref3$format = _ref3.format,
|
|
46
|
+
format = _ref3$format === void 0 ? "X" : _ref3$format,
|
|
45
47
|
onChange = _ref3.onChange,
|
|
46
48
|
showTime = _ref3.showTime,
|
|
47
49
|
_ref3$showSecond = _ref3.showSecond,
|
package/lib/TDPicker/index.js
CHANGED
|
@@ -20,8 +20,7 @@ var Index = function Index(_ref) {
|
|
|
20
20
|
onChange = _ref.onChange,
|
|
21
21
|
_ref$showTime = _ref.showTime,
|
|
22
22
|
showTime = _ref$showTime === void 0 ? true : _ref$showTime,
|
|
23
|
-
|
|
24
|
-
format = _ref$format === void 0 ? "X" : _ref$format,
|
|
23
|
+
format = _ref.format,
|
|
25
24
|
_disabledDate = _ref.disabledDate,
|
|
26
25
|
addFormat = _ref.addFormat,
|
|
27
26
|
_ref$style = _ref.style,
|
|
@@ -87,7 +86,7 @@ var Index = function Index(_ref) {
|
|
|
87
86
|
value: timeVal,
|
|
88
87
|
onChange: change,
|
|
89
88
|
showTime: propsShowTime,
|
|
90
|
-
format: pickerFormat,
|
|
89
|
+
format: format || pickerFormat,
|
|
91
90
|
style: {
|
|
92
91
|
flex: 1
|
|
93
92
|
},
|
package/lib/Text/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var HText = (function (_ref) {
|
|
|
20
20
|
size = _ref$size === void 0 ? 0 : _ref$size,
|
|
21
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
var text = React.useMemo(function () {
|
|
23
|
-
if (typeof value === "undefined" || value === null) {
|
|
23
|
+
if (typeof value === "undefined" || value === null || (value === null || value === void 0 ? void 0 : value.trim()) === "") {
|
|
24
24
|
return "-";
|
|
25
25
|
}
|
|
26
26
|
return value;
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ interface UseTimeChangeParams {
|
|
|
22
22
|
showTime?: HDatePickerProps["showTime"];
|
|
23
23
|
showSecond?: boolean;
|
|
24
24
|
}
|
|
25
|
-
export const useTimeVal = ({ value, format }: UseTimeValParams) => {
|
|
25
|
+
export const useTimeVal = ({ value, format="X" }: UseTimeValParams) => {
|
|
26
26
|
return useMemo(() => {
|
|
27
27
|
if (!value || !format) {
|
|
28
28
|
return value;
|
|
@@ -60,7 +60,7 @@ const timeProvider = (
|
|
|
60
60
|
return value;
|
|
61
61
|
};
|
|
62
62
|
export const useTimeChange = ({
|
|
63
|
-
format,
|
|
63
|
+
format="X",
|
|
64
64
|
onChange,
|
|
65
65
|
showTime,
|
|
66
66
|
showSecond = true,
|
|
@@ -9,7 +9,7 @@ const Index: React.FC<HDatePickerProps> = ({
|
|
|
9
9
|
value,
|
|
10
10
|
onChange,
|
|
11
11
|
showTime = true,
|
|
12
|
-
format
|
|
12
|
+
format,
|
|
13
13
|
disabledDate,
|
|
14
14
|
addFormat,
|
|
15
15
|
style = { width: "100%" },
|
|
@@ -44,13 +44,13 @@ const Index: React.FC<HDatePickerProps> = ({
|
|
|
44
44
|
}
|
|
45
45
|
}, [showSecond, showTime]);
|
|
46
46
|
return (
|
|
47
|
-
<Input.Group compact style={{display:"flex",...style}}>
|
|
47
|
+
<Input.Group compact style={{display:"flex",...style}} >
|
|
48
48
|
{addonBefore? <div className={addonClassName}>{addonBefore}</div>:null}
|
|
49
49
|
<Picker
|
|
50
50
|
value={timeVal}
|
|
51
51
|
onChange={change}
|
|
52
52
|
showTime={propsShowTime}
|
|
53
|
-
format={pickerFormat}
|
|
53
|
+
format={format||pickerFormat}
|
|
54
54
|
style={{flex:1}}
|
|
55
55
|
showSecond={showSecond}
|
|
56
56
|
disabledDate={(currentDate) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Space } from "antd";
|
|
1
|
+
import { Space ,DatePicker} from "antd";
|
|
2
2
|
import {HDatePicker, HRangePicker, HTimePicker, HTimeRangePicker} from "../../components";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
export default () => {
|
|
@@ -12,9 +12,8 @@ export default () => {
|
|
|
12
12
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
13
13
|
<HDatePicker
|
|
14
14
|
value={timeVal1}
|
|
15
|
-
showTime
|
|
15
|
+
showTime={false}
|
|
16
16
|
addonBefore="你好"
|
|
17
|
-
addonAfter="我很好"
|
|
18
17
|
onChange={(val) => {
|
|
19
18
|
console.log(val);
|
|
20
19
|
setTimeVal1(val);
|
|
@@ -4,12 +4,15 @@ import React, { useState } from "react";
|
|
|
4
4
|
import { MediaTypeEnum } from "../../components/Upload/enums";
|
|
5
5
|
|
|
6
6
|
export default () => {
|
|
7
|
-
const [files, setFiles] = useState([]);
|
|
7
|
+
const [files, setFiles] = useState([{}]);
|
|
8
8
|
const [files1, setFiles1] = useState([]);
|
|
9
9
|
return (
|
|
10
10
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
11
11
|
<HUpload
|
|
12
12
|
value={files}
|
|
13
|
+
exFiles={["MP4"]}
|
|
14
|
+
thumbUrl={"https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641"}
|
|
15
|
+
onPreview={null}
|
|
13
16
|
request={() => {
|
|
14
17
|
return {
|
|
15
18
|
url: "https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641",
|
|
@@ -24,13 +27,8 @@ export default () => {
|
|
|
24
27
|
/>
|
|
25
28
|
<HUpload
|
|
26
29
|
value={files1}
|
|
27
|
-
|
|
30
|
+
thumbUrl={"https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641"}
|
|
28
31
|
mediaType={MediaTypeEnum.file}
|
|
29
|
-
listType={null}
|
|
30
|
-
onPreview={false}
|
|
31
|
-
showUploadList={{
|
|
32
|
-
showPreviewIcon: false,
|
|
33
|
-
}}
|
|
34
32
|
onChange={setFiles1}
|
|
35
33
|
>
|
|
36
34
|
<Button>按钮</Button>
|