kui-crm_actions 0.0.39 → 0.0.41
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 +14 -12
- package/cjs/index.js.map +1 -1
- package/index.d.ts +11 -8
- package/index.js +15 -13
- 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 { ResourceTypes, MeterTypes, InputParams, InputFileWithVisibilityFields, MeterFeaturesFormFields, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, TaxesTypes, ApartmentDetailInfoModelFields, CityParams, RoomTypes, RenovationParams, RoomParams, PhoneParams, ParkingTypes, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, FillingInfoFormFields as FillingInfoFormFields$1 } 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
3
|
import * as yup from 'yup';
|
4
4
|
import { DateTime } from 'luxon';
|
5
5
|
import UploadFileParams$2, { UploadFileParams as UploadFileParams$1 } from 'kui-complex/dist/FileItem';
|
@@ -74,6 +74,8 @@ type ApartmentMetersStoreInterface = {
|
|
74
74
|
meters: PartialMeterInfoFields[]
|
75
75
|
}
|
76
76
|
|
77
|
+
declare type ParkingTypes = "public" | "house" | "underground" | "multi_level";
|
78
|
+
|
77
79
|
type InspectionTypes =
|
78
80
|
| "initial"
|
79
81
|
| "inventory"
|
@@ -116,6 +118,7 @@ type InspectionRoomsFields = {
|
|
116
118
|
bedroomsNumber: number | null
|
117
119
|
restroomsNumber: number | null
|
118
120
|
combinedBathroomsNumber: number | null
|
121
|
+
parking?: ParkingTypes | null
|
119
122
|
}
|
120
123
|
|
121
124
|
type InspectionImageFieldsSettings = {
|
@@ -332,7 +335,7 @@ type HouseServicesInfoStepFields = {
|
|
332
335
|
securityPhone: PhoneParams | null
|
333
336
|
hasVideoControl: boolean | null
|
334
337
|
videoControlPhone: PhoneParams | null
|
335
|
-
parkingType: ParkingTypes | null
|
338
|
+
parkingType: ParkingTypes$1 | null
|
336
339
|
parkingNumber: string
|
337
340
|
passengerElevatorsCount: number | null
|
338
341
|
serviceElevatorsCount: number | null
|
@@ -619,6 +622,8 @@ declare const SecurityApartmentInfoFieldsSchema: {
|
|
619
622
|
intercomCode: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
620
623
|
hasGate: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
621
624
|
gateCode: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
625
|
+
parkingType: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
626
|
+
parkingNumber: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
622
627
|
};
|
623
628
|
declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
|
624
629
|
typeOfRoom: string;
|
@@ -627,6 +632,8 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
|
|
627
632
|
intercomCode: string | null | undefined;
|
628
633
|
hasGate: string;
|
629
634
|
gateCode: string | null | undefined;
|
635
|
+
parkingType: string | null | undefined;
|
636
|
+
parkingNumber: string | null | undefined;
|
630
637
|
}, yup.AnyObject, {
|
631
638
|
typeOfRoom: undefined;
|
632
639
|
entrance: undefined;
|
@@ -634,6 +641,8 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
|
|
634
641
|
intercomCode: undefined;
|
635
642
|
hasGate: undefined;
|
636
643
|
gateCode: undefined;
|
644
|
+
parkingType: undefined;
|
645
|
+
parkingNumber: undefined;
|
637
646
|
}, "">;
|
638
647
|
|
639
648
|
declare const getApartmentPaymentFields: (settings?: InspectionFieldsSettings | undefined) => any[];
|
@@ -686,8 +695,6 @@ declare const HouseServicesInfoFieldsSchema: {
|
|
686
695
|
} | null, yup.AnyObject, {
|
687
696
|
phoneNumber: undefined;
|
688
697
|
}, "">;
|
689
|
-
parkingType: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
690
|
-
parkingNumber: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
691
698
|
passengerElevatorsCount: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
692
699
|
serviceElevatorsCount: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
693
700
|
};
|
@@ -708,8 +715,6 @@ declare const HouseServicesInfoStepSchema: yup.ObjectSchema<{
|
|
708
715
|
videoControlPhone: {
|
709
716
|
phoneNumber?: string | null | undefined;
|
710
717
|
} | null;
|
711
|
-
parkingType: string | null | undefined;
|
712
|
-
parkingNumber: string | null | undefined;
|
713
718
|
passengerElevatorsCount: number;
|
714
719
|
serviceElevatorsCount: number;
|
715
720
|
}, yup.AnyObject, {
|
@@ -729,8 +734,6 @@ declare const HouseServicesInfoStepSchema: yup.ObjectSchema<{
|
|
729
734
|
videoControlPhone: {
|
730
735
|
phoneNumber: undefined;
|
731
736
|
};
|
732
|
-
parkingType: undefined;
|
733
|
-
parkingNumber: undefined;
|
734
737
|
passengerElevatorsCount: undefined;
|
735
738
|
serviceElevatorsCount: undefined;
|
736
739
|
}, "">;
|
package/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
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,
|
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';
|
4
4
|
import to from 'await-to-js';
|
5
5
|
import { DateTime } from 'luxon';
|
6
6
|
import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm } from 'kui-complex';
|
@@ -536,6 +536,8 @@ var getSecurityApartmentInfoFields = function (settings) { return [
|
|
536
536
|
__assign({ name: "intercomCode", label: "Intercom code", variant: "custom", CustomInput: DependentInput, dependentInputName: "hasIntercom" }, settings === null || settings === void 0 ? void 0 : settings.intercomCode),
|
537
537
|
__assign({ name: "hasGate", label: "Gate", variant: "select", options: BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasGate),
|
538
538
|
__assign({ name: "gateCode", label: "Gate code", variant: "custom", CustomInput: DependentInput, dependentInputName: "hasGate" }, settings === null || settings === void 0 ? void 0 : settings.gateCode),
|
539
|
+
__assign({ name: "parkingType", label: "Parking", variant: "select", options: ParkingTypesValues }, settings === null || settings === void 0 ? void 0 : settings.parkingType),
|
540
|
+
__assign({ name: "parkingNumber", label: "Parking number", variant: "custom", CustomInput: DependentInput, dependentInputName: "parkingType" }, settings === null || settings === void 0 ? void 0 : settings.parkingNumber),
|
539
541
|
]; };
|
540
542
|
|
541
543
|
var SecurityApartmentInfoFieldsSchema = {
|
@@ -545,6 +547,14 @@ var SecurityApartmentInfoFieldsSchema = {
|
|
545
547
|
intercomCode: fieldWithConditionSchema("hasIntercom"),
|
546
548
|
hasGate: yup.string().required("This field is required"),
|
547
549
|
gateCode: fieldWithConditionSchema("hasGate"),
|
550
|
+
parkingType: yup.string().nullable(),
|
551
|
+
parkingNumber: yup
|
552
|
+
.string()
|
553
|
+
.when("parkingType", {
|
554
|
+
is: function (value) { return !!value; },
|
555
|
+
then: function (rule) { return rule.required(defaultRequiredMessage); },
|
556
|
+
})
|
557
|
+
.nullable(),
|
548
558
|
};
|
549
559
|
var SecurityApartmentInfoStepSchema = yup.object(SecurityApartmentInfoFieldsSchema);
|
550
560
|
|
@@ -581,8 +591,6 @@ var getHouseServicesInfoStep = function (settings) { return [
|
|
581
591
|
__assign({ name: "securityPhone", label: "Security", variant: "custom", CustomInput: DependentInput, dependentInputName: "hasSecurity", Input: InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.securityPhone),
|
582
592
|
__assign({ name: "hasVideoControl", label: "Video surveillance", variant: "select", options: BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasVideoControl),
|
583
593
|
__assign({ name: "videoControlPhone", label: "Video surveillance", variant: "custom", CustomInput: DependentInput, dependentInputName: "hasVideoControl", Input: InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.videoControlPhone),
|
584
|
-
__assign({ name: "parkingType", label: "Parking", variant: "select", options: ParkingTypesValues }, settings === null || settings === void 0 ? void 0 : settings.parkingType),
|
585
|
-
__assign({ name: "parkingNumber", label: "Parking number", variant: "custom", CustomInput: DependentInput, dependentInputName: "parkingType" }, settings === null || settings === void 0 ? void 0 : settings.parkingNumber),
|
586
594
|
__assign({ name: "passengerElevatorsCount", label: "Passenger elevators", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.passengerElevatorsCount),
|
587
595
|
__assign({ name: "serviceElevatorsCount", label: "Service elevators", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.serviceElevatorsCount),
|
588
596
|
]; };
|
@@ -596,14 +604,6 @@ var HouseServicesInfoFieldsSchema = {
|
|
596
604
|
securityPhone: phoneWithConditionSchema("hasSecurity"),
|
597
605
|
hasVideoControl: yup.string().required(defaultRequiredMessage),
|
598
606
|
videoControlPhone: phoneWithConditionSchema("hasVideoControl"),
|
599
|
-
parkingType: yup.string().nullable(),
|
600
|
-
parkingNumber: yup
|
601
|
-
.string()
|
602
|
-
.when("parkingType", {
|
603
|
-
is: function (value) { return !!value; },
|
604
|
-
then: function (rule) { return rule.required(defaultRequiredMessage); },
|
605
|
-
})
|
606
|
-
.nullable(),
|
607
607
|
passengerElevatorsCount: positiveNumberSchema,
|
608
608
|
serviceElevatorsCount: positiveNumberSchema,
|
609
609
|
};
|
@@ -677,7 +677,7 @@ var renderMetersSteps = function (MeterStep, MeterPhotoStep, maxMeters) {
|
|
677
677
|
]; });
|
678
678
|
};
|
679
679
|
|
680
|
-
var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
|
680
|
+
var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
|
681
681
|
__assign({ type: "kitchen" }, settings.kitchen)
|
682
682
|
], new Array(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0))
|
683
683
|
.fill(0)
|
@@ -695,7 +695,9 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
|
|
695
695
|
.map(function (_, index) { return (__assign({ type: "combined_bathroom" }, settings.combinedBathroom((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.combinedBathroomsNumber) ? "".concat(index + 1, " ") : ""))); }), true), [
|
696
696
|
__assign({ type: "others" }, settings.others),
|
697
697
|
__assign({ type: "keys" }, settings.keys)
|
698
|
-
], false), addToArrayByCondition(type === "inventory", __assign({ type: "entrance" }, settings.entrance)), true)
|
698
|
+
], false), addToArrayByCondition(type === "inventory", __assign({ type: "entrance" }, settings.entrance)), true), addToArrayByCondition(!!(type === "initial" && (roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.parking)), __assign({ type: "parking" }, settings.parkung)), true), [
|
699
|
+
__assign({ type: "additional" }, settings.additional),
|
700
|
+
], false); };
|
699
701
|
|
700
702
|
var useMetersValues = function (formStore, metersStore) {
|
701
703
|
useEffect(function () {
|