bhd-components 0.10.3 → 0.10.4

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # bhd-components
2
2
 
3
- **当前版本:** 0.9.26
3
+ **当前版本:** 0.10.4
4
4
 
5
5
  ## Install
6
6
 
@@ -1,5 +1,5 @@
1
- import { z as zhCN, A as App, _ as _object_spread, a as AntdMessage, M as Modal$1, b as AntdNotification, C as ConfigProvider, c as _extends, d as _object_destructuring_empty, j as jsx, e as _object_spread_props, f as jsxs, t as transform, S as StyleProvider, g as _sliced_to_array, T as Tooltip, h as Table$2, i as _to_consumable_array, P as Pagination$1, I as Icon, k as Select, l as CaretDownOutlined, m as _inherits, n as _create_super, o as _create_class, p as _class_call_check, q as _define_property, r as _assert_this_initialized, s as _async_to_generator, u as MinusOutlined, v as PlusOutlined, L as LeftOutlined, R as RightOutlined, w as __generator, x as Input, y as SearchOutlined, B as Spin, D as CloseOutlined, X, E as I, H, F as html2canvas$1, G as Remarkable, J as Drawer, K as HighlightJS, Z as ZoomInOutlined, N as DatePicker, O as Button, Q as l, U as Upload, V as cn, W as Popover, Y as DoubleRightOutlined, $ as CloseCircleFilled, a0 as fetchEventSource, a1 as Divider } from './vendor.esm.es5.development.js';
2
- export { a2 as Affix, a3 as Alert, a4 as Anchor, a as AntdMessage, A as App, a5 as AutoComplete, a6 as Avatar, a8 as BackTop, a9 as Badge, aa as Breadcrumb, O as Button, ab as Calendar, ac as Card, ad as Carousel, ae as Cascader, af as Checkbox, ag as Col, ah as Collapse, N as DatePicker, ai as Descriptions, a1 as Divider, J as Drawer, aj as Dropdown, ak as Empty, a7 as FloatButton, al as Form, am as Grid, an as Image, x as Input, ao as InputNumber, ap as Layout, aq as List, ar as Mentions, as as Menu, M as Modal, at as Popconfirm, W as Popover, au as Progress, aR as QRCode, av as Radio, aw as Rate, ax as Result, ay as Row, az as Segmented, k as Select, aA as Skeleton, aB as Slider, aC as Space, B as Spin, aD as Statistic, aE as Steps, aF as Switch, aG as Tabs, aH as Tag, aJ as TimePicker, aK as Timeline, T as Tooltip, aL as Tour, aM as Transfer, aN as Tree, aO as TreeSelect, aP as Typography, U as Upload, aQ as Watermark, aT as en_US, b as notification, aI as theme, aS as version, z as zh_CN } from './vendor.esm.es5.development.js';
1
+ import { z as zhCN, A as App, _ as _object_spread, a as AntdMessage, M as Modal$1, b as AntdNotification, C as ConfigProvider, c as _extends, d as _object_destructuring_empty, j as jsx, e as _object_spread_props, f as jsxs, t as transform, S as StyleProvider, g as _sliced_to_array, T as Tooltip, h as Table$2, i as _to_consumable_array, P as Pagination$1, I as Icon, k as Select, l as CaretDownOutlined, m as _inherits, n as _create_super, o as _create_class, p as _class_call_check, q as _define_property, r as _assert_this_initialized, s as _async_to_generator, u as MinusOutlined, v as PlusOutlined, L as LeftOutlined, R as RightOutlined, w as __generator, x as Input, y as SearchOutlined, B as Spin, D as CloseOutlined, X, E as I, H, F as html2canvas$1, G as Remarkable, J as Drawer, K as HighlightJS, Z as ZoomInOutlined, N as DatePicker, O as Button, Q as l, U as Upload, V as cn, W as Popover, Y as DoubleRightOutlined, $ as CloseCircleFilled, a0 as Divider, a1 as fetchEventSource } from './vendor.esm.es5.development.js';
2
+ export { a2 as Affix, a3 as Alert, a4 as Anchor, a as AntdMessage, A as App, a5 as AutoComplete, a6 as Avatar, a8 as BackTop, a9 as Badge, aa as Breadcrumb, O as Button, ab as Calendar, ac as Card, ad as Carousel, ae as Cascader, af as Checkbox, ag as Col, ah as Collapse, N as DatePicker, ai as Descriptions, a0 as Divider, J as Drawer, aj as Dropdown, ak as Empty, a7 as FloatButton, al as Form, am as Grid, an as Image, x as Input, ao as InputNumber, ap as Layout, aq as List, ar as Mentions, as as Menu, M as Modal, at as Popconfirm, W as Popover, au as Progress, aR as QRCode, av as Radio, aw as Rate, ax as Result, ay as Row, az as Segmented, k as Select, aA as Skeleton, aB as Slider, aC as Space, B as Spin, aD as Statistic, aE as Steps, aF as Switch, aG as Tabs, aH as Tag, aJ as TimePicker, aK as Timeline, T as Tooltip, aL as Tour, aM as Transfer, aN as Tree, aO as TreeSelect, aP as Typography, U as Upload, aQ as Watermark, aT as en_US, b as notification, aI as theme, aS as version, z as zh_CN } from './vendor.esm.es5.development.js';
3
3
  import * as React from 'react';
