@alifd/chat 0.3.33-beta.0 → 0.3.33-beta.1
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/index.js +1 -1
- package/es/tool-status/index.js +7 -2
- package/es/tool-status/types.d.ts +6 -2
- package/lib/index.js +1 -1
- package/lib/tool-status/index.js +7 -2
- package/lib/tool-status/types.d.ts +6 -2
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -32,4 +32,4 @@ export { default as CheckboxGroup } from './checkbox-group';
|
|
|
32
32
|
export { default as Select } from './select';
|
|
33
33
|
export { default as Flip } from './flip';
|
|
34
34
|
export { default as ToolStatus } from './tool-status';
|
|
35
|
-
export const version = '0.3.33-beta.
|
|
35
|
+
export const version = '0.3.33-beta.1';
|
package/es/tool-status/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const SUCCESS_ICON = 'success';
|
|
|
13
13
|
const ERROR_ICON = 'error';
|
|
14
14
|
const LOADING_ICON = 'loading';
|
|
15
15
|
const ToolStatus = forwardRef((props, ref) => {
|
|
16
|
-
const { className, selected = false, status, result = '', onToolClick,
|
|
16
|
+
const { className, selected = false, status, result = '', onToolClick, auth } = props;
|
|
17
17
|
const handleClick = (event) => {
|
|
18
18
|
event.stopPropagation();
|
|
19
19
|
onToolClick === null || onToolClick === void 0 ? void 0 : onToolClick(props);
|
|
@@ -25,7 +25,12 @@ const ToolStatus = forwardRef((props, ref) => {
|
|
|
25
25
|
React.createElement("div", { className: 'main-content' },
|
|
26
26
|
React.createElement(Icon, { size: 'small', type: status === 'error' ? ERROR_ICON : status === 'success' ? SUCCESS_ICON : LOADING_ICON }),
|
|
27
27
|
React.createElement("div", { className: 'content-result' }, result)),
|
|
28
|
-
|
|
28
|
+
auth && React.createElement("div", { className: 'auth-content' },
|
|
29
|
+
React.createElement("div", { onClick: (event) => {
|
|
30
|
+
var _a;
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
(_a = auth === null || auth === void 0 ? void 0 : auth.onAuthClick) === null || _a === void 0 ? void 0 : _a.call(auth, props);
|
|
33
|
+
} }, auth === null || auth === void 0 ? void 0 : auth.content))));
|
|
29
34
|
});
|
|
30
35
|
export * from './types';
|
|
31
36
|
export default ConfigProvider.config(ToolStatus);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type CommonProps } from '@alifd/next';
|
|
3
|
+
export interface ToolStatusAuthProps {
|
|
4
|
+
content: string | ReactNode;
|
|
5
|
+
onAuthClick?: (data: ToolStatusProps) => void;
|
|
6
|
+
}
|
|
3
7
|
/**
|
|
4
8
|
* 参考来源属性
|
|
5
9
|
*/
|
|
@@ -22,7 +26,7 @@ export interface ToolStatusProps extends React.HTMLAttributes<HTMLElement>, Comm
|
|
|
22
26
|
*/
|
|
23
27
|
onToolClick?: (data: ToolStatusProps) => void;
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* 额外的授权信息
|
|
26
30
|
*/
|
|
27
|
-
|
|
31
|
+
auth?: ToolStatusAuthProps;
|
|
28
32
|
}
|
package/lib/index.js
CHANGED
|
@@ -70,4 +70,4 @@ var flip_1 = require("./flip");
|
|
|
70
70
|
Object.defineProperty(exports, "Flip", { enumerable: true, get: function () { return tslib_1.__importDefault(flip_1).default; } });
|
|
71
71
|
var tool_status_1 = require("./tool-status");
|
|
72
72
|
Object.defineProperty(exports, "ToolStatus", { enumerable: true, get: function () { return tslib_1.__importDefault(tool_status_1).default; } });
|
|
73
|
-
exports.version = '0.3.33-beta.
|
|
73
|
+
exports.version = '0.3.33-beta.1';
|
package/lib/tool-status/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const SUCCESS_ICON = 'success';
|
|
|
16
16
|
const ERROR_ICON = 'error';
|
|
17
17
|
const LOADING_ICON = 'loading';
|
|
18
18
|
const ToolStatus = (0, react_1.forwardRef)((props, ref) => {
|
|
19
|
-
const { className, selected = false, status, result = '', onToolClick,
|
|
19
|
+
const { className, selected = false, status, result = '', onToolClick, auth } = props;
|
|
20
20
|
const handleClick = (event) => {
|
|
21
21
|
event.stopPropagation();
|
|
22
22
|
onToolClick === null || onToolClick === void 0 ? void 0 : onToolClick(props);
|
|
@@ -28,7 +28,12 @@ const ToolStatus = (0, react_1.forwardRef)((props, ref) => {
|
|
|
28
28
|
react_1.default.createElement("div", { className: 'main-content' },
|
|
29
29
|
react_1.default.createElement(icon_1.default, { size: 'small', type: status === 'error' ? ERROR_ICON : status === 'success' ? SUCCESS_ICON : LOADING_ICON }),
|
|
30
30
|
react_1.default.createElement("div", { className: 'content-result' }, result)),
|
|
31
|
-
|
|
31
|
+
auth && react_1.default.createElement("div", { className: 'auth-content' },
|
|
32
|
+
react_1.default.createElement("div", { onClick: (event) => {
|
|
33
|
+
var _a;
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
(_a = auth === null || auth === void 0 ? void 0 : auth.onAuthClick) === null || _a === void 0 ? void 0 : _a.call(auth, props);
|
|
36
|
+
} }, auth === null || auth === void 0 ? void 0 : auth.content))));
|
|
32
37
|
});
|
|
33
38
|
tslib_1.__exportStar(require("./types"), exports);
|
|
34
39
|
exports.default = next_1.ConfigProvider.config(ToolStatus);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
2
|
import { type CommonProps } from '@alifd/next';
|
|
3
|
+
export interface ToolStatusAuthProps {
|
|
4
|
+
content: string | ReactNode;
|
|
5
|
+
onAuthClick?: (data: ToolStatusProps) => void;
|
|
6
|
+
}
|
|
3
7
|
/**
|
|
4
8
|
* 参考来源属性
|
|
5
9
|
*/
|
|
@@ -22,7 +26,7 @@ export interface ToolStatusProps extends React.HTMLAttributes<HTMLElement>, Comm
|
|
|
22
26
|
*/
|
|
23
27
|
onToolClick?: (data: ToolStatusProps) => void;
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* 额外的授权信息
|
|
26
30
|
*/
|
|
27
|
-
|
|
31
|
+
auth?: ToolStatusAuthProps;
|
|
28
32
|
}
|