datastake-daf 0.6.516 → 0.6.518
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/components/index.js
CHANGED
|
@@ -37610,9 +37610,11 @@ const inputTypeComponent = {
|
|
|
37610
37610
|
drawTerritory: ({
|
|
37611
37611
|
formsValue,
|
|
37612
37612
|
name,
|
|
37613
|
-
addressData
|
|
37613
|
+
addressData,
|
|
37614
|
+
onValuesChange
|
|
37614
37615
|
}, {
|
|
37615
|
-
setFormValues
|
|
37616
|
+
setFormValues,
|
|
37617
|
+
form
|
|
37616
37618
|
}) => {
|
|
37617
37619
|
let search = formsValue.country;
|
|
37618
37620
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
@@ -37645,10 +37647,29 @@ const inputTypeComponent = {
|
|
|
37645
37647
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
37646
37648
|
value: formsValue[name],
|
|
37647
37649
|
onChange: val => {
|
|
37648
|
-
|
|
37649
|
-
|
|
37650
|
+
// Update form instance first
|
|
37651
|
+
if (form && typeof form.setFieldValue === 'function') {
|
|
37652
|
+
form.setFieldValue(name, val);
|
|
37653
|
+
}
|
|
37654
|
+
|
|
37655
|
+
// Get all current form values
|
|
37656
|
+
const allFormValues = form && typeof form.getFieldsValue === 'function' ? form.getFieldsValue(true) : formsValue;
|
|
37657
|
+
|
|
37658
|
+
// Create the updated values
|
|
37659
|
+
const updatedValues = {
|
|
37660
|
+
...allFormValues,
|
|
37650
37661
|
[name]: val
|
|
37651
|
-
}
|
|
37662
|
+
};
|
|
37663
|
+
|
|
37664
|
+
// Call onValuesChange with the change and all values
|
|
37665
|
+
if (typeof onValuesChange === 'function') {
|
|
37666
|
+
onValuesChange({
|
|
37667
|
+
[name]: val
|
|
37668
|
+
}, updatedValues);
|
|
37669
|
+
}
|
|
37670
|
+
|
|
37671
|
+
// Update React state
|
|
37672
|
+
setFormValues(updatedValues);
|
|
37652
37673
|
},
|
|
37653
37674
|
searchValue: search
|
|
37654
37675
|
});
|
package/package.json
CHANGED
|
@@ -435,7 +435,7 @@ export const inputTypeComponent = {
|
|
|
435
435
|
/>
|
|
436
436
|
);
|
|
437
437
|
},
|
|
438
|
-
drawTerritory: ({ formsValue, name, addressData }, { setFormValues }) => {
|
|
438
|
+
drawTerritory: ({ formsValue, name, addressData, onValuesChange }, { setFormValues, form }) => {
|
|
439
439
|
let search = formsValue.country;
|
|
440
440
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
441
441
|
if (addressData.address.country) {
|
|
@@ -470,10 +470,29 @@ export const inputTypeComponent = {
|
|
|
470
470
|
<PolygonSelector
|
|
471
471
|
value={formsValue[name]}
|
|
472
472
|
onChange={(val) => {
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
// Update form instance first
|
|
474
|
+
if (form && typeof form.setFieldValue === 'function') {
|
|
475
|
+
form.setFieldValue(name, val);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Get all current form values
|
|
479
|
+
const allFormValues = form && typeof form.getFieldsValue === 'function'
|
|
480
|
+
? form.getFieldsValue(true)
|
|
481
|
+
: formsValue;
|
|
482
|
+
|
|
483
|
+
// Create the updated values
|
|
484
|
+
const updatedValues = {
|
|
485
|
+
...allFormValues,
|
|
475
486
|
[name]: val,
|
|
476
|
-
}
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
// Call onValuesChange with the change and all values
|
|
490
|
+
if (typeof onValuesChange === 'function') {
|
|
491
|
+
onValuesChange({ [name]: val }, updatedValues);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// Update React state
|
|
495
|
+
setFormValues(updatedValues);
|
|
477
496
|
}}
|
|
478
497
|
searchValue={search}
|
|
479
498
|
/>
|