@fctc/widget-logic 4.4.4 → 4.4.6

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
@@ -5360,6 +5360,7 @@ var many2oneFieldController = (props) => {
5360
5360
  const [tempSelectedOption, setTempSelectedOption] = (0, import_react16.useState)(null);
5361
5361
  const [domainModal, setDomainModal] = (0, import_react16.useState)(null);
5362
5362
  const [domainObject, setDomainObject] = (0, import_react16.useState)(null);
5363
+ console.log("domainObject", domainObject, typeof domainObject);
5363
5364
  const initValue = methods?.getValues(name);
5364
5365
  const contextObject = {
5365
5366
  ...(typeof action?.context === "string" ? (0, utils_exports.evalJSONContext)(action?.context) : action?.context) || {},
@@ -5421,9 +5422,14 @@ var many2oneFieldController = (props) => {
5421
5422
  );
5422
5423
  (0, import_react16.useEffect)(() => {
5423
5424
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
5424
- setDomainObject(
5425
- (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
5426
- );
5425
+ const parsedDomain = typeof newDomain === "string" ? JSON.parse(
5426
+ newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
5427
+ ) : newDomain;
5428
+ setDomainObject((prev) => {
5429
+ const prevStr = JSON.stringify(prev);
5430
+ const nextStr = JSON.stringify(parsedDomain);
5431
+ return prevStr === nextStr ? prev : parsedDomain;
5432
+ });
5427
5433
  }, [domain, parsedFormValues]);
5428
5434
  (0, import_react16.useEffect)(() => {
5429
5435
  if (!propValue && tempSelectedOption) {
package/dist/index.mjs CHANGED
@@ -5455,6 +5455,7 @@ var many2oneFieldController = (props) => {
5455
5455
  const [tempSelectedOption, setTempSelectedOption] = useState7(null);
5456
5456
  const [domainModal, setDomainModal] = useState7(null);
5457
5457
  const [domainObject, setDomainObject] = useState7(null);
5458
+ console.log("domainObject", domainObject, typeof domainObject);
5458
5459
  const initValue = methods?.getValues(name);
5459
5460
  const contextObject = {
5460
5461
  ...(typeof action?.context === "string" ? (0, utils_exports.evalJSONContext)(action?.context) : action?.context) || {},
@@ -5516,9 +5517,14 @@ var many2oneFieldController = (props) => {
5516
5517
  );
5517
5518
  useEffect10(() => {
5518
5519
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
5519
- setDomainObject(
5520
- (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
5521
- );
5520
+ const parsedDomain = typeof newDomain === "string" ? JSON.parse(
5521
+ newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
5522
+ ) : newDomain;
5523
+ setDomainObject((prev) => {
5524
+ const prevStr = JSON.stringify(prev);
5525
+ const nextStr = JSON.stringify(parsedDomain);
5526
+ return prevStr === nextStr ? prev : parsedDomain;
5527
+ });
5522
5528
  }, [domain, parsedFormValues]);
5523
5529
  useEffect10(() => {
5524
5530
  if (!propValue && tempSelectedOption) {
package/dist/widget.js CHANGED
@@ -4586,6 +4586,7 @@ var many2oneFieldController = (props) => {
4586
4586
  const [tempSelectedOption, setTempSelectedOption] = (0, import_react16.useState)(null);
4587
4587
  const [domainModal, setDomainModal] = (0, import_react16.useState)(null);
4588
4588
  const [domainObject, setDomainObject] = (0, import_react16.useState)(null);
4589
+ console.log("domainObject", domainObject, typeof domainObject);
4589
4590
  const initValue = methods?.getValues(name);
4590
4591
  const contextObject = {
4591
4592
  ...(typeof action?.context === "string" ? (0, utils_exports.evalJSONContext)(action?.context) : action?.context) || {},
@@ -4647,9 +4648,14 @@ var many2oneFieldController = (props) => {
4647
4648
  );
4648
4649
  (0, import_react16.useEffect)(() => {
4649
4650
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
4650
- setDomainObject(
4651
- (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
4652
- );
4651
+ const parsedDomain = typeof newDomain === "string" ? JSON.parse(
4652
+ newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
4653
+ ) : newDomain;
4654
+ setDomainObject((prev) => {
4655
+ const prevStr = JSON.stringify(prev);
4656
+ const nextStr = JSON.stringify(parsedDomain);
4657
+ return prevStr === nextStr ? prev : parsedDomain;
4658
+ });
4653
4659
  }, [domain, parsedFormValues]);
4654
4660
  (0, import_react16.useEffect)(() => {
4655
4661
  if (!propValue && tempSelectedOption) {
package/dist/widget.mjs CHANGED
@@ -4658,6 +4658,7 @@ var many2oneFieldController = (props) => {
4658
4658
  const [tempSelectedOption, setTempSelectedOption] = useState7(null);
4659
4659
  const [domainModal, setDomainModal] = useState7(null);
4660
4660
  const [domainObject, setDomainObject] = useState7(null);
4661
+ console.log("domainObject", domainObject, typeof domainObject);
4661
4662
  const initValue = methods?.getValues(name);
4662
4663
  const contextObject = {
4663
4664
  ...(typeof action?.context === "string" ? (0, utils_exports.evalJSONContext)(action?.context) : action?.context) || {},
@@ -4719,9 +4720,14 @@ var many2oneFieldController = (props) => {
4719
4720
  );
4720
4721
  useEffect10(() => {
4721
4722
  const newDomain = (0, utils_exports.evalJSONDomain)(domain, parsedFormValues);
4722
- setDomainObject(
4723
- (prev) => JSON.stringify(prev) === JSON.stringify(newDomain) ? prev : newDomain
4724
- );
4723
+ const parsedDomain = typeof newDomain === "string" ? JSON.parse(
4724
+ newDomain.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"')
4725
+ ) : newDomain;
4726
+ setDomainObject((prev) => {
4727
+ const prevStr = JSON.stringify(prev);
4728
+ const nextStr = JSON.stringify(parsedDomain);
4729
+ return prevStr === nextStr ? prev : parsedDomain;
4730
+ });
4725
4731
  }, [domain, parsedFormValues]);
4726
4732
  useEffect10(() => {
4727
4733
  if (!propValue && tempSelectedOption) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/widget-logic",
3
- "version": "4.4.4",
3
+ "version": "4.4.6",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -74,7 +74,7 @@
74
74
  "test": "jest"
75
75
  },
76
76
  "dependencies": {
77
- "@fctc/interface-logic": "^3.8.4",
77
+ "@fctc/interface-logic": "^3.8.6",
78
78
  "@headlessui/react": "^2.2.6",
79
79
  "@tanstack/react-query": "^5.84.0",
80
80
  "i18next": "^25.3.2",