kui-crm_actions 0.0.118 → 0.0.120

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as kui_crm from 'kui-crm';
2
- import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes as ParkingTypes$1, CityParams, ApartmentMetroStationsParams, RoomTypes, RenovationParams, RoomParams, HouseTypes as HouseTypes$1, WallMaterials as WallMaterials$1, OverlapTypes as OverlapTypes$1, GasTypes as GasTypes$1, ImageStore, ApartmentDescriptionParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, PostInspectionFillingListModel, ApartmentDetailInfoModelFields as ApartmentDetailInfoModelFields$1, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, ApartmentMetroParams as ApartmentMetroParams$1, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, BasicMeterFeaturesFormFields, BasicMeterFieldsSettings, InputByTypeProps, InspectionFeedbackParams, FillingTypes, FillingListItemModel, GeolocationParams } from 'kui-crm';
2
+ import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes as ParkingTypes$1, CityParams, ApartmentMetroStationsParams, RoomTypes, RenovationParams, RoomParams, HouseTypes as HouseTypes$1, WallMaterials as WallMaterials$1, OverlapTypes as OverlapTypes$1, GasTypes as GasTypes$1, ImageStore, ApartmentDescriptionParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, PostInspectionFillingListModel, ApartmentDetailInfoModelFields as ApartmentDetailInfoModelFields$1, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, ApartmentMetroParams as ApartmentMetroParams$1, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, BasicMeterFieldsSettings, InputByTypeProps, BasicMeterFeaturesFormFields, InspectionFeedbackParams, FillingTypes, FillingListItemModel, GeolocationParams } from 'kui-crm';
3
3
  import { DateTime } from 'luxon';
4
4
  import { Loader, MultistepForm, PhoneParams as PhoneParams$1 } from 'kui-utils';
5
5
  import * as yup from 'yup';
