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/cjs/index.js +14 -6
- package/cjs/index.js.map +1 -1
- package/index.js +14 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
@@ -163,10 +163,17 @@ var WaterMeterFieldsSchema = yup__namespace.object().shape({
|
|
163
163
|
var getWaterMeterFields = function (meters, meter, withCheckValue, name, settings) {
|
164
164
|
var _a, _b;
|
165
165
|
var prefixName = name ? "".concat(name, ".") : "";
|
166
|
-
var meterOptions = meters.
|
167
|
-
|
168
|
-
|
169
|
-
|
166
|
+
var meterOptions = meters.length
|
167
|
+
? meters.map(function (meterParams) { return ({
|
168
|
+
value: meterParams.number,
|
169
|
+
label: "".concat(___default["default"].capitalize(meterParams.type || ""), " | #").concat(meterParams.number),
|
170
|
+
}); })
|
171
|
+
: [
|
172
|
+
{
|
173
|
+
value: meter === null || meter === void 0 ? void 0 : meter.number,
|
174
|
+
label: "".concat(___default["default"].capitalize((meter === null || meter === void 0 ? void 0 : meter.type) || ""), " | #").concat(meter === null || meter === void 0 ? void 0 : meter.number),
|
175
|
+
},
|
176
|
+
];
|
170
177
|
return [
|
171
178
|
__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),
|
172
179
|
__assign({ label: "Value", name: "".concat(prefixName, "value"), variant: "custom", CustomInput: kuiCrm.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
|
@@ -1207,7 +1214,7 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
|
|
1207
1214
|
switch (_c.label) {
|
1208
1215
|
case 0:
|
1209
1216
|
if (!(shouldBeLoad && apartmentId)) return [3 /*break*/, 3];
|
1210
|
-
if (!!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.
|
1217
|
+
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];
|
1211
1218
|
return [4 /*yield*/, fillingStore.fetchFillingList(apartmentId, "appliance")];
|
1212
1219
|
case 1:
|
1213
1220
|
_c.sent();
|
@@ -1228,7 +1235,8 @@ var useFillingList = function (apartmentId, formStore, fillingStore, shouldBeLoa
|
|
1228
1235
|
}, [apartmentId, shouldBeLoad]);
|
1229
1236
|
react.useEffect(function () {
|
1230
1237
|
var _a, _b;
|
1231
|
-
if (!fillingStore.loader.isLoading &&
|
1238
|
+
if (!fillingStore.loader.isLoading &&
|
1239
|
+
!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.fillingList) === null || _b === void 0 ? void 0 : _b.length)) {
|
1232
1240
|
formStore.updateFormFields({
|
1233
1241
|
fillingList: fillingStore.fillingList.map(function (filling) { return (__assign(__assign({}, filling), { check: false })); }),
|
1234
1242
|
});
|