lu-lowcode-package-form 0.9.74 → 0.9.76
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/dist/index.cjs.js +3 -3
- package/dist/index.es.js +281 -279
- package/package.json +1 -1
- package/src/App.jsx +7 -1
- package/src/components/field/base.jsx +1 -1
- package/src/components/field/date-picker/index.jsx +18 -11
@@ -20,21 +20,28 @@ const DatePicker = ({ datetype, value, defaultNow, onChange, ...props }) => {
|
|
20
20
|
const [showTime, setShowTime] = useState(false)
|
21
21
|
const [needConfirm, setNeedConfirm] = useState(false)
|
22
22
|
const isChanged = useRef(false)
|
23
|
-
useEffect(() => {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
// useEffect(() => {
|
24
|
+
// // console.log(`${props?.__id} defaultNow `, defaultNow)
|
25
|
+
// // console.log(`${props?.__id} value `, value)
|
26
|
+
// // console.log(`${props?.__id} value type `, typeof value)
|
27
|
+
// if (defaultNow && !value && !isChanged.current) {
|
28
|
+
// const now = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
29
|
+
// typeof onChange == "function" && onChange(now)
|
30
|
+
// return
|
31
|
+
// }
|
32
|
+
// // if (value && typeof value === "string" && dayjs(value).isValid()) {
|
33
|
+
// // typeof onChange === "function" && onChange(dayjs(value))
|
34
|
+
// // return
|
35
|
+
// // }
|
36
|
+
// }, [value,onChange, format, picker])
|
37
|
+
|
38
|
+
useEffect(()=>{
|
39
|
+
if (defaultNow && !value) {
|
28
40
|
const now = dayjs().format("YYYY-MM-DD HH:mm:ss")
|
29
41
|
typeof onChange == "function" && onChange(now)
|
30
42
|
return
|
31
43
|
}
|
32
|
-
|
33
|
-
// typeof onChange === "function" && onChange(dayjs(value))
|
34
|
-
// return
|
35
|
-
// }
|
36
|
-
}, [value,onChange, format, picker])
|
37
|
-
|
44
|
+
},[])
|
38
45
|
const handleChange = (value, dateString) => {
|
39
46
|
isChanged.current = true
|
40
47
|
onChange(dateString)
|