@@ -943,9 +943,8 @@ declare const FillingInfoFieldsSchema: yup.ObjectSchema<{
943
943
 
944
944
  type InventoryMeterInfoFieldsProps = {
945
945
  resource?: ResourceTypes
946
- handleSubmit: (data: BasicMeterFeaturesFormFields) => void
947
- handlePrevClick: () => void
948
- defaultValues?: Partial<BasicMeterFeaturesFormFields>
946
+ formStore: MultistepForm<any>
947
+ index: number
949
948
  }
950
949
 
951
950
  declare const getInventoryMeterFields: (settings: BasicMeterFieldsSettings, inputsSettings?: any) => InputByTypeProps<BasicMeterFeaturesFormFields>[];
@@ -984,6 +983,15 @@ declare class FillingListStore {
984
983
 
985
984
  declare const useFillingList: (apartmentId: number | null, formStore: MultistepForm<any>, fillingStore: FillingListStore) => void;
986
985
 
986
+ type AddedMetersBlockProps = {
987
+ formStore: MultistepForm<any>
988
+ resource: ResourceTypes
989
+ label: string
990
+ getMeterLabel: (resource: ResourceTypes, type?: MeterTypes) => string
991
+ }
992
+
993
+ declare const AddedMetersBlock: (props: AddedMetersBlockProps) => JSX.Element | null;
994
+
987
995
  declare type InspectionFieldsSettings = {
988
996
  [key: string]: InputParams<any>;
989
997
  };
@@ -1062,4 +1070,4 @@ type ApartmentPointProps = {
1062
1070
 
1063
1071
  declare const ObjectForMapPoint: (props: ApartmentPointProps) => JSX.Element;
1064
1072
 
1065
- export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionModel, ApartmentInspectionParams, ApartmentLinkParams, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, FillingCheckParams, FillingInfoFieldsSchema, FillingInfoFormFields, FillingInfoStepFields, FillingListInfoStepFields, FillingListStore, HouseInfoFieldsSchema, HouseInfoStepFields, HouseInfoStepSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InitialInspectionRoomParams, InspectionAppraisalLiteModel, _default as InspectionFeedback, InspectionFieldsSettings, InspectionFillingCard, InspectionFillingCardProps, InspectionFillingItemFields, InspectionFillingListFields, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomsImagesFields, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterInfoFields, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, ObjectForMapCard, ObjectForMapOverlay, ObjectForMapParams, ObjectForMapPoint, PartialMeterInfoFields, PartialMeterInfoStepProps, PartialMeterModel, PostApartmentInspectionRequest, RegularInspectionFormFields, RegularInspectionPostBody, RegularlyInspectionFieldsBody, RoomImagesParams, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseInfoStep, getHouseServicesInfoStep, getInventoryMeterFields, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
1073
+ export { AddedMetersBlock, AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionModel, ApartmentInspectionParams, ApartmentLinkParams, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, FillingCheckParams, FillingInfoFieldsSchema, FillingInfoFormFields, FillingInfoStepFields, FillingListInfoStepFields, FillingListStore, HouseInfoFieldsSchema, HouseInfoStepFields, HouseInfoStepSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InitialInspectionRoomParams, InspectionAppraisalLiteModel, _default as InspectionFeedback, InspectionFieldsSettings, InspectionFillingCard, InspectionFillingCardProps, InspectionFillingItemFields, InspectionFillingListFields, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomsImagesFields, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterInfoFields, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, ObjectForMapCard, ObjectForMapOverlay, ObjectForMapParams, ObjectForMapPoint, PartialMeterInfoFields, PartialMeterInfoStepProps, PartialMeterModel, PostApartmentInspectionRequest, RegularInspectionFormFields, RegularInspectionPostBody, RegularlyInspectionFieldsBody, RoomImagesParams, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseInfoStep, getHouseServicesInfoStep, getInventoryMeterFields, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as yup from 'yup';
2
- import { NumberField, requests, uploadFiles, ImageStore, FileStore, matchesAPIFillingTypes, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, HouseTypesValues, WallMaterialsValues, SlabsTypesValues, GasTypesValues, BooleanValues, positiveNumberSchema, defaultRequiredMessage, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, ParkingTypesValues, fieldWithConditionSchema, getApartmentPaymentFields, phoneWithConditionSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, getMeterValuesFieldsSchema, basicFieldsOfNewResourceMeter, FormWrapper, MeterTypeRadioGroup, InputByType, Tooltip, ApartmentsAgent, PreviewContent, Link, UserBadge, useMapCards, MapOverlay } from 'kui-crm';
2
+ import { NumberField, requests, uploadFiles, ImageStore, FileStore, matchesAPIFillingTypes, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, HouseTypesValues, WallMaterialsValues, SlabsTypesValues, GasTypesValues, BooleanValues, positiveNumberSchema, defaultRequiredMessage, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, ParkingTypesValues, fieldWithConditionSchema, getApartmentPaymentFields, phoneWithConditionSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, getMeterValuesFieldsSchema, basicFieldsOfNewResourceMeter, FormWrapper, MeterTypeRadioGroup, InputByType, Tooltip, ApartmentsAgent, meterUnitLabel, PreviewContent, Link, UserBadge, useMapCards, MapOverlay } from 'kui-crm';
3
3
  import _ from 'lodash';
4
4
  import { clearNotValidFields, getPhoneNumberFromPhoneParams, resHandler, callPromises, getPhoneParamsFromString, addToArrayByCondition, Loader } from 'kui-utils';
5
5
  import to from 'await-to-js';
@@ -937,11 +937,13 @@ var getInventoryMeterFields = function (settings, inputsSettings) { return __spr
937
937
  ], false); };
938
938
 
939
939
  function InventoryMeterInfoFields(props) {
940
- var resource = props.resource, handleSubmit = props.handleSubmit, handlePrevClick = props.handlePrevClick, defaultValues = props.defaultValues;
940
+ var _a, _b;
941
+ var resource = props.resource, index = props.index, formStore = props.formStore;
942
+ var defaultValues = (_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.meters) === null || _b === void 0 ? void 0 : _b[index];
941
943
  var withMeterType = resource === "water" || resource === "electricity";
942
944
  var defaultType = resource === "water" ? "cold" : "T1";
943
945
  var defaultMeterType = withMeterType ? defaultType : null;
944
- var _a = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.type) || defaultMeterType), meterType = _a[0], setMeterType = _a[1];
946
+ var _c = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.type) || defaultMeterType), meterType = _c[0], setMeterType = _c[1];
945
947
  var meterFields = getInventoryMeterFields({
946
948
  resource: resource,
947
949
  meterType: meterType,
@@ -957,7 +959,11 @@ function InventoryMeterInfoFields(props) {
957
959
  values: defaultValues,
958
960
  });
959
961
  }, [meterFeaturesFieldsSchema]);
