kui-crm_actions 0.0.38 → 0.0.40

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 CHANGED
@@ -166,20 +166,16 @@ var inspectionsRequestBody = {
166
166
  has_gate: inspection.hasGate,
167
167
  gate_code: inspection.gateCode,
168
168
  area: inspection.area,
169
- living_area: inspection.livingArea,
170
- kitchen_area: inspection.kitchenArea,
171
169
  rooms_number: inspection.roomsNumber,
172
170
  bedrooms_number: inspection.bedroomsNumber,
173
171
  bathrooms_number: inspection.bathroomsNumber,
174
172
  restrooms_number: inspection.restroomsNumber,
175
173
  combined_bathrooms_number: inspection.combinedBathroomsNumber,
176
- ceiling_height: inspection.ceilingHeight,
177
174
  number_of_windows: inspection.numberOfWindows,
178
175
  renovation_year: (_a = inspection.renovation) === null || _a === void 0 ? void 0 : _a.year,
179
176
  renovation_type: (_b = inspection.renovation) === null || _b === void 0 ? void 0 : _b.type,
180
177
  renovation_style: (_c = inspection.renovation) === null || _c === void 0 ? void 0 : _c.style,
181
178
  rooms: inspection.rooms.map(function (room, index) { return ({
182
- area: room.area,
183
179
  room_type: room.type,
184
180
  order_number: index + 1,
185
181
  }); }),
@@ -473,25 +469,21 @@ var inputProps = {
473
469
  var getDetailApartmentInfoFields = function (roomsCount, bedroomsCount, settings) {
474
470
  var _a, _b;
475
471
  return __spreadArray(__spreadArray([
476
- __assign(__assign({ label: "Total area", name: "area", type: "number" }, inputProps), settings === null || settings === void 0 ? void 0 : settings.area),
477
- __assign(__assign({ label: "Living area", name: "livingArea", type: "number" }, inputProps), settings === null || settings === void 0 ? void 0 : settings.livingArea),
478
- __assign(__assign({ label: "Kitchen area", name: "kitchenArea", type: "number" }, inputProps), settings === null || settings === void 0 ? void 0 : settings.kitchenArea)
472
+ __assign(__assign({ label: "Total area", name: "area", type: "number" }, inputProps), settings === null || settings === void 0 ? void 0 : settings.area)
479
473
  ], (roomsCount
480
474
  ? new Array(Number(roomsCount))
481
475
  .fill(0)
482
476
  .map(function (_, key) {
483
- var _a, _b;
477
+ var _a;
484
478
  var label = bedroomsCount && key < bedroomsCount
485
479
  ? "Bedroom ".concat(key + 1)
486
480
  : "Room ".concat(key + 1);
487
481
  return [
488
- __assign(__assign({ name: "rooms.".concat(key, ".area"), label: "".concat(label, " area"), type: "number" }, inputProps), ((settings === null || settings === void 0 ? void 0 : settings.rooms) ? (_a = settings.rooms(key)) === null || _a === void 0 ? void 0 : _a.area : {})),
489
- __assign({ name: "rooms.".concat(key, ".type"), label: "".concat(label, " type"), variant: "select", options: kuiCrm.RoomTypeValues }, ((settings === null || settings === void 0 ? void 0 : settings.rooms) ? (_b = settings.rooms(key)) === null || _b === void 0 ? void 0 : _b.type : {})),
482
+ __assign({ name: "rooms.".concat(key, ".type"), label: "".concat(label, " type"), variant: "select", options: kuiCrm.RoomTypeValues }, ((settings === null || settings === void 0 ? void 0 : settings.rooms) ? (_a = settings.rooms(key)) === null || _a === void 0 ? void 0 : _a.type : {})),
490
483
  ];
491
484
  })
492
485
  .flat()
493
486
  : []), true), [
494
- __assign(__assign({ name: "ceilingHeight", label: "Ceiling height", type: "number" }, inputProps), settings === null || settings === void 0 ? void 0 : settings.ceilingHeight),
495
487
  __assign({ name: "numberOfWindows", label: "Windows", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.numberOfWindows),
496
488
  __assign({ name: "renovation.year", label: "Year of last renovation", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.renovation.year),
497
489
  __assign({ name: "renovation.type", label: "Type of renovation", variant: "select", options: kuiCrm.RenovationTypeValues }, (_a = settings === null || settings === void 0 ? void 0 : settings.renovation) === null || _a === void 0 ? void 0 : _a.type),
@@ -571,6 +563,8 @@ var getSecurityApartmentInfoFields = function (settings) { return [
571
563
  __assign({ name: "intercomCode", label: "Intercom code", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasIntercom" }, settings === null || settings === void 0 ? void 0 : settings.intercomCode),
572
564
  __assign({ name: "hasGate", label: "Gate", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasGate),
573
565
  __assign({ name: "gateCode", label: "Gate code", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasGate" }, settings === null || settings === void 0 ? void 0 : settings.gateCode),
566
+ __assign({ name: "parkingType", label: "Parking", variant: "select", options: kuiCrm.ParkingTypesValues }, settings === null || settings === void 0 ? void 0 : settings.parkingType),
567
+ __assign({ name: "parkingNumber", label: "Parking number", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "parkingType" }, settings === null || settings === void 0 ? void 0 : settings.parkingNumber),
574
568
  ]; };
575
569
 
576
570
  var SecurityApartmentInfoFieldsSchema = {
@@ -580,6 +574,14 @@ var SecurityApartmentInfoFieldsSchema = {
580
574
  intercomCode: kuiCrm.fieldWithConditionSchema("hasIntercom"),
581
575
  hasGate: yup__namespace.string().required("This field is required"),
582
576
  gateCode: kuiCrm.fieldWithConditionSchema("hasGate"),
577
+ parkingType: yup__namespace.string().nullable(),
578
+ parkingNumber: yup__namespace
579
+ .string()
580
+ .when("parkingType", {
581
+ is: function (value) { return !!value; },
582
+ then: function (rule) { return rule.required(kuiCrm.defaultRequiredMessage); },
583
+ })
584
+ .nullable(),
583
585
  };
584
586
  var SecurityApartmentInfoStepSchema = yup__namespace.object(SecurityApartmentInfoFieldsSchema);
585
587
 
@@ -616,8 +618,6 @@ var getHouseServicesInfoStep = function (settings) { return [
616
618
  __assign({ name: "securityPhone", label: "Security", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasSecurity", Input: kuiComplex.InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.securityPhone),
617
619
  __assign({ name: "hasVideoControl", label: "Video surveillance", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasVideoControl),
618
620
  __assign({ name: "videoControlPhone", label: "Video surveillance", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasVideoControl", Input: kuiComplex.InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.videoControlPhone),
619
- __assign({ name: "parkingType", label: "Parking", variant: "select", options: kuiCrm.ParkingTypesValues }, settings === null || settings === void 0 ? void 0 : settings.parkingType),
620
- __assign({ name: "parkingNumber", label: "Parking number", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "parkingType" }, settings === null || settings === void 0 ? void 0 : settings.parkingNumber),
621
621
  __assign({ name: "passengerElevatorsCount", label: "Passenger elevators", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.passengerElevatorsCount),
622
622
  __assign({ name: "serviceElevatorsCount", label: "Service elevators", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.serviceElevatorsCount),
623
623
  ]; };
@@ -631,14 +631,6 @@ var HouseServicesInfoFieldsSchema = {
631
631
  securityPhone: kuiCrm.phoneWithConditionSchema("hasSecurity"),
632
632
  hasVideoControl: yup__namespace.string().required(kuiCrm.defaultRequiredMessage),
633
633
  videoControlPhone: kuiCrm.phoneWithConditionSchema("hasVideoControl"),
634
- parkingType: yup__namespace.string().nullable(),
635
- parkingNumber: yup__namespace
636
- .string()
637
- .when("parkingType", {
638
- is: function (value) { return !!value; },
639
- then: function (rule) { return rule.required(kuiCrm.defaultRequiredMessage); },
640
- })
641
- .nullable(),
642
634
  passengerElevatorsCount: kuiCrm.positiveNumberSchema,
643
635
  serviceElevatorsCount: kuiCrm.positiveNumberSchema,
644
636
  };
@@ -712,7 +704,7 @@ var renderMetersSteps = function (MeterStep, MeterPhotoStep, maxMeters) {
712
704
  ]; });
713
705
  };
714
706
 
715
- var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
707
+ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([
716
708
  __assign({ type: "kitchen" }, settings.kitchen)
717
709
  ], new Array(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0))
718
710
  .fill(0)
@@ -730,7 +722,9 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
730
722
  .map(function (_, index) { return (__assign({ type: "combined_bathroom" }, settings.combinedBathroom((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.combinedBathroomsNumber) ? "".concat(index + 1, " ") : ""))); }), true), [
731
723
  __assign({ type: "others" }, settings.others),
732
724
  __assign({ type: "keys" }, settings.keys)
733
- ], false), kuiUtils.addToArrayByCondition(type === "initial", __assign({ type: "entrance" }, settings.entrance)), true); };
725
+ ], false), kuiUtils.addToArrayByCondition(type === "inventory", __assign({ type: "entrance" }, settings.entrance)), true), kuiUtils.addToArrayByCondition(type === "initial", __assign({ type: "parking" }, settings.parkung)), true), [
726
+ __assign({ type: "additional" }, settings.additional),
727
+ ], false); };
734
728
 
735
729
  var useMetersValues = function (formStore, metersStore) {
736
730
  react.useEffect(function () {