@laser-ui/components 2.0.2 → 2.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## [2.0.3](https://github.com/laser-ui/laser-ui/compare/v2.0.2...v2.0.3) (2024-12-25)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **components:** fix form emit change ([37e7c2b](https://github.com/laser-ui/laser-ui/commit/37e7c2bb37d70190d4d86c021977bcf3cb936134))
10
+
5
11
  ## [2.0.2](https://github.com/laser-ui/laser-ui/compare/v2.0.1...v2.0.2) (2024-12-19)
6
12
 
7
13
  **Note:** Version bump only for package @laser-ui/components
package/form/FormItem.js CHANGED
@@ -43,7 +43,9 @@ export function FormItem(props) {
43
43
  throw new Error(`Cant find '${controlName}', please check if name exists!`);
44
44
  }
45
45
  formControl._emitChange = () => {
46
- formControl._emitChange = true;
46
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
47
+ formControl._emitChange = () => { };
48
+ formControl._emitChanged = true;
47
49
  };
48
50
  obj[controlName] = {
49
51
  control: formControl,
@@ -58,7 +60,7 @@ export function FormItem(props) {
58
60
  useEffect(() => {
59
61
  const clear = [];
60
62
  for (const { control } of Object.values(formControlProviders)) {
61
- if (control._emitChange === true) {
63
+ if (control._emitChanged === true) {
62
64
  forceUpdate();
63
65
  }
64
66
  control._emitChange = forceUpdate;
package/form/hooks.js CHANGED
@@ -40,7 +40,9 @@ export function useForm(initForm, deps) {
40
40
  const [form, setForm] = useState(() => {
41
41
  const form = initForm();
42
42
  form._emitChange = () => {
43
- form._emitChange = true;
43
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
44
+ form._emitChange = () => { };
45
+ form._emitChanged = true;
44
46
  };
45
47
  return form;
46
48
  });
@@ -58,7 +60,7 @@ export function useForm(initForm, deps) {
58
60
  forceUpdate();
59
61
  });
60
62
  useEffect(() => {
61
- if (form._emitChange === true) {
63
+ if (form._emitChanged === true) {
62
64
  forceUpdate();
63
65
  }
64
66
  form._emitChange = emitChange;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laser-ui/components",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "React components.",
5
5
  "keywords": [
6
6
  "ui",
@@ -37,5 +37,5 @@
37
37
  "access": "public",
38
38
  "directory": "../../dist/libs/components"
39
39
  },
40
- "gitHead": "b6947acf60a6162bb8dece6e9de0b1efd40b95f9"
40
+ "gitHead": "c7123f02baa424b48320c60861b29c7a55312ced"
41
41
  }