960
- return (jsx(FormWrapper, __assign({ form: form, onSubmit: handleSubmit, label: "Next", variant: "next", withPrevStep: true, handlePrevClick: handlePrevClick }, { children: jsxs(Grid, __assign({ container: true, spacing: 2 }, { children: [withMeterType && (jsx(MeterTypeRadioGroup, { form: form, resource: resource, handleChange: setMeterType })), meterFields.map(function (_a) {
962
+ var handleSubmit = function (data) {
963
+ formStore.replaceFieldInArray("meters", __assign(__assign({}, data), { resource: resource }), index);
964
+ formStore.nextStep();
965
+ };
966
+ return (jsx(FormWrapper, __assign({ form: form, onSubmit: handleSubmit, label: "Next", variant: "next", withPrevStep: true, handlePrevClick: formStore.prevStep }, { children: jsxs(Grid, __assign({ container: true, spacing: 2 }, { children: [withMeterType && (jsx(Grid, __assign({ item: true, xs: 12 }, { children: jsx(MeterTypeRadioGroup, { form: form, resource: resource, handleChange: setMeterType }) }))), meterFields.map(function (_a) {
961
967
  var size = _a.size, field = __rest(_a, ["size"]);
962
968
  return (jsx(Grid, __assign({ item: true, xs: size || 6 }, { children: jsx(InputByType, __assign({ form: form }, field)) }), field.name));
963
969
  })] })) })));
@@ -994,20 +1000,20 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
994
1000
 
995
1001
  var InspectionFeedbackBillet = function (props) {
996
1002
  var feedback = props.feedback, label = props.label;
997
- return (jsx(StyledWrapper$4, __assign({ status: feedback.status }, { children: jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [jsx(Caption, __assign({ size: "s", weight: 500, color: "fiftyP" }, { children: label })), feedback.status !== "notSigned" && (jsxs(StyledIconWrapper, { children: [feedback.status === "signed" ? (jsx(StyledCheckIcon, {})) : (jsx(StyledErrorIcon, {})), !!feedback.comment && (jsx(Tooltip, __assign({ placement: "bottom", content: jsxs("div", { children: [jsx(Caption, __assign({ size: "xs", color: "fiftyP" }, { children: "Comment" })), jsx(StyledComment, __assign({ size: "xs" }, { children: feedback.comment }))] }) }, { children: jsx(StyledCommentIcon, {}) })))] }))] })) })));
1003
+ return (jsx(StyledWrapper$5, __assign({ status: feedback.status }, { children: jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [jsx(Caption, __assign({ size: "s", weight: 500, color: "fiftyP" }, { children: label })), feedback.status !== "notSigned" && (jsxs(StyledIconWrapper, { children: [feedback.status === "signed" ? (jsx(StyledCheckIcon, {})) : (jsx(StyledErrorIcon, {})), !!feedback.comment && (jsx(Tooltip, __assign({ placement: "bottom", content: jsxs("div", { children: [jsx(Caption, __assign({ size: "xs", color: "fiftyP" }, { children: "Comment" })), jsx(StyledComment, __assign({ size: "xs" }, { children: feedback.comment }))] }) }, { children: jsx(StyledCommentIcon, {}) })))] }))] })) })));
998
1004
  };
999
- var StyledWrapper$4 = styled.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n background: ", ";\n border-radius: 66px;\n border: 1px solid ", ";\n padding: 6px 16px;\n width: fit-content;\n @media (max-width: ", "px) {\n width: 100%;\n > div {\n justify-content: center;\n }\n }\n"], ["\n background: ", ";\n border-radius: 66px;\n border: 1px solid ", ";\n padding: 6px 16px;\n width: fit-content;\n @media (max-width: ", "px) {\n width: 100%;\n > div {\n justify-content: center;\n }\n }\n"])), function (_a) {
1005
+ var StyledWrapper$5 = styled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n background: ", ";\n border-radius: 66px;\n border: 1px solid ", ";\n padding: 6px 16px;\n width: fit-content;\n @media (max-width: ", "px) {\n width: 100%;\n > div {\n justify-content: center;\n }\n }\n"], ["\n background: ", ";\n border-radius: 66px;\n border: 1px solid ", ";\n padding: 6px 16px;\n width: fit-content;\n @media (max-width: ", "px) {\n width: 100%;\n > div {\n justify-content: center;\n }\n }\n"])), function (_a) {
1000
1006
  var status = _a.status;
1001
1007
  return status === "notSigned"
1002
1008
  ? theme.palette.background.light1
1003
1009
  : theme.palette.grey.zero;
1004
1010
  }, theme.palette.grey.fifteenB, theme.breakpoints.sm);
1005
- var StyledIconWrapper = styled.div(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 8px;\n > div {\n margin-left: 8px;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-left: 8px;\n > div {\n margin-left: 8px;\n }\n"])));
1006
- var StyledCheckIcon = styled(CheckIcon)(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n path {\n fill: ", ";\n }\n"], ["\n path {\n fill: ", ";\n }\n"])), theme.palette.green.fiftyP);
1011
+ var StyledIconWrapper = styled.div(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 8px;\n > div {\n margin-left: 8px;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-left: 8px;\n > div {\n margin-left: 8px;\n }\n"])));
1012
+ var StyledCheckIcon = styled(CheckIcon)(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n path {\n fill: ", ";\n }\n"], ["\n path {\n fill: ", ";\n }\n"])), theme.palette.green.fiftyP);
1007
1013
  var StyledErrorIcon = styled(CancelIcon)(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n width: 12px;\n height: 12px;\n path {\n fill: ", ";\n }\n"], ["\n width: 12px;\n height: 12px;\n path {\n fill: ", ";\n }\n"])), theme.palette.red.fiftyP);
1008
1014
  var StyledComment = styled(Caption)(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n margin-top: 8px;\n"], ["\n margin-top: 8px;\n"])));
1009
1015
  var StyledCommentIcon = styled(CommentIcon)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 13px;\n cursor: pointer;\n path {\n fill: ", ";\n stroke: ", ";\n }\n"], ["\n width: 13px;\n cursor: pointer;\n path {\n fill: ", ";\n stroke: ", ";\n }\n"])), theme.palette.grey.zero, theme.palette.grey.thirty);
1010
- var templateObject_1$8, templateObject_2$5, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6;
1016
+ var templateObject_1$a, templateObject_2$6, templateObject_3$3, templateObject_4$1, templateObject_5$1, templateObject_6;
1011
1017
 
1012
1018
  var InspectionFeedbackStatus = function (props) {
1013
1019
  var feedback = props.feedback, label = props.label, resendLabel = props.resendLabel, resend = props.resend;
@@ -1016,19 +1022,19 @@ var InspectionFeedbackStatus = function (props) {
1016
1022
  return (jsx(Grid, __assign({ item: true }, { children: jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [jsx(InspectionFeedbackBillet, { feedback: feedback, label: label }), feedback.status === "rejected" && (jsx(StyledButton, __assign({ size: "xs", variant: "orange", onClick: resend, endIcon: jsx(UpdateIcon, {}) }, { children: resendLabel })))] })) })));
1017
1023
  };
1018
1024
  var InspectionFeedbackStatus$1 = observer(InspectionFeedbackStatus);
1019
- var StyledButton = styled(Button)(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n margin-left: 16px;\n @media (max-width: ", "px) {\n width: 100%;\n margin-left: 0;\n margin-top: 8px;\n }\n"], ["\n margin-left: 16px;\n @media (max-width: ", "px) {\n width: 100%;\n margin-left: 0;\n margin-top: 8px;\n }\n"])), theme.breakpoints.sm);
1020
- var templateObject_1$7;
1025
+ var StyledButton = styled(Button)(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n margin-left: 16px;\n @media (max-width: ", "px) {\n width: 100%;\n margin-left: 0;\n margin-top: 8px;\n }\n"], ["\n margin-left: 16px;\n @media (max-width: ", "px) {\n width: 100%;\n margin-left: 0;\n margin-top: 8px;\n }\n"])), theme.breakpoints.sm);
1026
+ var templateObject_1$9;
1021
1027
 
1022
1028
  var InspectionFeedback = function (props) {
1023
1029
  var tenantFeedback = props.tenantFeedback, landlordFeedback = props.landlordFeedback, resignInspection = props.resignInspection, resendLabel = props.resendLabel;
1024
1030
  var tenantLabel = props.tenantLabel, landlordLabel = props.landlordLabel;
1025
1031
  if (!tenantFeedback && !landlordFeedback)
1026
1032
  return null;
1027
- return (jsxs(StyledWrapper$3, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: [jsx(InspectionFeedbackStatus$1, { resend: resignInspection, resendLabel: resendLabel, feedback: tenantFeedback, label: tenantLabel }), jsx(InspectionFeedbackStatus$1, { resend: resignInspection, resendLabel: resendLabel, feedback: landlordFeedback, label: landlordLabel })] })));
1033
+ return (jsxs(StyledWrapper$4, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: [jsx(InspectionFeedbackStatus$1, { resend: resignInspection, resendLabel: resendLabel, feedback: tenantFeedback, label: tenantLabel }), jsx(InspectionFeedbackStatus$1, { resend: resignInspection, resendLabel: resendLabel, feedback: landlordFeedback, label: landlordLabel })] })));
1028
1034
  };
1029
1035
  var index = observer(InspectionFeedback);
1030
- var StyledWrapper$3 = styled(Grid)(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n padding-top: 8px;\n"], ["\n padding-top: 8px;\n"])));
1031
- var templateObject_1$6;
1036
+ var StyledWrapper$4 = styled(Grid)(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n padding-top: 8px;\n"], ["\n padding-top: 8px;\n"])));
1037
+ var templateObject_1$8;
1032
1038
 
1033
1039
  var FillingCardContent = function (props) {
1034
1040
  var filling = props.filling, warningLabel = props.warningLabel;
@@ -1036,18 +1042,18 @@ var FillingCardContent = function (props) {
1036
1042
  ? "".concat(filling.numberOfSubjects, " pieces")
1037
1043
  : "", filling.numberOfSubjects && filling.serialNumber ? " \u2022 " : "", filling.serialNumber] })))] })] })));
