@snack-uikit/drawer 0.10.8 → 0.10.10-preview-a2f98ef7.0
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/README.md +25 -5
- package/dist/cjs/components/DrawerCustom/DrawerCustom.d.ts +4 -8
- package/dist/cjs/components/DrawerCustom/DrawerCustom.js +7 -7
- package/dist/esm/components/DrawerCustom/DrawerCustom.d.ts +4 -8
- package/dist/esm/components/DrawerCustom/DrawerCustom.js +6 -6
- package/package.json +5 -5
- package/src/components/DrawerCustom/DrawerCustom.tsx +4 -12
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
|
+
## 0.10.9 (2024-12-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-5734:** eslint fixes ([5ce6f1f](https://github.com/cloud-ru-tech/snack-uikit/commit/5ce6f1f22d3ac3dd367cbdd184e5873e67837c8b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.10.8 (2024-12-25)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -10,20 +10,40 @@
|
|
|
10
10
|
[//]: DOCUMENTATION_SECTION_START
|
|
11
11
|
[//]: THIS_SECTION_IS_AUTOGENERATED_PLEASE_DONT_EDIT_IT
|
|
12
12
|
## DrawerCustom
|
|
13
|
-
Компонент-конструктор
|
|
14
13
|
### Props
|
|
15
14
|
| name | type | default value | description |
|
|
16
15
|
|------|------|---------------|-------------|
|
|
17
16
|
| onClose* | `() => void` | - | Колбэк закрытия |
|
|
18
17
|
| open* | `boolean` | - | Управление состоянием показан/не показан. |
|
|
19
|
-
| mode | enum Mode: `"regular"`, `"soft"` |
|
|
20
|
-
| position | enum Position: `"right"`, `"left"` |
|
|
18
|
+
| mode | enum Mode: `"regular"`, `"soft"` | regular | Режим отображения |
|
|
19
|
+
| position | enum Position: `"right"`, `"left"` | right | Расположение открытого Drawer |
|
|
21
20
|
| className | `string` | - | CSS-класс для элемента с контентом |
|
|
22
21
|
| rootClassName | `string` | - | CSS-класс для корневого элемента |
|
|
23
|
-
| size | `string \| number` |
|
|
22
|
+
| size | `string \| number` | s | Размер |
|
|
24
23
|
| push | `boolean \| PushConfig` | - | Смещение при открытии "вложенного" компонента |
|
|
25
24
|
| container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
26
25
|
| nestedDrawer | `ReactElement<DrawerCustomProps, string \| JSXElementConstructor<any>>` | - | Вложенный Drawer |
|
|
26
|
+
## DrawerCustom.Header
|
|
27
|
+
### Props
|
|
28
|
+
| name | type | default value | description |
|
|
29
|
+
|------|------|---------------|-------------|
|
|
30
|
+
| title* | `ReactNode` | - | Заголовок |
|
|
31
|
+
| image | `{ src: string; alt: string; }` | - | Изображение |
|
|
32
|
+
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
33
|
+
| subtitle | `ReactNode` | - | Подзаголовок |
|
|
34
|
+
| className | `string` | - | CSS-класс |
|
|
35
|
+
## DrawerCustom.Body
|
|
36
|
+
### Props
|
|
37
|
+
| name | type | default value | description |
|
|
38
|
+
|------|------|---------------|-------------|
|
|
39
|
+
| content* | `ReactNode` | - | Контент |
|
|
40
|
+
| className | `string` | - | CSS-класс |
|
|
41
|
+
## DrawerCustom.Footer
|
|
42
|
+
### Props
|
|
43
|
+
| name | type | default value | description |
|
|
44
|
+
|------|------|---------------|-------------|
|
|
45
|
+
| actions* | `ReactNode` | - | Слот для добавления кнопок-действий |
|
|
46
|
+
| className | `string` | - | CSS-класс |
|
|
27
47
|
## Drawer
|
|
28
48
|
Готовый компонент Drawer
|
|
29
49
|
### Props
|
|
@@ -38,8 +58,8 @@
|
|
|
38
58
|
| className | `string` | - | CSS-класс для элемента с контентом |
|
|
39
59
|
| rootClassName | `string` | - | CSS-класс для корневого элемента |
|
|
40
60
|
| container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
41
|
-
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
42
61
|
| image | `{ src: string; alt: string; }` | - | Изображение |
|
|
62
|
+
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
43
63
|
| subtitle | `string` | - | Подзаголовок |
|
|
44
64
|
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
45
65
|
| approveButton | `Omit<ButtonFilledProps, "size"> & { tooltip?: TooltipProps; }` | - | Основная кнопка |
|
|
@@ -26,16 +26,12 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
26
26
|
/** Вложенный Drawer */
|
|
27
27
|
nestedDrawer?: ReactElement<DrawerCustomProps>;
|
|
28
28
|
}>>;
|
|
29
|
-
declare function
|
|
30
|
-
/** Компонент-конструктор */
|
|
31
|
-
export declare const DrawerCustom: typeof DrawerCustomComponent & {
|
|
32
|
-
Header: typeof DrawerHeader;
|
|
33
|
-
Body: typeof DrawerBody;
|
|
34
|
-
Footer: typeof DrawerFooter;
|
|
35
|
-
};
|
|
29
|
+
export declare function DrawerCustom({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
36
30
|
export declare namespace DrawerCustom {
|
|
37
31
|
type HeaderProps = DrawerHeaderProps;
|
|
38
32
|
type BodyProps = DrawerBodyProps;
|
|
39
33
|
type FooterProps = DrawerFooterProps;
|
|
34
|
+
const Header: typeof DrawerHeader;
|
|
35
|
+
const Body: typeof DrawerBody;
|
|
36
|
+
const Footer: typeof DrawerFooter;
|
|
40
37
|
}
|
|
41
|
-
export {};
|
|
@@ -16,7 +16,7 @@ var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
17
17
|
value: true
|
|
18
18
|
});
|
|
19
|
-
exports.DrawerCustom =
|
|
19
|
+
exports.DrawerCustom = DrawerCustom;
|
|
20
20
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
21
|
require("rc-drawer/assets/index.css");
|
|
22
22
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -26,7 +26,7 @@ const constants_1 = require("../../constants");
|
|
|
26
26
|
const helperComponents_1 = require("../../helperComponents");
|
|
27
27
|
const constants_2 = require("./constants");
|
|
28
28
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
29
|
-
function
|
|
29
|
+
function DrawerCustom(_a) {
|
|
30
30
|
var {
|
|
31
31
|
open,
|
|
32
32
|
mode = constants_1.MODE.Regular,
|
|
@@ -70,8 +70,8 @@ function DrawerCustomComponent(_a) {
|
|
|
70
70
|
}), children, nestedDrawer]
|
|
71
71
|
}));
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
exports.DrawerCustom
|
|
73
|
+
(function (DrawerCustom) {
|
|
74
|
+
DrawerCustom.Header = helperComponents_1.DrawerHeader;
|
|
75
|
+
DrawerCustom.Body = helperComponents_1.DrawerBody;
|
|
76
|
+
DrawerCustom.Footer = helperComponents_1.DrawerFooter;
|
|
77
|
+
})(DrawerCustom || (exports.DrawerCustom = DrawerCustom = {}));
|
|
@@ -26,16 +26,12 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
26
26
|
/** Вложенный Drawer */
|
|
27
27
|
nestedDrawer?: ReactElement<DrawerCustomProps>;
|
|
28
28
|
}>>;
|
|
29
|
-
declare function
|
|
30
|
-
/** Компонент-конструктор */
|
|
31
|
-
export declare const DrawerCustom: typeof DrawerCustomComponent & {
|
|
32
|
-
Header: typeof DrawerHeader;
|
|
33
|
-
Body: typeof DrawerBody;
|
|
34
|
-
Footer: typeof DrawerFooter;
|
|
35
|
-
};
|
|
29
|
+
export declare function DrawerCustom({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
36
30
|
export declare namespace DrawerCustom {
|
|
37
31
|
type HeaderProps = DrawerHeaderProps;
|
|
38
32
|
type BodyProps = DrawerBodyProps;
|
|
39
33
|
type FooterProps = DrawerFooterProps;
|
|
34
|
+
const Header: typeof DrawerHeader;
|
|
35
|
+
const Body: typeof DrawerBody;
|
|
36
|
+
const Footer: typeof DrawerFooter;
|
|
40
37
|
}
|
|
41
|
-
export {};
|
|
@@ -18,14 +18,14 @@ import { MODE, POSITION, SIZE, SIZE_AS_VALUES } from '../../constants';
|
|
|
18
18
|
import { ButtonClose, DrawerBody, DrawerFooter, DrawerHeader, } from '../../helperComponents';
|
|
19
19
|
import { motionProps } from './constants';
|
|
20
20
|
import styles from './styles.module.css';
|
|
21
|
-
function
|
|
21
|
+
export function DrawerCustom(_a) {
|
|
22
22
|
var { open, mode = MODE.Regular, position = POSITION.Right, onClose, rootClassName, className, size = SIZE.S, push, container, children, nestedDrawer } = _a, rest = __rest(_a, ["open", "mode", "position", "onClose", "rootClassName", "className", "size", "push", "container", "children", "nestedDrawer"]);
|
|
23
23
|
const isRegular = mode === MODE.Regular;
|
|
24
24
|
const isPredefinedSize = typeof size === 'string' && SIZE_AS_VALUES.includes(size);
|
|
25
25
|
return (_jsxs(RcDrawer, Object.assign({ mask: isRegular, maskClosable: isRegular, maskClassName: styles.mask, keyboard: isRegular, width: isPredefinedSize ? 'null' : size, open: open, placement: position, destroyOnClose: true, push: push, onClose: onClose, getContainer: container, className: cn(styles.drawer, className), rootClassName: cn(styles.drawerRoot, rootClassName) }, extractSupportProps(rest), { "data-content-wrapper": true, "data-size": isPredefinedSize ? size : undefined, "data-mode": mode }, motionProps, { children: [_jsx("div", { className: styles.headerElements, children: _jsx(ButtonClose, { onClick: onClose }) }), children, nestedDrawer] })));
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
DrawerCustom.
|
|
30
|
-
DrawerCustom.
|
|
31
|
-
DrawerCustom
|
|
27
|
+
(function (DrawerCustom) {
|
|
28
|
+
DrawerCustom.Header = DrawerHeader;
|
|
29
|
+
DrawerCustom.Body = DrawerBody;
|
|
30
|
+
DrawerCustom.Footer = DrawerFooter;
|
|
31
|
+
})(DrawerCustom || (DrawerCustom = {}));
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Drawer",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.10-preview-a2f98ef7.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@snack-uikit/button": "0.19.
|
|
39
|
+
"@snack-uikit/button": "0.19.6-preview-a2f98ef7.0",
|
|
40
40
|
"@snack-uikit/icons": "0.24.1",
|
|
41
41
|
"@snack-uikit/scroll": "0.9.2",
|
|
42
|
-
"@snack-uikit/tooltip": "0.15.
|
|
43
|
-
"@snack-uikit/truncate-string": "0.6.
|
|
42
|
+
"@snack-uikit/tooltip": "0.15.3",
|
|
43
|
+
"@snack-uikit/truncate-string": "0.6.4",
|
|
44
44
|
"@snack-uikit/typography": "0.8.3",
|
|
45
45
|
"@snack-uikit/utils": "3.6.0",
|
|
46
46
|
"classnames": "2.5.1",
|
|
47
47
|
"rc-drawer": "6.4.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "16999df080b0b870c1a90ba74aa6c296cd4d480b"
|
|
50
50
|
}
|
|
@@ -45,7 +45,7 @@ export type DrawerCustomProps = WithSupportProps<
|
|
|
45
45
|
}>
|
|
46
46
|
>;
|
|
47
47
|
|
|
48
|
-
function
|
|
48
|
+
export function DrawerCustom({
|
|
49
49
|
open,
|
|
50
50
|
mode = MODE.Regular,
|
|
51
51
|
position = POSITION.Right,
|
|
@@ -94,19 +94,11 @@ function DrawerCustomComponent({
|
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
/** Компонент-конструктор */
|
|
98
|
-
export const DrawerCustom = DrawerCustomComponent as typeof DrawerCustomComponent & {
|
|
99
|
-
Header: typeof DrawerHeader;
|
|
100
|
-
Body: typeof DrawerBody;
|
|
101
|
-
Footer: typeof DrawerFooter;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
DrawerCustom.Header = DrawerHeader;
|
|
105
|
-
DrawerCustom.Body = DrawerBody;
|
|
106
|
-
DrawerCustom.Footer = DrawerFooter;
|
|
107
|
-
|
|
108
97
|
export namespace DrawerCustom {
|
|
109
98
|
export type HeaderProps = DrawerHeaderProps;
|
|
110
99
|
export type BodyProps = DrawerBodyProps;
|
|
111
100
|
export type FooterProps = DrawerFooterProps;
|
|
101
|
+
export const Header = DrawerHeader;
|
|
102
|
+
export const Body = DrawerBody;
|
|
103
|
+
export const Footer = DrawerFooter;
|
|
112
104
|
}
|