@cloud-ru/uikit-product-modal-predefined 2.1.2 → 2.1.3
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/CHANGELOG.md +11 -0
- package/dist/cjs/components/DeleteModal/DeleteModal.js +2 -2
- package/dist/cjs/components/MobileDeleteModal/MobileDeleteModal.js +2 -2
- package/dist/esm/components/DeleteModal/DeleteModal.js +2 -2
- package/dist/esm/components/MobileDeleteModal/MobileDeleteModal.js +2 -2
- package/package.json +2 -2
- package/src/components/DeleteModal/DeleteModal.tsx +3 -3
- package/src/components/MobileDeleteModal/MobileDeleteModal.tsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 2.1.3 (2026-03-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **PDS-3586:** reset field stage on close modal ([51565ca](https://github.com/cloud-ru-tech/uikit-product/commit/51565ca3c9f69cd14821769b5157e05968e5bb48))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 2.1.2 (2026-03-17)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
|
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.DeleteModal = DeleteModal;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
19
20
|
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
20
21
|
const button_1 = require("@snack-uikit/button");
|
|
21
22
|
const modal_1 = require("@snack-uikit/modal");
|
|
@@ -35,14 +36,13 @@ function DeleteModal(_a) {
|
|
|
35
36
|
}), { reset, handleSubmit } = _b, inputProps = __rest(_b, ["reset", "handleSubmit"]);
|
|
36
37
|
const handleClose = () => {
|
|
37
38
|
onClose();
|
|
38
|
-
reset();
|
|
39
39
|
};
|
|
40
40
|
const handleCancel = () => {
|
|
41
41
|
onClose();
|
|
42
|
-
reset();
|
|
43
42
|
};
|
|
44
43
|
const handleDelete = handleSubmit(() => {
|
|
45
44
|
onDelete(handleClose);
|
|
46
45
|
});
|
|
46
|
+
(0, react_1.useEffect)(() => reset, [reset, open]);
|
|
47
47
|
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, Object.assign({}, restProps, { open: open, onClose: handleClose, children: [(0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { text: `${t('title')} ${objectType !== null && objectType !== void 0 ? objectType : ''}`, maxLines: 2 }), subtitle: subtitle, titleTooltip: titleTooltip }), description && (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { content: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.description, children: description }) }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Footer, { actions: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [withInputConfirmation && ((0, jsx_runtime_1.jsx)(helperComponents_1.InputConfirm, Object.assign({ confirmText: confirmText, hideConfirmCopyButton: hideConfirmCopyButton, labelText: t('fieldLabel'), placeholder: t(`enterText.${confirmTextVariant}`) }, inputProps))), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footerActions, children: [(0, jsx_runtime_1.jsx)(button_1.ButtonFilled, { label: t('delete'), loading: deleting, "data-test-id": constants_1.TEST_IDS.approveButton, onClick: handleDelete, size: 'm', appearance: 'destructive' }), (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { label: t('cancel'), onClick: handleCancel, "data-test-id": constants_1.TEST_IDS.closeButton, appearance: 'neutral', size: 'm' })] })] }) })] })));
|
|
48
48
|
}
|
|
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.MobileDeleteModal = MobileDeleteModal;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
19
20
|
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
20
21
|
const uikit_product_mobile_modal_1 = require("@cloud-ru/uikit-product-mobile-modal");
|
|
21
22
|
const button_1 = require("@snack-uikit/button");
|
|
@@ -34,14 +35,13 @@ function MobileDeleteModal(_a) {
|
|
|
34
35
|
}), { reset, handleSubmit } = _b, inputProps = __rest(_b, ["reset", "handleSubmit"]);
|
|
35
36
|
const handleClose = () => {
|
|
36
37
|
onClose();
|
|
37
|
-
reset();
|
|
38
38
|
};
|
|
39
39
|
const handleCancel = () => {
|
|
40
40
|
onClose();
|
|
41
|
-
reset();
|
|
42
41
|
};
|
|
43
42
|
const handleDelete = handleSubmit(() => {
|
|
44
43
|
onDelete(handleClose);
|
|
45
44
|
});
|
|
45
|
+
(0, react_1.useEffect)(() => reset, [reset, open]);
|
|
46
46
|
return ((0, jsx_runtime_1.jsxs)(uikit_product_mobile_modal_1.MobileModalCustom, Object.assign({}, restProps, { open: open, onClose: handleClose, children: [(0, jsx_runtime_1.jsx)(uikit_product_mobile_modal_1.MobileModalCustom.Header, { title: `${t('title')} ${objectType !== null && objectType !== void 0 ? objectType : ''}`, titleTooltip: titleTooltip, subtitle: subtitle }), (0, jsx_runtime_1.jsx)(uikit_product_mobile_modal_1.MobileModalCustom.Body, { content: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.description, children: description }) }), (0, jsx_runtime_1.jsx)(uikit_product_mobile_modal_1.MobileModalCustom.Footer, { actions: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [withInputConfirmation && ((0, jsx_runtime_1.jsx)(helperComponents_1.InputConfirm, Object.assign({ confirmText: confirmText, hideConfirmCopyButton: hideConfirmCopyButton, labelText: t('fieldLabel'), placeholder: t(`enterText.${confirmTextVariant}`) }, inputProps))), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footerActions, children: [(0, jsx_runtime_1.jsx)(button_1.ButtonFilled, { size: 'm', fullWidth: true, label: t('delete'), loading: deleting, onClick: handleDelete, appearance: 'destructive', "data-test-id": constants_1.TEST_IDS.approveButton }), (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { size: 'm', fullWidth: true, appearance: 'neutral', label: t('cancel'), onClick: handleCancel, "data-test-id": constants_1.TEST_IDS.closeButton })] })] }) })] })));
|
|
47
47
|
}
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect } from 'react';
|
|
13
14
|
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
14
15
|
import { ButtonFilled, ButtonOutline } from '@snack-uikit/button';
|
|
15
16
|
import { ModalCustom } from '@snack-uikit/modal';
|
|
@@ -29,14 +30,13 @@ export function DeleteModal(_a) {
|
|
|
29
30
|
}), { reset, handleSubmit } = _b, inputProps = __rest(_b, ["reset", "handleSubmit"]);
|
|
30
31
|
const handleClose = () => {
|
|
31
32
|
onClose();
|
|
32
|
-
reset();
|
|
33
33
|
};
|
|
34
34
|
const handleCancel = () => {
|
|
35
35
|
onClose();
|
|
36
|
-
reset();
|
|
37
36
|
};
|
|
38
37
|
const handleDelete = handleSubmit(() => {
|
|
39
38
|
onDelete(handleClose);
|
|
40
39
|
});
|
|
40
|
+
useEffect(() => reset, [reset, open]);
|
|
41
41
|
return (_jsxs(ModalCustom, Object.assign({}, restProps, { open: open, onClose: handleClose, children: [_jsx(ModalCustom.Header, { title: _jsx(TruncateString, { text: `${t('title')} ${objectType !== null && objectType !== void 0 ? objectType : ''}`, maxLines: 2 }), subtitle: subtitle, titleTooltip: titleTooltip }), description && _jsx(ModalCustom.Body, { content: _jsx("div", { className: styles.description, children: description }) }), _jsx(ModalCustom.Footer, { actions: _jsxs("div", { className: styles.footer, children: [withInputConfirmation && (_jsx(InputConfirm, Object.assign({ confirmText: confirmText, hideConfirmCopyButton: hideConfirmCopyButton, labelText: t('fieldLabel'), placeholder: t(`enterText.${confirmTextVariant}`) }, inputProps))), _jsxs("div", { className: styles.footerActions, children: [_jsx(ButtonFilled, { label: t('delete'), loading: deleting, "data-test-id": TEST_IDS.approveButton, onClick: handleDelete, size: 'm', appearance: 'destructive' }), _jsx(ButtonOutline, { label: t('cancel'), onClick: handleCancel, "data-test-id": TEST_IDS.closeButton, appearance: 'neutral', size: 'm' })] })] }) })] })));
|
|
42
42
|
}
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect } from 'react';
|
|
13
14
|
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
14
15
|
import { MobileModalCustom } from '@cloud-ru/uikit-product-mobile-modal';
|
|
15
16
|
import { ButtonFilled, ButtonOutline } from '@snack-uikit/button';
|
|
@@ -28,14 +29,13 @@ export function MobileDeleteModal(_a) {
|
|
|
28
29
|
}), { reset, handleSubmit } = _b, inputProps = __rest(_b, ["reset", "handleSubmit"]);
|
|
29
30
|
const handleClose = () => {
|
|
30
31
|
onClose();
|
|
31
|
-
reset();
|
|
32
32
|
};
|
|
33
33
|
const handleCancel = () => {
|
|
34
34
|
onClose();
|
|
35
|
-
reset();
|
|
36
35
|
};
|
|
37
36
|
const handleDelete = handleSubmit(() => {
|
|
38
37
|
onDelete(handleClose);
|
|
39
38
|
});
|
|
39
|
+
useEffect(() => reset, [reset, open]);
|
|
40
40
|
return (_jsxs(MobileModalCustom, Object.assign({}, restProps, { open: open, onClose: handleClose, children: [_jsx(MobileModalCustom.Header, { title: `${t('title')} ${objectType !== null && objectType !== void 0 ? objectType : ''}`, titleTooltip: titleTooltip, subtitle: subtitle }), _jsx(MobileModalCustom.Body, { content: _jsx("div", { className: styles.description, children: description }) }), _jsx(MobileModalCustom.Footer, { actions: _jsxs("div", { className: styles.footer, children: [withInputConfirmation && (_jsx(InputConfirm, Object.assign({ confirmText: confirmText, hideConfirmCopyButton: hideConfirmCopyButton, labelText: t('fieldLabel'), placeholder: t(`enterText.${confirmTextVariant}`) }, inputProps))), _jsxs("div", { className: styles.footerActions, children: [_jsx(ButtonFilled, { size: 'm', fullWidth: true, label: t('delete'), loading: deleting, onClick: handleDelete, appearance: 'destructive', "data-test-id": TEST_IDS.approveButton }), _jsx(ButtonOutline, { size: 'm', fullWidth: true, appearance: 'neutral', label: t('cancel'), onClick: handleCancel, "data-test-id": TEST_IDS.closeButton })] })] }) })] })));
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-modal-predefined",
|
|
3
3
|
"title": "Modal Predefined",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.3",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@cloud-ru/uikit-product-locale": "*"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "77ed2ce1843bb25f87d981ac273158c60faa7e35"
|
|
61
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
4
4
|
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
@@ -61,18 +61,18 @@ export function DeleteModal({
|
|
|
61
61
|
|
|
62
62
|
const handleClose = () => {
|
|
63
63
|
onClose();
|
|
64
|
-
reset();
|
|
65
64
|
};
|
|
66
65
|
|
|
67
66
|
const handleCancel = () => {
|
|
68
67
|
onClose();
|
|
69
|
-
reset();
|
|
70
68
|
};
|
|
71
69
|
|
|
72
70
|
const handleDelete = handleSubmit(() => {
|
|
73
71
|
onDelete(handleClose);
|
|
74
72
|
});
|
|
75
73
|
|
|
74
|
+
useEffect(() => reset, [reset, open]);
|
|
75
|
+
|
|
76
76
|
return (
|
|
77
77
|
<ModalCustom {...restProps} open={open} onClose={handleClose}>
|
|
78
78
|
<ModalCustom.Header
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
4
4
|
import { MobileModalCustom, MobileModalCustomProps } from '@cloud-ru/uikit-product-mobile-modal';
|
|
@@ -60,18 +60,18 @@ export function MobileDeleteModal({
|
|
|
60
60
|
|
|
61
61
|
const handleClose = () => {
|
|
62
62
|
onClose();
|
|
63
|
-
reset();
|
|
64
63
|
};
|
|
65
64
|
|
|
66
65
|
const handleCancel = () => {
|
|
67
66
|
onClose();
|
|
68
|
-
reset();
|
|
69
67
|
};
|
|
70
68
|
|
|
71
69
|
const handleDelete = handleSubmit(() => {
|
|
72
70
|
onDelete(handleClose);
|
|
73
71
|
});
|
|
74
72
|
|
|
73
|
+
useEffect(() => reset, [reset, open]);
|
|
74
|
+
|
|
75
75
|
return (
|
|
76
76
|
<MobileModalCustom {...restProps} open={open} onClose={handleClose}>
|
|
77
77
|
<MobileModalCustom.Header
|