kui-crm_actions 0.0.70 → 0.0.72

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, CityParams, RoomTypes, RenovationParams, RoomParams, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, ApartmentDetailInfoModelFields, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, ApartmentMetroParams, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, GeolocationParams } from 'kui-crm';
2
+ import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, CityParams, RoomTypes, RenovationParams, RoomParams, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, ApartmentDetailInfoModelFields, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, ApartmentMetroParams, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, InspectionFeedbackParams, 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';
@@ -35,6 +35,7 @@ type PartialMeterInfoFields = {
35
35
  T2?: string | number | null
36
36
  T3?: string | number | null
37
37
  images: FileStore[]
38
+ maxValue?: number | string
38
39
  }
39
40
 
40
41
  declare const getWaterMeterFields: (meters: PartialMeterInfoFields[], name?: string | undefined, settings?: any) => any[];
@@ -816,6 +817,17 @@ declare const renderMetersSteps: (MeterStep: (props: MeterInfoStepProps) => Reac
816
817
 
817
818
  declare const getRoomsImagesSteps: (type: InspectionTypes, settings: InspectionImageFieldsSettings, roomsParams?: InspectionRoomsFields | null | undefined) => any[];
818
819
 
820
+ type InspectionFeedbackProps = {
821
+ tenantFeedback: InspectionFeedbackParams | null
822
+ landlordFeedback: InspectionFeedbackParams | null
823
+ resignInspection: () => Promise<void>
824
+ resendLabel: string
825
+ tenantLabel: string
826
+ landlordLabel: string
827
+ }
828
+
829
+ declare const _default: (props: InspectionFeedbackProps) => JSX.Element | null;
830
+
819
831
  declare const useMetersValues: (formStore: MultistepForm<any>, metersStore: ApartmentMetersStoreInterface) => void;
820
832
 
821
833
  declare type InspectionFieldsSettings = {
@@ -869,4 +881,4 @@ type ApartmentOverlayProps = {
869
881
 
870
882
  declare const ApartmentInspectionOverlay: (props: ApartmentOverlayProps) => JSX.Element;
871
883
 
872
- export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionModel, ApartmentInspectionOverlay, ApartmentInspectionParams, ApartmentLinkParams, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingInfoFormFields, FillingInfoStepFields, FillingListInfoStepFields, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InitialInspectionRoomParams, InspectionAppraisalLiteModel, InspectionFieldsSettings, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomsImagesFields, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, 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, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
884
+ export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionModel, ApartmentInspectionOverlay, ApartmentInspectionParams, ApartmentLinkParams, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingInfoFormFields, FillingInfoStepFields, FillingListInfoStepFields, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InitialInspectionRoomParams, InspectionAppraisalLiteModel, _default as InspectionFeedback, InspectionFieldsSettings, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomsImagesFields, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, 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, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
package/index.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import * as yup from 'yup';
2
- import { NumberField, requests, uploadFiles, ImageStore, FileStore, matchesAPIFillingTypes, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, BooleanValues, ParkingTypesValues, fieldWithConditionSchema, defaultRequiredMessage, getApartmentPaymentFields, phoneWithConditionSchema, positiveNumberSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, PreviewContent, Link, UserBadge, useMapCards, MapOverlay } from 'kui-crm';
2
+ import { NumberField, requests, uploadFiles, ImageStore, FileStore, matchesAPIFillingTypes, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, BooleanValues, ParkingTypesValues, fieldWithConditionSchema, defaultRequiredMessage, getApartmentPaymentFields, phoneWithConditionSchema, positiveNumberSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, Tooltip, PreviewContent, Link, UserBadge, useMapCards, MapOverlay } from 'kui-crm';
3
3
  import _ from 'lodash';
4
4
  import { clearNotValidFields, getPhoneNumberFromPhoneParams, resHandler, callPromises, getPhoneParamsFromString, addToArrayByCondition } from 'kui-utils';
5
5
  import to from 'await-to-js';
6
6
  import { DateTime } from 'luxon';
7
7
  import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm } from 'kui-complex';
8
8
  import { jsx, jsxs } from 'react/jsx-runtime';
9
- import { useEffect } from 'react';
9
+ import { theme, Caption, Grid, Button } from 'kui-basic';
10
+ import { observer } from 'mobx-react';
10
11
  import styled from '@emotion/styled';
11
- import { Button, Grid, Caption, theme } from 'kui-basic';
12
- import { PhoneIcon, CloseIcon } from 'kui-icon';
12
+ import { CheckIcon, CancelIcon, CommentIcon, UpdateIcon, PhoneIcon, CloseIcon } from 'kui-icon';
13
+ import { useEffect } from 'react';
13
14
 
14
15
  /******************************************************************************
15
16
  Copyright (c) Microsoft Corporation.
@@ -904,6 +905,44 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
904
905
  __assign({ type: "additional" }, settings.additional),
905
906
  ], false); };
906
907
 
908
+ var InspectionFeedbackBillet = function (props) {
909
+ var feedback = props.feedback, label = props.label;
910
+ 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, {}) })))] }))] })) })));
911
+ };
912
+ var StyledWrapper$4 = styled.div(templateObject_1$6 || (templateObject_1$6 = __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) {
913
+ var status = _a.status;
914
+ return status === "notSigned"
915
+ ? theme.palette.background.light1
916
+ : theme.palette.grey.zero;
917
+ }, theme.palette.grey.fifteenB, theme.breakpoints.sm);
918
+ var StyledIconWrapper = styled.div(templateObject_2$3 || (templateObject_2$3 = __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"])));
919
+ var StyledCheckIcon = styled(CheckIcon)(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n path {\n fill: ", ";\n }\n"], ["\n path {\n fill: ", ";\n }\n"])), theme.palette.green.fiftyP);
920
+ 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);
921
+ var StyledComment = styled(Caption)(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n margin-top: 8px;\n"], ["\n margin-top: 8px;\n"])));
922
+ 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);
923
+ var templateObject_1$6, templateObject_2$3, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6;
924
+
925
+ var InspectionFeedbackStatus = function (props) {
926
+ var feedback = props.feedback, label = props.label, resendLabel = props.resendLabel, resend = props.resend;
927
+ if (!feedback)
928
+ return null;
929
+ 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 })))] })) })));
930
+ };
931
+ var InspectionFeedbackStatus$1 = observer(InspectionFeedbackStatus);
932
+ var StyledButton = styled(Button)(templateObject_1$5 || (templateObject_1$5 = __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);
933
+ var templateObject_1$5;
934
+
935
+ var InspectionFeedback = function (props) {
936
+ var tenantFeedback = props.tenantFeedback, landlordFeedback = props.landlordFeedback, resignInspection = props.resignInspection, resendLabel = props.resendLabel;
937
+ var tenantLabel = props.tenantLabel, landlordLabel = props.landlordLabel;
938
+ if (!tenantFeedback && !landlordFeedback)
939
+ return null;
940
+ 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 })] })));
941
+ };
942
+ var index = observer(InspectionFeedback);
943
+ var StyledWrapper$3 = styled(Grid)(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n padding-top: 8px;\n"], ["\n padding-top: 8px;\n"])));
944
+ var templateObject_1$4;
945
+
907
946
  var useMetersValues = function (formStore, metersStore) {
908
947
  useEffect(function () {
909
948
  var _a, _b;
@@ -965,5 +1004,5 @@ var ApartmentInspectionOverlay = function (props) {
965
1004
  var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
966
1005
  var templateObject_1;
967
1006
 
968
- export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionOverlay, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
1007
+ export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionOverlay, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, index as InspectionFeedback, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
969
1008
  //# sourceMappingURL=index.js.map