kui-crm_actions 0.0.47 → 0.0.48
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/cjs/index.js +43 -0
- package/cjs/index.js.map +1 -1
- package/index.d.ts +43 -4
- package/index.js +44 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as kui_crm from 'kui-crm';
|
2
|
-
import { ResourceTypes, MeterTypes, InputParams, InputFileWithVisibilityFields, MeterFeaturesFormFields, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, TaxesTypes, ApartmentDetailInfoModelFields, CityParams, RoomTypes, RenovationParams, RoomParams, PhoneParams, ParkingTypes as ParkingTypes$1, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, FillingInfoFormFields as FillingInfoFormFields$1 } from 'kui-crm';
|
3
|
-
import * as yup from 'yup';
|
2
|
+
import { ResourceTypes, MeterTypes, InputParams, InputFileWithVisibilityFields, MeterFeaturesFormFields, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, TaxesTypes, ApartmentDetailInfoModelFields, CityParams, RoomTypes, RenovationParams, RoomParams, PhoneParams, ParkingTypes as ParkingTypes$1, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, FillingInfoFormFields as FillingInfoFormFields$1, GeolocationParams } from 'kui-crm';
|
4
3
|
import { DateTime } from 'luxon';
|
4
|
+
import { Loader, MultistepForm, PhoneParams as PhoneParams$1 } from 'kui-utils';
|
5
|
+
import * as yup from 'yup';
|
5
6
|
import UploadFileParams$2, { UploadFileParams as UploadFileParams$1 } from 'kui-complex/dist/FileItem';
|
6
|
-
import { Loader, MultistepForm } from 'kui-utils';
|
7
7
|
import { InputWithAddressFields } from 'kui-complex/dist/InputWithAddressAutocomplete';
|
8
8
|
import { ReactElement } from 'react';
|
9
9
|
|
@@ -813,4 +813,43 @@ declare type InspectionFieldsSettings = {
|
|
813
813
|
[key: string]: InputParams<any>;
|
814
814
|
};
|
815
815
|
|
816
|
-
|
816
|
+
type MetroStationParams = {
|
817
|
+
color: string
|
818
|
+
name: string
|
819
|
+
}
|
820
|
+
|
821
|
+
type ApartmentLinkParams = {
|
822
|
+
id: number
|
823
|
+
address: string
|
824
|
+
previewImage?: string
|
825
|
+
folderNumber?: string
|
826
|
+
payerCode?: string
|
827
|
+
apartmentNumber?: string | number
|
828
|
+
}
|
829
|
+
|
830
|
+
type TenantParams = {
|
831
|
+
id: number
|
832
|
+
avatar: string | null
|
833
|
+
fullName: string
|
834
|
+
phone: PhoneParams$1 | null
|
835
|
+
}
|
836
|
+
|
837
|
+
type ApartmentInspectionParams = {
|
838
|
+
id: number
|
839
|
+
apartment: ApartmentLinkParams
|
840
|
+
date: DateTime | null
|
841
|
+
tenant: TenantParams
|
842
|
+
metroStations: MetroStationParams[]
|
843
|
+
location: GeolocationParams
|
844
|
+
}
|
845
|
+
|
846
|
+
type ApartmentCardProps = {
|
847
|
+
inspection: ApartmentInspectionParams
|
848
|
+
onClose: () => void
|
849
|
+
getClientLink?: (id: number) => string
|
850
|
+
getApartmentLink: (id: number) => string
|
851
|
+
}
|
852
|
+
|
853
|
+
declare const ApartmentInspectionCard: (props: ApartmentCardProps) => JSX.Element;
|
854
|
+
|
855
|
+
export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionCard, ApartmentInspectionModel, 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$1 as InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields$1 as InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomPhotoTypes, InspectionRoomsImagesFields, InspectionTypes, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, PartialMeterInfoFields, PartialMeterInfoStepProps, PartialMeterModel, PostApartmentInspectionRequest, QuarterlyInspectionFieldsBody, QuarterlyInspectionFormFields, QuarterlyInspectionPostBody, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, getAdditionalInfoStepFields, getApartmentPaymentFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
|
package/index.js
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
import { addToArrayByCondition, clearNotValidFields, getPhoneNumberFromPhoneParams, resHandler, callPromises } from 'kui-utils';
|
2
2
|
import * as yup from 'yup';
|
3
|
-
import { requests, uploadImages, uploadFiles, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, BooleanValues, ParkingTypesValues, fieldWithConditionSchema, defaultRequiredMessage, CompanyAutocomplete, TaxTypeValues, phoneWithConditionSchema, positiveNumberSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete } from 'kui-crm';
|
3
|
+
import { requests, uploadImages, uploadFiles, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, BooleanValues, ParkingTypesValues, fieldWithConditionSchema, defaultRequiredMessage, CompanyAutocomplete, TaxTypeValues, phoneWithConditionSchema, positiveNumberSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, PreviewContent, Link, UserBadge } from 'kui-crm';
|
4
4
|
import to from 'await-to-js';
|
5
5
|
import { DateTime } from 'luxon';
|
6
6
|
import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm } from 'kui-complex';
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
8
8
|
import { useEffect } from 'react';
|
9
|
+
import styled from '@emotion/styled';
|
10
|
+
import { Grid, Caption, theme, Button } from 'kui-basic';
|
11
|
+
import { PhoneIcon, CloseIcon } from 'kui-icon';
|
9
12
|
|
10
13
|
/******************************************************************************
|
11
14
|
Copyright (c) Microsoft Corporation.
|
@@ -79,6 +82,11 @@ function __spreadArray(to, from, pack) {
|
|
79
82
|
}
|
80
83
|
}
|
81
84
|
return to.concat(ar || Array.prototype.slice.call(from));
|
85
|
+
}
|
86
|
+
|
87
|
+
function __makeTemplateObject(cooked, raw) {
|
88
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
89
|
+
return cooked;
|
82
90
|
}
|
83
91
|
|
84
92
|
var getPartialMeterInfoFields = function (resource, type, name, settings) {
|
@@ -714,5 +722,38 @@ var useMetersValues = function (formStore, metersStore) {
|
|
714
722
|
}, [metersStore.meters, metersStore.loader.isLoading]);
|
715
723
|
};
|
716
724
|
|
717
|
-
|
725
|
+
var MetroStation = function (props) {
|
726
|
+
var metroStation = props.metroStation;
|
727
|
+
var color = metroStation.color, name = metroStation.name;
|
728
|
+
return (jsxs(StyledWrapper$1, __assign({ item: true, container: true, alignItems: "center" }, { children: [jsx(StyledPoint, { style: { background: color } }), jsx(Caption, __assign({ size: "s", color: "sixty" }, { children: name }))] })));
|
729
|
+
};
|
730
|
+
var StyledWrapper$1 = styled(Grid)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n width: auto;\n"], ["\n width: auto;\n"])));
|
731
|
+
var StyledPoint = styled.div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 6px;\n"], ["\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 6px;\n"])));
|
732
|
+
var templateObject_1$2, templateObject_2$2;
|
733
|
+
|
734
|
+
var ContactPhone = function (props) {
|
735
|
+
var phone = props.phone;
|
736
|
+
var formattedPhone = getPhoneNumberFromPhoneParams(phone, " ");
|
737
|
+
var phoneLink = formattedPhone.replace(/\d/g, "");
|
738
|
+
return (jsxs(StyledWrapper, __assign({ container: true, alignItems: "center", wrap: "nowrap" }, { children: [jsx(StyledPhoneIcon, { width: 14, height: 14 }), jsx("a", __assign({ href: "tel:+".concat(phoneLink) }, { children: jsx(Caption, __assign({ size: "s", weight: 500, color: "sixty" }, { children: formattedPhone })) }))] })));
|
739
|
+
};
|
740
|
+
var StyledWrapper = styled(Grid)(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n width: auto;\n"], ["\n width: auto;\n"])));
|
741
|
+
var StyledPhoneIcon = styled(PhoneIcon)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n margin-right: 6px;\n transform: rotate(15deg);\n path {\n stroke: ", ";\n }\n"], ["\n margin-right: 6px;\n transform: rotate(15deg);\n path {\n stroke: ", ";\n }\n"])), theme.palette.grey.sixty);
|
742
|
+
var templateObject_1$1, templateObject_2$1;
|
743
|
+
|
744
|
+
var ApartmentInspectionCard = function (props) {
|
745
|
+
var inspection = props.inspection, onClose = props.onClose, getClientLink = props.getClientLink, getApartmentLink = props.getApartmentLink;
|
746
|
+
var apartment = inspection.apartment, tenant = inspection.tenant, metroStations = inspection.metroStations;
|
747
|
+
var clientLink = getClientLink ? getClientLink(tenant.id) : "";
|
748
|
+
var apartmentLink = getApartmentLink(apartment.id);
|
749
|
+
return (jsxs(StyledCard, { children: [jsx(Link, __assign({ href: apartmentLink }, { children: jsx(StyledPreviewContent, { imageSrc: apartment.previewImage, description: "".concat(apartment.address, ", \u043A\u0432. ").concat(apartment.apartmentNumber) }) })), jsx(Grid, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: metroStations.map(function (station) { return (jsx(MetroStation, { metroStation: station }, station.name)); }) })), jsxs(StyledTenantInfo, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [clientLink ? (jsx(StyledClientLink, __assign({ href: clientLink }, { children: jsx(UserBadge, { weight: 500, user: tenant }) }))) : (jsx(UserBadge, { weight: 500, user: tenant })), !!tenant.phone && jsx(ContactPhone, { phone: tenant.phone })] })), jsx(StyledCloseButton, __assign({ isCircle: true, size: "xs", variant: "whiteWithGray", onClick: onClose }, { children: jsx(CloseIcon, { width: 6, height: 6 }) }))] }));
|
750
|
+
};
|
751
|
+
var StyledCard = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"], ["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"])), theme.palette.grey.zero);
|
752
|
+
var StyledPreviewContent = styled(PreviewContent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 8px;\n p {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"], ["\n margin-bottom: 8px;\n p {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"])));
|
753
|
+
var StyledTenantInfo = styled(Grid)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-top: 8px;\n border-top: 1px solid ", ";\n margin-top: 8px;\n flex-wrap: nowrap;\n"], ["\n padding-top: 8px;\n border-top: 1px solid ", ";\n margin-top: 8px;\n flex-wrap: nowrap;\n"])), theme.palette.grey.fifteenB);
|
754
|
+
var StyledCloseButton = styled(Button)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n top: -10px;\n right: -10px;\n width: 24px;\n height: 24px;\n"], ["\n position: absolute;\n top: -10px;\n right: -10px;\n width: 24px;\n height: 24px;\n"])));
|
755
|
+
var StyledClientLink = styled(Link)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n max-width: calc(100% - 140px);\n"], ["\n max-width: calc(100% - 140px);\n"])));
|
756
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
757
|
+
|
758
|
+
export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionCard, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, getAdditionalInfoStepFields, getApartmentPaymentFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
|
718
759
|
//# sourceMappingURL=index.js.map
|