4
4
  import React__default, { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle, useCallback, useMemo } from 'react';
5
5
  import { Fragment } from 'react/jsx-runtime';
@@ -15235,81 +15235,105 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
15235
15235
  sendMsgAjax();
15236
15236
  };
15237
15237
  var sendMsgAjax = function() {
15238
- var url = sendMsgAjaxParams.url, _sendMsgAjaxParams_method = sendMsgAjaxParams.method, method = _sendMsgAjaxParams_method === void 0 ? "POST" : _sendMsgAjaxParams_method, _sendMsgAjaxParams_headers = sendMsgAjaxParams.headers, headers = _sendMsgAjaxParams_headers === void 0 ? {} : _sendMsgAjaxParams_headers, _sendMsgAjaxParams_params = sendMsgAjaxParams.params, params = _sendMsgAjaxParams_params === void 0 ? function() {
15239
- return "";
15240
- } : _sendMsgAjaxParams_params, _sendMsgAjaxParams_onOpen = sendMsgAjaxParams.onOpen, onOpen = _sendMsgAjaxParams_onOpen === void 0 ? function() {} : _sendMsgAjaxParams_onOpen, _sendMsgAjaxParams_onMessage = sendMsgAjaxParams.onMessage, onMessage = _sendMsgAjaxParams_onMessage === void 0 ? function(ev) {
15241
- return ev;
15242
- } : _sendMsgAjaxParams_onMessage, _sendMsgAjaxParams_onClose = sendMsgAjaxParams.onClose, onClose = _sendMsgAjaxParams_onClose === void 0 ? function() {} : _sendMsgAjaxParams_onClose, _sendMsgAjaxParams_onError = sendMsgAjaxParams.onError, onError = _sendMsgAjaxParams_onError === void 0 ? function() {} : _sendMsgAjaxParams_onError, _sendMsgAjaxParams_coverProps = sendMsgAjaxParams.coverProps, coverProps = _sendMsgAjaxParams_coverProps === void 0 ? {} : _sendMsgAjaxParams_coverProps;
15243
- ctrl.current = new AbortController();
15244
- // apiRef
15245
- console.log("apiRef", apiRef);
15246
- var msgId = "inputing";
15247
- var createTime = new Date().getTime();
15248
- apiRef.contentApi.addMsg({
15249
- id: msgId,
15250
- createTime: createTime,
15251
- content: "正在输入...",
15252
- location: "left",
15253
- reference: null,
15254
- source: null
15255
- });
15256
- var msgContent = "";
15257
- setSending(true);
15258
- setTextValue("");
15259
- setReferencesSource(null);
15260
- var recordMsgObj = {};
15261
- var arg = [
15262
- recordRef.current.value,
15263
- recordRef.current.referencesSource,
15264
- fileListRef.current ? fileListRef.current.getFileList() : []
15265
- ];
15266
- fetchEventSource(url, _object_spread({
15267
- method: method,
15268
- headers: _object_spread({
15269
- "Content-Type": "application/json",
15270
- Accept: "text/event-stream,application/json"
15271
- }, headers),
15272
- body: params.apply(void 0, _to_consumable_array(arg)),
15273
- openWhenHidden: true,
15274
- signal: ctrl.current.signal,
15275
- onopen: function(res) {
15276
- onOpen(res);
15277
- if (res.status === 200) ;
15278
- return null;
15279
- },
15280
- onmessage: function(ev) {
15281
- var data = onMessage(ev);
15282
- msgContent += data.content;
15283
- delete data.content;
15284
- recordMsgObj = _object_spread({
15285
- createTime: createTime,
15286
- content: msgContent,
15287
- location: "left",
15288
- reference: null,
15289
- source: null
15290
- }, data);
15291
- updateMsgRef.current = setTimeout(function() {
15292
- apiRef.contentApi.updateMsg(msgId, recordMsgObj);
15293
- msgId = data.id;
15294
- }, 100);
15295
- },
15296
- onclose: function() {
15297
- onClose();
15298
- setSending(false);
15299
- if (recordMsgObj.id) {
15300
- apiRef.contentApi.recordMsg(recordMsgObj);
15301
- }
15302
- console.log("onclose: ", recordMsgObj);
15303
- },
15304
- onerror: function(err) {
15305
- onError(err);
15306
- if (recordMsgObj.id) {
15307
- apiRef.contentApi.recordMsg(recordMsgObj);
15238
+ var _ref = _async_to_generator(function() {
15239
+ var url, _sendMsgAjaxParams_method, method, _sendMsgAjaxParams_headers, headers, _sendMsgAjaxParams_params, params, _sendMsgAjaxParams_onOpen, onOpen, _sendMsgAjaxParams_onMessage, onMessage, _sendMsgAjaxParams_onClose, onClose, _sendMsgAjaxParams_onError, onError, _sendMsgAjaxParams_coverProps, coverProps, _sendMsgAjaxParams_beforeSendMsg, beforeSendMsg, msgId, createTime, msgContent, recordMsgObj, arg, beforeInfo;
15240
+ return __generator(this, function(_state) {
15241
+ switch(_state.label){
15242
+ case 0:
15243
+ url = sendMsgAjaxParams.url, _sendMsgAjaxParams_method = sendMsgAjaxParams.method, method = _sendMsgAjaxParams_method === void 0 ? "POST" : _sendMsgAjaxParams_method, _sendMsgAjaxParams_headers = sendMsgAjaxParams.headers, headers = _sendMsgAjaxParams_headers === void 0 ? {} : _sendMsgAjaxParams_headers, _sendMsgAjaxParams_params = sendMsgAjaxParams.params, params = _sendMsgAjaxParams_params === void 0 ? function() {
15244
+ return "";
15245
+ } : _sendMsgAjaxParams_params, _sendMsgAjaxParams_onOpen = sendMsgAjaxParams.onOpen, onOpen = _sendMsgAjaxParams_onOpen === void 0 ? function() {} : _sendMsgAjaxParams_onOpen, _sendMsgAjaxParams_onMessage = sendMsgAjaxParams.onMessage, onMessage = _sendMsgAjaxParams_onMessage === void 0 ? function(ev) {
15246
+ return ev;
15247
+ } : _sendMsgAjaxParams_onMessage, _sendMsgAjaxParams_onClose = sendMsgAjaxParams.onClose, onClose = _sendMsgAjaxParams_onClose === void 0 ? function() {} : _sendMsgAjaxParams_onClose, _sendMsgAjaxParams_onError = sendMsgAjaxParams.onError, onError = _sendMsgAjaxParams_onError === void 0 ? function() {} : _sendMsgAjaxParams_onError, _sendMsgAjaxParams_coverProps = sendMsgAjaxParams.coverProps, coverProps = _sendMsgAjaxParams_coverProps === void 0 ? {} : _sendMsgAjaxParams_coverProps, _sendMsgAjaxParams_beforeSendMsg = sendMsgAjaxParams.beforeSendMsg, beforeSendMsg = _sendMsgAjaxParams_beforeSendMsg === void 0 ? function() {
15248
+ return Promise.resolve();
15249
+ } : _sendMsgAjaxParams_beforeSendMsg;
15250
+ ctrl.current = new AbortController();
15251
+ // apiRef
15252
+ console.log("apiRef", apiRef);
15253
+ msgId = "inputing";
15254
+ createTime = new Date().getTime();
15255
+ apiRef.contentApi.addMsg({
15256
+ id: msgId,
15257
+ createTime: createTime,
15258
+ content: "正在输入...",
15259
+ location: "left",
15260
+ reference: null,
15261
+ source: null
15262
+ });
15263
+ msgContent = "";
15264
+ setSending(true);
15265
+ setTextValue("");
15266
+ setReferencesSource(null);
15267
+ recordMsgObj = {};
15268
+ arg = [
15269
+ recordRef.current.value,
15270
+ recordRef.current.referencesSource,
15271
+ fileListRef.current ? fileListRef.current.getFileList() : []
15272
+ ];
15273
+ return [
15274
+ 4,
15275
+ beforeSendMsg.apply(void 0, _to_consumable_array(arg))
15276
+ ];
15277
+ case 1:
15278
+ beforeInfo = _state.sent();
15279
+ fetchEventSource(url, _object_spread({
15280
+ method: method,
15281
+ headers: _object_spread({
15282
+ "Content-Type": "application/json",
15283
+ Accept: "text/event-stream,application/json"
15284
+ }, headers),
15285
+ body: params.apply(void 0, _to_consumable_array(arg).concat([
15286
+ beforeInfo
15287
+ ])),
15288
+ openWhenHidden: true,
15289
+ signal: ctrl.current.signal,
15290
+ onopen: function(res) {
15291
+ onOpen(res);
15292
+ if (res.status === 200) ;
15293
+ return null;
15294
+ },
15295
+ onmessage: function(ev) {
15296
+ var data = onMessage(ev);
15297
+ msgContent += data.content;
15298
+ delete data.content;
15299
+ recordMsgObj = _object_spread({
15300
+ createTime: createTime,
15301
+ content: msgContent,
15302
+ location: "left",
15303
+ reference: null,
15304
+ source: null
15305
+ }, data);
15306
+ updateMsgRef.current = setTimeout(function() {
15307
+ apiRef.contentApi.updateMsg(msgId, recordMsgObj);
15308
+ msgId = data.id;
15309
+ }, 100);
15310
+ },
15311
+ onclose: function() {
15312
+ onClose();
15313
+ setSending(false);
15314
+ if (recordMsgObj.id) {
15315
+ apiRef.contentApi.recordMsg(recordMsgObj);
15316
+ }
15317
+ console.log("onclose: ", recordMsgObj);
15318
+ },
15319
+ onerror: function(err) {
15320
+ onError(err);
15321
+ if (recordMsgObj.id) {
15322
+ apiRef.contentApi.recordMsg(recordMsgObj);
15323
+ }
15324
+ console.log("onerror: ", err);
15325
+ }
15326
+ }, coverProps));
15327
+ return [
15328
+ 2
15329
+ ];
15308
15330
  }
15309
- console.log("onerror: ", err);
15310
- }
15311
- }, coverProps));
15312
- };
15331
+ });
15332
+ });
15333
+ return function sendMsgAjax() {
15334
+ return _ref.apply(this, arguments);
15335
+ };
15336
+ }();
15313
15337
  // 判断是否超出最大字数
15314
15338
  var judegTextLengthWarn = function() {
15315
15339
  if (typeof maxLength === "function") {