kui-crm_actions 0.0.128 → 0.0.130

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/index.js CHANGED
@@ -134,10 +134,17 @@ var WaterMeterFieldsSchema = yup.object().shape({
134
134
  var getWaterMeterFields = function (meters, meter, withCheckValue, name, settings) {
135
135
  var _a, _b;
136
136
  var prefixName = name ? "".concat(name, ".") : "";
137
- var meterOptions = meters.map(function (meterParams) { return ({
138
- value: meterParams.number,
139
- label: "".concat(_.capitalize(meterParams.type || ""), " | #").concat(meterParams.number),
140
- }); });
137
+ var meterOptions = meters.length
138
+ ? meters.map(function (meterParams) { return ({
139
+ value: meterParams.number,
140
+ label: "".concat(_.capitalize(meterParams.type || ""), " | #").concat(meterParams.number),
141
+ }); })
142
+ : [
143
+ {
144
+ value: meter === null || meter === void 0 ? void 0 : meter.number,
145
+ label: "".concat(_.capitalize((meter === null || meter === void 0 ? void 0 : meter.type) || ""), " | #").concat(meter === null || meter === void 0 ? void 0 : meter.number),
146
+ },
147
+ ];
141
148
  return [
142
149
  __assign({ label: "Meter", name: "".concat(prefixName, "number"), variant: "select", options: meterOptions, size: 12, isRequired: true, disabled: meterOptions.length === 1 }, settings === null || settings === void 0 ? void 0 : settings.meter),
143
150
  __assign({ label: "Value", name: "".concat(prefixName, "value"), variant: "custom", CustomInput: NumberField, maxIntegerPart: 7, maxDecimalPart: 3, maxValue: ((_a = meter === null || meter === void 0 ? void 0 : meter.maxValue) === null || _a === void 0 ? void 0 : _a.value) && withCheckValue
@@ -1178,7 +1185,7 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
1178
1185
  switch (_c.label) {
1179
1186
  case 0:
1180
1187
  if (!(shouldBeLoad && apartmentId)) return [3 /*break*/, 3];
1181
- if (!!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) return [3 /*break*/, 2];
1188
+ if (!!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.fillingList) === null || _b === void 0 ? void 0 : _b.length)) return [3 /*break*/, 2];
1182
1189
  return [4 /*yield*/, fillingStore.fetchFillingList(apartmentId, "appliance")];
1183
1190
  case 1:
1184
1191
  _c.sent();
@@ -1199,7 +1206,8 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
1199
1206
  }, [apartmentId, shouldBeLoad]);
1200
1207
  useEffect(function () {
1201
1208
  var _a, _b;
1202
- if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {
1209
+ if (!fillingStore.loader.isLoading &&
1210
+ !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.fillingList) === null || _b === void 0 ? void 0 : _b.length)) {
1203
1211
  formStore.updateFormFields({
1204
1212
  fillingList: fillingStore.fillingList.map(function (filling) { return (__assign(__assign({}, filling), { check: false })); }),
1205
1213
  });