kui-crm_actions 0.0.120 → 0.0.122

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
@@ -986,8 +986,8 @@ declare const useFillingList: (apartmentId: number | null, formStore: MultistepF
986
986
  type AddedMetersBlockProps = {
987
987
  formStore: MultistepForm<any>
988
988
  resource: ResourceTypes
989
- label: string
990
- getMeterLabel: (resource: ResourceTypes, type?: MeterTypes) => string
989
+ label?: string
990
+ getMeterLabel?: (resource: ResourceTypes, type?: MeterTypes) => string
991
991
  }
992
992
 
993
993
  declare const AddedMetersBlock: (props: AddedMetersBlockProps) => JSX.Element | null;
package/index.js CHANGED
@@ -1,18 +1,18 @@
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, meterUnitLabel, 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, meterUnitLabel, FormWrapper, MeterTypeRadioGroup, InputByType, Tooltip, ApartmentsAgent, 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';
6
6
  import { DateTime } from 'luxon';
7
7
  import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm, InputFile } from 'kui-complex';
8
- import { jsx, jsxs } from 'react/jsx-runtime';
8
+ import { jsxs, jsx } from 'react/jsx-runtime';
9
9
  import { useState, useMemo, useEffect } from 'react';
10
10
  import { useForm } from 'react-hook-form';
11
- import { Grid, theme, Caption, Button } from 'kui-basic';
11
+ import { Caption, theme, Grid, Button } from 'kui-basic';
12
12
  import { yupResolver } from '@hookform/resolvers/yup';
13
- import { observer } from 'mobx-react';
14
13
  import styled from '@emotion/styled';
15
- import { CheckIcon, CancelIcon, CommentIcon, UpdateIcon, WarningIcon, PhoneIcon, CloseIcon } from 'kui-icon';
14
+ import { WarningIcon, CheckIcon, CancelIcon, CommentIcon, UpdateIcon, PhoneIcon, CloseIcon } from 'kui-icon';
15
+ import { observer } from 'mobx-react';
16
16
  import { makeAutoObservable } from 'mobx';
17
17
 
