kui-crm_actions 0.0.66 → 0.0.68
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 +33 -7
- package/cjs/index.js.map +1 -1
- package/index.d.ts +23 -2
- package/index.js +34 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
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, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, ApartmentDetailInfoModelFields, GeolocationParams } from 'kui-crm';
|
2
|
+
import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, CityParams, RoomTypes, RenovationParams, RoomParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, ApartmentDetailInfoModelFields, 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';
|
@@ -761,6 +761,27 @@ declare const renderMetersSteps: (MeterStep: (props: MeterInfoStepProps) => Reac
|
|
761
761
|
|
762
762
|
declare const getRoomsImagesSteps: (type: InspectionTypes, settings: InspectionImageFieldsSettings, roomsParams?: InspectionRoomsFields | null | undefined) => any[];
|
763
763
|
|
764
|
+
type InspectionLabelInterface = {
|
765
|
+
rejected: string
|
766
|
+
notSigned: string
|
767
|
+
signed: string
|
768
|
+
}
|
769
|
+
|
770
|
+
type InspectionFeedbackCommentProps = {
|
771
|
+
feedback: InspectionFeedbackParams
|
772
|
+
labels: InspectionLabelInterface
|
773
|
+
}
|
774
|
+
|
775
|
+
type InspectionFeedbackIndicatorProps = {
|
776
|
+
feedback: InspectionFeedbackParams
|
777
|
+
className?: string
|
778
|
+
labels: InspectionLabelInterface
|
779
|
+
}
|
780
|
+
|
781
|
+
declare const InspectionFeedbackIndicator: (props: InspectionFeedbackIndicatorProps) => JSX.Element;
|
782
|
+
|
783
|
+
declare const InspectionFeedbackComment: (props: InspectionFeedbackCommentProps) => JSX.Element;
|
784
|
+
|
764
785
|
declare const useMetersValues: (formStore: MultistepForm<any>, metersStore: ApartmentMetersStoreInterface) => void;
|
765
786
|
|
766
787
|
declare type InspectionFieldsSettings = {
|
@@ -814,4 +835,4 @@ type ApartmentOverlayProps = {
|
|
814
835
|
|
815
836
|
declare const ApartmentInspectionOverlay: (props: ApartmentOverlayProps) => JSX.Element;
|
816
837
|
|
817
|
-
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, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, WaterMeterFieldsSchema, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
|
838
|
+
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, InspectionFeedbackComment, InspectionFeedbackIndicator, 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, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, WaterMeterFieldsSchema, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
|
package/index.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import * as yup from 'yup';
|
2
|
-
import { NumberField, requests, uploadFiles, 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, 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, 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';
|
10
9
|
import styled from '@emotion/styled';
|
11
|
-
import {
|
12
|
-
import {
|
10
|
+
import { QuestionIcon, CheckWithCircleIcon, CrossWithCircleIcon, PhoneIcon, CloseIcon } from 'kui-icon';
|
11
|
+
import { Caption, theme, Button, Grid } from 'kui-basic';
|
12
|
+
import { useEffect } from 'react';
|
13
13
|
|
14
14
|
/******************************************************************************
|
15
15
|
Copyright (c) Microsoft Corporation.
|
@@ -131,7 +131,7 @@ var getWaterMeterFields = function (meters, name, settings) {
|
|
131
131
|
var prefixName = name ? "".concat(name, ".") : "";
|
132
132
|
var meterOptions = meters.map(function (meter) { return ({
|
133
133
|
value: meter.number,
|
134
|
-
label: "
|
134
|
+
label: "".concat(_.capitalize(meter.type || ""), " | #").concat(meter.number),
|
135
135
|
}); });
|
136
136
|
return [
|
137
137
|
__assign({ label: "Meter", name: "".concat(prefixName, "number"), variant: "select", options: meterOptions, size: 12 }, settings === null || settings === void 0 ? void 0 : settings.meter),
|
@@ -648,7 +648,7 @@ var renderMetersSteps = function (MeterStep, MeterPhotoStep, maxMeters) {
|
|
648
648
|
]; });
|
649
649
|
};
|
650
650
|
|
651
|
-
var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
|
651
|
+
var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
|
652
652
|
__assign({ type: "kitchen" }, settings.kitchen)
|
653
653
|
], new Array(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0))
|
654
654
|
.fill(0)
|
@@ -664,12 +664,36 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
|
|
664
664
|
.map(function (_, index) { return (__assign({ type: "toilet" }, settings.toilet((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.restroomsNumber) ? "".concat(index + 1, " ") : ""))); }), true), new Array(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.combinedBathroomsNumber) || 0))
|
665
665
|
.fill(0)
|
666
666
|
.map(function (_, index) { return (__assign({ type: "combined_bathroom" }, settings.combinedBathroom((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.combinedBathroomsNumber) ? "".concat(index + 1, " ") : ""))); }), true), [
|
667
|
-
__assign({ type: "others" }, settings.others)
|
668
|
-
|
669
|
-
], false), addToArrayByCondition(type === "inventory", __assign({ type: "keys" }, settings.keys)), true), addToArrayByCondition(!!(type === "initial" && (roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.parkingType)), __assign({ type: "parking" }, settings.parking)), true), [
|
667
|
+
__assign({ type: "others" }, settings.others)
|
668
|
+
], false), addToArrayByCondition(type === "initial", __assign({ type: "entrance" }, settings.entrance)), true), addToArrayByCondition(type !== "initial", __assign({ type: "keys" }, settings.keys)), true), addToArrayByCondition(!!(type === "initial" && (roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.parkingType)), __assign({ type: "parking" }, settings.parking)), true), [
|
670
669
|
__assign({ type: "additional" }, settings.additional),
|
671
670
|
], false); };
|
672
671
|
|
672
|
+
var InspectionFeedbackComment = function (props) {
|
673
|
+
var feedback = props.feedback, labels = props.labels;
|
674
|
+
if (feedback.status === "rejected") {
|
675
|
+
return (jsxs("div", { children: [jsx(Caption, __assign({ size: "xs" }, { children: labels.rejected })), jsxs(StyledComment, __assign({ size: "xs" }, { children: [jsx(StyledAccent, { children: "Comment:" }), " ", feedback.comment || "-"] }))] }));
|
676
|
+
}
|
677
|
+
return jsx(Caption, __assign({ size: "xs" }, { children: labels[feedback.status] }));
|
678
|
+
};
|
679
|
+
var StyledComment = styled(Caption)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n margin-top: 8px;\n"], ["\n margin-top: 8px;\n"])));
|
680
|
+
var StyledAccent = styled.span(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), theme.palette.grey.fiftyP);
|
681
|
+
var templateObject_1$5, templateObject_2$4;
|
682
|
+
|
683
|
+
var InspectionFeedbackIndicator = function (props) {
|
684
|
+
var feedback = props.feedback, className = props.className, labels = props.labels;
|
685
|
+
return (jsx("div", __assign({ className: className }, { children: jsx(Tooltip, __assign({ content: jsx(InspectionFeedbackComment, { feedback: feedback, labels: labels }) }, { children: indicatorIcon[feedback.status] })) })));
|
686
|
+
};
|
687
|
+
var StyledQuestionIcon = styled(QuestionIcon)(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n path {\n fill: ", ";\n }\n"], ["\n path {\n fill: ", ";\n }\n"])), theme.palette.grey.fiftyP);
|
688
|
+
var StyledCheckIcon = styled(CheckWithCircleIcon)(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n path {\n fill: ", ";\n }\n"], ["\n path {\n fill: ", ";\n }\n"])), theme.palette.green.fiftyP);
|
689
|
+
var StyledErrorIcon = styled(CrossWithCircleIcon)(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n width: 14px;\n height: 14px;\n path {\n fill: ", ";\n }\n"], ["\n width: 14px;\n height: 14px;\n path {\n fill: ", ";\n }\n"])), theme.palette.red.fiftyP);
|
690
|
+
var indicatorIcon = {
|
691
|
+
notSigned: jsx(StyledQuestionIcon, {}),
|
692
|
+
signed: jsx(StyledCheckIcon, {}),
|
693
|
+
rejected: jsx(StyledErrorIcon, {}),
|
694
|
+
};
|
695
|
+
var templateObject_1$4, templateObject_2$3, templateObject_3$1;
|
696
|
+
|
673
697
|
var useMetersValues = function (formStore, metersStore) {
|
674
698
|
useEffect(function () {
|
675
699
|
var _a, _b;
|
@@ -731,5 +755,5 @@ var ApartmentInspectionOverlay = function (props) {
|
|
731
755
|
var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
732
756
|
var templateObject_1;
|
733
757
|
|
734
|
-
export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionOverlay, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
|
758
|
+
export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionOverlay, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, InspectionFeedbackComment, InspectionFeedbackIndicator, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
|
735
759
|
//# sourceMappingURL=index.js.map
|