kui-crm 0.0.217 → 0.0.220

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 CHANGED
@@ -2616,11 +2616,11 @@ function ModalWithMap(props) {
2616
2616
  map.addListener("click", addPlace);
2617
2617
  return function () { return map === null || map === void 0 ? void 0 : map.unbindAll(); };
2618
2618
  }, [map, disabled]);
2619
- return (jsxRuntime.jsxs(StyledModal$2, __assign({ handleClose: handleClose, open: open }, { children: [jsxRuntime.jsx(kuiComplex.MapWrapper, { children: jsxRuntime.jsx(MapComponent$1, { setMap: setMap }) }), !disabled && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(StyledInput$5, { name: "mapAddress", label: "Address", form: form, handlePlaceSelect: handlePlaceSelect }), jsxRuntime.jsx(StyledButton$5, __assign({ size: "s", onClick: form.handleSubmit(handleSave), endIcon: jsxRuntime.jsx(kuiIcon.CheckIcon, {}) }, { children: "Save" }))] }))] })));
2619
+ return (jsxRuntime.jsxs(StyledModal$2, __assign({ handleClose: handleClose, open: open }, { children: [jsxRuntime.jsx(kuiComplex.MapWrapper, { children: jsxRuntime.jsx(MapComponent$1, { setMap: setMap }) }), !disabled && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(StyledInput$4, { name: "mapAddress", label: "Address", form: form, handlePlaceSelect: handlePlaceSelect }), jsxRuntime.jsx(StyledButton$5, __assign({ size: "s", onClick: form.handleSubmit(handleSave), endIcon: jsxRuntime.jsx(kuiIcon.CheckIcon, {}) }, { children: "Save" }))] }))] })));
2620
2620
  }
2621
2621
  var ModalWithMap$1 = mobxReact.observer(ModalWithMap);
2622
2622
  var StyledModal$2 = styled__default["default"](Modal)(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n max-width: 1295px !important;\n max-height: 736px !important;\n height: 100%;\n width: 100%;\n overflow: hidden;\n position: relative;\n .KUI-Modal_close-button {\n width: 32px;\n height: 32px;\n background: white;\n border-color: ", ";\n svg {\n width: 16px;\n height: 16px;\n path {\n fill: ", ";\n }\n }\n }\n"], ["\n max-width: 1295px !important;\n max-height: 736px !important;\n height: 100%;\n width: 100%;\n overflow: hidden;\n position: relative;\n .KUI-Modal_close-button {\n width: 32px;\n height: 32px;\n background: white;\n border-color: ", ";\n svg {\n width: 16px;\n height: 16px;\n path {\n fill: ", ";\n }\n }\n }\n"])), kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.grey.seventy);
2623
- var StyledInput$5 = styled__default["default"](kuiComplex.InputWithAddressAutocomplete)(templateObject_2$p || (templateObject_2$p = __makeTemplateObject(["\n position: absolute;\n top: 24px;\n left: 24px;\n max-width: 25%;\n"], ["\n position: absolute;\n top: 24px;\n left: 24px;\n max-width: 25%;\n"])));
2623
+ var StyledInput$4 = styled__default["default"](kuiComplex.InputWithAddressAutocomplete)(templateObject_2$p || (templateObject_2$p = __makeTemplateObject(["\n position: absolute;\n top: 24px;\n left: 24px;\n max-width: 25%;\n"], ["\n position: absolute;\n top: 24px;\n left: 24px;\n max-width: 25%;\n"])));
2624
2624
  var StyledButton$5 = styled__default["default"](kuiBasic.Button)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n position: absolute;\n bottom: 24px;\n right: 24px;\n"], ["\n position: absolute;\n bottom: 24px;\n right: 24px;\n"])));
2625
2625
  var templateObject_1$G, templateObject_2$p, templateObject_3$k;
2626
2626
 
@@ -2712,12 +2712,12 @@ function FileUploaderWithPreview(props) {
2712
2712
  setFilePreview(null);
2713
2713
  form.setValue(name, null);
2714
2714
  };
2715
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(StyledWrapper$a, { children: [jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "xs", color: "fiftyP" }, { children: label })), jsxRuntime.jsx(StyledInput$4, __assign({ id: "file_input", type: "file", "data-testid": "file_input" }, formRegister, { onChange: handleChange })), filePreview ? (jsxRuntime.jsx(PreviewImageCard, { url: filePreview, onDelete: handleDelete })) : (jsxRuntime.jsx(StyledLabel$1, __assign({ htmlFor: "file_input" }, { children: jsxRuntime.jsx(StyledCircleButton, __assign({ isCircle: true, size: "l", variant: "grayLight" }, { children: jsxRuntime.jsx(kuiIcon.PlusIcon, {}) })) })))] }), error && (jsxRuntime.jsx(StyledErrorMessage, __assign({ size: "xs", colorGroup: "red", color: "seventy" }, { children: error })))] }));
2715
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(StyledWrapper$a, { children: [jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "xs", color: "fiftyP" }, { children: label })), jsxRuntime.jsx(StyledInput$3, __assign({ id: "file_input", type: "file", "data-testid": "file_input" }, formRegister, { onChange: handleChange })), filePreview ? (jsxRuntime.jsx(PreviewImageCard, { url: filePreview, onDelete: handleDelete })) : (jsxRuntime.jsx(StyledLabel$1, __assign({ htmlFor: "file_input" }, { children: jsxRuntime.jsx(StyledCircleButton, __assign({ isCircle: true, size: "l", variant: "grayLight" }, { children: jsxRuntime.jsx(kuiIcon.PlusIcon, {}) })) })))] }), error && (jsxRuntime.jsx(StyledErrorMessage, __assign({ size: "xs", colorGroup: "red", color: "seventy" }, { children: error })))] }));
2716
2716
  }
