bhd-components 0.11.14 → 0.11.15

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.
@@ -41,6 +41,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
41
41
  const ctrl = useRef(); //停止生成ai回答时使用
42
42
  const [textValue, setTextValue] = useState("");
43
43
  const [sending, setSending] = useState(false);
44
+ const [isFocus, setIsFocus] = useState(false);
44
45
  const [isDisabled, setIsDisabled] = useState(false);
45
46
  const [fileCanSending, setFileCanSending] = useState(true); // 是否允许发送 关联文件
46
47
  const updateMsgRef = useRef(null);
@@ -100,7 +101,8 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
100
101
  },
101
102
  setDisabled: (flag)=>{
102
103
  setIsDisabled(flag);
103
- }
104
+ },
105
+ setIsFocus
104
106
  }, fileListRef.current || {});
105
107
  });
106
108
  useEffect(()=>{
@@ -462,12 +464,12 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
462
464
  }
463
465
  };
464
466
  return /*#__PURE__*/ _jsxs("div", {
465
- className: `${getCls("footer")} ${className}`,
467
+ className: `${getCls("footer")} ${className} `,
466
468
  ref: footerDomRef,
467
469
  children: [
468
470
  renderTopContent && renderTopContent(),
469
471
  /*#__PURE__*/ _jsxs("div", {
470
- className: `${getCls("footerBody")} ${judegTextLengthWarn() ? getCls("footerBodyWarn") : ""}`,
472
+ className: `${getCls("footerBody")} ${judegTextLengthWarn() ? getCls("footerBodyWarn") : ""} ${isFocus ? getCls("footerBodyFocus") : ""}`,
471
473
  children: [
472
474
  fileUpload && /*#__PURE__*/ _jsx("div", {
473
475
  className: getCls("footerFile"),
@@ -497,7 +499,13 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
497
499
  minRows: 2,
498
500
  maxRows: 6
499
501
  },
500
- onPressEnter: onPressEnter
502
+ onPressEnter: onPressEnter,
503
+ onFocus: ()=>{
504
+ setIsFocus(true);
505
+ },
506
+ onBlur: ()=>{
507
+ setIsFocus(false);
508
+ }
501
509
  }, textAreaProps)),
502
510
  /*#__PURE__*/ _jsx(References, {
503
511
  prefix: prefix,
@@ -11,6 +11,9 @@
11
11
  &.footerBodyWarn {
12
12
  border-color: #f4523b;
13
13
  }
14
+ &.footerBodyFocus{
15
+
16
+ }
14
17
 
15
18
  .footerFile {
16
19
  width: 100%;
@@ -55,7 +55,7 @@ export interface contentConfigProps {
55
55
  dataSource: dataItemType[];
56
56
  }>; // 列表数据
57
57
  loadMore?: boolean; // 是否开启加载更多 // 默认为true
58
- showTime:boolean;// 是否显示时间 默认为true
58
+ showTime?:boolean;// 是否显示时间 默认为true
59
59
  helloMsg?: string; //欢迎语
60
60
  pageSize?: number; //每页数量 默认为30
61
61
  coverRenderText?: (
@@ -207,6 +207,7 @@ export interface footerRefProps {
207
207
  stopMessage: () => void; //停止发送消息
208
208
  setReferences: (reference: referenceType) => void; // 添加引用
209
209
  setDisabled: (flag: boolean) => void;// 设置是否禁用发送按钮
210
+ setIsFocus: (flag: boolean) => void;//设置是否聚焦
210
211
  }
211
212
 
212
213
  // sendBtn Props
@@ -45,8 +45,9 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
45
45
  var ctrl = useRef(); //停止生成ai回答时使用
46
46
  var _useState = _sliced_to_array(useState(""), 2), textValue = _useState[0], setTextValue = _useState[1];
47
47
  var _useState1 = _sliced_to_array(useState(false), 2), sending = _useState1[0], setSending = _useState1[1];
48
- var _useState2 = _sliced_to_array(useState(false), 2), isDisabled = _useState2[0], setIsDisabled = _useState2[1];
49
- var _useState3 = _sliced_to_array(useState(true), 2), fileCanSending = _useState3[0], setFileCanSending = _useState3[1]; // 是否允许发送 关联文件
48
+ var _useState2 = _sliced_to_array(useState(false), 2), isFocus = _useState2[0], setIsFocus = _useState2[1];
49
+ var _useState3 = _sliced_to_array(useState(false), 2), isDisabled = _useState3[0], setIsDisabled = _useState3[1];
50
+ var _useState4 = _sliced_to_array(useState(true), 2), fileCanSending = _useState4[0], setFileCanSending = _useState4[1]; // 是否允许发送 关联文件
50
51
  var updateMsgRef = useRef(null);
51
52
  var canSendMsgRef = useRef(false);
52
53
  var recordFileList = useRef({
@@ -65,7 +66,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
65
66
  // source: undefined,
66
67
  // },
67
68
  // });
68
- var _useState4 = _sliced_to_array(useState(null), 2), referencesSource = _useState4[0], setReferencesSource = _useState4[1];
69
+ var _useState5 = _sliced_to_array(useState(null), 2), referencesSource = _useState5[0], setReferencesSource = _useState5[1];
69
70
  var recordRef = useRef({
70
71
  value: textValue,
71
72
  referencesSource: referencesSource,
@@ -104,7 +105,8 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
104
105
  },
105
106
  setDisabled: function(flag) {
106
107
  setIsDisabled(flag);
107
- }
108
+ },
109
+ setIsFocus: setIsFocus
108
110
  }, fileListRef.current || {});
109
111
  });
110
112
  useEffect(function() {
@@ -477,12 +479,12 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
477
479
  }
478
480
  };
479
481
  return /*#__PURE__*/ _jsxs("div", {
480
- className: "".concat(getCls("footer"), " ").concat(className),
482
+ className: "".concat(getCls("footer"), " ").concat(className, " "),
481
483
  ref: footerDomRef,
482
484
  children: [
483
485
  renderTopContent && renderTopContent(),
484
486
  /*#__PURE__*/ _jsxs("div", {
485
- className: "".concat(getCls("footerBody"), " ").concat(judegTextLengthWarn() ? getCls("footerBodyWarn") : ""),
487
+ className: "".concat(getCls("footerBody"), " ").concat(judegTextLengthWarn() ? getCls("footerBodyWarn") : "", " ").concat(isFocus ? getCls("footerBodyFocus") : ""),
486
488
  children: [
487
489
  fileUpload && /*#__PURE__*/ _jsx("div", {
488
490
  className: getCls("footerFile"),
@@ -513,7 +515,13 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
513
515
  minRows: 2,
514
516
  maxRows: 6
515
517
  },
516
- onPressEnter: onPressEnter
518
+ onPressEnter: onPressEnter,
519
+ onFocus: function() {
520
+ setIsFocus(true);
521
+ },
522
+ onBlur: function() {
523
+ setIsFocus(false);
524
+ }
517
525
  }, textAreaProps)),
518
526
  /*#__PURE__*/ _jsx(References, {
519
527
  prefix: prefix,
@@ -11,6 +11,9 @@
11
11
  &.footerBodyWarn {
12
12
  border-color: #f4523b;
13
13
  }
14
+ &.footerBodyFocus{
15
+
16
+ }
14
17
 
15
18
  .footerFile {
16
19
  width: 100%;
@@ -55,7 +55,7 @@ export interface contentConfigProps {
55
55
  dataSource: dataItemType[];
56
56
  }>; // 列表数据
57
57
  loadMore?: boolean; // 是否开启加载更多 // 默认为true
58
- showTime:boolean;// 是否显示时间 默认为true
58
+ showTime?:boolean;// 是否显示时间 默认为true
59
59
  helloMsg?: string; //欢迎语
60
60
  pageSize?: number; //每页数量 默认为30
61
61
  coverRenderText?: (
@@ -207,6 +207,7 @@ export interface footerRefProps {
207
207
  stopMessage: () => void; //停止发送消息
208
208
  setReferences: (reference: referenceType) => void; // 添加引用
209
209
  setDisabled: (flag: boolean) => void;// 设置是否禁用发送按钮
210
+ setIsFocus: (flag: boolean) => void;//设置是否聚焦
210
211
  }
211
212
 
212
213
  // sendBtn Props
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.11.14",
3
+ "version": "0.11.15",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {