@fctc/widget-logic 4.4.9 → 4.5.0

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.js CHANGED
@@ -5421,14 +5421,9 @@ var many2oneFieldController = (props) => {
5421
5421
  );
5422
5422
  (0, import_react16.useEffect)(() => {
5423
5423
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
5424
- const parsedDomain = typeof newDomain === "string" ? JSON.parse(
5425
- newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
5426
- ) : newDomain;
5427
- setDomainObject((prev) => {
5428
- const prevStr = JSON.stringify(prev);
5429
- const nextStr = JSON.stringify(parsedDomain);
5430
- return prevStr === nextStr ? prev : parsedDomain;
5431
- });
5424
+ setDomainObject(
5425
+ (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
5426
+ );
5432
5427
  }, [domain, parsedFormValues]);
5433
5428
  (0, import_react16.useEffect)(() => {
5434
5429
  if (!propValue && tempSelectedOption) {
@@ -5558,6 +5553,10 @@ var many2oneFieldController = (props) => {
5558
5553
  const newValue = widget === MANY2ONE_EXTERNAL && optionsObject?.field_name ? selectedOption?.[optionsObject?.field_name] : selectedOption.value;
5559
5554
  if (widget === MANY2ONE_EXTERNAL && optionsObject?.values_included) {
5560
5555
  Object.keys(optionsObject?.values_included)?.forEach((field) => {
5556
+ console.log(
5557
+ "optionsObject?.values_included[field]?.name,",
5558
+ optionsObject?.values_included[field]?.name
5559
+ );
5561
5560
  methods?.setValue(
5562
5561
  optionsObject?.values_included[field]?.name,
5563
5562
  selectedOption?.[field],
package/dist/index.mjs CHANGED
@@ -5516,14 +5516,9 @@ var many2oneFieldController = (props) => {
5516
5516
  );
5517
5517
  useEffect10(() => {
5518
5518
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
5519
- const parsedDomain = typeof newDomain === "string" ? JSON.parse(
5520
- newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
5521
- ) : newDomain;
5522
- setDomainObject((prev) => {
5523
- const prevStr = JSON.stringify(prev);
5524
- const nextStr = JSON.stringify(parsedDomain);
5525
- return prevStr === nextStr ? prev : parsedDomain;
5526
- });
5519
+ setDomainObject(
5520
+ (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
5521
+ );
5527
5522
  }, [domain, parsedFormValues]);
5528
5523
  useEffect10(() => {
5529
5524
  if (!propValue && tempSelectedOption) {
@@ -5653,6 +5648,10 @@ var many2oneFieldController = (props) => {
5653
5648
  const newValue = widget === MANY2ONE_EXTERNAL && optionsObject?.field_name ? selectedOption?.[optionsObject?.field_name] : selectedOption.value;
5654
5649
  if (widget === MANY2ONE_EXTERNAL && optionsObject?.values_included) {
5655
5650
  Object.keys(optionsObject?.values_included)?.forEach((field) => {
5651
+ console.log(
5652
+ "optionsObject?.values_included[field]?.name,",
5653
+ optionsObject?.values_included[field]?.name
5654
+ );
5656
5655
  methods?.setValue(
5657
5656
  optionsObject?.values_included[field]?.name,
5658
5657
  selectedOption?.[field],
package/dist/widget.js CHANGED
@@ -4647,14 +4647,9 @@ var many2oneFieldController = (props) => {
4647
4647
  );
4648
4648
  (0, import_react16.useEffect)(() => {
4649
4649
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
4650
- const parsedDomain = typeof newDomain === "string" ? JSON.parse(
4651
- newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
4652
- ) : newDomain;
4653
- setDomainObject((prev) => {
4654
- const prevStr = JSON.stringify(prev);
4655
- const nextStr = JSON.stringify(parsedDomain);
4656
- return prevStr === nextStr ? prev : parsedDomain;
4657
- });
4650
+ setDomainObject(
4651
+ (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
4652
+ );
4658
4653
  }, [domain, parsedFormValues]);
4659
4654
  (0, import_react16.useEffect)(() => {
4660
4655
  if (!propValue && tempSelectedOption) {
@@ -4784,6 +4779,10 @@ var many2oneFieldController = (props) => {
4784
4779
  const newValue = widget === MANY2ONE_EXTERNAL && optionsObject?.field_name ? selectedOption?.[optionsObject?.field_name] : selectedOption.value;
4785
4780
  if (widget === MANY2ONE_EXTERNAL && optionsObject?.values_included) {
4786
4781
  Object.keys(optionsObject?.values_included)?.forEach((field) => {
4782
+ console.log(
4783
+ "optionsObject?.values_included[field]?.name,",
4784
+ optionsObject?.values_included[field]?.name
4785
+ );
4787
4786
  methods?.setValue(
4788
4787
  optionsObject?.values_included[field]?.name,
4789
4788
  selectedOption?.[field],
package/dist/widget.mjs CHANGED
@@ -4719,14 +4719,9 @@ var many2oneFieldController = (props) => {
4719
4719
  );
4720
4720
  useEffect10(() => {
4721
4721
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
4722
- const parsedDomain = typeof newDomain === "string" ? JSON.parse(
4723
- newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
4724
- ) : newDomain;
4725
- setDomainObject((prev) => {
4726
- const prevStr = JSON.stringify(prev);
4727
- const nextStr = JSON.stringify(parsedDomain);
4728
- return prevStr === nextStr ? prev : parsedDomain;
4729
- });
4722
+ setDomainObject(
4723
+ (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
4724
+ );
4730
4725
  }, [domain, parsedFormValues]);
4731
4726
  useEffect10(() => {
4732
4727
  if (!propValue && tempSelectedOption) {
@@ -4856,6 +4851,10 @@ var many2oneFieldController = (props) => {
4856
4851
  const newValue = widget === MANY2ONE_EXTERNAL && optionsObject?.field_name ? selectedOption?.[optionsObject?.field_name] : selectedOption.value;
4857
4852
  if (widget === MANY2ONE_EXTERNAL && optionsObject?.values_included) {
4858
4853
  Object.keys(optionsObject?.values_included)?.forEach((field) => {
4854
+ console.log(
4855
+ "optionsObject?.values_included[field]?.name,",
4856
+ optionsObject?.values_included[field]?.name
4857
+ );
4859
4858
  methods?.setValue(
4860
4859
  optionsObject?.values_included[field]?.name,
4861
4860
  selectedOption?.[field],
package/package.json CHANGED
@@ -1,94 +1,94 @@
1
- {
2
- "name": "@fctc/widget-logic",
3
- "version": "4.4.9",
4
- "types": "dist/index.d.ts",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.cjs"
12
- },
13
- "./hooks": {
14
- "types": "./dist/hooks.d.ts",
15
- "import": "./dist/hooks.mjs",
16
- "require": "./dist/hooks.cjs"
17
- },
18
- "./widget": {
19
- "types": "./dist/widget.d.ts",
20
- "import": "./dist/widget.mjs",
21
- "require": "./dist/widget.cjs"
22
- },
23
- "./icons": {
24
- "types": "./dist/icons.d.ts",
25
- "import": "./dist/icons.mjs",
26
- "require": "./dist/icons.cjs"
27
- },
28
- "./utils": {
29
- "types": "./dist/utils.d.ts",
30
- "import": "./dist/utils.mjs",
31
- "require": "./dist/utils.cjs"
32
- },
33
- "./store": {
34
- "types": "./dist/store.d.ts",
35
- "import": "./dist/store.mjs",
36
- "require": "./dist/store.cjs"
37
- },
38
- "./config": {
39
- "types": "./dist/config.d.ts",
40
- "import": "./dist/config.mjs",
41
- "require": "./dist/config.cjs"
42
- },
43
- "./constants": {
44
- "types": "./dist/constants.d.ts",
45
- "import": "./dist/constants.mjs",
46
- "require": "./dist/constants.cjs"
47
- },
48
- "./environment": {
49
- "types": "./dist/environment.d.ts",
50
- "import": "./dist/environment.mjs",
51
- "require": "./dist/environment.cjs"
52
- },
53
- "./provider": {
54
- "types": "./dist/provider.d.ts",
55
- "import": "./dist/provider.mjs",
56
- "require": "./dist/provider.cjs"
57
- },
58
- "./services": {
59
- "types": "./dist/services.d.ts",
60
- "import": "./dist/services.mjs",
61
- "require": "./dist/services.cjs"
62
- },
63
- "./types": {
64
- "types": "./dist/types.d.ts",
65
- "import": "./dist/types.mjs",
66
- "require": "./dist/types.cjs"
67
- }
68
- },
69
- "files": [
70
- "dist"
71
- ],
72
- "scripts": {
73
- "build": "tsup",
74
- "test": "jest"
75
- },
76
- "dependencies": {
77
- "@fctc/interface-logic": "^3.8.10",
78
- "@headlessui/react": "^2.2.6",
79
- "@tanstack/react-query": "^5.84.0",
80
- "i18next": "^25.3.2",
81
- "i18next-browser-languagedetector": "^8.2.0",
82
- "react-i18next": "^15.6.1",
83
- "react-tooltip": "^5.29.1"
84
- },
85
- "devDependencies": {
86
- "@types/react": "^18.3.1",
87
- "jest": "^29.7.0",
88
- "react": "18.0.0",
89
- "tsup": "^8.0.0",
90
- "typescript": "^5.8.2"
91
- },
92
- "packageManager": "yarn@1.22.0",
93
- "peerDependencies": {}
94
- }
1
+ {
2
+ "name": "@fctc/widget-logic",
3
+ "version": "4.5.0",
4
+ "types": "dist/index.d.ts",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.mjs",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./hooks": {
14
+ "types": "./dist/hooks.d.ts",
15
+ "import": "./dist/hooks.mjs",
16
+ "require": "./dist/hooks.cjs"
17
+ },
18
+ "./widget": {
19
+ "types": "./dist/widget.d.ts",
20
+ "import": "./dist/widget.mjs",
21
+ "require": "./dist/widget.cjs"
22
+ },
23
+ "./icons": {
24
+ "types": "./dist/icons.d.ts",
25
+ "import": "./dist/icons.mjs",
26
+ "require": "./dist/icons.cjs"
27
+ },
28
+ "./utils": {
29
+ "types": "./dist/utils.d.ts",
30
+ "import": "./dist/utils.mjs",
31
+ "require": "./dist/utils.cjs"
32
+ },
33
+ "./store": {
34
+ "types": "./dist/store.d.ts",
35
+ "import": "./dist/store.mjs",
36
+ "require": "./dist/store.cjs"
37
+ },
38
+ "./config": {
39
+ "types": "./dist/config.d.ts",
40
+ "import": "./dist/config.mjs",
41
+ "require": "./dist/config.cjs"
42
+ },
43
+ "./constants": {
44
+ "types": "./dist/constants.d.ts",
45
+ "import": "./dist/constants.mjs",
46
+ "require": "./dist/constants.cjs"
47
+ },
48
+ "./environment": {
49
+ "types": "./dist/environment.d.ts",
50
+ "import": "./dist/environment.mjs",
51
+ "require": "./dist/environment.cjs"
52
+ },
53
+ "./provider": {
54
+ "types": "./dist/provider.d.ts",
55
+ "import": "./dist/provider.mjs",
56
+ "require": "./dist/provider.cjs"
57
+ },
58
+ "./services": {
59
+ "types": "./dist/services.d.ts",
60
+ "import": "./dist/services.mjs",
61
+ "require": "./dist/services.cjs"
62
+ },
63
+ "./types": {
64
+ "types": "./dist/types.d.ts",
65
+ "import": "./dist/types.mjs",
66
+ "require": "./dist/types.cjs"
67
+ }
68
+ },
69
+ "files": [
70
+ "dist"
71
+ ],
72
+ "scripts": {
73
+ "build": "tsup",
74
+ "test": "jest"
75
+ },
76
+ "dependencies": {
77
+ "@fctc/interface-logic": "^3.9.0",
78
+ "@headlessui/react": "^2.2.6",
79
+ "@tanstack/react-query": "^5.84.0",
80
+ "i18next": "^25.3.2",
81
+ "i18next-browser-languagedetector": "^8.2.0",
82
+ "react-i18next": "^15.6.1",
83
+ "react-tooltip": "^5.29.1"
84
+ },
85
+ "devDependencies": {
86
+ "@types/react": "^18.3.1",
87
+ "jest": "^29.7.0",
88
+ "react": "18.0.0",
89
+ "tsup": "^8.0.0",
90
+ "typescript": "^5.8.2"
91
+ },
92
+ "packageManager": "yarn@1.22.0",
93
+ "peerDependencies": {}
94
+ }