2717
2717
  var StyledWrapper$a = styled__default["default"].div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n border-radius: 8px;\n border: 1px dashed ", ";\n padding: 6px 16px 16px;\n display: inline-block;\n"], ["\n border-radius: 8px;\n border: 1px dashed ", ";\n padding: 6px 16px 16px;\n display: inline-block;\n"])), kuiBasic.theme.palette.grey.fifteenB);
2718
2718
  var StyledLabel$1 = styled__default["default"].label(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n margin-top: 8px;\n display: block;\n cursor: pointer;\n"], ["\n margin-top: 8px;\n display: block;\n cursor: pointer;\n"])));
2719
2719
  var StyledCircleButton = styled__default["default"](kuiBasic.Button)(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n border-radius: 8px;\n background: ", ";\n pointer-events: none;\n"], ["\n border-radius: 8px;\n background: ", ";\n pointer-events: none;\n"])), kuiBasic.theme.palette.background.light2);
2720
- var StyledInput$4 = styled__default["default"].input(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
2720
+ var StyledInput$3 = styled__default["default"].input(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
2721
2721
  var StyledErrorMessage = styled__default["default"](kuiBasic.Caption)(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n margin-top: 4px;\n"], ["\n margin-top: 4px;\n"])));
2722
2722
  var templateObject_1$D, templateObject_2$n, templateObject_3$i, templateObject_4$5, templateObject_5$3;
2723
2723
 
@@ -3194,9 +3194,9 @@ function TariffReplacementField(props) {
3194
3194
  var handleDelete = function () {
3195
3195
  remove(index);
3196
3196
  };
3197
- return (jsxRuntime.jsx(StyledInputWrapper, { children: jsxRuntime.jsx(TariffGroupAutocomplete$1, __assign({ label: !value && "Tariff group", endIcon: value && jsxRuntime.jsx(StyledCrossIcon, { onClick: handleDelete }), form: form, name: name, filter: "&can_be_replaced=true" }, inputProps)) }));
3197
+ return (jsxRuntime.jsx(StyledInputWrapper$1, { children: jsxRuntime.jsx(TariffGroupAutocomplete$1, __assign({ label: !value && "Tariff group", endIcon: value && jsxRuntime.jsx(StyledCrossIcon, { onClick: handleDelete }), form: form, name: name, filter: "&can_be_replaced=true" }, inputProps)) }));
3198
3198
  }
3199
- var StyledInputWrapper = styled__default["default"].div(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n padding-top: 16px;\n &:first-child {\n padding-top: 12px;\n }\n"], ["\n padding-top: 16px;\n &:first-child {\n padding-top: 12px;\n }\n"])));
3199
+ var StyledInputWrapper$1 = styled__default["default"].div(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n padding-top: 16px;\n &:first-child {\n padding-top: 12px;\n }\n"], ["\n padding-top: 16px;\n &:first-child {\n padding-top: 12px;\n }\n"])));
3200
3200
  var StyledCrossIcon = styled__default["default"](kuiIcon.CloseIcon)(templateObject_2$k || (templateObject_2$k = __makeTemplateObject(["\n cursor: pointer;\n margin-right: -6px;\n width: 22px;\n height: 22px;\n path {\n fill: ", ";\n }\n"], ["\n cursor: pointer;\n margin-right: -6px;\n width: 22px;\n height: 22px;\n path {\n fill: ", ";\n }\n"])), kuiBasic.theme.palette.grey.fiftyP);
3201
3201
  var templateObject_1$z, templateObject_2$k;
3202
3202
 
@@ -3291,9 +3291,9 @@ function ElectricityTariffCreationFields(props) {
3291
3291
  handleSubmit(__assign(__assign({}, creationForm.fields), data));
3292
3292
  }
3293
3293
  };
3294
- return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsxs(kuiBasic.Box, __assign({ pl: 5, pr: 5, mb: 3 }, { children: [jsxRuntime.jsx(StyledInput$3, { form: form, name: "T1", label: "One-part", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$3, { form: form, name: "T2", label: "Two-part", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$3, { form: form, name: "T3", label: "Three-part", type: "number", step: 0.001 })] })), jsxRuntime.jsx(FormBottom, { label: isReplaceable ? "Next" : "Create", endIcon: isReplaceable ? jsxRuntime.jsx(kuiIcon.NextArrowIcon, {}) : jsxRuntime.jsx(kuiIcon.CheckIcon, {}), type: "button", handleClick: form.handleSubmit(handleFormSubmit) })] }));
3294
+ return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsxs(kuiBasic.Box, __assign({ pl: 5, pr: 5, mb: 3 }, { children: [jsxRuntime.jsx(StyledInput$2, { form: form, name: "T1", label: "One-part", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$2, { form: form, name: "T2", label: "Two-part", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$2, { form: form, name: "T3", label: "Three-part", type: "number", step: 0.001 })] })), jsxRuntime.jsx(FormBottom, { label: isReplaceable ? "Next" : "Create", endIcon: isReplaceable ? jsxRuntime.jsx(kuiIcon.NextArrowIcon, {}) : jsxRuntime.jsx(kuiIcon.CheckIcon, {}), type: "button", handleClick: form.handleSubmit(handleFormSubmit) })] }));
3295
3295
  }
3296
- var StyledInput$3 = styled__default["default"](kuiComplex.InputWithController)(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"], ["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"])));
3296
+ var StyledInput$2 = styled__default["default"](kuiComplex.InputWithController)(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"], ["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"])));
3297
3297
  var templateObject_1$w;
3298
3298
 
3299
3299
  var WaterTariffFieldsSchema = yup__namespace.object().shape({
@@ -3324,9 +3324,9 @@ function WaterTariffCreationFields(props) {
3324
3324
  handleSubmit(__assign(__assign({}, creationForm.fields), data));
3325
3325
  }
3326
3326
  };
3327
- return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsxs(kuiBasic.Box, __assign({ pl: 5, pr: 5, mb: 3 }, { children: [jsxRuntime.jsx(StyledInput$2, { form: form, name: "cold", label: "Cold", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$2, { form: form, name: "hot", label: "Hot", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$2, { form: form, name: "sewerage", label: "Sewer", type: "number", step: 0.001 })] })), jsxRuntime.jsx(FormBottom, { label: isReplaceable ? "Next" : "Create", endIcon: isReplaceable ? jsxRuntime.jsx(kuiIcon.NextArrowIcon, {}) : jsxRuntime.jsx(kuiIcon.CheckIcon, {}), type: "button", handleClick: form.handleSubmit(handleFormSubmit) })] }));
3327
+ return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsxs(kuiBasic.Box, __assign({ pl: 5, pr: 5, mb: 3 }, { children: [jsxRuntime.jsx(StyledInput$1, { form: form, name: "cold", label: "Cold", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$1, { form: form, name: "hot", label: "Hot", type: "number", step: 0.001 }), jsxRuntime.jsx(StyledInput$1, { form: form, name: "sewerage", label: "Sewer", type: "number", step: 0.001 })] })), jsxRuntime.jsx(FormBottom, { label: isReplaceable ? "Next" : "Create", endIcon: isReplaceable ? jsxRuntime.jsx(kuiIcon.NextArrowIcon, {}) : jsxRuntime.jsx(kuiIcon.CheckIcon, {}), type: "button", handleClick: form.handleSubmit(handleFormSubmit) })] }));
3328
3328
  }