1038
1044
  };
1039
- var StyledWarningIcon = styled(WarningIcon)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n margin-left: 4px;\n path {\n fill: ", ";\n }\n"], ["\n margin-left: 4px;\n path {\n fill: ", ";\n }\n"])), theme.palette.red.fiftyP);
1040
- var StyledLabelWrapper = styled.div(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n margin-left: 8px;\n"], ["\n margin-left: 8px;\n"])));
1041
- var StyledSubtitle = styled(Caption)(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n margin-top: 4px;\n"], ["\n margin-top: 4px;\n"])));
1042
- var templateObject_1$5, templateObject_2$4, templateObject_3$1;
1045
+ var StyledWarningIcon = styled(WarningIcon)(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n margin-left: 4px;\n path {\n fill: ", ";\n }\n"], ["\n margin-left: 4px;\n path {\n fill: ", ";\n }\n"])), theme.palette.red.fiftyP);
1046
+ var StyledLabelWrapper = styled.div(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n margin-left: 8px;\n"], ["\n margin-left: 8px;\n"])));
1047
+ var StyledSubtitle = styled(Caption)(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n margin-top: 4px;\n"], ["\n margin-top: 4px;\n"])));
1048
+ var templateObject_1$7, templateObject_2$5, templateObject_3$2;
1043
1049
 
1044
1050
  var InspectionFillingCard = function (props) {
1045
1051
  var className = props.className, form = props.form, index = props.index, disabled = props.disabled, other = __rest(props, ["className", "form", "index", "disabled"]);
1046
1052
  return (jsx(StyledCard$1, __assign({ className: className }, { children: jsx(StyledCheckbox, { form: form, name: "fillingList.".concat(index, ".check"), label: jsx(FillingCardContent, __assign({}, other)), disabled: disabled }) })));
1047
1053
  };
1048
- var StyledCard$1 = styled(Grid)(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"], ["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"])));
1049
- var StyledCheckbox = styled(CheckboxWithController)(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"], ["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"])));
1050
- var templateObject_1$4, templateObject_2$3;
1054
+ var StyledCard$1 = styled(Grid)(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"], ["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"])));
1055
+ var StyledCheckbox = styled(CheckboxWithController)(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"], ["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"])));
1056
+ var templateObject_1$6, templateObject_2$4;
1051
1057
 
1052
1058
  var useMetersValues = function (formStore, metersStore) {
1053
1059
  useEffect(function () {
@@ -1115,6 +1121,38 @@ var useFillingList = function (apartmentId, formStore, fillingStore) {
1115
1121
  }, [fillingStore.fillingList, fillingStore.loader.isLoading]);
1116
1122
  };
1117
1123
 
1124
+ var AddedMeterItem = function (props) {
1125
+ var meter = props.meter, getMeterLabel = props.getMeterLabel;
1126
+ var resource = meter.resource, type = meter.type, number = meter.number;
1127
+ var initialValue = meter.initialValue, initialValueT1 = meter.initialValueT1, initialValueT2 = meter.initialValueT2, initialValueT3 = meter.initialValueT3;
1128
+ var label = getMeterLabel(resource, type);
1129
+ var meterValues = [
1130
+ initialValue,
1131
+ initialValueT1,
1132
+ initialValueT2,
1133
+ initialValueT3,
1134
+ ]
1135
+ .filter(function (value) { return typeof value !== "undefined"; })
1136
+ .map(function (value) { return value; })
1137
+ .join(" / ");
1138
+ return (jsxs(Caption, __assign({ size: "s" }, { children: ["\u2022 ", label, " #", number, " -", " ", jsxs(StyledAccent, { children: [meterValues, " ", meterUnitLabel[meter.resource]] })] })));
1139
+ };
1140
+ var StyledAccent = styled.span(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n font-weight: 600;\n"], ["\n font-weight: 600;\n"])));
1141
+ var templateObject_1$5;
1142
+
1143
+ var AddedMetersBlock = function (props) {
1144
+ var _a, _b;
1145
+ var resource = props.resource, formStore = props.formStore, label = props.label, getMeterLabel = props.getMeterLabel;
1146
+ var addedMeters = (_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.meters) === null || _b === void 0 ? void 0 : _b.filter(function (meter) { return meter.resource === resource; });
1147
+ if (!(addedMeters === null || addedMeters === void 0 ? void 0 : addedMeters.length))
1148
+ return null;
1149
+ return (jsxs(StyledWrapper$3, { children: [jsxs(StyledHeader, __assign({ container: true, alignItems: "center" }, { children: [jsx(StyledIcon, {}), jsx(Caption, __assign({ size: "s", color: "fiftyP" }, { children: label }))] })), addedMeters.map(function (meter) { return (jsx(AddedMeterItem, { getMeterLabel: getMeterLabel, meter: meter }, meter.number)); })] }));
1150
+ };
1151
+ var StyledWrapper$3 = styled.div(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n border-radius: 8px;\n border: 1px solid ", ";\n padding: 12px 16px;\n"], ["\n border-radius: 8px;\n border: 1px solid ", ";\n padding: 12px 16px;\n"])), theme.palette.grey.fifteenB);
1152
+ var StyledIcon = styled(WarningIcon)(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n margin-right: 8px;\n width: 16px;\n height: 16px;\n path {\n fill: ", ";\n }\n"], ["\n margin-right: 8px;\n width: 16px;\n height: 16px;\n path {\n fill: ", ";\n }\n"])), theme.palette.brand.main);
1153
+ var StyledHeader = styled(Grid)(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n margin-bottom: 8px;\n"], ["\n margin-bottom: 8px;\n"])));
1154
+ var templateObject_1$4, templateObject_2$3, templateObject_3$1;
1155
+
1118
1156
  var ObjectForMapPoint = function (props) {
1119
1157
  var label = props.label, onClick = props.onClick, isActive = props.isActive;
1120
1158
  return (jsx(Button, __assign({ size: "xs", variant: isActive ? "primary" : "white", onClick: onClick }, { children: label })));
@@ -1162,5 +1200,5 @@ var ObjectForMapOverlay = function (props) {
1162
1200
  var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
1163
1201
  var templateObject_1;
1164
1202
 
1165
- export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingListStore, HouseInfoFieldsSchema, HouseInfoStepSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, index as InspectionFeedback, InspectionFillingCard, InventoryMeterInfoFields, MetersInfoFieldsSchema, MetersInfoStepSchema, ObjectForMapCard, ObjectForMapOverlay, ObjectForMapPoint, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseInfoStep, getHouseServicesInfoStep, getInventoryMeterFields, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
1203
+ export { AddedMetersBlock, AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingListStore, HouseInfoFieldsSchema, HouseInfoStepSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, index as InspectionFeedback, InspectionFillingCard, InventoryMeterInfoFields, MetersInfoFieldsSchema, MetersInfoStepSchema, ObjectForMapCard, ObjectForMapOverlay, ObjectForMapPoint, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseInfoStep, getHouseServicesInfoStep, getInventoryMeterFields, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
1166
1204
  //# sourceMappingURL=index.js.map