@alifd/chat 0.1.4 → 0.1.6
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/es/float-button/hooks/useDragable.js +3 -2
- package/es/float-button/hooks/useNestleEdge.js +4 -6
- package/es/float-button/index.d.ts +2 -1
- package/es/float-button/index.js +2 -1
- package/es/float-button/main.scss +12 -6
- package/es/float-button/types.d.ts +17 -4
- package/es/float-button/view/drawer.d.ts +4 -2
- package/es/float-button/view/drawer.js +10 -2
- package/es/float-button/view/inner-drawer.js +1 -0
- package/es/index.js +1 -1
- package/lib/float-button/hooks/useDragable.js +3 -2
- package/lib/float-button/hooks/useNestleEdge.js +3 -5
- package/lib/float-button/index.d.ts +2 -1
- package/lib/float-button/index.js +2 -1
- package/lib/float-button/main.scss +12 -6
- package/lib/float-button/types.d.ts +17 -4
- package/lib/float-button/view/drawer.d.ts +4 -2
- package/lib/float-button/view/drawer.js +9 -1
- package/lib/float-button/view/inner-drawer.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -18,8 +18,9 @@ function parsePosition(position, element) {
|
|
|
18
18
|
const maxLeft = width - rect.width;
|
|
19
19
|
const maxTop = height - rect.height;
|
|
20
20
|
return {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
transform: `translate(${Math.min(maxLeft, normalizePositionRatio(widthRatio) * width)}px, ${Math.min(maxTop, normalizePositionRatio(heightRatio) * height)}px)`,
|
|
22
|
+
left: 0,
|
|
23
|
+
top: 0,
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
return position;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
2
|
import { useDebounce } from '../../utils';
|
|
3
3
|
import { getScreenSize, getNearlyEdge, adjustBySafeAreaMargin } from '../util';
|
|
4
4
|
/**
|
|
@@ -60,11 +60,9 @@ export function useNestleEdge(dom, { enable, safeAreaMargin, interactiveEdges, o
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
const debounceUpdate = useDebounce(() => update(), 100);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
}, [dom]);
|
|
63
|
+
useLayoutEffect(() => {
|
|
64
|
+
update(false);
|
|
65
|
+
});
|
|
68
66
|
useEffect(() => {
|
|
69
67
|
window.addEventListener('resize', debounceUpdate);
|
|
70
68
|
return () => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const FloatButtonWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").FloatButtonProps & import("react").RefAttributes<import("./types").FloatButtonRef>, "key" | keyof import("./types").FloatButtonProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").FloatButtonRef, {}> & {
|
|
3
3
|
Backtop: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").BacktopProps & import("react").RefAttributes<import("./types").BacktopRef>, "key" | keyof import("./types").BacktopProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").BacktopRef, {}>;
|
|
4
|
+
Drawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
4
5
|
InnerDrawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
5
6
|
};
|
|
6
|
-
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps,
|
|
7
|
+
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps, FloatButtonDrawerProps, FloatButtonInnerDrawerProps, Edge, Margin, Position, RequiredParts, ScreenRatioPosition, Size, TriggerType, } from './types';
|
|
7
8
|
export default FloatButtonWithSub;
|
package/es/float-button/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import FloatButton from './view/float-button';
|
|
2
2
|
import Backtop from './view/backtop';
|
|
3
3
|
import InnerDrawer from './view/inner-drawer';
|
|
4
|
+
import Drawer from './view/drawer';
|
|
4
5
|
import { assignSubComponent } from '../utils/index';
|
|
5
|
-
const FloatButtonWithSub = assignSubComponent(FloatButton, { Backtop, InnerDrawer });
|
|
6
|
+
const FloatButtonWithSub = assignSubComponent(FloatButton, { Backtop, Drawer, InnerDrawer });
|
|
6
7
|
export default FloatButtonWithSub;
|
|
@@ -42,25 +42,31 @@
|
|
|
42
42
|
height: 100%;
|
|
43
43
|
display: flex;
|
|
44
44
|
flex-direction: column;
|
|
45
|
+
position: relative;
|
|
45
46
|
|
|
46
47
|
&--has-title {
|
|
47
48
|
.#{$prefix}float-button-inner-drawer {
|
|
48
49
|
&-header {
|
|
49
|
-
|
|
50
|
+
margin: $size-base * 2 $size-base * 3;
|
|
50
51
|
}
|
|
51
52
|
&-body {
|
|
52
|
-
|
|
53
|
+
margin-top: 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&--has-close {
|
|
58
|
+
.#{$prefix}float-button-inner-drawer {
|
|
59
|
+
&-header-title {
|
|
60
|
+
margin-right: $size-base * 2;
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
&-header {
|
|
58
66
|
flex: none;
|
|
59
|
-
position: relative;
|
|
60
67
|
&-title {
|
|
61
68
|
font-size: $font-size-subhead;
|
|
62
69
|
line-height: 1.5;
|
|
63
|
-
padding-right: $size-base * 2;
|
|
64
70
|
}
|
|
65
71
|
&-close {
|
|
66
72
|
position: absolute;
|
|
@@ -76,13 +82,13 @@
|
|
|
76
82
|
background-color: transparent;
|
|
77
83
|
|
|
78
84
|
&:hover {
|
|
79
|
-
color: $color-
|
|
85
|
+
color: $color-text1-4;
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
&-body {
|
|
84
90
|
flex: 1;
|
|
85
|
-
|
|
91
|
+
margin: $size-base * 2 $size-base * 3;
|
|
86
92
|
}
|
|
87
93
|
&-footer {
|
|
88
94
|
flex: none;
|
|
@@ -205,10 +205,6 @@ export interface FloatButtonProps extends CommonProps {
|
|
|
205
205
|
children?: React.ReactNode;
|
|
206
206
|
_renderView?: (prefix: string, props: RequiredParts<FloatButtonProps, 'visible' | 'onVisibleChange'>) => ReactNode;
|
|
207
207
|
}
|
|
208
|
-
/**
|
|
209
|
-
* @api
|
|
210
|
-
* @order 5
|
|
211
|
-
*/
|
|
212
208
|
export interface DragableOption {
|
|
213
209
|
enable?: boolean;
|
|
214
210
|
defaultPosition?: FloatButtonProps['defaultPosition'];
|
|
@@ -235,3 +231,20 @@ export interface FloatButtonInnerDrawerProps extends FloatButtonProps {
|
|
|
235
231
|
beforeClose?: () => void;
|
|
236
232
|
afterClose?: () => void;
|
|
237
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @api FloatButton.Drawer
|
|
236
|
+
*/
|
|
237
|
+
export interface FloatButtonDrawerProps extends FloatButtonProps {
|
|
238
|
+
width?: string | number;
|
|
239
|
+
title?: ReactNode;
|
|
240
|
+
drawerClassName?: string;
|
|
241
|
+
/**
|
|
242
|
+
* 关闭时是否保留节点
|
|
243
|
+
* @defaultValue false
|
|
244
|
+
*/
|
|
245
|
+
cache?: boolean;
|
|
246
|
+
beforeOpen?: () => void;
|
|
247
|
+
afterOpen?: () => void;
|
|
248
|
+
beforeClose?: () => void;
|
|
249
|
+
afterClose?: () => void;
|
|
250
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DrawerProps as NextDrawerProps } from '@alifd/next/types/drawer';
|
|
3
|
-
import type { TriggerType } from '../types';
|
|
3
|
+
import type { FloatButtonDrawerProps, TriggerType } from '../types';
|
|
4
4
|
export interface DrawerProps extends Omit<NextDrawerProps, 'triggerType' | 'container' | 'onVisibleChange'> {
|
|
5
5
|
onVisibleChange?: (visible: boolean, reason: string) => void;
|
|
6
6
|
triggerType?: TriggerType | TriggerType[];
|
|
7
7
|
}
|
|
8
|
-
export declare function Drawer({ prefix,
|
|
8
|
+
export declare function Drawer({ prefix, children, trigger, triggerType, visible, onVisibleChange, ...rests }: DrawerProps): React.JSX.Element;
|
|
9
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<FloatButtonDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
10
|
+
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Drawer as NextDrawer } from '@alifd/next';
|
|
3
|
+
import { Drawer as NextDrawer, ConfigProvider } from '@alifd/next';
|
|
4
4
|
import { useTriggerType } from '../hooks/useTriggerType';
|
|
5
|
+
import FloatButton from './float-button';
|
|
5
6
|
export function Drawer(_a) {
|
|
6
|
-
var { prefix,
|
|
7
|
+
var { prefix, children, trigger, triggerType, visible, onVisibleChange } = _a, rests = __rest(_a, ["prefix", "children", "trigger", "triggerType", "visible", "onVisibleChange"]);
|
|
7
8
|
const handlers = useTriggerType({ visible, onVisibleChange, triggerType });
|
|
8
9
|
return (React.createElement(React.Fragment, null,
|
|
9
10
|
React.createElement("div", Object.assign({}, handlers), trigger),
|
|
@@ -11,3 +12,10 @@ export function Drawer(_a) {
|
|
|
11
12
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(false, reason);
|
|
12
13
|
}, v2: true }), children)));
|
|
13
14
|
}
|
|
15
|
+
function FloatButtonDrawer(_a) {
|
|
16
|
+
var { width, title, drawerClassName, cache = false, beforeOpen, afterOpen, beforeClose, afterClose } = _a, rests = __rest(_a, ["width", "title", "drawerClassName", "cache", "beforeOpen", "afterOpen", "beforeClose", "afterClose"]);
|
|
17
|
+
return (React.createElement(FloatButton, Object.assign({}, rests, { _renderView: (prefix, { visible, onVisibleChange, trigger, triggerType, showClose, children }) => {
|
|
18
|
+
return (React.createElement(Drawer, { prefix: prefix, className: drawerClassName, visible: visible, onVisibleChange: onVisibleChange, trigger: trigger, closeMode: ['esc', 'mask', ...(showClose ? ['close'] : [])], triggerType: triggerType, cache: cache }, children));
|
|
19
|
+
} })));
|
|
20
|
+
}
|
|
21
|
+
export default ConfigProvider.config(FloatButtonDrawer);
|
|
@@ -133,6 +133,7 @@ export function InnerDrawer({ className, prefix, target, children, trigger, trig
|
|
|
133
133
|
ReactDOM.createPortal(React.createElement("div", { className: cs(cls, { [`${cls}--visible`]: visible }), ref: domRef },
|
|
134
134
|
React.createElement("div", { className: cs(`${cls}-inner`, {
|
|
135
135
|
[`${cls}-inner--has-title`]: !!title,
|
|
136
|
+
[`${cls}-inner--has-close`]: !!closable,
|
|
136
137
|
}), style: { width } },
|
|
137
138
|
React.createElement("div", { className: cs(`${cls}-header`) },
|
|
138
139
|
!!title && React.createElement("div", { className: `${cls}-header-title` }, title),
|
package/es/index.js
CHANGED
|
@@ -21,8 +21,9 @@ function parsePosition(position, element) {
|
|
|
21
21
|
const maxLeft = width - rect.width;
|
|
22
22
|
const maxTop = height - rect.height;
|
|
23
23
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
transform: `translate(${Math.min(maxLeft, normalizePositionRatio(widthRatio) * width)}px, ${Math.min(maxTop, normalizePositionRatio(heightRatio) * height)}px)`,
|
|
25
|
+
left: 0,
|
|
26
|
+
top: 0,
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
return position;
|
|
@@ -63,11 +63,9 @@ function useNestleEdge(dom, { enable, safeAreaMargin, interactiveEdges, onUpdate
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
const debounceUpdate = (0, utils_1.useDebounce)(() => update(), 100);
|
|
66
|
-
(0, react_1.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}, [dom]);
|
|
66
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
67
|
+
update(false);
|
|
68
|
+
});
|
|
71
69
|
(0, react_1.useEffect)(() => {
|
|
72
70
|
window.addEventListener('resize', debounceUpdate);
|
|
73
71
|
return () => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const FloatButtonWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").FloatButtonProps & import("react").RefAttributes<import("./types").FloatButtonRef>, "key" | keyof import("./types").FloatButtonProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").FloatButtonRef, {}> & {
|
|
3
3
|
Backtop: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").BacktopProps & import("react").RefAttributes<import("./types").BacktopRef>, "key" | keyof import("./types").BacktopProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").BacktopRef, {}>;
|
|
4
|
+
Drawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
4
5
|
InnerDrawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
5
6
|
};
|
|
6
|
-
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps,
|
|
7
|
+
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps, FloatButtonDrawerProps, FloatButtonInnerDrawerProps, Edge, Margin, Position, RequiredParts, ScreenRatioPosition, Size, TriggerType, } from './types';
|
|
7
8
|
export default FloatButtonWithSub;
|
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const float_button_1 = tslib_1.__importDefault(require("./view/float-button"));
|
|
5
5
|
const backtop_1 = tslib_1.__importDefault(require("./view/backtop"));
|
|
6
6
|
const inner_drawer_1 = tslib_1.__importDefault(require("./view/inner-drawer"));
|
|
7
|
+
const drawer_1 = tslib_1.__importDefault(require("./view/drawer"));
|
|
7
8
|
const index_1 = require("../utils/index");
|
|
8
|
-
const FloatButtonWithSub = (0, index_1.assignSubComponent)(float_button_1.default, { Backtop: backtop_1.default, InnerDrawer: inner_drawer_1.default });
|
|
9
|
+
const FloatButtonWithSub = (0, index_1.assignSubComponent)(float_button_1.default, { Backtop: backtop_1.default, Drawer: drawer_1.default, InnerDrawer: inner_drawer_1.default });
|
|
9
10
|
exports.default = FloatButtonWithSub;
|
|
@@ -42,25 +42,31 @@
|
|
|
42
42
|
height: 100%;
|
|
43
43
|
display: flex;
|
|
44
44
|
flex-direction: column;
|
|
45
|
+
position: relative;
|
|
45
46
|
|
|
46
47
|
&--has-title {
|
|
47
48
|
.#{$prefix}float-button-inner-drawer {
|
|
48
49
|
&-header {
|
|
49
|
-
|
|
50
|
+
margin: $size-base * 2 $size-base * 3;
|
|
50
51
|
}
|
|
51
52
|
&-body {
|
|
52
|
-
|
|
53
|
+
margin-top: 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&--has-close {
|
|
58
|
+
.#{$prefix}float-button-inner-drawer {
|
|
59
|
+
&-header-title {
|
|
60
|
+
margin-right: $size-base * 2;
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
&-header {
|
|
58
66
|
flex: none;
|
|
59
|
-
position: relative;
|
|
60
67
|
&-title {
|
|
61
68
|
font-size: $font-size-subhead;
|
|
62
69
|
line-height: 1.5;
|
|
63
|
-
padding-right: $size-base * 2;
|
|
64
70
|
}
|
|
65
71
|
&-close {
|
|
66
72
|
position: absolute;
|
|
@@ -76,13 +82,13 @@
|
|
|
76
82
|
background-color: transparent;
|
|
77
83
|
|
|
78
84
|
&:hover {
|
|
79
|
-
color: $color-
|
|
85
|
+
color: $color-text1-4;
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
&-body {
|
|
84
90
|
flex: 1;
|
|
85
|
-
|
|
91
|
+
margin: $size-base * 2 $size-base * 3;
|
|
86
92
|
}
|
|
87
93
|
&-footer {
|
|
88
94
|
flex: none;
|
|
@@ -205,10 +205,6 @@ export interface FloatButtonProps extends CommonProps {
|
|
|
205
205
|
children?: React.ReactNode;
|
|
206
206
|
_renderView?: (prefix: string, props: RequiredParts<FloatButtonProps, 'visible' | 'onVisibleChange'>) => ReactNode;
|
|
207
207
|
}
|
|
208
|
-
/**
|
|
209
|
-
* @api
|
|
210
|
-
* @order 5
|
|
211
|
-
*/
|
|
212
208
|
export interface DragableOption {
|
|
213
209
|
enable?: boolean;
|
|
214
210
|
defaultPosition?: FloatButtonProps['defaultPosition'];
|
|
@@ -235,3 +231,20 @@ export interface FloatButtonInnerDrawerProps extends FloatButtonProps {
|
|
|
235
231
|
beforeClose?: () => void;
|
|
236
232
|
afterClose?: () => void;
|
|
237
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @api FloatButton.Drawer
|
|
236
|
+
*/
|
|
237
|
+
export interface FloatButtonDrawerProps extends FloatButtonProps {
|
|
238
|
+
width?: string | number;
|
|
239
|
+
title?: ReactNode;
|
|
240
|
+
drawerClassName?: string;
|
|
241
|
+
/**
|
|
242
|
+
* 关闭时是否保留节点
|
|
243
|
+
* @defaultValue false
|
|
244
|
+
*/
|
|
245
|
+
cache?: boolean;
|
|
246
|
+
beforeOpen?: () => void;
|
|
247
|
+
afterOpen?: () => void;
|
|
248
|
+
beforeClose?: () => void;
|
|
249
|
+
afterClose?: () => void;
|
|
250
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DrawerProps as NextDrawerProps } from '@alifd/next/types/drawer';
|
|
3
|
-
import type { TriggerType } from '../types';
|
|
3
|
+
import type { FloatButtonDrawerProps, TriggerType } from '../types';
|
|
4
4
|
export interface DrawerProps extends Omit<NextDrawerProps, 'triggerType' | 'container' | 'onVisibleChange'> {
|
|
5
5
|
onVisibleChange?: (visible: boolean, reason: string) => void;
|
|
6
6
|
triggerType?: TriggerType | TriggerType[];
|
|
7
7
|
}
|
|
8
|
-
export declare function Drawer({ prefix,
|
|
8
|
+
export declare function Drawer({ prefix, children, trigger, triggerType, visible, onVisibleChange, ...rests }: DrawerProps): React.JSX.Element;
|
|
9
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<FloatButtonDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
10
|
+
export default _default;
|
|
@@ -5,8 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
const next_1 = require("@alifd/next");
|
|
7
7
|
const useTriggerType_1 = require("../hooks/useTriggerType");
|
|
8
|
+
const float_button_1 = tslib_1.__importDefault(require("./float-button"));
|
|
8
9
|
function Drawer(_a) {
|
|
9
|
-
var { prefix,
|
|
10
|
+
var { prefix, children, trigger, triggerType, visible, onVisibleChange } = _a, rests = tslib_1.__rest(_a, ["prefix", "children", "trigger", "triggerType", "visible", "onVisibleChange"]);
|
|
10
11
|
const handlers = (0, useTriggerType_1.useTriggerType)({ visible, onVisibleChange, triggerType });
|
|
11
12
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
13
|
react_1.default.createElement("div", Object.assign({}, handlers), trigger),
|
|
@@ -15,3 +16,10 @@ function Drawer(_a) {
|
|
|
15
16
|
}, v2: true }), children)));
|
|
16
17
|
}
|
|
17
18
|
exports.Drawer = Drawer;
|
|
19
|
+
function FloatButtonDrawer(_a) {
|
|
20
|
+
var { width, title, drawerClassName, cache = false, beforeOpen, afterOpen, beforeClose, afterClose } = _a, rests = tslib_1.__rest(_a, ["width", "title", "drawerClassName", "cache", "beforeOpen", "afterOpen", "beforeClose", "afterClose"]);
|
|
21
|
+
return (react_1.default.createElement(float_button_1.default, Object.assign({}, rests, { _renderView: (prefix, { visible, onVisibleChange, trigger, triggerType, showClose, children }) => {
|
|
22
|
+
return (react_1.default.createElement(Drawer, { prefix: prefix, className: drawerClassName, visible: visible, onVisibleChange: onVisibleChange, trigger: trigger, closeMode: ['esc', 'mask', ...(showClose ? ['close'] : [])], triggerType: triggerType, cache: cache }, children));
|
|
23
|
+
} })));
|
|
24
|
+
}
|
|
25
|
+
exports.default = next_1.ConfigProvider.config(FloatButtonDrawer);
|
|
@@ -136,6 +136,7 @@ function InnerDrawer({ className, prefix, target, children, trigger, triggerType
|
|
|
136
136
|
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: (0, classnames_1.default)(cls, { [`${cls}--visible`]: visible }), ref: domRef },
|
|
137
137
|
react_1.default.createElement("div", { className: (0, classnames_1.default)(`${cls}-inner`, {
|
|
138
138
|
[`${cls}-inner--has-title`]: !!title,
|
|
139
|
+
[`${cls}-inner--has-close`]: !!closable,
|
|
139
140
|
}), style: { width } },
|
|
140
141
|
react_1.default.createElement("div", { className: (0, classnames_1.default)(`${cls}-header`) },
|
|
141
142
|
!!title && react_1.default.createElement("div", { className: `${cls}-header-title` }, title),
|
package/lib/index.js
CHANGED
|
@@ -18,4 +18,4 @@ var tag_1 = require("./tag");
|
|
|
18
18
|
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return __importDefault(tag_1).default; } });
|
|
19
19
|
var tab_1 = require("./tab");
|
|
20
20
|
Object.defineProperty(exports, "Tab", { enumerable: true, get: function () { return __importDefault(tab_1).default; } });
|
|
21
|
-
exports.version = '0.1.
|
|
21
|
+
exports.version = '0.1.6';
|