@snack-uikit/drawer 0.10.7 → 0.10.8-preview-95f36d41.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/README.md +28 -5
- package/dist/cjs/components/DrawerCustom/DrawerCustom.d.ts +6 -8
- package/dist/cjs/components/DrawerCustom/DrawerCustom.js +5 -7
- package/dist/esm/components/DrawerCustom/DrawerCustom.d.ts +6 -8
- package/dist/esm/components/DrawerCustom/DrawerCustom.js +1 -3
- package/package.json +4 -4
- package/src/components/DrawerCustom/DrawerCustom.tsx +1 -8
package/README.md
CHANGED
|
@@ -10,20 +10,43 @@
|
|
|
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
|
+
Вспомогательный компонент для добавления "шапки" в 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-класс |
|
|
27
50
|
## Drawer
|
|
28
51
|
Готовый компонент Drawer
|
|
29
52
|
### Props
|
|
@@ -38,8 +61,8 @@
|
|
|
38
61
|
| className | `string` | - | CSS-класс для элемента с контентом |
|
|
39
62
|
| rootClassName | `string` | - | CSS-класс для корневого элемента |
|
|
40
63
|
| container | `string \| HTMLElement` | - | Контейнер в котором будет рендерится Drawer. По-умолчанию - body |
|
|
41
|
-
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
42
64
|
| image | `{ src: string; alt: string; }` | - | Изображение |
|
|
65
|
+
| titleTooltip | `ReactNode` | - | Тултип для заголовка |
|
|
43
66
|
| subtitle | `string` | - | Подзаголовок |
|
|
44
67
|
| size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
|
|
45
68
|
| approveButton | `Omit<ButtonFilledProps, "size"> & { tooltip?: TooltipProps; }` | - | Основная кнопка |
|
|
@@ -26,16 +26,14 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
26
26
|
/** Вложенный Drawer */
|
|
27
27
|
nestedDrawer?: ReactElement<DrawerCustomProps>;
|
|
28
28
|
}>>;
|
|
29
|
-
declare function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
|
30
|
+
export declare namespace DrawerCustom {
|
|
31
|
+
var Header: typeof DrawerHeader;
|
|
32
|
+
var Body: typeof DrawerBody;
|
|
33
|
+
var Footer: typeof DrawerFooter;
|
|
34
|
+
}
|
|
36
35
|
export declare namespace DrawerCustom {
|
|
37
36
|
type HeaderProps = DrawerHeaderProps;
|
|
38
37
|
type BodyProps = DrawerBodyProps;
|
|
39
38
|
type FooterProps = DrawerFooterProps;
|
|
40
39
|
}
|
|
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,6 @@ function DrawerCustomComponent(_a) {
|
|
|
70
70
|
}), children, nestedDrawer]
|
|
71
71
|
}));
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
exports.DrawerCustom.Body = helperComponents_1.DrawerBody;
|
|
77
|
-
exports.DrawerCustom.Footer = helperComponents_1.DrawerFooter;
|
|
73
|
+
DrawerCustom.Header = helperComponents_1.DrawerHeader;
|
|
74
|
+
DrawerCustom.Body = helperComponents_1.DrawerBody;
|
|
75
|
+
DrawerCustom.Footer = helperComponents_1.DrawerFooter;
|
|
@@ -26,16 +26,14 @@ export type DrawerCustomProps = WithSupportProps<PropsWithChildren<{
|
|
|
26
26
|
/** Вложенный Drawer */
|
|
27
27
|
nestedDrawer?: ReactElement<DrawerCustomProps>;
|
|
28
28
|
}>>;
|
|
29
|
-
declare function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
|
30
|
+
export declare namespace DrawerCustom {
|
|
31
|
+
var Header: typeof DrawerHeader;
|
|
32
|
+
var Body: typeof DrawerBody;
|
|
33
|
+
var Footer: typeof DrawerFooter;
|
|
34
|
+
}
|
|
36
35
|
export declare namespace DrawerCustom {
|
|
37
36
|
type HeaderProps = DrawerHeaderProps;
|
|
38
37
|
type BodyProps = DrawerBodyProps;
|
|
39
38
|
type FooterProps = DrawerFooterProps;
|
|
40
39
|
}
|
|
41
|
-
export {};
|
|
@@ -18,14 +18,12 @@ 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
|
-
export const DrawerCustom = DrawerCustomComponent;
|
|
29
27
|
DrawerCustom.Header = DrawerHeader;
|
|
30
28
|
DrawerCustom.Body = DrawerBody;
|
|
31
29
|
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.
|
|
7
|
+
"version": "0.10.8-preview-95f36d41.0",
|
|
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.
|
|
42
|
+
"@snack-uikit/tooltip": "0.15.3-preview-95f36d41.0",
|
|
43
|
+
"@snack-uikit/truncate-string": "0.6.3-preview-95f36d41.0",
|
|
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": "e866724aaa8b037109a05efa3e188a2c17989aa6"
|
|
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,13 +94,6 @@ 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
97
|
DrawerCustom.Header = DrawerHeader;
|
|
105
98
|
DrawerCustom.Body = DrawerBody;
|
|
106
99
|
DrawerCustom.Footer = DrawerFooter;
|