@snack-uikit/drawer 0.10.8-preview-95f36d41.0 → 0.10.8
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 +9 -0
- package/README.md +5 -28
- package/dist/cjs/components/DrawerCustom/DrawerCustom.d.ts +8 -6
- package/dist/cjs/components/DrawerCustom/DrawerCustom.js +7 -5
- package/dist/esm/components/DrawerCustom/DrawerCustom.d.ts +8 -6
- package/dist/esm/components/DrawerCustom/DrawerCustom.js +3 -1
- package/package.json +4 -4
- package/src/components/DrawerCustom/DrawerCustom.tsx +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
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.8 (2024-12-25)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/truncate-string@0.6.3](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## 0.10.7 (2024-12-17)
|
|
7
16
|
|
|
8
17
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -10,43 +10,20 @@
|
|
|
10
10
|
[//]: DOCUMENTATION_SECTION_START
|
|
11
11
|
[//]: THIS_SECTION_IS_AUTOGENERATED_PLEASE_DONT_EDIT_IT
|
|
12
12
|
## DrawerCustom
|
|
13
|
+
Компонент-конструктор
|
|
13
14
|
### Props
|
|
14
15
|
| name | type | default value | description |
|
|
15
16
|
|------|------|---------------|-------------|
|
|
16
17
|
| onClose* | `() => void` | - | Колбэк закрытия |
|
|
17
18
|
| open* | `boolean` | - | Управление состоянием показан/не показан. |
|
|
18
|
-
| mode | enum Mode: `"regular"`, `"soft"` |
|
|
19
|
-
| position | enum Position: `"right"`, `"left"` |
|
|
19
|
+
| mode | enum Mode: `"regular"`, `"soft"` | - | Режим отображения |
|
|
20
|
+
| position | enum Position: `"right"`, `"left"` | - | Расположение открытого Drawer |
|
|
20
21
|
| className | `string` | - | CSS-класс для элемента с контентом |
|
|
21
22
|
| rootClassName | `string` | - | CSS-класс для корневого элемента |
|
|
22
|
-
| size | `string \| number` |
|
|
23
|
+
| size | `string \| number` | - | Размер |
|
|
23
24
|
| push | `boolean \| PushConfig` | - | Смещение при открытии "вложенного" компонента |
|
|
24
25
|
| container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
25
26
|
| nestedDrawer | `ReactElement<DrawerCustomProps, string \| JSXElementConstructor<any>>` | - | Вложенный Drawer |
|
|
26
|
-
## DrawerCustom.Header
|
|
27
|
-
Вспомогательный компонент для добавления "шапки" в DrawerCustom
|
|
28
|
-
### Props
|
|
29
|
-
| name | type | default value | description |
|
|
30
|
-
|------|------|---------------|-------------|
|
|
31
|
-
| title* | `ReactNode` | - | Заголовок |
|
|
32
|
-
| image | `{ src: string; alt: string; }` | - | Изображение |
|
|
33
|
-
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
34
|
-
| subtitle | `ReactNode` | - | Подзаголовок |
|
|
35
|
-
| className | `string` | - | CSS-класс |
|
|
36
|
-
## DrawerCustom.Body
|
|
37
|
-
Вспомогательный компонент для добавления "тела" в DrawerCustom
|
|
38
|
-
### Props
|
|
39
|
-
| name | type | default value | description |
|
|
40
|
-
|------|------|---------------|-------------|
|
|
41
|
-
| content* | `ReactNode` | - | Контент |
|
|
42
|
-
| className | `string` | - | CSS-класс |
|
|
43
|
-
## DrawerCustom.Footer
|
|
44
|
-
Вспомогательный компонент для добавления "футера" в DrawerCustom
|
|
45
|
-
### Props
|
|
46
|
-
| name | type | default value | description |
|
|
47
|
-
|------|------|---------------|-------------|
|
|
48
|
-
| actions* | `ReactNode` | - | Слот для добавления кнопок-действий |
|
|
49
|
-
| className | `string` | - | CSS-класс |
|
|
50
27
|
## Drawer
|
|
51
28
|
Готовый компонент Drawer
|
|
52
29
|
### Props
|
|
@@ -61,8 +38,8 @@
|
|
|
61
38
|
| className | `string` | - | CSS-класс для элемента с контентом |
|
|
62
39
|
| rootClassName | `string` | - | CSS-класс для корневого элемента |
|
|
63
40
|
| container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
64
|
-
| image | `{ src: string; alt: string; }` | - | Изображение |
|
|
65
41
|
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
42
|
+
| image | `{ src: string; alt: string; }` | - | Изображение |
|
|
66
43
|
| subtitle | `string` | - | Подзаголовок |
|
|
67
44
|
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
68
45
|
| approveButton | `Omit<ButtonFilledProps, "size"> & { tooltip?: TooltipProps; }` | - | Основная кнопка |
|
|
@@ -26,14 +26,16 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
26
26
|
/** Вложенный Drawer */
|
|
27
27
|
nestedDrawer?: ReactElement<DrawerCustomProps>;
|
|
28
28
|
}>>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
declare function DrawerCustomComponent({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/** Компонент-конструктор */
|
|
31
|
+
export declare const DrawerCustom: typeof DrawerCustomComponent & {
|
|
32
|
+
Header: typeof DrawerHeader;
|
|
33
|
+
Body: typeof DrawerBody;
|
|
34
|
+
Footer: typeof DrawerFooter;
|
|
35
|
+
};
|
|
35
36
|
export declare namespace DrawerCustom {
|
|
36
37
|
type HeaderProps = DrawerHeaderProps;
|
|
37
38
|
type BodyProps = DrawerBodyProps;
|
|
38
39
|
type FooterProps = DrawerFooterProps;
|
|
39
40
|
}
|
|
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 = void 0;
|
|
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 DrawerCustomComponent(_a) {
|
|
30
30
|
var {
|
|
31
31
|
open,
|
|
32
32
|
mode = constants_1.MODE.Regular,
|
|
@@ -70,6 +70,8 @@ function DrawerCustom(_a) {
|
|
|
70
70
|
}), children, nestedDrawer]
|
|
71
71
|
}));
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
DrawerCustom
|
|
75
|
-
DrawerCustom.
|
|
73
|
+
/** Компонент-конструктор */
|
|
74
|
+
exports.DrawerCustom = DrawerCustomComponent;
|
|
75
|
+
exports.DrawerCustom.Header = helperComponents_1.DrawerHeader;
|
|
76
|
+
exports.DrawerCustom.Body = helperComponents_1.DrawerBody;
|
|
77
|
+
exports.DrawerCustom.Footer = helperComponents_1.DrawerFooter;
|
|
@@ -26,14 +26,16 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
26
26
|
/** Вложенный Drawer */
|
|
27
27
|
nestedDrawer?: ReactElement<DrawerCustomProps>;
|
|
28
28
|
}>>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
declare function DrawerCustomComponent({ open, mode, position, onClose, rootClassName, className, size, push, container, children, nestedDrawer, ...rest }: DrawerCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/** Компонент-конструктор */
|
|
31
|
+
export declare const DrawerCustom: typeof DrawerCustomComponent & {
|
|
32
|
+
Header: typeof DrawerHeader;
|
|
33
|
+
Body: typeof DrawerBody;
|
|
34
|
+
Footer: typeof DrawerFooter;
|
|
35
|
+
};
|
|
35
36
|
export declare namespace DrawerCustom {
|
|
36
37
|
type HeaderProps = DrawerHeaderProps;
|
|
37
38
|
type BodyProps = DrawerBodyProps;
|
|
38
39
|
type FooterProps = DrawerFooterProps;
|
|
39
40
|
}
|
|
41
|
+
export {};
|
|
@@ -18,12 +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
|
-
|
|
21
|
+
function DrawerCustomComponent(_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
|
+
export const DrawerCustom = DrawerCustomComponent;
|
|
27
29
|
DrawerCustom.Header = DrawerHeader;
|
|
28
30
|
DrawerCustom.Body = DrawerBody;
|
|
29
31
|
DrawerCustom.Footer = DrawerFooter;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Drawer",
|
|
7
|
-
"version": "0.10.8
|
|
7
|
+
"version": "0.10.8",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@snack-uikit/button": "0.19.5",
|
|
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.3
|
|
42
|
+
"@snack-uikit/tooltip": "0.15.2",
|
|
43
|
+
"@snack-uikit/truncate-string": "0.6.3",
|
|
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": "5f981cd3d7c5169db2bff1d58db36b6c83da6861"
|
|
50
50
|
}
|
|
@@ -45,7 +45,7 @@ export type DrawerCustomProps = WithSupportProps<
|
|
|
45
45
|
}>
|
|
46
46
|
>;
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
function DrawerCustomComponent({
|
|
49
49
|
open,
|
|
50
50
|
mode = MODE.Regular,
|
|
51
51
|
position = POSITION.Right,
|
|
@@ -94,6 +94,13 @@ export function DrawerCustom({
|
|
|
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
|
+
|
|
97
104
|
DrawerCustom.Header = DrawerHeader;
|
|
98
105
|
DrawerCustom.Body = DrawerBody;
|
|
99
106
|
DrawerCustom.Footer = DrawerFooter;
|