bhd-components 0.11.20 → 0.11.22
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/dist/index.esm.es5.development.js +5 -3
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +1 -1
- package/dist/vendor.esm.es5.production.js +1 -1
- package/es2017/AIMessageList/components/footer/index.js +6 -3
- package/es2017/AIMessageList/type.d.ts +2 -0
- package/esm/AIMessageList/components/footer/index.js +6 -3
- package/esm/AIMessageList/type.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
2
3
|
import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
3
4
|
import React, { useState, useEffect, useImperativeHandle, forwardRef, useRef, useMemo } from "react";
|
|
4
5
|
import styles from "./index.module.less";
|
|
@@ -28,7 +29,7 @@ const defaultFileUploadProps = {
|
|
|
28
29
|
};
|
|
29
30
|
const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
30
31
|
let { footerConfig, prefix, errorCallback, apiRef } = props;
|
|
31
|
-
let { placeholder = defaultProps.placeholder, className = defaultProps.className, maxLength = defaultProps.maxLength, renderAction, fileUpload, sendMsgAjaxParams, onClickStop = ()=>{}, conversionContent = (str)=>str, renderTopContent, inputingText = "正在输入...", canStopMessage = true, speed = 0, textAreaProps = {} } = footerConfig;
|
|
32
|
+
let { placeholder = defaultProps.placeholder, className = defaultProps.className, maxLength = defaultProps.maxLength, renderAction, fileUpload, sendMsgAjaxParams, onClickStop = ()=>{}, conversionContent = (str)=>str, renderTopContent, inputingText = "正在输入...", canStopMessage = true, speed = 0, textAreaProps = {}, onChange = ()=>{} } = footerConfig;
|
|
32
33
|
if (speed < 0) {
|
|
33
34
|
speed = 0;
|
|
34
35
|
}
|
|
@@ -125,6 +126,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
125
126
|
recordRef.current.sending = sending;
|
|
126
127
|
recordRef.current.fileCanSending = fileCanSending;
|
|
127
128
|
apiRef.contentApi && apiRef.contentApi.setIsSending(sending);
|
|
129
|
+
onChange();
|
|
128
130
|
}, [
|
|
129
131
|
textValue,
|
|
130
132
|
referencesSource,
|
|
@@ -285,6 +287,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
285
287
|
return;
|
|
286
288
|
}
|
|
287
289
|
recordRef.current.value = value;
|
|
290
|
+
value = value.trim();
|
|
288
291
|
apiRef.contentApi.addMsg({
|
|
289
292
|
id: guidGenerator(),
|
|
290
293
|
createTime: new Date().getTime(),
|
|
@@ -496,7 +499,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
496
499
|
/*#__PURE__*/ _jsxs("div", {
|
|
497
500
|
className: getCls("footerInput"),
|
|
498
501
|
children: [
|
|
499
|
-
/*#__PURE__*/ _jsx(TextArea, _object_spread({
|
|
502
|
+
/*#__PURE__*/ _jsx(TextArea, _object_spread_props(_object_spread({}, textAreaProps), {
|
|
500
503
|
value: textValue,
|
|
501
504
|
onChange: (e)=>{
|
|
502
505
|
setTextValue(e.target.value);
|
|
@@ -513,7 +516,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
513
516
|
onBlur: ()=>{
|
|
514
517
|
setIsFocus(false);
|
|
515
518
|
}
|
|
516
|
-
}
|
|
519
|
+
})),
|
|
517
520
|
/*#__PURE__*/ _jsx(References, {
|
|
518
521
|
prefix: prefix,
|
|
519
522
|
referencesSource: referencesSource,
|
|
@@ -122,6 +122,8 @@ export interface footerConfigProps {
|
|
|
122
122
|
inputingText?: string;
|
|
123
123
|
canStopMessage?: boolean;//是否允许停止消息 默认为true
|
|
124
124
|
speed?:number;// 控制文字每次输出的速度 默认为0 即不控制
|
|
125
|
+
textAreaProps:any;
|
|
126
|
+
onChange:()=>void;//底部数据变更 内容 文件上传等
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
export interface onOpenProps {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
2
3
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
3
4
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
4
5
|
import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
|
|
@@ -32,7 +33,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
32
33
|
var footerConfig = props.footerConfig, prefix = props.prefix, errorCallback = props.errorCallback, apiRef = props.apiRef;
|
|
33
34
|
var _footerConfig_placeholder = footerConfig.placeholder, placeholder = _footerConfig_placeholder === void 0 ? defaultProps.placeholder : _footerConfig_placeholder, _footerConfig_className = footerConfig.className, className = _footerConfig_className === void 0 ? defaultProps.className : _footerConfig_className, _footerConfig_maxLength = footerConfig.maxLength, maxLength = _footerConfig_maxLength === void 0 ? defaultProps.maxLength : _footerConfig_maxLength, renderAction = footerConfig.renderAction, fileUpload = footerConfig.fileUpload, sendMsgAjaxParams = footerConfig.sendMsgAjaxParams, _footerConfig_onClickStop = footerConfig.onClickStop, onClickStop = _footerConfig_onClickStop === void 0 ? function() {} : _footerConfig_onClickStop, _footerConfig_conversionContent = footerConfig.conversionContent, conversionContent = _footerConfig_conversionContent === void 0 ? function(str) {
|
|
34
35
|
return str;
|
|
35
|
-
} : _footerConfig_conversionContent, renderTopContent = footerConfig.renderTopContent, _footerConfig_inputingText = footerConfig.inputingText, inputingText = _footerConfig_inputingText === void 0 ? "正在输入..." : _footerConfig_inputingText, _footerConfig_canStopMessage = footerConfig.canStopMessage, canStopMessage = _footerConfig_canStopMessage === void 0 ? true : _footerConfig_canStopMessage, _footerConfig_speed = footerConfig.speed, speed = _footerConfig_speed === void 0 ? 0 : _footerConfig_speed, _footerConfig_textAreaProps = footerConfig.textAreaProps, textAreaProps = _footerConfig_textAreaProps === void 0 ? {} : _footerConfig_textAreaProps;
|
|
36
|
+
} : _footerConfig_conversionContent, renderTopContent = footerConfig.renderTopContent, _footerConfig_inputingText = footerConfig.inputingText, inputingText = _footerConfig_inputingText === void 0 ? "正在输入..." : _footerConfig_inputingText, _footerConfig_canStopMessage = footerConfig.canStopMessage, canStopMessage = _footerConfig_canStopMessage === void 0 ? true : _footerConfig_canStopMessage, _footerConfig_speed = footerConfig.speed, speed = _footerConfig_speed === void 0 ? 0 : _footerConfig_speed, _footerConfig_textAreaProps = footerConfig.textAreaProps, textAreaProps = _footerConfig_textAreaProps === void 0 ? {} : _footerConfig_textAreaProps, _footerConfig_onChange = footerConfig.onChange, onChange = _footerConfig_onChange === void 0 ? function() {} : _footerConfig_onChange;
|
|
36
37
|
if (speed < 0) {
|
|
37
38
|
speed = 0;
|
|
38
39
|
}
|
|
@@ -129,6 +130,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
129
130
|
recordRef.current.sending = sending;
|
|
130
131
|
recordRef.current.fileCanSending = fileCanSending;
|
|
131
132
|
apiRef.contentApi && apiRef.contentApi.setIsSending(sending);
|
|
133
|
+
onChange();
|
|
132
134
|
}, [
|
|
133
135
|
textValue,
|
|
134
136
|
referencesSource,
|
|
@@ -289,6 +291,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
289
291
|
return;
|
|
290
292
|
}
|
|
291
293
|
recordRef.current.value = value;
|
|
294
|
+
value = value.trim();
|
|
292
295
|
apiRef.contentApi.addMsg({
|
|
293
296
|
id: guidGenerator(),
|
|
294
297
|
createTime: new Date().getTime(),
|
|
@@ -512,7 +515,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
512
515
|
/*#__PURE__*/ _jsxs("div", {
|
|
513
516
|
className: getCls("footerInput"),
|
|
514
517
|
children: [
|
|
515
|
-
/*#__PURE__*/ _jsx(TextArea, _object_spread({
|
|
518
|
+
/*#__PURE__*/ _jsx(TextArea, _object_spread_props(_object_spread({}, textAreaProps), {
|
|
516
519
|
value: textValue,
|
|
517
520
|
onChange: function(e) {
|
|
518
521
|
setTextValue(e.target.value);
|
|
@@ -529,7 +532,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
529
532
|
onBlur: function() {
|
|
530
533
|
setIsFocus(false);
|
|
531
534
|
}
|
|
532
|
-
}
|
|
535
|
+
})),
|
|
533
536
|
/*#__PURE__*/ _jsx(References, {
|
|
534
537
|
prefix: prefix,
|
|
535
538
|
referencesSource: referencesSource,
|
|
@@ -122,6 +122,8 @@ export interface footerConfigProps {
|
|
|
122
122
|
inputingText?: string;
|
|
123
123
|
canStopMessage?: boolean;//是否允许停止消息 默认为true
|
|
124
124
|
speed?:number;// 控制文字每次输出的速度 默认为0 即不控制
|
|
125
|
+
textAreaProps:any;
|
|
126
|
+
onChange:()=>void;//底部数据变更 内容 文件上传等
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
export interface onOpenProps {
|