kui-crm_actions 0.0.46 → 0.0.48
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 +50 -5
- package/cjs/index.js.map +1 -1
- package/index.d.ts +43 -4
- package/index.js +51 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
@@ -10,6 +10,9 @@ var luxon = require('luxon');
|
|
10
10
|
var kuiComplex = require('kui-complex');
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
12
12
|
var react = require('react');
|
13
|
+
var styled = require('@emotion/styled');
|
14
|
+
var kuiBasic = require('kui-basic');
|
15
|
+
var kuiIcon = require('kui-icon');
|
13
16
|
|
14
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
15
18
|
|
@@ -33,6 +36,7 @@ function _interopNamespace(e) {
|
|
33
36
|
|
34
37
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
35
38
|
var to__default = /*#__PURE__*/_interopDefaultLegacy(to);
|
39
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
36
40
|
|
37
41
|
/******************************************************************************
|
38
42
|
Copyright (c) Microsoft Corporation.
|
@@ -106,6 +110,11 @@ function __spreadArray(to, from, pack) {
|
|
106
110
|
}
|
107
111
|
}
|
108
112
|
return to.concat(ar || Array.prototype.slice.call(from));
|
113
|
+
}
|
114
|
+
|
115
|
+
function __makeTemplateObject(cooked, raw) {
|
116
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
117
|
+
return cooked;
|
109
118
|
}
|
110
119
|
|
111
120
|
var getPartialMeterInfoFields = function (resource, type, name, settings) {
|
@@ -177,7 +186,7 @@ var inspectionsRequestBody = {
|
|
177
186
|
renovation_style: (_c = inspection.renovation) === null || _c === void 0 ? void 0 : _c.style,
|
178
187
|
rooms: inspection.rooms.map(function (room, index) { return ({
|
179
188
|
room_type: room.type,
|
180
|
-
order_number: index
|
189
|
+
order_number: index,
|
181
190
|
}); }),
|
182
191
|
};
|
183
192
|
},
|
@@ -329,12 +338,14 @@ var inspectionsRequests = {
|
|
329
338
|
bedroomIndex = 0;
|
330
339
|
return [2 /*return*/, roomsImages.map(function (room, index) {
|
331
340
|
if (room.type === "room") {
|
332
|
-
|
333
|
-
|
341
|
+
return __assign(__assign({}, _this.getRoomParams(room, images[index])), {
|
342
|
+
// eslint-disable-next-line no-plusplus
|
343
|
+
room_order_number: roomIndex++ });
|
334
344
|
}
|
335
345
|
if (room.type === "bedroom") {
|
336
|
-
|
337
|
-
|
346
|
+
return __assign(__assign({}, _this.getRoomParams(room, images[index])), {
|
347
|
+
// eslint-disable-next-line no-plusplus
|
348
|
+
room_order_number: bedroomIndex++ });
|
338
349
|
}
|
339
350
|
return _this.getRoomParams(room, images[index]);
|
340
351
|
})];
|
@@ -739,8 +750,42 @@ var useMetersValues = function (formStore, metersStore) {
|
|
739
750
|
}, [metersStore.meters, metersStore.loader.isLoading]);
|
740
751
|
};
|
741
752
|
|
753
|
+
var MetroStation = function (props) {
|
754
|
+
var metroStation = props.metroStation;
|
755
|
+
var color = metroStation.color, name = metroStation.name;
|
756
|
+
return (jsxRuntime.jsxs(StyledWrapper$1, __assign({ item: true, container: true, alignItems: "center" }, { children: [jsxRuntime.jsx(StyledPoint, { style: { background: color } }), jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "s", color: "sixty" }, { children: name }))] })));
|
757
|
+
};
|
758
|
+
var StyledWrapper$1 = styled__default["default"](kuiBasic.Grid)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n width: auto;\n"], ["\n width: auto;\n"])));
|
759
|
+
var StyledPoint = styled__default["default"].div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 6px;\n"], ["\n width: 6px;\n height: 6px;\n border-radius: 50%;\n margin-right: 6px;\n"])));
|
760
|
+
var templateObject_1$2, templateObject_2$2;
|
761
|
+
|
762
|
+
var ContactPhone = function (props) {
|
763
|
+
var phone = props.phone;
|
764
|
+
var formattedPhone = kuiUtils.getPhoneNumberFromPhoneParams(phone, " ");
|
765
|
+
var phoneLink = formattedPhone.replace(/\d/g, "");
|
766
|
+
return (jsxRuntime.jsxs(StyledWrapper, __assign({ container: true, alignItems: "center", wrap: "nowrap" }, { children: [jsxRuntime.jsx(StyledPhoneIcon, { width: 14, height: 14 }), jsxRuntime.jsx("a", __assign({ href: "tel:+".concat(phoneLink) }, { children: jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "s", weight: 500, color: "sixty" }, { children: formattedPhone })) }))] })));
|
767
|
+
};
|
768
|
+
var StyledWrapper = styled__default["default"](kuiBasic.Grid)(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n width: auto;\n"], ["\n width: auto;\n"])));
|
769
|
+
var StyledPhoneIcon = styled__default["default"](kuiIcon.PhoneIcon)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n margin-right: 6px;\n transform: rotate(15deg);\n path {\n stroke: ", ";\n }\n"], ["\n margin-right: 6px;\n transform: rotate(15deg);\n path {\n stroke: ", ";\n }\n"])), kuiBasic.theme.palette.grey.sixty);
|
770
|
+
var templateObject_1$1, templateObject_2$1;
|
771
|
+
|
772
|
+
var ApartmentInspectionCard = function (props) {
|
773
|
+
var inspection = props.inspection, onClose = props.onClose, getClientLink = props.getClientLink, getApartmentLink = props.getApartmentLink;
|
774
|
+
var apartment = inspection.apartment, tenant = inspection.tenant, metroStations = inspection.metroStations;
|
775
|
+
var clientLink = getClientLink ? getClientLink(tenant.id) : "";
|
776
|
+
var apartmentLink = getApartmentLink(apartment.id);
|
777
|
+
return (jsxRuntime.jsxs(StyledCard, { children: [jsxRuntime.jsx(kuiCrm.Link, __assign({ href: apartmentLink }, { children: jsxRuntime.jsx(StyledPreviewContent, { imageSrc: apartment.previewImage, description: "".concat(apartment.address, ", \u043A\u0432. ").concat(apartment.apartmentNumber) }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: metroStations.map(function (station) { return (jsxRuntime.jsx(MetroStation, { metroStation: station }, station.name)); }) })), jsxRuntime.jsxs(StyledTenantInfo, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [clientLink ? (jsxRuntime.jsx(StyledClientLink, __assign({ href: clientLink }, { children: jsxRuntime.jsx(kuiCrm.UserBadge, { weight: 500, user: tenant }) }))) : (jsxRuntime.jsx(kuiCrm.UserBadge, { weight: 500, user: tenant })), !!tenant.phone && jsxRuntime.jsx(ContactPhone, { phone: tenant.phone })] })), jsxRuntime.jsx(StyledCloseButton, __assign({ isCircle: true, size: "xs", variant: "whiteWithGray", onClick: onClose }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 6, height: 6 }) }))] }));
|
778
|
+
};
|
779
|
+
var StyledCard = styled__default["default"].div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"], ["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"])), kuiBasic.theme.palette.grey.zero);
|
780
|
+
var StyledPreviewContent = styled__default["default"](kuiCrm.PreviewContent)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 8px;\n p {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"], ["\n margin-bottom: 8px;\n p {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"])));
|
781
|
+
var StyledTenantInfo = styled__default["default"](kuiBasic.Grid)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-top: 8px;\n border-top: 1px solid ", ";\n margin-top: 8px;\n flex-wrap: nowrap;\n"], ["\n padding-top: 8px;\n border-top: 1px solid ", ";\n margin-top: 8px;\n flex-wrap: nowrap;\n"])), kuiBasic.theme.palette.grey.fifteenB);
|
782
|
+
var StyledCloseButton = styled__default["default"](kuiBasic.Button)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n top: -10px;\n right: -10px;\n width: 24px;\n height: 24px;\n"], ["\n position: absolute;\n top: -10px;\n right: -10px;\n width: 24px;\n height: 24px;\n"])));
|
783
|
+
var StyledClientLink = styled__default["default"](kuiCrm.Link)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n max-width: calc(100% - 140px);\n"], ["\n max-width: calc(100% - 140px);\n"])));
|
784
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
785
|
+
|
742
786
|
exports.AdditionalInfoFieldsSchema = AdditionalInfoFieldsSchema;
|
743
787
|
exports.AdditionalInfoStepSchema = AdditionalInfoStepSchema;
|
788
|
+
exports.ApartmentInspectionCard = ApartmentInspectionCard;
|
744
789
|
exports.BasicApartmentInfoFieldsSchema = BasicApartmentInfoFieldsSchema;
|
745
790
|
exports.BasicApartmentInfoStepSchema = BasicApartmentInfoStepSchema;
|
746
791
|
exports.DetailApartmentInfoFieldsSchema = DetailApartmentInfoFieldsSchema;
|