kui-crm_actions 0.0.128 → 0.0.129

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