3329
- var StyledInput$2 = styled__default["default"](kuiComplex.InputWithController)(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"], ["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"])));
3329
+ var StyledInput$1 = styled__default["default"](kuiComplex.InputWithController)(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"], ["\n margin-top: 16px;\n &:first-child {\n margin-top: 0;\n }\n"])));
3330
3330
  var templateObject_1$v;
3331
3331
 
3332
3332
  var SingleTariffFieldsSchema = yup__namespace.object().shape({
@@ -4354,20 +4354,27 @@ function MetroItem$2(props) {
4354
4354
  var handleDelete = function () {
4355
4355
  onDelete(index);
4356
4356
  };
4357
- return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, spacing: 3 }, { children: [jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 6 }, { children: jsxRuntime.jsx(MetroAutocomplete$1, { metroStore: metroStore, hideName: "metroStations.".concat(index, ".id"), name: "metroStations.".concat(index, ".name"), label: "Metro", form: form, disabled: !isEditing, handleChange: handleChange, isRequired: true }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 2 }, { children: jsxRuntime.jsx(kuiComplex.InputWithMask, { name: "metroStations.".concat(index, ".walkDistance"), label: "Walk distance", form: form, disabled: !isEditing, cornerLabel: "m", mask: Number, thousandsSeparator: " " }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 2 }, { children: jsxRuntime.jsx(kuiComplex.InputWithMask, { name: "metroStations.".concat(index, ".carDistance"), label: "Car distance", form: form, disabled: !isEditing, cornerLabel: "m", mask: Number, thousandsSeparator: " " }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 2 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [jsxRuntime.jsx(StyledInput$1, { name: "metroStations.".concat(index, ".carTime"), label: "Car time", form: form, disabled: !isEditing, cornerLabel: "min", mask: Number, thousandsSeparator: " " }), jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "backgroundLight", onClick: handleDelete, disabled: !isEditing }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 8, height: 8 }) }))] })) }))] })) })));
4357
+ return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, spacing: 3 }, { children: [jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 6 }, { children: jsxRuntime.jsx(MetroAutocomplete$1, { metroStore: metroStore, hideName: "metroStations.".concat(index, ".id"), name: "metroStations.".concat(index, ".name"), label: "Metro", form: form, disabled: !isEditing, handleChange: handleChange, isRequired: true }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 2 }, { children: jsxRuntime.jsx(kuiComplex.InputWithMask, { name: "metroStations.".concat(index, ".walkDistance"), label: "Walk distance", form: form, disabled: !isEditing, cornerLabel: "m", mask: Number, thousandsSeparator: " " }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 2 }, { children: jsxRuntime.jsx(kuiComplex.InputWithMask, { name: "metroStations.".concat(index, ".carDistance"), label: "Car distance", form: form, disabled: !isEditing, cornerLabel: "m", mask: Number, thousandsSeparator: " " }) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 2 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [jsxRuntime.jsx(StyledInput, { name: "metroStations.".concat(index, ".carTime"), label: "Car time", form: form, disabled: !isEditing, cornerLabel: "min", mask: Number, thousandsSeparator: " " }), jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "backgroundLight", onClick: handleDelete, disabled: !isEditing }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 8, height: 8 }) }))] })) }))] })) })));
4358
4358
  }
