kui-crm_actions 0.0.108 → 0.0.110
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 +44 -1
- package/cjs/index.js.map +1 -1
- package/index.d.ts +11 -2
- package/index.js +47 -5
- 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 as ParkingTypes$1, CityParams, RoomTypes, RenovationParams, RoomParams, HouseTypes as HouseTypes$1, WallMaterials as WallMaterials$1, OverlapTypes as OverlapTypes$1, GasTypes as GasTypes$1, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, 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, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, InspectionFeedbackParams, FillingTypes, FillingListItemModel, GeolocationParams } from 'kui-crm';
|
2
|
+
import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes as ParkingTypes$1, CityParams, RoomTypes, RenovationParams, RoomParams, HouseTypes as HouseTypes$1, WallMaterials as WallMaterials$1, OverlapTypes as OverlapTypes$1, GasTypes as GasTypes$1, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, 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, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, 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';
|
@@ -929,6 +929,15 @@ declare const FillingInfoFieldsSchema: yup.ObjectSchema<{
|
|
929
929
|
serialNumber: undefined;
|
930
930
|
}, "">;
|
931
931
|
|
932
|
+
type InventoryMeterInfoFieldsProps = {
|
933
|
+
resource?: ResourceTypes
|
934
|
+
handleSubmit: (data: BasicMeterFeaturesFormFields) => void
|
935
|
+
handlePrevClick: () => void
|
936
|
+
defaultValues?: Partial<BasicMeterFeaturesFormFields>
|
937
|
+
}
|
938
|
+
|
939
|
+
declare function InventoryMeterInfoFields(props: InventoryMeterInfoFieldsProps): JSX.Element;
|
940
|
+
|
932
941
|
type MeterInfoStepProps = {
|
933
942
|
index: number
|
934
943
|
resource: ResourceTypes
|
@@ -1039,4 +1048,4 @@ type ApartmentPointProps = {
|
|
1039
1048
|
|
1040
1049
|
declare const ObjectForMapPoint: (props: ApartmentPointProps) => JSX.Element;
|
1041
1050
|
|
1042
|
-
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, 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, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
|
1051
|
+
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, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
|
package/index.js
CHANGED
@@ -1,16 +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, 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, 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
|
-
import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm } from 'kui-complex';
|
7
|
+
import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm, InputFile } from 'kui-complex';
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
9
|
-
import {
|
9
|
+
import { useState, useMemo, useEffect } from 'react';
|
10
|
+
import { useForm } from 'react-hook-form';
|
11
|
+
import { Grid, theme, Caption, Button } from 'kui-basic';
|
12
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
10
13
|
import { observer } from 'mobx-react';
|
11
14
|
import styled from '@emotion/styled';
|
12
15
|
import { CheckIcon, CancelIcon, CommentIcon, UpdateIcon, WarningIcon, PhoneIcon, CloseIcon } from 'kui-icon';
|
13
|
-
import { useEffect } from 'react';
|
14
16
|
import { makeAutoObservable } from 'mobx';
|
15
17
|
|
16
18
|
/******************************************************************************
|
@@ -913,6 +915,46 @@ var FillingInfoFieldsSchema = yup.object().shape({
|
|
913
915
|
}),
|
914
916
|
});
|
915
917
|
|
918
|
+
var meterFeaturesFieldsSchema = {
|
919
|
+
number: yup.string().required("This field is required"),
|
920
|
+
};
|
921
|
+
var getMeterFeaturesFieldsSchema = function (valuesFields) {
|
922
|
+
var valuesSchema = getMeterValuesFieldsSchema(valuesFields);
|
923
|
+
return yup.object().shape(__assign(__assign({}, meterFeaturesFieldsSchema), Object.assign.apply(Object, __spreadArray([{}], valuesSchema, false))));
|
924
|
+
};
|
925
|
+
|
926
|
+
var getMeterFields = function (settings, inputsSettings) { return __spreadArray(__spreadArray([], basicFieldsOfNewResourceMeter(settings, inputsSettings), true), [
|
927
|
+
__assign({ label: "Activation date", name: "startDate", variant: "date", max: DateTime.now() }, inputsSettings === null || inputsSettings === void 0 ? void 0 : inputsSettings.startDate),
|
928
|
+
__assign({ label: "Passport", name: "passportFile", variant: "custom", CustomInput: InputFile }, inputsSettings === null || inputsSettings === void 0 ? void 0 : inputsSettings.passportFile),
|
929
|
+
], false); };
|
930
|
+
|
931
|
+
function InventoryMeterInfoFields(props) {
|
932
|
+
var resource = props.resource, handleSubmit = props.handleSubmit, handlePrevClick = props.handlePrevClick, defaultValues = props.defaultValues;
|
933
|
+
var withMeterType = resource === "water" || resource === "electricity";
|
934
|
+
var defaultType = resource === "water" ? "cold" : "T1";
|
935
|
+
var defaultMeterType = withMeterType ? defaultType : null;
|
936
|
+
var _a = useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.type) || defaultMeterType), meterType = _a[0], setMeterType = _a[1];
|
937
|
+
var meterFields = getMeterFields({
|
938
|
+
resource: resource,
|
939
|
+
meterType: meterType,
|
940
|
+
});
|
941
|
+
var valueFieldsName = meterFields
|
942
|
+
.filter(function (field) { return field.type === "number"; })
|
943
|
+
.map(function (field) { return field.name; });
|
944
|
+
var meterFeaturesFieldsSchema = getMeterFeaturesFieldsSchema(valueFieldsName);
|
945
|
+
var form = useMemo(function () {
|
946
|
+
return useForm({
|
947
|
+
resolver: yupResolver(meterFeaturesFieldsSchema),
|
948
|
+
defaultValues: __assign({}, defaultValues),
|
949
|
+
values: defaultValues,
|
950
|
+
});
|
951
|
+
}, [meterFeaturesFieldsSchema]);
|
952
|
+
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) {
|
953
|
+
var size = _a.size, field = __rest(_a, ["size"]);
|
954
|
+
return (jsx(Grid, __assign({ item: true, xs: size || 6 }, { children: jsx(InputByType, __assign({ form: form }, field)) }), field.name));
|
955
|
+
})] })) })));
|
956
|
+
}
|
957
|
+
|
916
958
|
var renderMetersSteps = function (MeterStep, MeterPhotoStep, maxMeters) {
|
917
959
|
var meters = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], new Array(Number((maxMeters === null || maxMeters === void 0 ? void 0 : maxMeters.water) || 0)).fill("water"), true), new Array(Number((maxMeters === null || maxMeters === void 0 ? void 0 : maxMeters.electricity) || 0)).fill("electricity"), true), new Array(Number((maxMeters === null || maxMeters === void 0 ? void 0 : maxMeters.gas) || 0)).fill("gas"), true), new Array(Number((maxMeters === null || maxMeters === void 0 ? void 0 : maxMeters.heating) || 0)).fill("heating"), true);
|
918
960
|
return meters.map(function (resource, index) { return [
|
@@ -1112,5 +1154,5 @@ var ObjectForMapOverlay = function (props) {
|
|
1112
1154
|
var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
1113
1155
|
var templateObject_1;
|
1114
1156
|
|
1115
|
-
export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingListStore, HouseInfoFieldsSchema, HouseInfoStepSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, index as InspectionFeedback, InspectionFillingCard, MetersInfoFieldsSchema, MetersInfoStepSchema, ObjectForMapCard, ObjectForMapOverlay, ObjectForMapPoint, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, WaterMeterFieldsSchema, apartmentFields, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseInfoStep, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
|
1157
|
+
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, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, getWaterMeterFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useFillingList, useMetersValues };
|
1116
1158
|
//# sourceMappingURL=index.js.map
|