kui-crm_actions 0.0.79 → 0.0.81
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 +24 -3
- package/cjs/index.js.map +1 -1
- package/index.d.ts +5 -3
- package/index.js +24 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
@@ -223,7 +223,7 @@ var inspectionsRequestBody = {
|
|
223
223
|
based_on: null,
|
224
224
|
dropbox_link: inspection.dropboxLink,
|
225
225
|
photo_groups: roomsImages,
|
226
|
-
regular: __assign(__assign({}, this.getInspectionFilling(inspection.
|
226
|
+
regular: __assign(__assign({}, this.getInspectionFilling(inspection.fillingList)), this.getPartialInspectionMeters(inspection.meters)),
|
227
227
|
};
|
228
228
|
},
|
229
229
|
getPostBodyTransferInspection: function (inspection, roomsImages) {
|
@@ -233,7 +233,7 @@ var inspectionsRequestBody = {
|
|
233
233
|
based_on: null,
|
234
234
|
dropbox_link: inspection.dropboxLink,
|
235
235
|
photo_groups: roomsImages,
|
236
|
-
transfer: __assign(__assign({ transfer_type: inspection.transferType }, this.getInspectionFilling(inspection.
|
236
|
+
transfer: __assign(__assign({ transfer_type: inspection.transferType }, this.getInspectionFilling(inspection.fillingList)), this.getPartialInspectionMeters(inspection.meters)),
|
237
237
|
};
|
238
238
|
},
|
239
239
|
getInspectionFilling: function (fillingList) {
|
@@ -1001,7 +1001,7 @@ var templateObject_1$5, templateObject_2$4, templateObject_3$1;
|
|
1001
1001
|
|
1002
1002
|
var InspectionFillingCard = function (props) {
|
1003
1003
|
var className = props.className, form = props.form, index = props.index, disabled = props.disabled, other = __rest(props, ["className", "form", "index", "disabled"]);
|
1004
|
-
return (jsxRuntime.jsx(StyledCard$1, __assign({ className: className }, { children: jsxRuntime.jsx(StyledCheckbox, { form: form, name: "
|
1004
|
+
return (jsxRuntime.jsx(StyledCard$1, __assign({ className: className }, { children: jsxRuntime.jsx(StyledCheckbox, { form: form, name: "fillingList.".concat(index, ".check"), label: jsxRuntime.jsx(FillingCardContent, __assign({}, other)), disabled: disabled }) })));
|
1005
1005
|
};
|
1006
1006
|
var StyledCard$1 = styled__default["default"](kuiBasic.Grid)(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"], ["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"])));
|
1007
1007
|
var StyledCheckbox = styled__default["default"](kuiComplex.CheckboxWithController)(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"], ["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"])));
|
@@ -1054,6 +1054,26 @@ var FillingListStore = /** @class */ (function () {
|
|
1054
1054
|
return FillingListStore;
|
1055
1055
|
}());
|
1056
1056
|
|
1057
|
+
var useFillingList = function (apartmentId, formStore, fillingStore) {
|
1058
|
+
react.useEffect(function () {
|
1059
|
+
var _a, _b;
|
1060
|
+
if (!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length) && apartmentId) {
|
1061
|
+
fillingStore.fetchFillingList(apartmentId);
|
1062
|
+
}
|
1063
|
+
}, [apartmentId]);
|
1064
|
+
react.useEffect(function () {
|
1065
|
+
var _a, _b;
|
1066
|
+
if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {
|
1067
|
+
formStore.updateFormFields({
|
1068
|
+
fillingList: fillingStore.fillingList.map(function (filling) { return ({
|
1069
|
+
id: filling.id,
|
1070
|
+
check: false,
|
1071
|
+
}); }),
|
1072
|
+
});
|
1073
|
+
}
|
1074
|
+
}, [fillingStore.fillingList, fillingStore.loader.isLoading]);
|
1075
|
+
};
|
1076
|
+
|
1057
1077
|
var ApartmentInspectionPoint = function (props) {
|
1058
1078
|
var date = props.date, onClick = props.onClick, isActive = props.isActive, apartment = props.apartment;
|
1059
1079
|
return (jsxRuntime.jsx(kuiBasic.Button, __assign({ size: "xs", variant: isActive ? "primary" : "white", onClick: onClick }, { children: (date === null || date === void 0 ? void 0 : date.toFormat("dd.MM.yyyy")) || "".concat(Number(apartment.roomsCount), "-\u043A\u043E\u043C\u043D.") })));
|
@@ -1139,5 +1159,6 @@ exports.getWaterMeterFields = getWaterMeterFields;
|
|
1139
1159
|
exports.inspectionsRequestBody = inspectionsRequestBody;
|
1140
1160
|
exports.inspectionsRequests = inspectionsRequests;
|
1141
1161
|
exports.renderMetersSteps = renderMetersSteps;
|
1162
|
+
exports.useFillingList = useFillingList;
|
1142
1163
|
exports.useMetersValues = useMetersValues;
|
1143
1164
|
//# sourceMappingURL=index.js.map
|