4359
4359
  var MetroItem$3 = mobxReact.observer(MetroItem$2);
4360
- var StyledInput$1 = styled__default["default"](kuiComplex.InputWithMask)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n max-width: calc(100% - 32px - 16px);\n"], ["\n max-width: calc(100% - 32px - 16px);\n"])));
4360
+ var StyledInput = styled__default["default"](kuiComplex.InputWithMask)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n max-width: calc(100% - 32px - 16px);\n"], ["\n max-width: calc(100% - 32px - 16px);\n"])));
4361
4361
  var templateObject_1$5;
4362
4362
 
4363
4363
  var useMetroBlock = function (form, mapStore, metroStore, coords) {
4364
- var map = mapStore.map;
4364
+ var map = mapStore.map, setMap = mapStore.setMap;
4365
4365
  var findNearbyStations = metroStore.findNearbyStations, setError = metroStore.setError;
4366
4366
  var _a = React.useState(false), isLoading = _a[0], setIsLoading = _a[1];
4367
4367
  var _b = reactHookForm.useFieldArray({
4368
4368
  control: form.control,
4369
4369
  name: "metroStations",
4370
4370
  }), fields = _b.fields, append = _b.append, remove = _b.remove, update = _b.update, replace = _b.replace;
4371
+ React.useEffect(function () {
4372
+ if (!map) {
4373
+ var div = document.createElement("div");
4374
+ var createdMap = new window.google.maps.Map(div);
4375
+ setMap(createdMap);
4376
+ }
4377
+ }, [map]);
4371
4378
  var updateMetroStations = function () { return __awaiter(void 0, void 0, void 0, function () {
4372
4379
  var nearbyStations;
4373
4380
  return __generator(this, function (_a) {
@@ -4418,8 +4425,7 @@ var StyledHeadingWithButton = styled__default["default"](HeadingWithButton)(temp
4418
4425
  var templateObject_1$4;
4419
4426
 
4420
4427
  var getMetroItemFields = function (settings) { return [
4421
- __assign({ label: "Walk distance", name: "walkDistance", cornerLabel: "m", mask: Number, thousandsSeparator: " " }, settings === null || settings === void 0 ? void 0 : settings.walkDistance),
4422
- __assign({ label: "Walk time", name: "walkTime", cornerLabel: "min", mask: Number, thousandsSeparator: " " }, settings === null || settings === void 0 ? void 0 : settings.walkTime),
4428
+ __assign({ label: "Walk distance", name: "walkDistance", cornerLabel: "m", mask: Number, thousandsSeparator: " ", size: 12 }, settings === null || settings === void 0 ? void 0 : settings.walkDistance),
4423
4429
  __assign({ label: "Car distance", name: "carDistance", cornerLabel: "m", mask: Number, thousandsSeparator: " " }, settings === null || settings === void 0 ? void 0 : settings.carDistance),
4424
4430
  __assign({ label: "Car time", name: "carTime", cornerLabel: "min", mask: Number, thousandsSeparator: " " }, settings === null || settings === void 0 ? void 0 : settings.carTime),
4425
4431
  ]; };
@@ -4444,27 +4450,27 @@ function MetroItem(props) {
4444
4450
  var handleDelete = function () {
4445
4451
  onDelete(index);
4446
4452
  };
4447
- return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, spacing: 2 }, { children: [jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, alignItems: "center", justify: "space-between", wrap: "nowrap" }, { children: [jsxRuntime.jsx(StyledInput, { metroStore: metroStore, hideName: "metroStations.".concat(index, ".id"), name: "metroStations.".concat(index, ".name"), label: "Metro", form: form, disabled: !isEditing, handleChange: handleChange, isRequired: true }), jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "backgroundLight", onClick: handleDelete, disabled: !isEditing }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 8, height: 8 }) }))] })) })), fields.map(function (_a) {
4448
- var name = _a.name, field = __rest(_a, ["name"]);
4449
- return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 6 }, { children: jsxRuntime.jsx(InputByType, __assign({ name: "metroStations.".concat(index, ".").concat(name), form: form, disabled: !isEditing }, field)) }), name));
4453
+ return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, spacing: 2 }, { children: [jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(kuiBasic.Grid, __assign({ container: true, alignItems: "center", justify: "space-between", wrap: "nowrap" }, { children: [jsxRuntime.jsx(StyledInputWrapper, { children: jsxRuntime.jsx(MetroAutocomplete$1, __assign({ metroStore: metroStore, hideName: "metroStations.".concat(index, ".id"), name: "metroStations.".concat(index, ".name"), label: "Metro", form: form, disabled: !isEditing, handleChange: handleChange, isRequired: true }, fieldsSettings === null || fieldsSettings === void 0 ? void 0 : fieldsSettings.name)) }), jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "backgroundLight", onClick: handleDelete, disabled: !isEditing }, { children: jsxRuntime.jsx(kuiIcon.CloseIcon, { width: 8, height: 8 }) }))] })) })), fields.map(function (_a) {
4454
+ var name = _a.name, size = _a.size, field = __rest(_a, ["name", "size"]);
4455
+ return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: size || 6 }, { children: jsxRuntime.jsx(InputByType, __assign({ name: "metroStations.".concat(index, ".").concat(name), form: form, disabled: !isEditing }, field)) }), name));
4450
4456
  })] })) })));