18
18
  /******************************************************************************
@@ -936,6 +936,43 @@ var getInventoryMeterFields = function (settings, inputsSettings) { return __spr
936
936
  __assign({ label: "Passport", name: "passportFile", variant: "custom", CustomInput: InputFile }, inputsSettings === null || inputsSettings === void 0 ? void 0 : inputsSettings.passportFile),
937
937
  ], false); };
938
938
 
939
+ var AddedMeterItem = function (props) {
940
+ var meter = props.meter, getMeterLabel = props.getMeterLabel;
941
+ var resource = meter.resource, type = meter.type, number = meter.number;
942
+ var initialValue = meter.initialValue, initialValueT1 = meter.initialValueT1, initialValueT2 = meter.initialValueT2, initialValueT3 = meter.initialValueT3;
943
+ var meterValues = [
944
+ initialValue,
945
+ initialValueT1,
946
+ initialValueT2,
947
+ initialValueT3,
948
+ ]
949
+ .filter(function (value) { return typeof value !== "undefined"; })
950
+ .map(function (value) { return value; })
951
+ .join(" / ");
952
+ var getDefaultMeterLabel = function () {
953
+ return _.capitalize("".concat(type ? "".concat(type, " ") : "").concat(resource, " meter"));
954
+ };
955
+ var label = getMeterLabel
956
+ ? getMeterLabel(resource, type)
957
+ : getDefaultMeterLabel();
958
+ return (jsxs(Caption, __assign({ size: "s" }, { children: ["\u2022 ", label, " #", number, " -", " ", jsxs(StyledAccent, { children: [meterValues, " ", meterUnitLabel[meter.resource]] })] })));
959
+ };
960
+ var StyledAccent = styled.span(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n font-weight: 600;\n"], ["\n font-weight: 600;\n"])));
961
+ var templateObject_1$a;
962
+
963
+ var AddedMetersBlock = function (props) {
964
+ var _a, _b;
965
+ var resource = props.resource, formStore = props.formStore, label = props.label, getMeterLabel = props.getMeterLabel;
966
+ 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; });
967
+ if (!(addedMeters === null || addedMeters === void 0 ? void 0 : addedMeters.length))
968
+ return null;
969
+ return (jsxs(StyledWrapper$5, { children: [jsxs(StyledHeader, __assign({ container: true, alignItems: "center" }, { children: [jsx(StyledIcon, {}), jsx(Caption, __assign({ size: "s", color: "fiftyP" }, { children: label || "In the previous steps were added:" }))] })), addedMeters.map(function (meter) { return (jsx(AddedMeterItem, { getMeterLabel: getMeterLabel, meter: meter }, meter.number)); })] }));
970
+ };
971
+ var StyledWrapper$5 = styled.div(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n border-radius: 8px;\n border: 1px solid ", ";\n padding: 12px 16px;\n background: white;\n"], ["\n border-radius: 8px;\n border: 1px solid ", ";\n padding: 12px 16px;\n background: white;\n"])), theme.palette.grey.fifteenB);
972
+ var StyledIcon = styled(WarningIcon)(templateObject_2$6 || (templateObject_2$6 = __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);
973
+ var StyledHeader = styled(Grid)(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n margin-bottom: 8px;\n"], ["\n margin-bottom: 8px;\n"])));
974
+ var templateObject_1$9, templateObject_2$6, templateObject_3$3;
975
+
939
976
  function InventoryMeterInfoFields(props) {
940
977
  var _a, _b;
941
978
  var resource = props.resource, index = props.index, formStore = props.formStore;
@@ -963,7 +1000,7 @@ function InventoryMeterInfoFields(props) {
963
1000
  formStore.replaceFieldInArray("meters", __assign(__assign({}, data), { resource: resource }), index);
964
1001
  formStore.nextStep();
965
1002
  };
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) {
1003
+ 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: [jsx(Grid, __assign({ item: true, xs: 12 }, { children: jsx(AddedMetersBlock, { formStore: formStore, resource: resource }) })), withMeterType && (jsx(Grid, __assign({ item: true, xs: 12 }, { children: jsx(MeterTypeRadioGroup, { form: form, resource: resource, handleChange: setMeterType }) }))), meterFields.map(function (_a) {
967
1004
  var size = _a.size, field = __rest(_a, ["size"]);
968
1005
  return (jsx(Grid, __assign({ item: true, xs: size || 6 }, { children: jsx(InputByType, __assign({ form: form }, field)) }), field.name));
969
1006
  })] })) })));
@@ -1000,20 +1037,20 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
1000
1037
 
1001
1038
  var InspectionFeedbackBillet = function (props) {
1002
1039
  var feedback = props.feedback, label = props.label;
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, {}) })))] }))] })) })));
1040
+ 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, {}) })))] }))] })) })));
1004
1041
  };
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) {
1042
+ 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) {
1006
1043
  var status = _a.status;
1007
1044
  return status === "notSigned"
1008
1045
  ? theme.palette.background.light1
1009
1046
  : theme.palette.grey.zero;
1010
1047
  }, theme.palette.grey.fifteenB, theme.breakpoints.sm);
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);
1048
+ 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"])));
1049
+ 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);
1013
1050
  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);
1014
1051
  var StyledComment = styled(Caption)(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n margin-top: 8px;\n"], ["\n margin-top: 8px;\n"])));
1015
1052
  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);
1016
- var templateObject_1$a, templateObject_2$6, templateObject_3$3, templateObject_4$1, templateObject_5$1, templateObject_6;
1053
+ var templateObject_1$8, templateObject_2$5, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6;
1017
1054
 
1018
1055
  var InspectionFeedbackStatus = function (props) {
1019
1056
  var feedback = props.feedback, label = props.label, resendLabel = props.resendLabel, resend = props.resend;
@@ -1022,19 +1059,19 @@ var InspectionFeedbackStatus = function (props) {
1022
1059
  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 })))] })) })));
1023
1060
  };
1024
1061
  var InspectionFeedbackStatus$1 = observer(InspectionFeedbackStatus);
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;
1062
+ 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);
1063
+ var templateObject_1$7;
1027
1064
 
1028
1065
  var InspectionFeedback = function (props) {
1029
1066
  var tenantFeedback = props.tenantFeedback, landlordFeedback = props.landlordFeedback, resignInspection = props.resignInspection, resendLabel = props.resendLabel;
1030
1067
  var tenantLabel = props.tenantLabel, landlordLabel = props.landlordLabel;
1031
1068
  if (!tenantFeedback && !landlordFeedback)
1032
1069
  return null;
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 })] })));
1070
+ 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 })] })));
1034
1071
  };
1035
1072
  var index = observer(InspectionFeedback);
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;
1073
+ var StyledWrapper$3 = styled(Grid)(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n padding-top: 8px;\n"], ["\n padding-top: 8px;\n"])));
1074
+ var templateObject_1$6;
1038
1075
 
1039
1076
  var FillingCardContent = function (props) {
1040
1077
  var filling = props.filling, warningLabel = props.warningLabel;
@@ -1042,18 +1079,18 @@ var FillingCardContent = function (props) {
1042
1079
  ? "".concat(filling.numberOfSubjects, " pieces")
1043
1080
  : "", filling.numberOfSubjects && filling.serialNumber ? " \u2022 " : "", filling.serialNumber] })))] })] })));
1044
1081
  };
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;
1082
+ 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);
1083
+ var StyledLabelWrapper = styled.div(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n margin-left: 8px;\n"], ["\n margin-left: 8px;\n"])));
1084
+ var StyledSubtitle = styled(Caption)(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n margin-top: 4px;\n"], ["\n margin-top: 4px;\n"])));
1085
+ var templateObject_1$5, templateObject_2$4, templateObject_3$1;
1049
1086
 
1050
1087
  var InspectionFillingCard = function (props) {
1051
1088
  var className = props.className, form = props.form, index = props.index, disabled = props.disabled, other = __rest(props, ["className", "form", "index", "disabled"]);
1052
1089
  return (jsx(StyledCard$1, __assign({ className: className }, { children: jsx(StyledCheckbox, { form: form, name: "fillingList.".concat(index, ".check"), label: jsx(FillingCardContent, __assign({}, other)), disabled: disabled }) })));
1053
1090
  };
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;
1091
+ 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"])));
1092
+ 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"])));
1093
+ var templateObject_1$4, templateObject_2$3;
1057
1094
 
1058
1095
  var useMetersValues = function (formStore, metersStore) {
1059
1096
  useEffect(function () {
@@ -1121,38 +1158,6 @@ var useFillingList = function (apartmentId, formStore, fillingStore) {
1121
1158
  }, [fillingStore.fillingList, fillingStore.loader.isLoading]);
1122
1159
  };
1123
1160
 
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
-
1156
1161
  var ObjectForMapPoint = function (props) {
1157
1162
  var label = props.label, onClick = props.onClick, isActive = props.isActive;
1158
1163
  return (jsx(Button, __assign({ size: "xs", variant: isActive ? "primary" : "white", onClick: onClick }, { children: label })));