@alifd/chat 0.1.0 → 0.1.2
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/button/index.d.ts +3 -2
- package/es/button/index.js +8 -5
- package/es/card/index.d.ts +1 -0
- package/es/card/index.js +1 -0
- package/es/feedback/index.d.ts +1 -0
- package/es/feedback/index.js +1 -0
- package/es/float-button/index.d.ts +3 -2
- package/es/float-button/index.js +2 -1
- package/es/float-button/main.scss +7 -2
- package/es/float-button/types.d.ts +11 -0
- package/es/float-button/view/float-button.d.ts +1 -1
- package/es/float-button/view/float-button.js +37 -30
- package/es/float-button/view/inner-drawer.d.ts +3 -1
- package/es/float-button/view/inner-drawer.js +13 -2
- package/es/index.js +1 -1
- package/es/tab/index.d.ts +3 -3
- package/es/tab/index.js +3 -3
- package/es/tag/index.d.ts +3 -2
- package/es/tag/index.js +7 -4
- package/lib/button/index.d.ts +3 -2
- package/lib/button/index.js +6 -3
- package/lib/card/index.d.ts +1 -0
- package/lib/card/index.js +1 -0
- package/lib/feedback/index.d.ts +1 -0
- package/lib/feedback/index.js +1 -0
- package/lib/float-button/index.d.ts +3 -2
- package/lib/float-button/index.js +2 -1
- package/lib/float-button/main.scss +7 -2
- package/lib/float-button/types.d.ts +11 -0
- package/lib/float-button/view/float-button.d.ts +1 -1
- package/lib/float-button/view/float-button.js +37 -30
- package/lib/float-button/view/inner-drawer.d.ts +3 -1
- package/lib/float-button/view/inner-drawer.js +11 -1
- package/lib/index.js +1 -1
- package/lib/tab/index.d.ts +3 -3
- package/lib/tab/index.js +2 -2
- package/lib/tag/index.d.ts +3 -2
- package/lib/tag/index.js +5 -2
- package/package.json +25 -1
- package/es/tag/types.d.ts +0 -0
- package/es/tag/types.js +0 -1
- package/lib/tag/types.d.ts +0 -0
- package/lib/tag/types.js +0 -1
package/es/button/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import type { ButtonProps } from './types';
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export * from './types';
|
|
23
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<ButtonProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/button").ButtonProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/button/view/button").default>>, keyof ButtonProps | "key"> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/button").ButtonProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/button/view/button").default>, {}>;
|
|
24
|
+
export default _default;
|
package/es/button/index.js
CHANGED
|
@@ -19,12 +19,15 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { __rest } from "tslib";
|
|
21
21
|
import React, { forwardRef } from 'react';
|
|
22
|
-
import { Button as NextButton } from '@alifd/next';
|
|
22
|
+
import { Button as NextButton, ConfigProvider } from '@alifd/next';
|
|
23
23
|
import cs from 'classnames';
|
|
24
|
-
import { PREFIX_DEFAULT } from '../utils';
|
|
24
|
+
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
25
25
|
const Button = forwardRef((_a, ref) => {
|
|
26
26
|
var { className, size = 'small' } = _a, props = __rest(_a, ["className", "size"]);
|
|
27
|
-
return React.createElement(NextButton, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}button`, className), size: size, ref: ref }));
|
|
27
|
+
return (React.createElement(NextButton, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}button`, className), size: size, ref: ref })));
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const ButtonWithSub = assignSubComponent(Button, {
|
|
30
|
+
displayName: 'Button',
|
|
31
|
+
});
|
|
32
|
+
export * from './types';
|
|
33
|
+
export default ConfigProvider.config(ButtonWithSub);
|
package/es/card/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import Collapsable from './view/collapsable';
|
|
|
2
2
|
declare const CardWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").CardProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}> & {
|
|
3
3
|
Collapsable: typeof Collapsable;
|
|
4
4
|
};
|
|
5
|
+
export * from './types';
|
|
5
6
|
export default CardWithSub;
|
package/es/card/index.js
CHANGED
package/es/feedback/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FeedbackProps } from './types';
|
|
2
2
|
import Good from './view/good';
|
|
3
|
+
export * from './types';
|
|
3
4
|
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<FeedbackProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}> & {
|
|
4
5
|
Good: typeof Good;
|
|
5
6
|
};
|
package/es/feedback/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const FloatButtonWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").FloatButtonProps & import("react").RefAttributes<import("./types").FloatButtonRef>, keyof import("./types").FloatButtonProps
|
|
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
|
+
InnerDrawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
4
5
|
};
|
|
5
|
-
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps } from './types';
|
|
6
|
+
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps, FloatButtonInnerDrawerProps, DragableOption, Edge, Margin, Position, RequiredParts, ScreenRatioPosition, Size, TriggerType, } from './types';
|
|
6
7
|
export default FloatButtonWithSub;
|
package/es/float-button/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import FloatButton from './view/float-button';
|
|
2
2
|
import Backtop from './view/backtop';
|
|
3
|
+
import InnerDrawer from './view/inner-drawer';
|
|
3
4
|
import { assignSubComponent } from '../utils/index';
|
|
4
|
-
const FloatButtonWithSub = assignSubComponent(FloatButton, { Backtop });
|
|
5
|
+
const FloatButtonWithSub = assignSubComponent(FloatButton, { Backtop, InnerDrawer });
|
|
5
6
|
export default FloatButtonWithSub;
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
&-inner-drawer {
|
|
20
20
|
flex: 1;
|
|
21
21
|
display: flex;
|
|
22
|
-
padding: $size-base * 2 $size-base * 3;
|
|
23
22
|
overflow: hidden;
|
|
24
23
|
display: flex;
|
|
25
24
|
box-shadow: $shadow-2;
|
|
@@ -47,16 +46,21 @@
|
|
|
47
46
|
flex: none;
|
|
48
47
|
display: flex;
|
|
49
48
|
justify-content: end;
|
|
49
|
+
padding: $size-base * 2 $size-base * 3;
|
|
50
50
|
&-title {
|
|
51
51
|
flex: 1;
|
|
52
|
+
font-size: $font-size-subhead;
|
|
53
|
+
line-height: 1.5;
|
|
52
54
|
}
|
|
53
55
|
&-close {
|
|
54
56
|
flex: none;
|
|
55
57
|
color: $color-text1-2;
|
|
56
58
|
cursor: pointer;
|
|
57
|
-
transition: color .15s;
|
|
59
|
+
transition: color 0.15s;
|
|
58
60
|
outline: 0;
|
|
59
61
|
border: 0;
|
|
62
|
+
padding: 0;
|
|
63
|
+
align-self: flex-start;
|
|
60
64
|
background-color: transparent;
|
|
61
65
|
|
|
62
66
|
&:hover {
|
|
@@ -66,6 +70,7 @@
|
|
|
66
70
|
}
|
|
67
71
|
&-body {
|
|
68
72
|
flex: 1;
|
|
73
|
+
padding: 0 $size-base * 3 $size-base * 2;
|
|
69
74
|
}
|
|
70
75
|
&-footer {
|
|
71
76
|
flex: none;
|
|
@@ -101,6 +101,7 @@ export interface FloatButtonRef {
|
|
|
101
101
|
updateNestleEdge(animation?: boolean): void;
|
|
102
102
|
}
|
|
103
103
|
export type TriggerType = 'hover' | 'click';
|
|
104
|
+
export type RequiredParts<O, K extends keyof O> = Omit<O, K> & Required<Pick<O, K>>;
|
|
104
105
|
/**
|
|
105
106
|
* @api FloatButton
|
|
106
107
|
* @order 1
|
|
@@ -120,6 +121,7 @@ export interface FloatButtonProps extends CommonProps {
|
|
|
120
121
|
drawerProps?: {
|
|
121
122
|
title?: ReactNode;
|
|
122
123
|
width?: number | string;
|
|
124
|
+
target: string | (() => HTMLElement);
|
|
123
125
|
};
|
|
124
126
|
/**
|
|
125
127
|
* 弹层位置,适用 `type`: 'balloon'
|
|
@@ -215,6 +217,7 @@ export interface FloatButtonProps extends CommonProps {
|
|
|
215
217
|
* 弹层内容
|
|
216
218
|
*/
|
|
217
219
|
children?: React.ReactNode;
|
|
220
|
+
_renderView?: (prefix: string, props: RequiredParts<FloatButtonProps, 'visible' | 'onVisibleChange'>) => ReactNode;
|
|
218
221
|
}
|
|
219
222
|
/**
|
|
220
223
|
* @api
|
|
@@ -228,3 +231,11 @@ export interface DragableOption {
|
|
|
228
231
|
onDraging?: (dom: HTMLElement, event: MouseEvent) => void | false;
|
|
229
232
|
onDragend?: (dom: HTMLElement) => void;
|
|
230
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @api FloatButton.InnerDrawer
|
|
236
|
+
*/
|
|
237
|
+
export interface FloatButtonInnerDrawerProps extends FloatButtonProps {
|
|
238
|
+
width?: string | number;
|
|
239
|
+
target: string | (() => HTMLElement);
|
|
240
|
+
title?: ReactNode;
|
|
241
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FloatButtonProps, FloatButtonRef } from '../types';
|
|
3
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<FloatButtonProps & React.RefAttributes<FloatButtonRef>, keyof FloatButtonProps
|
|
3
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<FloatButtonProps & React.RefAttributes<FloatButtonRef>, "key" | keyof FloatButtonProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, FloatButtonRef, {}>;
|
|
4
4
|
export default _default;
|
|
@@ -7,7 +7,7 @@ import { useAutoHide } from '../hooks/useAutoHide';
|
|
|
7
7
|
import { useAutoAlign } from '../hooks/useAutoAlign';
|
|
8
8
|
import { useNestleEdge } from '../hooks/useNestleEdge';
|
|
9
9
|
import { useDragable } from '../hooks/useDragable';
|
|
10
|
-
import { InnerDrawer } from './inner-drawer';
|
|
10
|
+
// import { InnerDrawer } from './inner-drawer';
|
|
11
11
|
/**
|
|
12
12
|
* @component 悬浮球
|
|
13
13
|
* @en FloatButton
|
|
@@ -27,8 +27,8 @@ import { InnerDrawer } from './inner-drawer';
|
|
|
27
27
|
* | Enter | Trigger the onClick event |
|
|
28
28
|
* | SPACE | Trigger the onClick event |
|
|
29
29
|
*/
|
|
30
|
-
const FloatButton = forwardRef((
|
|
31
|
-
|
|
30
|
+
const FloatButton = forwardRef((props, ref) => {
|
|
31
|
+
const { className, style, type = 'balloon', addonAfter, addonBefore, dragable, safeAreaMargin = [10, 10, 10, 10], autoNestleEdge = true, interactiveEdges = ['left', 'right'], autoHide, autoAlign, leftSizeOfHidden, defaultPosition, trigger, triggerType = 'click', showClose = true, align, balloonProps, drawerProps, children, _renderView } = props, others = __rest(props, ["className", "style", "type", "addonAfter", "addonBefore", "dragable", "safeAreaMargin", "autoNestleEdge", "interactiveEdges", "autoHide", "autoAlign", "leftSizeOfHidden", "defaultPosition", "trigger", "triggerType", "showClose", "align", "balloonProps", "drawerProps", "children", "_renderView"]);
|
|
32
32
|
const elRef = useRef(null);
|
|
33
33
|
const triggerRef = useRef(null);
|
|
34
34
|
const [el, setEl] = useState(null);
|
|
@@ -106,13 +106,14 @@ const FloatButton = forwardRef((_a, ref) => {
|
|
|
106
106
|
},
|
|
107
107
|
});
|
|
108
108
|
const classNames = cs(cls, className, dragClassName);
|
|
109
|
+
const handleVisibleChange = (v, type) => {
|
|
110
|
+
if (draggedRef.current) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
onVisibleChange(v, type);
|
|
114
|
+
};
|
|
109
115
|
const renderBalloon = () => {
|
|
110
|
-
return (React.createElement(Balloon, Object.assign({ visible: visible, onVisibleChange:
|
|
111
|
-
if (draggedRef.current) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(...args);
|
|
115
|
-
}, popupProps: {
|
|
116
|
+
return (React.createElement(Balloon, Object.assign({ visible: visible, onVisibleChange: handleVisibleChange, popupProps: {
|
|
116
117
|
afterOpen() {
|
|
117
118
|
var _a, _b;
|
|
118
119
|
updateAlign();
|
|
@@ -120,29 +121,35 @@ const FloatButton = forwardRef((_a, ref) => {
|
|
|
120
121
|
},
|
|
121
122
|
}, popupClassName: `${cls}-popup`, trigger: trigger, popupContainer: () => el, triggerType: triggerType, align: currentAlign, v2: true, closable: showClose, autoAdjust: false }, balloonProps), children));
|
|
122
123
|
};
|
|
123
|
-
const renderDrawer = () => {
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
const renderInnerDrawer = () => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
124
|
+
// const renderDrawer = () => {
|
|
125
|
+
// return <div></div>;
|
|
126
|
+
// };
|
|
127
|
+
// const renderInnerDrawer = () => {
|
|
128
|
+
// return (
|
|
129
|
+
// <InnerDrawer
|
|
130
|
+
// {...drawerProps}
|
|
131
|
+
// prefix={`${cls}-`}
|
|
132
|
+
// target=".card-legal-affairs"
|
|
133
|
+
// trigger={trigger}
|
|
134
|
+
// triggerType={triggerType}
|
|
135
|
+
// visible={visible}
|
|
136
|
+
// closable={showClose}
|
|
137
|
+
// onVisibleChange={(...args) => {
|
|
138
|
+
// if (draggedRef.current) {
|
|
139
|
+
// return;
|
|
140
|
+
// }
|
|
141
|
+
// onVisibleChange?.(...args);
|
|
142
|
+
// }}
|
|
143
|
+
// >
|
|
144
|
+
// {children}
|
|
145
|
+
// </InnerDrawer>
|
|
146
|
+
// );
|
|
147
|
+
// };
|
|
134
148
|
const renderView = () => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return renderDrawer();
|
|
138
|
-
}
|
|
139
|
-
case 'inner-drawer': {
|
|
140
|
-
return renderInnerDrawer();
|
|
141
|
-
}
|
|
142
|
-
default: {
|
|
143
|
-
return renderBalloon();
|
|
144
|
-
}
|
|
149
|
+
if (typeof _renderView === 'function') {
|
|
150
|
+
return _renderView(`${cls}-`, Object.assign(Object.assign({}, props), { visible, onVisibleChange: handleVisibleChange }));
|
|
145
151
|
}
|
|
152
|
+
return renderBalloon();
|
|
146
153
|
};
|
|
147
154
|
return (React.createElement("div", { className: classNames, style: Object.assign(Object.assign({}, style), dragStyle), ref: elRef },
|
|
148
155
|
!!addonBefore && (React.createElement("div", { className: cs(`${cls}-addon`, `${cls}-addon--before`) }, addonBefore)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
-
import type { FloatButtonProps } from '../types';
|
|
2
|
+
import type { FloatButtonInnerDrawerProps, FloatButtonProps } from '../types';
|
|
3
3
|
export interface InnerDrawerProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
title?: ReactNode;
|
|
@@ -14,3 +14,5 @@ export interface InnerDrawerProps {
|
|
|
14
14
|
width?: string | number;
|
|
15
15
|
}
|
|
16
16
|
export declare function InnerDrawer({ className, prefix, target, children, trigger, triggerType, visible, onVisibleChange, closable, title, width, }: InnerDrawerProps): React.JSX.Element;
|
|
17
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
18
|
+
export default _default;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
import React, { useRef, useLayoutEffect, useEffect, useState } from 'react';
|
|
2
3
|
import ReactDOM from 'react-dom';
|
|
3
4
|
import cs from 'classnames';
|
|
4
|
-
import { Icon } from '@alifd/next';
|
|
5
|
+
import { Icon, ConfigProvider } from '@alifd/next';
|
|
5
6
|
import { useTriggerType } from '../hooks/useTriggerType';
|
|
7
|
+
import FloatButton from './float-button';
|
|
6
8
|
function getTarget(target) {
|
|
7
9
|
if (typeof target === 'string') {
|
|
8
10
|
return document.querySelector(target);
|
|
@@ -99,6 +101,15 @@ export function InnerDrawer({ className, prefix, target, children, trigger, trig
|
|
|
99
101
|
React.createElement("div", { className: `${cls}-header` },
|
|
100
102
|
!!title && React.createElement("div", { className: `${cls}-header-title` }, title),
|
|
101
103
|
!!closable && (React.createElement("button", { className: `${cls}-header-close`, onClick: () => handleVisibleChange(false, 'close') },
|
|
102
|
-
React.createElement(Icon, { className: `${cls}-header-close-icon`, type: "close", size:
|
|
104
|
+
React.createElement(Icon, { className: `${cls}-header-close-icon`, type: "close", size: 12 })))),
|
|
103
105
|
React.createElement("div", { className: `${cls}-body` }, children))), mountTarget)));
|
|
104
106
|
}
|
|
107
|
+
function FloatButtonByInnerDrawer(props) {
|
|
108
|
+
const { width, title, target } = props, rests = __rest(props, ["width", "title", "target"]);
|
|
109
|
+
return (React.createElement(FloatButton, Object.assign({}, rests, { _renderView: (prefix, { trigger, triggerType, visible, onVisibleChange, showClose, children }) => {
|
|
110
|
+
return (React.createElement(InnerDrawer, { prefix: prefix, target: target, width: width, title: title, trigger: trigger, triggerType: triggerType, visible: visible, closable: showClose, onVisibleChange: (...args) => {
|
|
111
|
+
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(...args);
|
|
112
|
+
} }, children));
|
|
113
|
+
} })));
|
|
114
|
+
}
|
|
115
|
+
export default ConfigProvider.config(FloatButtonByInnerDrawer);
|
package/es/index.js
CHANGED
package/es/tab/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tab as NextTab } from '@alifd/next';
|
|
3
3
|
import type { TabProps } from '@alifd/next/types/tab';
|
|
4
|
-
|
|
4
|
+
export type { TabProps, ItemProps } from '@alifd/next/types/tab';
|
|
5
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<TabProps & React.RefAttributes<NextTab>, "key" | keyof TabProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, NextTab, {}> & {
|
|
5
6
|
Item: typeof import("@alifd/next/types/tab").Item;
|
|
6
|
-
displayName: string;
|
|
7
7
|
};
|
|
8
|
-
export default
|
|
8
|
+
export default _default;
|
package/es/tab/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
-
import { Tab as NextTab } from '@alifd/next';
|
|
3
|
+
import { Tab as NextTab, ConfigProvider } from '@alifd/next';
|
|
4
4
|
import cs from 'classnames';
|
|
5
5
|
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
6
6
|
const Tab = forwardRef((_a, ref) => {
|
|
7
7
|
var { className, size = 'small' } = _a, props = __rest(_a, ["className", "size"]);
|
|
8
|
-
return React.createElement(NextTab, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}tabs`, className), ref: ref, size: size }));
|
|
8
|
+
return (React.createElement(NextTab, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}tabs`, className), ref: ref, size: size })));
|
|
9
9
|
});
|
|
10
10
|
const TabWithSub = assignSubComponent(Tab, {
|
|
11
11
|
Item: NextTab.Item,
|
|
12
12
|
displayName: 'Tab',
|
|
13
13
|
});
|
|
14
|
-
export default TabWithSub;
|
|
14
|
+
export default ConfigProvider.config(TabWithSub);
|
package/es/tag/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Tag as NextTag } from '@alifd/next';
|
|
10
10
|
import type { TagProps } from '@alifd/next/types/tag';
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export type { TagProps } from '@alifd/next/types/tag';
|
|
12
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<TagProps & React.RefAttributes<NextTag>, "key" | keyof TagProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, NextTag, {}>;
|
|
13
|
+
export default _default;
|
package/es/tag/index.js
CHANGED
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { __rest } from "tslib";
|
|
9
9
|
import React, { forwardRef } from 'react';
|
|
10
|
-
import { Tag as NextTag } from '@alifd/next';
|
|
10
|
+
import { Tag as NextTag, ConfigProvider } from '@alifd/next';
|
|
11
11
|
import cs from 'classnames';
|
|
12
|
-
import { PREFIX_DEFAULT } from '../utils';
|
|
12
|
+
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
13
13
|
const Tag = forwardRef((_a, ref) => {
|
|
14
14
|
var { className, size = 'small', type = 'normal' } = _a, props = __rest(_a, ["className", "size", "type"]);
|
|
15
15
|
return (React.createElement(NextTag, Object.assign({}, props, { ref: ref, className: cs(`${PREFIX_DEFAULT}tag`, className), size: size, type: type })));
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// 暂时只开放 Tag 组件,其它子组件后续看需求
|
|
18
|
+
const TagWithSub = assignSubComponent(Tag, {
|
|
19
|
+
displayName: 'Tag',
|
|
20
|
+
});
|
|
21
|
+
export default ConfigProvider.config(TagWithSub);
|
package/lib/button/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import type { ButtonProps } from './types';
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export * from './types';
|
|
23
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<ButtonProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/button").ButtonProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/button/view/button").default>>, keyof ButtonProps | "key"> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/button").ButtonProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/button/view/button").default>, {}>;
|
|
24
|
+
export default _default;
|
package/lib/button/index.js
CHANGED
|
@@ -26,7 +26,10 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
26
26
|
const utils_1 = require("../utils");
|
|
27
27
|
const Button = (0, react_1.forwardRef)((_a, ref) => {
|
|
28
28
|
var { className, size = 'small' } = _a, props = tslib_1.__rest(_a, ["className", "size"]);
|
|
29
|
-
return react_1.default.createElement(next_1.Button, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}button`, className), size: size, ref: ref }));
|
|
29
|
+
return (react_1.default.createElement(next_1.Button, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}button`, className), size: size, ref: ref })));
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const ButtonWithSub = (0, utils_1.assignSubComponent)(Button, {
|
|
32
|
+
displayName: 'Button',
|
|
33
|
+
});
|
|
34
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
35
|
+
exports.default = next_1.ConfigProvider.config(ButtonWithSub);
|
package/lib/card/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import Collapsable from './view/collapsable';
|
|
|
2
2
|
declare const CardWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").CardProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}> & {
|
|
3
3
|
Collapsable: typeof Collapsable;
|
|
4
4
|
};
|
|
5
|
+
export * from './types';
|
|
5
6
|
export default CardWithSub;
|
package/lib/card/index.js
CHANGED
|
@@ -5,4 +5,5 @@ const utils_1 = require("../utils");
|
|
|
5
5
|
const card_1 = tslib_1.__importDefault(require("./view/card"));
|
|
6
6
|
const collapsable_1 = tslib_1.__importDefault(require("./view/collapsable"));
|
|
7
7
|
const CardWithSub = (0, utils_1.assignSubComponent)(card_1.default, { Collapsable: collapsable_1.default });
|
|
8
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
8
9
|
exports.default = CardWithSub;
|
package/lib/feedback/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FeedbackProps } from './types';
|
|
2
2
|
import Good from './view/good';
|
|
3
|
+
export * from './types';
|
|
3
4
|
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<FeedbackProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}> & {
|
|
4
5
|
Good: typeof Good;
|
|
5
6
|
};
|
package/lib/feedback/index.js
CHANGED
|
@@ -45,4 +45,5 @@ function Feedback(props) {
|
|
|
45
45
|
}
|
|
46
46
|
Feedback.displayName = 'Feedback';
|
|
47
47
|
const FeedbackWithSub = (0, utils_1.assignSubComponent)(Feedback, { Good: good_1.default });
|
|
48
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
48
49
|
exports.default = next_1.ConfigProvider.config(FeedbackWithSub);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const FloatButtonWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").FloatButtonProps & import("react").RefAttributes<import("./types").FloatButtonRef>, keyof import("./types").FloatButtonProps
|
|
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
|
+
InnerDrawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
4
5
|
};
|
|
5
|
-
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps } from './types';
|
|
6
|
+
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps, FloatButtonInnerDrawerProps, DragableOption, Edge, Margin, Position, RequiredParts, ScreenRatioPosition, Size, TriggerType, } from './types';
|
|
6
7
|
export default FloatButtonWithSub;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
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
|
+
const inner_drawer_1 = tslib_1.__importDefault(require("./view/inner-drawer"));
|
|
6
7
|
const index_1 = require("../utils/index");
|
|
7
|
-
const FloatButtonWithSub = (0, index_1.assignSubComponent)(float_button_1.default, { Backtop: backtop_1.default });
|
|
8
|
+
const FloatButtonWithSub = (0, index_1.assignSubComponent)(float_button_1.default, { Backtop: backtop_1.default, InnerDrawer: inner_drawer_1.default });
|
|
8
9
|
exports.default = FloatButtonWithSub;
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
&-inner-drawer {
|
|
20
20
|
flex: 1;
|
|
21
21
|
display: flex;
|
|
22
|
-
padding: $size-base * 2 $size-base * 3;
|
|
23
22
|
overflow: hidden;
|
|
24
23
|
display: flex;
|
|
25
24
|
box-shadow: $shadow-2;
|
|
@@ -47,16 +46,21 @@
|
|
|
47
46
|
flex: none;
|
|
48
47
|
display: flex;
|
|
49
48
|
justify-content: end;
|
|
49
|
+
padding: $size-base * 2 $size-base * 3;
|
|
50
50
|
&-title {
|
|
51
51
|
flex: 1;
|
|
52
|
+
font-size: $font-size-subhead;
|
|
53
|
+
line-height: 1.5;
|
|
52
54
|
}
|
|
53
55
|
&-close {
|
|
54
56
|
flex: none;
|
|
55
57
|
color: $color-text1-2;
|
|
56
58
|
cursor: pointer;
|
|
57
|
-
transition: color .15s;
|
|
59
|
+
transition: color 0.15s;
|
|
58
60
|
outline: 0;
|
|
59
61
|
border: 0;
|
|
62
|
+
padding: 0;
|
|
63
|
+
align-self: flex-start;
|
|
60
64
|
background-color: transparent;
|
|
61
65
|
|
|
62
66
|
&:hover {
|
|
@@ -66,6 +70,7 @@
|
|
|
66
70
|
}
|
|
67
71
|
&-body {
|
|
68
72
|
flex: 1;
|
|
73
|
+
padding: 0 $size-base * 3 $size-base * 2;
|
|
69
74
|
}
|
|
70
75
|
&-footer {
|
|
71
76
|
flex: none;
|
|
@@ -101,6 +101,7 @@ export interface FloatButtonRef {
|
|
|
101
101
|
updateNestleEdge(animation?: boolean): void;
|
|
102
102
|
}
|
|
103
103
|
export type TriggerType = 'hover' | 'click';
|
|
104
|
+
export type RequiredParts<O, K extends keyof O> = Omit<O, K> & Required<Pick<O, K>>;
|
|
104
105
|
/**
|
|
105
106
|
* @api FloatButton
|
|
106
107
|
* @order 1
|
|
@@ -120,6 +121,7 @@ export interface FloatButtonProps extends CommonProps {
|
|
|
120
121
|
drawerProps?: {
|
|
121
122
|
title?: ReactNode;
|
|
122
123
|
width?: number | string;
|
|
124
|
+
target: string | (() => HTMLElement);
|
|
123
125
|
};
|
|
124
126
|
/**
|
|
125
127
|
* 弹层位置,适用 `type`: 'balloon'
|
|
@@ -215,6 +217,7 @@ export interface FloatButtonProps extends CommonProps {
|
|
|
215
217
|
* 弹层内容
|
|
216
218
|
*/
|
|
217
219
|
children?: React.ReactNode;
|
|
220
|
+
_renderView?: (prefix: string, props: RequiredParts<FloatButtonProps, 'visible' | 'onVisibleChange'>) => ReactNode;
|
|
218
221
|
}
|
|
219
222
|
/**
|
|
220
223
|
* @api
|
|
@@ -228,3 +231,11 @@ export interface DragableOption {
|
|
|
228
231
|
onDraging?: (dom: HTMLElement, event: MouseEvent) => void | false;
|
|
229
232
|
onDragend?: (dom: HTMLElement) => void;
|
|
230
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @api FloatButton.InnerDrawer
|
|
236
|
+
*/
|
|
237
|
+
export interface FloatButtonInnerDrawerProps extends FloatButtonProps {
|
|
238
|
+
width?: string | number;
|
|
239
|
+
target: string | (() => HTMLElement);
|
|
240
|
+
title?: ReactNode;
|
|
241
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FloatButtonProps, FloatButtonRef } from '../types';
|
|
3
|
-
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<FloatButtonProps & React.RefAttributes<FloatButtonRef>, keyof FloatButtonProps
|
|
3
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<FloatButtonProps & React.RefAttributes<FloatButtonRef>, "key" | keyof FloatButtonProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, FloatButtonRef, {}>;
|
|
4
4
|
export default _default;
|
|
@@ -9,7 +9,7 @@ const useAutoHide_1 = require("../hooks/useAutoHide");
|
|
|
9
9
|
const useAutoAlign_1 = require("../hooks/useAutoAlign");
|
|
10
10
|
const useNestleEdge_1 = require("../hooks/useNestleEdge");
|
|
11
11
|
const useDragable_1 = require("../hooks/useDragable");
|
|
12
|
-
|
|
12
|
+
// import { InnerDrawer } from './inner-drawer';
|
|
13
13
|
/**
|
|
14
14
|
* @component 悬浮球
|
|
15
15
|
* @en FloatButton
|
|
@@ -29,8 +29,8 @@ const inner_drawer_1 = require("./inner-drawer");
|
|
|
29
29
|
* | Enter | Trigger the onClick event |
|
|
30
30
|
* | SPACE | Trigger the onClick event |
|
|
31
31
|
*/
|
|
32
|
-
const FloatButton = (0, react_1.forwardRef)((
|
|
33
|
-
|
|
32
|
+
const FloatButton = (0, react_1.forwardRef)((props, ref) => {
|
|
33
|
+
const { className, style, type = 'balloon', addonAfter, addonBefore, dragable, safeAreaMargin = [10, 10, 10, 10], autoNestleEdge = true, interactiveEdges = ['left', 'right'], autoHide, autoAlign, leftSizeOfHidden, defaultPosition, trigger, triggerType = 'click', showClose = true, align, balloonProps, drawerProps, children, _renderView } = props, others = tslib_1.__rest(props, ["className", "style", "type", "addonAfter", "addonBefore", "dragable", "safeAreaMargin", "autoNestleEdge", "interactiveEdges", "autoHide", "autoAlign", "leftSizeOfHidden", "defaultPosition", "trigger", "triggerType", "showClose", "align", "balloonProps", "drawerProps", "children", "_renderView"]);
|
|
34
34
|
const elRef = (0, react_1.useRef)(null);
|
|
35
35
|
const triggerRef = (0, react_1.useRef)(null);
|
|
36
36
|
const [el, setEl] = (0, react_1.useState)(null);
|
|
@@ -108,13 +108,14 @@ const FloatButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
108
108
|
},
|
|
109
109
|
});
|
|
110
110
|
const classNames = (0, classnames_1.default)(cls, className, dragClassName);
|
|
111
|
+
const handleVisibleChange = (v, type) => {
|
|
112
|
+
if (draggedRef.current) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
onVisibleChange(v, type);
|
|
116
|
+
};
|
|
111
117
|
const renderBalloon = () => {
|
|
112
|
-
return (react_1.default.createElement(next_1.Balloon, Object.assign({ visible: visible, onVisibleChange:
|
|
113
|
-
if (draggedRef.current) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(...args);
|
|
117
|
-
}, popupProps: {
|
|
118
|
+
return (react_1.default.createElement(next_1.Balloon, Object.assign({ visible: visible, onVisibleChange: handleVisibleChange, popupProps: {
|
|
118
119
|
afterOpen() {
|
|
119
120
|
var _a, _b;
|
|
120
121
|
updateAlign();
|
|
@@ -122,29 +123,35 @@ const FloatButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
122
123
|
},
|
|
123
124
|
}, popupClassName: `${cls}-popup`, trigger: trigger, popupContainer: () => el, triggerType: triggerType, align: currentAlign, v2: true, closable: showClose, autoAdjust: false }, balloonProps), children));
|
|
124
125
|
};
|
|
125
|
-
const renderDrawer = () => {
|
|
126
|
-
|
|
127
|
-
};
|
|
128
|
-
const renderInnerDrawer = () => {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
126
|
+
// const renderDrawer = () => {
|
|
127
|
+
// return <div></div>;
|
|
128
|
+
// };
|
|
129
|
+
// const renderInnerDrawer = () => {
|
|
130
|
+
// return (
|
|
131
|
+
// <InnerDrawer
|
|
132
|
+
// {...drawerProps}
|
|
133
|
+
// prefix={`${cls}-`}
|
|
134
|
+
// target=".card-legal-affairs"
|
|
135
|
+
// trigger={trigger}
|
|
136
|
+
// triggerType={triggerType}
|
|
137
|
+
// visible={visible}
|
|
138
|
+
// closable={showClose}
|
|
139
|
+
// onVisibleChange={(...args) => {
|
|
140
|
+
// if (draggedRef.current) {
|
|
141
|
+
// return;
|
|
142
|
+
// }
|
|
143
|
+
// onVisibleChange?.(...args);
|
|
144
|
+
// }}
|
|
145
|
+
// >
|
|
146
|
+
// {children}
|
|
147
|
+
// </InnerDrawer>
|
|
148
|
+
// );
|
|
149
|
+
// };
|
|
136
150
|
const renderView = () => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return renderDrawer();
|
|
140
|
-
}
|
|
141
|
-
case 'inner-drawer': {
|
|
142
|
-
return renderInnerDrawer();
|
|
143
|
-
}
|
|
144
|
-
default: {
|
|
145
|
-
return renderBalloon();
|
|
146
|
-
}
|
|
151
|
+
if (typeof _renderView === 'function') {
|
|
152
|
+
return _renderView(`${cls}-`, Object.assign(Object.assign({}, props), { visible, onVisibleChange: handleVisibleChange }));
|
|
147
153
|
}
|
|
154
|
+
return renderBalloon();
|
|
148
155
|
};
|
|
149
156
|
return (react_1.default.createElement("div", { className: classNames, style: Object.assign(Object.assign({}, style), dragStyle), ref: elRef },
|
|
150
157
|
!!addonBefore && (react_1.default.createElement("div", { className: (0, classnames_1.default)(`${cls}-addon`, `${cls}-addon--before`) }, addonBefore)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
-
import type { FloatButtonProps } from '../types';
|
|
2
|
+
import type { FloatButtonInnerDrawerProps, FloatButtonProps } from '../types';
|
|
3
3
|
export interface InnerDrawerProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
title?: ReactNode;
|
|
@@ -14,3 +14,5 @@ export interface InnerDrawerProps {
|
|
|
14
14
|
width?: string | number;
|
|
15
15
|
}
|
|
16
16
|
export declare function InnerDrawer({ className, prefix, target, children, trigger, triggerType, visible, onVisibleChange, closable, title, width, }: InnerDrawerProps): React.JSX.Element;
|
|
17
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
18
|
+
export default _default;
|
|
@@ -7,6 +7,7 @@ const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
|
7
7
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
8
|
const next_1 = require("@alifd/next");
|
|
9
9
|
const useTriggerType_1 = require("../hooks/useTriggerType");
|
|
10
|
+
const float_button_1 = tslib_1.__importDefault(require("./float-button"));
|
|
10
11
|
function getTarget(target) {
|
|
11
12
|
if (typeof target === 'string') {
|
|
12
13
|
return document.querySelector(target);
|
|
@@ -103,7 +104,16 @@ function InnerDrawer({ className, prefix, target, children, trigger, triggerType
|
|
|
103
104
|
react_1.default.createElement("div", { className: `${cls}-header` },
|
|
104
105
|
!!title && react_1.default.createElement("div", { className: `${cls}-header-title` }, title),
|
|
105
106
|
!!closable && (react_1.default.createElement("button", { className: `${cls}-header-close`, onClick: () => handleVisibleChange(false, 'close') },
|
|
106
|
-
react_1.default.createElement(next_1.Icon, { className: `${cls}-header-close-icon`, type: "close", size:
|
|
107
|
+
react_1.default.createElement(next_1.Icon, { className: `${cls}-header-close-icon`, type: "close", size: 12 })))),
|
|
107
108
|
react_1.default.createElement("div", { className: `${cls}-body` }, children))), mountTarget)));
|
|
108
109
|
}
|
|
109
110
|
exports.InnerDrawer = InnerDrawer;
|
|
111
|
+
function FloatButtonByInnerDrawer(props) {
|
|
112
|
+
const { width, title, target } = props, rests = tslib_1.__rest(props, ["width", "title", "target"]);
|
|
113
|
+
return (react_1.default.createElement(float_button_1.default, Object.assign({}, rests, { _renderView: (prefix, { trigger, triggerType, visible, onVisibleChange, showClose, children }) => {
|
|
114
|
+
return (react_1.default.createElement(InnerDrawer, { prefix: prefix, target: target, width: width, title: title, trigger: trigger, triggerType: triggerType, visible: visible, closable: showClose, onVisibleChange: (...args) => {
|
|
115
|
+
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(...args);
|
|
116
|
+
} }, children));
|
|
117
|
+
} })));
|
|
118
|
+
}
|
|
119
|
+
exports.default = next_1.ConfigProvider.config(FloatButtonByInnerDrawer);
|
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.1';
|
package/lib/tab/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tab as NextTab } from '@alifd/next';
|
|
3
3
|
import type { TabProps } from '@alifd/next/types/tab';
|
|
4
|
-
|
|
4
|
+
export type { TabProps, ItemProps } from '@alifd/next/types/tab';
|
|
5
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<TabProps & React.RefAttributes<NextTab>, "key" | keyof TabProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, NextTab, {}> & {
|
|
5
6
|
Item: typeof import("@alifd/next/types/tab").Item;
|
|
6
|
-
displayName: string;
|
|
7
7
|
};
|
|
8
|
-
export default
|
|
8
|
+
export default _default;
|
package/lib/tab/index.js
CHANGED
|
@@ -7,10 +7,10 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const Tab = (0, react_1.forwardRef)((_a, ref) => {
|
|
9
9
|
var { className, size = 'small' } = _a, props = tslib_1.__rest(_a, ["className", "size"]);
|
|
10
|
-
return react_1.default.createElement(next_1.Tab, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}tabs`, className), ref: ref, size: size }));
|
|
10
|
+
return (react_1.default.createElement(next_1.Tab, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}tabs`, className), ref: ref, size: size })));
|
|
11
11
|
});
|
|
12
12
|
const TabWithSub = (0, utils_1.assignSubComponent)(Tab, {
|
|
13
13
|
Item: next_1.Tab.Item,
|
|
14
14
|
displayName: 'Tab',
|
|
15
15
|
});
|
|
16
|
-
exports.default = TabWithSub;
|
|
16
|
+
exports.default = next_1.ConfigProvider.config(TabWithSub);
|
package/lib/tag/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Tag as NextTag } from '@alifd/next';
|
|
10
10
|
import type { TagProps } from '@alifd/next/types/tag';
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export type { TagProps } from '@alifd/next/types/tag';
|
|
12
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<TagProps & React.RefAttributes<NextTag>, "key" | keyof TagProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, NextTag, {}>;
|
|
13
|
+
export default _default;
|
package/lib/tag/index.js
CHANGED
|
@@ -16,5 +16,8 @@ const Tag = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
16
16
|
var { className, size = 'small', type = 'normal' } = _a, props = tslib_1.__rest(_a, ["className", "size", "type"]);
|
|
17
17
|
return (react_1.default.createElement(next_1.Tag, Object.assign({}, props, { ref: ref, className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}tag`, className), size: size, type: type })));
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// 暂时只开放 Tag 组件,其它子组件后续看需求
|
|
20
|
+
const TagWithSub = (0, utils_1.assignSubComponent)(Tag, {
|
|
21
|
+
displayName: 'Tag',
|
|
22
|
+
});
|
|
23
|
+
exports.default = next_1.ConfigProvider.config(TagWithSub);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alifd/chat",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A configurable component library for chat built on React.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -10,6 +10,30 @@
|
|
|
10
10
|
"require": "./lib/index.js"
|
|
11
11
|
},
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
|
+
"./es/*": {
|
|
14
|
+
"import": "./es/*.js",
|
|
15
|
+
"require": "./lib/*.js"
|
|
16
|
+
},
|
|
17
|
+
"./es/*.js": {
|
|
18
|
+
"import": "./es/*.js",
|
|
19
|
+
"require": "./lib/*.js"
|
|
20
|
+
},
|
|
21
|
+
"./es/*.scss": {
|
|
22
|
+
"import": "./es/*.scss",
|
|
23
|
+
"require": "./lib/*.scss"
|
|
24
|
+
},
|
|
25
|
+
"./lib/*": {
|
|
26
|
+
"import": "./es/*.js",
|
|
27
|
+
"require": "./lib/*.js"
|
|
28
|
+
},
|
|
29
|
+
"./lib/*.js": {
|
|
30
|
+
"import": "./es/*.js",
|
|
31
|
+
"require": "./lib/*.js"
|
|
32
|
+
},
|
|
33
|
+
"./lib/*.scss": {
|
|
34
|
+
"import": "./es/*.scss",
|
|
35
|
+
"require": "./lib/*.scss"
|
|
36
|
+
},
|
|
13
37
|
"./button": {
|
|
14
38
|
"import": "./es/button/index.js",
|
|
15
39
|
"require": "./lib/button/index.js"
|
package/es/tag/types.d.ts
DELETED
|
File without changes
|
package/es/tag/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/lib/tag/types.d.ts
DELETED
|
File without changes
|
package/lib/tag/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|