@djb25/digit-ui-module-ws 1.0.51 → 1.0.52

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.
@@ -9673,7 +9673,8 @@ const WSCalculation = _ref => {
9673
9673
  register = _useForm.register,
9674
9674
  errors = _useForm.formState.errors,
9675
9675
  watch = _useForm.watch,
9676
- setValue = _useForm.setValue;
9676
+ setValue = _useForm.setValue,
9677
+ reset = _useForm.reset;
9677
9678
  const tenantId = Digit.ULBService.getCurrentTenantId();
9678
9679
  const _useTranslation = useTranslation(),
9679
9680
  t = _useTranslation.t;
@@ -9864,7 +9865,7 @@ const WSCalculation = _ref => {
9864
9865
  });
9865
9866
  };
9866
9867
  const RenderCalculationDetails = _ref2 => {
9867
- var _data$Calculation, _calc$calculationDeta, _calc$calculationDeta2, _calc$calculationDeta3, _waterDemandDetail$co, _infraDetail$waterCom, _infraDetail$sewerCom, _infraDetail$grossIFC, _infraDetail$rebateAm, _infraDetail$netIFC;
9868
+ var _data$Calculation, _calc$calculationDeta, _calc$calculationDeta2, _calc$calculationDeta3, _waterDemandDetail$co, _waterDemandDetail$co2, _waterDemandDetail$co3, _waterDemandDetail$co4, _waterDemandDetail$co5, _waterDemandDetail$co6, _waterDemandDetail$co7, _waterDemandDetail$co8, _waterDemandDetail$co9, _waterDemandDetail$co0, _waterDemandDetail$co1, _waterDemandDetail$co10, _waterDemandDetail$co11, _waterDemandDetail$co12, _waterDemandDetail$co13, _waterDemandDetail$co14, _waterDemandDetail$co15, _waterDemandDetail$co16, _infraDetail$waterCom, _infraDetail$sewerCom, _infraDetail$grossIFC, _infraDetail$rebateAm, _infraDetail$netIFC;
9868
9869
  let data = _ref2.data;
9869
9870
  if (!data) return null;
9870
9871
  const calc = (_data$Calculation = data.Calculation) === null || _data$Calculation === void 0 ? void 0 : _data$Calculation[0];
@@ -9887,7 +9888,7 @@ const WSCalculation = _ref => {
9887
9888
  }, t("WS_PROPERTY_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9888
9889
  className: "ws-calc-property-box"
9889
9890
  }, /*#__PURE__*/React.createElement("div", {
9890
- className: "ws-calc-grid-3"
9891
+ className: "ws-calc-grid-4"
9891
9892
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9892
9893
  className: "ws-calc-label"
9893
9894
  }, t("WS_PROPERTY_TYPE")), /*#__PURE__*/React.createElement("div", {
@@ -9900,7 +9901,7 @@ const WSCalculation = _ref => {
9900
9901
  className: "ws-calc-label"
9901
9902
  }, t("WS_WATER_CONNECTION_USAGE_TYPE")), /*#__PURE__*/React.createElement("div", {
9902
9903
  className: "ws-calc-value"
9903
- }, propertyDetail.usageCategory || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9904
+ }, propertyDetail.waterConnectionUsageType || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9904
9905
  className: "ws-calc-label"
9905
9906
  }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9906
9907
  className: "ws-calc-pill"
@@ -9920,7 +9921,43 @@ const WSCalculation = _ref => {
9920
9921
  className: "ws-calc-label"
9921
9922
  }, t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
9922
9923
  className: "ws-calc-value"
9923
- }, ((_waterDemandDetail$co = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co === void 0 ? void 0 : _waterDemandDetail$co.built_up_area) || 0, " sq. m."))))), /*#__PURE__*/React.createElement("div", {
9924
+ }, ((_waterDemandDetail$co = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co === void 0 ? void 0 : _waterDemandDetail$co.built_up_area) || 0, " sq. m.")), (propertyDetail.coveredArea > 0 || ((_waterDemandDetail$co2 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co2 === void 0 ? void 0 : _waterDemandDetail$co2.covered_area) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9925
+ className: "ws-calc-label"
9926
+ }, t("WS_COVERED_AREA")), /*#__PURE__*/React.createElement("div", {
9927
+ className: "ws-calc-value"
9928
+ }, propertyDetail.coveredArea || ((_waterDemandDetail$co3 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co3 === void 0 ? void 0 : _waterDemandDetail$co3.covered_area), " sq. m.")), (propertyDetail.numberOfDwellingUnits > 0 || ((_waterDemandDetail$co4 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co4 === void 0 ? void 0 : _waterDemandDetail$co4.dwelling_units) > 0 || ((_waterDemandDetail$co5 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co5 === void 0 ? void 0 : _waterDemandDetail$co5.total_du) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9929
+ className: "ws-calc-label"
9930
+ }, t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
9931
+ className: "ws-calc-value"
9932
+ }, propertyDetail.numberOfDwellingUnits || ((_waterDemandDetail$co6 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co6 === void 0 ? void 0 : _waterDemandDetail$co6.dwelling_units) || ((_waterDemandDetail$co7 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co7 === void 0 ? void 0 : _waterDemandDetail$co7.total_du))), (propertyDetail.numberOfBeds > 0 || ((_waterDemandDetail$co8 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co8 === void 0 ? void 0 : _waterDemandDetail$co8.total_beds) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9933
+ className: "ws-calc-label"
9934
+ }, t("WS_NUMBER_OF_BEDS")), /*#__PURE__*/React.createElement("div", {
9935
+ className: "ws-calc-value"
9936
+ }, propertyDetail.numberOfBeds || ((_waterDemandDetail$co9 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co9 === void 0 ? void 0 : _waterDemandDetail$co9.total_beds))), (propertyDetail.numberOfRooms > 0 || ((_waterDemandDetail$co0 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co0 === void 0 ? void 0 : _waterDemandDetail$co0.total_rooms) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9937
+ className: "ws-calc-label"
9938
+ }, t("WS_NUMBER_OF_ROOMS")), /*#__PURE__*/React.createElement("div", {
9939
+ className: "ws-calc-value"
9940
+ }, propertyDetail.numberOfRooms || ((_waterDemandDetail$co1 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co1 === void 0 ? void 0 : _waterDemandDetail$co1.total_rooms))), (propertyDetail.numberOfStudents > 0 || ((_waterDemandDetail$co10 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co10 === void 0 ? void 0 : _waterDemandDetail$co10.total_students) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9941
+ className: "ws-calc-label"
9942
+ }, t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
9943
+ className: "ws-calc-value"
9944
+ }, propertyDetail.numberOfStudents || ((_waterDemandDetail$co11 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co11 === void 0 ? void 0 : _waterDemandDetail$co11.total_students))), (propertyDetail.numberOfStaff > 0 || ((_waterDemandDetail$co12 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co12 === void 0 ? void 0 : _waterDemandDetail$co12.total_staff) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9945
+ className: "ws-calc-label"
9946
+ }, t("WS_NUMBER_OF_STAFF")), /*#__PURE__*/React.createElement("div", {
9947
+ className: "ws-calc-value"
9948
+ }, propertyDetail.numberOfStaff || ((_waterDemandDetail$co13 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co13 === void 0 ? void 0 : _waterDemandDetail$co13.total_staff))), ((_waterDemandDetail$co14 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co14 === void 0 ? void 0 : _waterDemandDetail$co14.total_seats) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9949
+ className: "ws-calc-label"
9950
+ }, t("WS_NUMBER_OF_SEATS")), /*#__PURE__*/React.createElement("div", {
9951
+ className: "ws-calc-value"
9952
+ }, waterDemandDetail.contextVariables.total_seats)), ((_waterDemandDetail$co15 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co15 === void 0 ? void 0 : _waterDemandDetail$co15.highest_shift_strength) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9953
+ className: "ws-calc-label"
9954
+ }, t("WS_HIGHEST_SHIFT_STRENGTH")), /*#__PURE__*/React.createElement("div", {
9955
+ className: "ws-calc-value"
9956
+ }, waterDemandDetail.contextVariables.highest_shift_strength)), ((_waterDemandDetail$co16 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co16 === void 0 ? void 0 : _waterDemandDetail$co16.sanctioned_beds) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9957
+ className: "ws-calc-label"
9958
+ }, t("WS_SANCTIONED_BEDS")), /*#__PURE__*/React.createElement("div", {
9959
+ className: "ws-calc-value"
9960
+ }, waterDemandDetail.contextVariables.sanctioned_beds))))), /*#__PURE__*/React.createElement("div", {
9924
9961
  className: "ws-calc-detail-card"
9925
9962
  }, /*#__PURE__*/React.createElement("div", {
9926
9963
  className: "ws-calc-detail-card-header"
@@ -10321,9 +10358,20 @@ const WSCalculation = _ref => {
10321
10358
  display: "flex",
10322
10359
  marginTop: "24px",
10323
10360
  marginBottom: "32px",
10324
- justifyContent: isMobile ? "center" : "flex-end"
10361
+ justifyContent: isMobile ? "center" : "flex-end",
10362
+ alignItems: "center"
10325
10363
  }
10326
- }, /*#__PURE__*/React.createElement(SubmitBar, {
10364
+ }, /*#__PURE__*/React.createElement("button", {
10365
+ type: "button",
10366
+ className: "clear-search generic-button",
10367
+ style: {
10368
+ marginRight: "24px"
10369
+ },
10370
+ onClick: () => {
10371
+ reset();
10372
+ setCalculationData(null);
10373
+ }
10374
+ }, t("CS_COMMON_CLEAR_SEARCH")), /*#__PURE__*/React.createElement(SubmitBar, {
10327
10375
  label: t("ES_COMMON_CALCULATE"),
10328
10376
  onSubmit: handleSubmit
10329
10377
  })), calculationData && /*#__PURE__*/React.createElement(RenderCalculationDetails, {