@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.
@@ -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 { useEffect } from 'react';
4
+ import { useLayoutEffect } from 'react';
5
5
 
6
6
  var InitSet = (function () {
7
7
  var _useFormContext = useFormContext(),
8
8
  form = _useFormContext.form;
9
- useEffect(function () {
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
@@ -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.useEffect(function () {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.33",
3
+ "version": "1.10.34-bate",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,14 +1,14 @@
1
1
  import { useFormContext } from "./Context";
2
- import { useEffect } from "react";
2
+ import {useLayoutEffect} from "react";
3
3
 
4
4
  export default () => {
5
5
  const { form } = useFormContext();
6
- useEffect(() => {
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
  };
@@ -92,7 +92,6 @@ export default ({
92
92
  {...props}
93
93
  form={hForm}
94
94
  onFinish={run}
95
- initialValues={initialValues}
96
95
  onValuesChange={valuesChange}
97
96
  style={requiredMode ? { paddingLeft: 10, ...style } : style}
98
97
  >
@@ -50,6 +50,7 @@ const Index: React.FC<HInputGroupProps> = ({
50
50
  }
51
51
  return "";
52
52
  }, [addonAfter, addonBefore]);
53
+
53
54
  return (
54
55
  <Input.Group compact className={`${contentClassname} ${className}`}>
55
56
  <Addon value={value} onChange={onChange}>
@@ -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 = {
@@ -108,7 +108,7 @@ export default () => {
108
108
  },
109
109
  {
110
110
  type:"richEditor",
111
- name:"1",
111
+ name:"richEditor",
112
112
  itemProps:{
113
113
 
114
114
  }
@@ -1,27 +1,13 @@
1
- import { Button, Input } from "antd";
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);