4451
4457
  }
4452
4458
  var MetroItem$1 = mobxReact.observer(MetroItem);
4453
- var StyledInput = styled__default["default"](MetroAutocomplete$1)(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n max-width: calc(100% - 32px - 16px);\n"], ["\n max-width: calc(100% - 32px - 16px);\n"])));
4459
+ var StyledInputWrapper = styled__default["default"].div(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n max-width: calc(100% - 32px - 16px);\n width: 100%;\n"], ["\n max-width: calc(100% - 32px - 16px);\n width: 100%;\n"])));
4454
4460
  var templateObject_1$3;
4455
4461
 
4456
4462
  var MetroBlockHeader = function (props) {
4457
- var addMetro = props.addMetro, updateMetroStations = props.updateMetroStations;
4458
- return (jsxRuntime.jsxs(StyledWrapper$1, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "xs", weight: 600 }, { children: "METRO" })), jsxRuntime.jsxs(StyledButtonsWrapper, __assign({ container: true, wrap: "nowrap" }, { children: [jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "grayLight", onClick: updateMetroStations }, { children: jsxRuntime.jsx(kuiIcon.UpdateIcon, {}) })), jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "grayLight", onClick: addMetro }, { children: jsxRuntime.jsx(kuiIcon.PlusIcon, {}) }))] }))] })));
4463
+ var addMetro = props.addMetro, updateMetroStations = props.updateMetroStations, label = props.label;
4464
+ return (jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true, xs: 12 }, { children: jsxRuntime.jsxs(StyledWrapper$1, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "xs", weight: 600 }, { children: (label || "METRO").toUpperCase() })), jsxRuntime.jsxs(StyledButtonsWrapper, __assign({ container: true, wrap: "nowrap" }, { children: [jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "grayLight", onClick: updateMetroStations }, { children: jsxRuntime.jsx(kuiIcon.UpdateIcon, {}) })), jsxRuntime.jsx(kuiBasic.Button, __assign({ isCircle: true, size: "xs", variant: "grayLight", onClick: addMetro }, { children: jsxRuntime.jsx(kuiIcon.PlusIcon, { width: 14, height: 14 }) }))] }))] })) })));
4459
4465
  };
