bhd-components 0.11.16 → 0.11.18
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.css +154 -153
- package/dist/index.esm.es5.development.js +25 -9
- package/dist/index.esm.es5.production.css +1 -1
- 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/virtuosoList/index.js +22 -8
- package/es2017/AIMessageList/components/virtuosoList/index.module.less +1 -0
- package/esm/AIMessageList/components/virtuosoList/index.js +24 -8
- package/esm/AIMessageList/components/virtuosoList/index.module.less +1 -0
- package/package.json +1 -1
|
@@ -143,11 +143,18 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
143
143
|
return item;
|
|
144
144
|
});
|
|
145
145
|
});
|
|
146
|
+
recordRef.current.dataSource = recordRef.current.dataSource.map((item)=>{
|
|
147
|
+
if (item.id == id) {
|
|
148
|
+
return _object_spread({}, item, obj);
|
|
149
|
+
}
|
|
150
|
+
return item;
|
|
151
|
+
});
|
|
146
152
|
},
|
|
147
153
|
clearInputing () {
|
|
148
154
|
setDataSource((data)=>{
|
|
149
155
|
return data.filter((item)=>item.id !== "inputing");
|
|
150
156
|
});
|
|
157
|
+
recordRef.current.dataSource = recordRef.current.dataSource.filter((item)=>item.id !== "inputing");
|
|
151
158
|
},
|
|
152
159
|
recordMsg: (msg)=>{
|
|
153
160
|
onRecordMessage(msg);
|
|
@@ -164,9 +171,16 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
164
171
|
return item;
|
|
165
172
|
});
|
|
166
173
|
});
|
|
174
|
+
recordRef.current.dataSource = recordRef.current.dataSource.map((item)=>{
|
|
175
|
+
if (item.id == id) {
|
|
176
|
+
return _object_spread({}, item, obj);
|
|
177
|
+
}
|
|
178
|
+
return item;
|
|
179
|
+
});
|
|
167
180
|
},
|
|
168
181
|
changeDataSource: (data)=>{
|
|
169
182
|
setDataSource(data);
|
|
183
|
+
recordRef.current.dataSource = data;
|
|
170
184
|
},
|
|
171
185
|
scrollToBottom,
|
|
172
186
|
setSendingId: (id)=>{
|
|
@@ -275,14 +289,14 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
275
289
|
const scrollToBottom = ()=>{
|
|
276
290
|
if (!virtuosoRef.current) return;
|
|
277
291
|
if (isAutoScrollRef.current && !userScrolledUpRef.current) {
|
|
278
|
-
timerRef.current.scrollTimer = setTimeout(()=>{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
292
|
+
// timerRef.current.scrollTimer = setTimeout(() => {
|
|
293
|
+
virtuosoRef.current.scrollToIndex({
|
|
294
|
+
index: "LAST",
|
|
295
|
+
align: "end",
|
|
296
|
+
behavior: "auto",
|
|
297
|
+
offset: scrollOffset
|
|
298
|
+
});
|
|
299
|
+
// }, 100);
|
|
286
300
|
}
|
|
287
301
|
};
|
|
288
302
|
const getData = (page, pageSize)=>{
|
|
@@ -149,6 +149,12 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
149
149
|
return item;
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
|
+
recordRef.current.dataSource = recordRef.current.dataSource.map(function(item) {
|
|
153
|
+
if (item.id == id) {
|
|
154
|
+
return _object_spread({}, item, obj);
|
|
155
|
+
}
|
|
156
|
+
return item;
|
|
157
|
+
});
|
|
152
158
|
},
|
|
153
159
|
clearInputing: function clearInputing() {
|
|
154
160
|
setDataSource(function(data) {
|
|
@@ -156,6 +162,9 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
156
162
|
return item.id !== "inputing";
|
|
157
163
|
});
|
|
158
164
|
});
|
|
165
|
+
recordRef.current.dataSource = recordRef.current.dataSource.filter(function(item) {
|
|
166
|
+
return item.id !== "inputing";
|
|
167
|
+
});
|
|
159
168
|
},
|
|
160
169
|
recordMsg: function(msg) {
|
|
161
170
|
onRecordMessage(msg);
|
|
@@ -172,9 +181,16 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
172
181
|
return item;
|
|
173
182
|
});
|
|
174
183
|
});
|
|
184
|
+
recordRef.current.dataSource = recordRef.current.dataSource.map(function(item) {
|
|
185
|
+
if (item.id == id) {
|
|
186
|
+
return _object_spread({}, item, obj);
|
|
187
|
+
}
|
|
188
|
+
return item;
|
|
189
|
+
});
|
|
175
190
|
},
|
|
176
191
|
changeDataSource: function(data) {
|
|
177
192
|
setDataSource(data);
|
|
193
|
+
recordRef.current.dataSource = data;
|
|
178
194
|
},
|
|
179
195
|
scrollToBottom: scrollToBottom,
|
|
180
196
|
setSendingId: function(id) {
|
|
@@ -280,14 +296,14 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
280
296
|
var scrollToBottom = function() {
|
|
281
297
|
if (!virtuosoRef.current) return;
|
|
282
298
|
if (isAutoScrollRef.current && !userScrolledUpRef.current) {
|
|
283
|
-
timerRef.current.scrollTimer = setTimeout(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
299
|
+
// timerRef.current.scrollTimer = setTimeout(() => {
|
|
300
|
+
virtuosoRef.current.scrollToIndex({
|
|
301
|
+
index: "LAST",
|
|
302
|
+
align: "end",
|
|
303
|
+
behavior: "auto",
|
|
304
|
+
offset: scrollOffset
|
|
305
|
+
});
|
|
306
|
+
// }, 100);
|
|
291
307
|
}
|
|
292
308
|
};
|
|
293
309
|
var getData = function(page, pageSize) {
|