@djb25/digit-ui-module-vendor 1.0.67 → 1.0.68

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
@@ -9612,31 +9612,20 @@ const SelectEkycZones = _ref => {
9612
9612
  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);
9613
9613
  });
9614
9614
  }, [supervisorSearchResponse, loggedInUser]);
9615
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS("dl", "egov-location", ["TenantBoundary"]),
9616
- boundaryData = _Digit$Hooks$useCommo.data,
9615
+ const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS("dl", "common-masters", ["ZroOfficeList"]),
9616
+ zroData = _Digit$Hooks$useCommo.data,
9617
9617
  isLoading = _Digit$Hooks$useCommo.isLoading;
9618
9618
  React.useEffect(() => {
9619
- var _boundaryData$egovLo, _boundaryData$MdmsRes, _boundaryData$MdmsRes2;
9620
- 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) || [];
9621
- const zoneMap = {};
9622
- tenantBoundaryList.forEach(tb => {
9623
- const walkBoundary = node => {
9624
- if (!node) return;
9625
- if (node.label === "Zone" && node.code && node.code !== "UNKNOWN") {
9626
- if (!zoneMap[node.code]) {
9627
- zoneMap[node.code] = {
9628
- code: node.code,
9629
- name: node.name || node.code
9630
- };
9631
- }
9632
- }
9633
- (node.children || []).forEach(walkBoundary);
9634
- };
9635
- walkBoundary(tb.boundary);
9636
- });
9637
- const uniqueZones = Object.values(zoneMap).sort((a, b) => a.name.localeCompare(b.name));
9638
- setZones(uniqueZones);
9639
- }, [boundaryData]);
9619
+ var _zroData$commonMaste, _zroData$MdmsRes, _zroData$MdmsRes$comm;
9620
+ const zroOfficeList = (zroData === null || zroData === void 0 ? void 0 : (_zroData$commonMaste = zroData["common-masters"]) === null || _zroData$commonMaste === void 0 ? void 0 : _zroData$commonMaste.ZroOfficeList) || (zroData === null || zroData === void 0 ? void 0 : (_zroData$MdmsRes = zroData.MdmsRes) === null || _zroData$MdmsRes === void 0 ? void 0 : (_zroData$MdmsRes$comm = _zroData$MdmsRes["common-masters"]) === null || _zroData$MdmsRes$comm === void 0 ? void 0 : _zroData$MdmsRes$comm.ZroOfficeList) || [];
9621
+ if (Array.isArray(zroOfficeList)) {
9622
+ const activeZros = zroOfficeList.filter(zro => zro && zro.active).map(zro => ({
9623
+ code: zro.code,
9624
+ name: zro.code
9625
+ }));
9626
+ setZones(activeZros);
9627
+ }
9628
+ }, [zroData]);
9640
9629
  React.useEffect(() => {
9641
9630
  if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
9642
9631
  if (isMultiSelect) {
@@ -9645,10 +9634,7 @@ const SelectEkycZones = _ref => {
9645
9634
  setSelectedZones(formData.zoneIds.filter(Boolean));
9646
9635
  return;
9647
9636
  }
9648
- const selected = zones.filter(zone => zone && formData.zoneIds.some(id => {
9649
- var _zone$code, _zone$name;
9650
- 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()));
9651
- }));
9637
+ const selected = zones.filter(zone => zone && (formData.zoneIds.includes(zone.name) || formData.zoneIds.includes(zone.code)));
9652
9638
  setSelectedZones(selected);
9653
9639
  if (!initialized.current) {
9654
9640
  initialized.current = true;
@@ -9663,10 +9649,7 @@ const SelectEkycZones = _ref => {
9663
9649
  if (selectedVal && typeof selectedVal === "object") {
9664
9650
  selectedVal = selectedVal.name || selectedVal.code || "";
9665
9651
  }
9666
- const selected = zones.find(zone => {
9667
- var _zone$name2, _selectedVal, _zone$code2, _selectedVal2;
9668
- 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()));
9669
- });
9652
+ const selected = zones.find(zone => zone && (zone.name === selectedVal || zone.code === selectedVal));
9670
9653
  setSelectedZones(selected ? [selected] : []);
9671
9654
  if (!initialized.current && selected) {
9672
9655
  initialized.current = true;
@@ -9685,7 +9668,7 @@ const SelectEkycZones = _ref => {
9685
9668
  if (isMultiSelect) {
9686
9669
  const selected = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : [];
9687
9670
  setSelectedZones(selected);
9688
- onSelect(config.key, selected.map(z => z.name));
9671
+ onSelect(config.key, selected);
9689
9672
  } else {
9690
9673
  const selectedZone = Array.isArray(value) ? Array.isArray(value[0]) ? value[0][1] : value[0] : value;
9691
9674
  setSelectedZones(selectedZone ? [selectedZone] : []);
@@ -9717,10 +9700,10 @@ const SelectEkycZones = _ref => {
9717
9700
  disable: disable || isEkycSupervisor || ((_config$props = config.props) === null || _config$props === void 0 ? void 0 : _config$props.disable) || config.disable
9718
9701
  })), isMultiSelect && selectedZones.length > 0 && /*#__PURE__*/React__default.createElement("div", {
9719
9702
  className: "selected-zones"
9720
- }, selectedZones.filter(zone => zone && zone.name).map(zone => /*#__PURE__*/React__default.createElement("span", {
9703
+ }, selectedZones.filter(zone => zone && zone.code).map(zone => /*#__PURE__*/React__default.createElement("span", {
9721
9704
  key: zone.code,
9722
9705
  className: "selected-zone-chip"
9723
- }, zone.name))));
9706
+ }, t(zone.code)))));
9724
9707
  };
9725
9708
 
9726
9709
  const SelectEkycClusters = _ref => {