4460
- var StyledWrapper$1 = styled__default["default"](kuiBasic.Grid)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n margin-bottom: 16px;\n"], ["\n margin-bottom: 16px;\n"])));
4466
+ var StyledWrapper$1 = styled__default["default"](kuiBasic.Grid)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n margin-bottom: 16px;\n margin-top: 8px;\n"], ["\n margin-bottom: 16px;\n margin-top: 8px;\n"])));
4461
4467
  var StyledButtonsWrapper = styled__default["default"](kuiBasic.Grid)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n width: fit-content;\n > button:first-of-type {\n margin-right: 16px;\n }\n"], ["\n width: fit-content;\n > button:first-of-type {\n margin-right: 16px;\n }\n"])));
4462
4468
  var templateObject_1$2, templateObject_2$1;
4463
4469
 
4464
4470
  function MetroBlockForModal(props) {
4465
- var form = props.form, isEditing = props.isEditing, coords = props.coords, metroStore = props.metroStore, mapStore = props.mapStore, fieldsSettings = props.fieldsSettings;
4471
+ var form = props.form, isEditing = props.isEditing, coords = props.coords, metroStore = props.metroStore, mapStore = props.mapStore, fieldsSettings = props.fieldsSettings, label = props.label;
4466
4472
  var _a = useMetroBlock(form, mapStore, metroStore, coords), fields = _a.fields, isLoading = _a.isLoading, remove = _a.remove, update = _a.update, updateMetroStations = _a.updateMetroStations, addMetro = _a.addMetro;
4467
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MetroBlockHeader, { addMetro: addMetro, updateMetroStations: updateMetroStations }), jsxRuntime.jsx(kuiBasic.Grid, __assign({ container: true, spacing: 3 }, { children: fields.map(function (item, index) { return (jsxRuntime.jsx(MetroItem$1, { index: index, form: form, isEditing: isEditing, onDelete: remove, apartmentCoords: coords, onChange: update, metroStore: metroStore, fieldsSettings: fieldsSettings }, fields[index].id)); }) })), isLoading && jsxRuntime.jsx(LoaderPopup, { label: "metro changes" })] }));
4473
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MetroBlockHeader, { addMetro: addMetro, updateMetroStations: updateMetroStations, label: label }), jsxRuntime.jsx(kuiBasic.Grid, __assign({ container: true, spacing: 3 }, { children: fields.map(function (item, index) { return (jsxRuntime.jsx(MetroItem$1, { index: index, form: form, isEditing: isEditing, onDelete: remove, apartmentCoords: coords, onChange: update, metroStore: metroStore, fieldsSettings: fieldsSettings }, fields[index].id)); }) })), isLoading && jsxRuntime.jsx(LoaderPopup, { label: "metro changes" })] }));
4468
4474
  }
4469
4475
  var index$1 = mobxReact.observer(MetroBlockForModal);
4470
4476