@djb25/digit-ui-module-vendor 1.0.66 → 1.0.67
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 +34 -17
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +34 -17
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -9609,20 +9609,31 @@ const SelectEkycZones = _ref => {
|
|
|
9609
9609
|
return ((_s$id = s.id) === null || _s$id === void 0 ? void 0 : _s$id.toLowerCase()) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$uuid = loggedInUser.uuid) === null || _loggedInUser$uuid === void 0 ? void 0 : _loggedInUser$uuid.toLowerCase()) || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : (_s$owner$uuid = _s$owner.uuid) === null || _s$owner$uuid === void 0 ? void 0 : _s$owner$uuid.toLowerCase()) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$uuid2 = loggedInUser.uuid) === null || _loggedInUser$uuid2 === void 0 ? void 0 : _loggedInUser$uuid2.toLowerCase()) || ((_s$owner2 = s.owner) === null || _s$owner2 === void 0 ? void 0 : _s$owner2.mobileNumber) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || s.mobileNo === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber);
|
|
9610
9610
|
});
|
|
9611
9611
|
}, [supervisorSearchResponse, loggedInUser]);
|
|
9612
|
-
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS("dl", "
|
|
9613
|
-
|
|
9612
|
+
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS("dl", "egov-location", ["TenantBoundary"]),
|
|
9613
|
+
boundaryData = _Digit$Hooks$useCommo.data,
|
|
9614
9614
|
isLoading = _Digit$Hooks$useCommo.isLoading;
|
|
9615
9615
|
useEffect(() => {
|
|
9616
|
-
var
|
|
9617
|
-
const
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9616
|
+
var _boundaryData$egovLo, _boundaryData$MdmsRes, _boundaryData$MdmsRes2;
|
|
9617
|
+
const tenantBoundaryList = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : _boundaryData$egovLo.TenantBoundary) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : _boundaryData$MdmsRes2.TenantBoundary) || [];
|
|
9618
|
+
const zoneMap = {};
|
|
9619
|
+
tenantBoundaryList.forEach(tb => {
|
|
9620
|
+
const walkBoundary = node => {
|
|
9621
|
+
if (!node) return;
|
|
9622
|
+
if (node.label === "Zone" && node.code && node.code !== "UNKNOWN") {
|
|
9623
|
+
if (!zoneMap[node.code]) {
|
|
9624
|
+
zoneMap[node.code] = {
|
|
9625
|
+
code: node.code,
|
|
9626
|
+
name: node.name || node.code
|
|
9627
|
+
};
|
|
9628
|
+
}
|
|
9629
|
+
}
|
|
9630
|
+
(node.children || []).forEach(walkBoundary);
|
|
9631
|
+
};
|
|
9632
|
+
walkBoundary(tb.boundary);
|
|
9633
|
+
});
|
|
9634
|
+
const uniqueZones = Object.values(zoneMap).sort((a, b) => a.name.localeCompare(b.name));
|
|
9635
|
+
setZones(uniqueZones);
|
|
9636
|
+
}, [boundaryData]);
|
|
9626
9637
|
useEffect(() => {
|
|
9627
9638
|
if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
|
|
9628
9639
|
if (isMultiSelect) {
|
|
@@ -9631,7 +9642,10 @@ const SelectEkycZones = _ref => {
|
|
|
9631
9642
|
setSelectedZones(formData.zoneIds.filter(Boolean));
|
|
9632
9643
|
return;
|
|
9633
9644
|
}
|
|
9634
|
-
const selected = zones.filter(zone => zone &&
|
|
9645
|
+
const selected = zones.filter(zone => zone && formData.zoneIds.some(id => {
|
|
9646
|
+
var _zone$code, _zone$name;
|
|
9647
|
+
return id && (id.toString().toUpperCase() === ((_zone$code = zone.code) === null || _zone$code === void 0 ? void 0 : _zone$code.toUpperCase()) || id.toString().toUpperCase() === ((_zone$name = zone.name) === null || _zone$name === void 0 ? void 0 : _zone$name.toUpperCase()));
|
|
9648
|
+
}));
|
|
9635
9649
|
setSelectedZones(selected);
|
|
9636
9650
|
if (!initialized.current) {
|
|
9637
9651
|
initialized.current = true;
|
|
@@ -9646,7 +9660,10 @@ const SelectEkycZones = _ref => {
|
|
|
9646
9660
|
if (selectedVal && typeof selectedVal === "object") {
|
|
9647
9661
|
selectedVal = selectedVal.name || selectedVal.code || "";
|
|
9648
9662
|
}
|
|
9649
|
-
const selected = zones.find(zone =>
|
|
9663
|
+
const selected = zones.find(zone => {
|
|
9664
|
+
var _zone$name2, _selectedVal, _zone$code2, _selectedVal2;
|
|
9665
|
+
return zone && (((_zone$name2 = zone.name) === null || _zone$name2 === void 0 ? void 0 : _zone$name2.toUpperCase()) === ((_selectedVal = selectedVal) === null || _selectedVal === void 0 ? void 0 : _selectedVal.toString().toUpperCase()) || ((_zone$code2 = zone.code) === null || _zone$code2 === void 0 ? void 0 : _zone$code2.toUpperCase()) === ((_selectedVal2 = selectedVal) === null || _selectedVal2 === void 0 ? void 0 : _selectedVal2.toString().toUpperCase()));
|
|
9666
|
+
});
|
|
9650
9667
|
setSelectedZones(selected ? [selected] : []);
|
|
9651
9668
|
if (!initialized.current && selected) {
|
|
9652
9669
|
initialized.current = true;
|
|
@@ -9665,7 +9682,7 @@ const SelectEkycZones = _ref => {
|
|
|
9665
9682
|
if (isMultiSelect) {
|
|
9666
9683
|
const selected = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : [];
|
|
9667
9684
|
setSelectedZones(selected);
|
|
9668
|
-
onSelect(config.key, selected);
|
|
9685
|
+
onSelect(config.key, selected.map(z => z.name));
|
|
9669
9686
|
} else {
|
|
9670
9687
|
const selectedZone = Array.isArray(value) ? Array.isArray(value[0]) ? value[0][1] : value[0] : value;
|
|
9671
9688
|
setSelectedZones(selectedZone ? [selectedZone] : []);
|
|
@@ -9697,10 +9714,10 @@ const SelectEkycZones = _ref => {
|
|
|
9697
9714
|
disable: disable || isEkycSupervisor || ((_config$props = config.props) === null || _config$props === void 0 ? void 0 : _config$props.disable) || config.disable
|
|
9698
9715
|
})), isMultiSelect && selectedZones.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
9699
9716
|
className: "selected-zones"
|
|
9700
|
-
}, selectedZones.filter(zone => zone && zone.
|
|
9717
|
+
}, selectedZones.filter(zone => zone && zone.name).map(zone => /*#__PURE__*/React.createElement("span", {
|
|
9701
9718
|
key: zone.code,
|
|
9702
9719
|
className: "selected-zone-chip"
|
|
9703
|
-
},
|
|
9720
|
+
}, zone.name))));
|
|
9704
9721
|
};
|
|
9705
9722
|
|
|
9706
9723
|
const SelectEkycClusters = _ref => {
|