@hw-component/form 1.10.33 → 1.10.34-bate
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/InitSet.js +2 -2
- package/es/Form/index.js +0 -1
- package/lib/Form/InitSet.js +1 -1
- package/lib/Form/index.js +0 -1
- package/package.json +1 -1
- package/src/components/Form/InitSet.tsx +3 -3
- package/src/components/Form/index.tsx +0 -1
- package/src/components/InputGroup/index.tsx +1 -0
- package/src/components/RichEditor/index.tsx +1 -1
- package/src/pages/Form/index.tsx +1 -1
- package/src/pages/ModalForm/index.tsx +3 -39
package/es/Form/InitSet.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useFormContext } from './Context/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { useLayoutEffect } from 'react';
|
|
5
5
|
|
|
6
6
|
var InitSet = (function () {
|
|
7
7
|
var _useFormContext = useFormContext(),
|
|
8
8
|
form = _useFormContext.form;
|
|
9
|
-
|
|
9
|
+
useLayoutEffect(function () {
|
|
10
10
|
form.initValues();
|
|
11
11
|
form.inited = true;
|
|
12
12
|
return function () {
|
package/es/Form/index.js
CHANGED
|
@@ -97,7 +97,6 @@ var HForm = (function (_ref) {
|
|
|
97
97
|
children: jsxs(Form, _objectSpread(_objectSpread({}, props), {}, {
|
|
98
98
|
form: hForm,
|
|
99
99
|
onFinish: run,
|
|
100
|
-
initialValues: initialValues,
|
|
101
100
|
onValuesChange: valuesChange,
|
|
102
101
|
style: requiredMode ? _objectSpread({
|
|
103
102
|
paddingLeft: 10
|
package/lib/Form/InitSet.js
CHANGED
|
@@ -9,7 +9,7 @@ var React = require('react');
|
|
|
9
9
|
var InitSet = (function () {
|
|
10
10
|
var _useFormContext = index.useFormContext(),
|
|
11
11
|
form = _useFormContext.form;
|
|
12
|
-
React.
|
|
12
|
+
React.useLayoutEffect(function () {
|
|
13
13
|
form.initValues();
|
|
14
14
|
form.inited = true;
|
|
15
15
|
return function () {
|
package/lib/Form/index.js
CHANGED
|
@@ -100,7 +100,6 @@ var HForm = (function (_ref) {
|
|
|
100
100
|
children: jsxRuntime.jsxs(antd.Form, _objectSpread(_objectSpread({}, props), {}, {
|
|
101
101
|
form: hForm,
|
|
102
102
|
onFinish: run,
|
|
103
|
-
initialValues: initialValues,
|
|
104
103
|
onValuesChange: valuesChange,
|
|
105
104
|
style: requiredMode ? _objectSpread({
|
|
106
105
|
paddingLeft: 10
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useFormContext } from "./Context";
|
|
2
|
-
import {
|
|
2
|
+
import {useLayoutEffect} from "react";
|
|
3
3
|
|
|
4
4
|
export default () => {
|
|
5
5
|
const { form } = useFormContext();
|
|
6
|
-
|
|
6
|
+
useLayoutEffect(()=>{
|
|
7
7
|
form.initValues();
|
|
8
8
|
form.inited = true;
|
|
9
9
|
return () => {
|
|
10
10
|
form.inited = false;
|
|
11
11
|
};
|
|
12
|
-
},
|
|
12
|
+
},[]);
|
|
13
13
|
return <></>;
|
|
14
14
|
};
|
|
@@ -4,7 +4,7 @@ import "braft-editor/dist/index.css";
|
|
|
4
4
|
import type { IHRichEditorProps } from "./modal";
|
|
5
5
|
import { useFocusClassname, useProps, useUploadFn, useVC } from "./hooks";
|
|
6
6
|
import { useClassName } from "../hooks";
|
|
7
|
-
import React from "react";
|
|
7
|
+
import React, {useEffect} from "react";
|
|
8
8
|
import HFormConnect from "../Form/HFormConnect";
|
|
9
9
|
|
|
10
10
|
const defaultContentStyle = {
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import { Button
|
|
1
|
+
import { Button } from "antd";
|
|
2
2
|
import {
|
|
3
3
|
HModalForm,
|
|
4
4
|
useHDialogForm,
|
|
5
5
|
HFormConfigProvider,
|
|
6
|
-
HUrlUpload,
|
|
7
6
|
} from "../../components";
|
|
8
|
-
import { useEffect, useState } from "react";
|
|
9
|
-
import { ShowParamsModal } from "@/components/DialogForm/modal";
|
|
10
7
|
|
|
11
|
-
const Test = (props) => {
|
|
12
|
-
return <HUrlUpload {...props} />;
|
|
13
|
-
};
|
|
14
|
-
const ITest = () => {
|
|
15
|
-
return (
|
|
16
|
-
<Input
|
|
17
|
-
onPressEnter={(e) => {
|
|
18
|
-
e.preventDefault();
|
|
19
|
-
console.log("ITest");
|
|
20
|
-
}}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
8
|
const data = [
|
|
9
|
+
{label:"name",name: "name"},
|
|
10
|
+
|
|
25
11
|
{
|
|
26
12
|
label: "输入框",
|
|
27
13
|
name: "inputNumberGroup",
|
|
@@ -36,25 +22,12 @@ const data = [
|
|
|
36
22
|
},
|
|
37
23
|
},
|
|
38
24
|
];
|
|
39
|
-
let num = 0;
|
|
40
|
-
const Test1 = ({ formNode }) => {
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
console.log("渲染");
|
|
43
|
-
}, []);
|
|
44
|
-
return (
|
|
45
|
-
<div>
|
|
46
|
-
<div>测试一些</div>
|
|
47
|
-
{formNode}
|
|
48
|
-
</div>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
25
|
export default () => {
|
|
52
26
|
const modalForm = useHDialogForm();
|
|
53
27
|
return (
|
|
54
28
|
<>
|
|
55
29
|
<Button
|
|
56
30
|
onClick={() => {
|
|
57
|
-
num++;
|
|
58
31
|
modalForm.show({});
|
|
59
32
|
}}
|
|
60
33
|
>
|
|
@@ -63,9 +36,6 @@ export default () => {
|
|
|
63
36
|
<Button
|
|
64
37
|
onClick={() => {
|
|
65
38
|
modalForm.show({
|
|
66
|
-
params: {
|
|
67
|
-
name: num,
|
|
68
|
-
},
|
|
69
39
|
initialValues: {
|
|
70
40
|
name: "name",
|
|
71
41
|
},
|
|
@@ -88,12 +58,6 @@ export default () => {
|
|
|
88
58
|
formItemStyle={{
|
|
89
59
|
marginBottom: 100,
|
|
90
60
|
}}
|
|
91
|
-
destroyOnClose={false}
|
|
92
|
-
autoClear={false}
|
|
93
|
-
onOk={() => {
|
|
94
|
-
console.log("fff");
|
|
95
|
-
return false;
|
|
96
|
-
}}
|
|
97
61
|
labelAlign={"left"}
|
|
98
62
|
request={(values, params) => {
|
|
99
63
|
console.log(values, params);
|