bhd-components 0.9.2 → 0.9.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 +1 -1
- package/dist/index.esm.es5.development.css +456 -364
- package/dist/index.esm.es5.development.js +414 -323
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.css +119 -0
- package/dist/{a5565b8a.esm.es5.development.js → vendor.esm.es5.development.js} +8247 -6856
- package/dist/vendor.esm.es5.production.css +11 -0
- package/dist/vendor.esm.es5.production.js +485 -0
- package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +1 -1
- package/es2017/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +2 -2
- package/es2017/bhdAppLayout/index.js +16 -16
- package/es2017/bhdDatePicker/index.d.ts +1 -2
- package/es2017/bhdDatePicker/index.js +311 -254
- package/es2017/bhdDatePicker/index.module.less +106 -9
- package/es2017/bhdSelect/index.js +4 -4
- package/es2017/bhdTipModal/index.js +6 -6
- package/es2017/customerService/contactsList.d.ts +2 -2
- package/es2017/customerService/contactsList.js +2 -2
- package/es2017/customerService/function.js +2 -1
- package/es2017/customerService/historyFun.d.ts +2 -2
- package/es2017/customerService/historyFun.js +2 -2
- package/es2017/customerService/index.d.ts +2 -2
- package/es2017/customerService/index.js +5 -5
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +1 -1
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +1 -1
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
- package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
- package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
- package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.js +2 -2
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +6 -5
- package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
- package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +1 -1
- package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
- package/es2017/customerService/js-screen-shot/main.js +38 -35
- package/es2017/customerService/screenshotTool.d.ts +2 -2
- package/es2017/customerService/screenshotTool.js +2 -2
- package/es2017/customerService/teacherList.d.ts +2 -2
- package/es2017/customerService/teacherList.js +2 -2
- package/es2017/i18n/en_US.js +16 -1
- package/es2017/i18n/zh_CN.js +16 -1
- package/es2017/icons/index.js +2 -2
- package/es2017/index.js +14 -14
- package/es2017/provider/index.js +2 -2
- package/es2017/table/index.js +4 -4
- package/es2017/tableSelect/index.js +3 -3
- package/es2017/textTootip/index.js +1 -1
- package/es2017/titleBar/index.js +3 -3
- package/es2017/viewImage/index.js +13 -13
- package/esm/bhdAppLayout/index.js +15 -15
- package/esm/bhdDatePicker/index.d.ts +1 -2
- package/esm/bhdDatePicker/index.js +312 -255
- package/esm/bhdDatePicker/index.module.less +106 -9
- package/esm/bhdSelect/index.js +1 -1
- package/esm/bhdTipModal/index.js +1 -1
- package/esm/customerService/contactsList.d.ts +2 -2
- package/esm/customerService/contactsList.js +1 -1
- package/esm/customerService/function.js +2 -1
- package/esm/customerService/historyFun.d.ts +2 -2
- package/esm/customerService/historyFun.js +1 -1
- package/esm/customerService/index.d.ts +2 -2
- package/esm/customerService/index.js +1 -1
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +3 -2
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +2 -1
- package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +3 -3
- package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +4 -3
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +5 -4
- package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +15 -14
- package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +2 -1
- package/esm/customerService/js-screen-shot/main.js +31 -28
- package/esm/customerService/screenshotTool.d.ts +2 -2
- package/esm/customerService/screenshotTool.js +1 -1
- package/esm/customerService/teacherList.d.ts +2 -2
- package/esm/customerService/teacherList.js +1 -1
- package/esm/i18n/en_US.js +16 -1
- package/esm/i18n/zh_CN.js +16 -1
- package/esm/icons/index.js +1 -1
- package/esm/index.js +14 -14
- package/esm/tableSelect/index.js +1 -1
- package/esm/viewImage/index.js +3 -3
- package/package.json +1 -1
- package/dist/deb6cc9b.esm.es5.production.js +0 -485
- package/dist/vendor.esm.es5.development.esm.es5.development.css +0 -119
- package/dist/vendor.esm.es5.production.esm.es5.production.css +0 -11
- package/es2017/customerService/screenShotPlugin.esm.js +0 -6515
- package/esm/customerService/screenShotPlugin.esm.js +0 -6516
|
@@ -1,7 +1,7 @@
|
|
|
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 Icon, E as ExclamationCircleFilled, i as _to_consumable_array, P as Pagination$1, 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, L as LeftOutlined, R as RightOutlined, u as MinusOutlined, v as PlusOutlined, w as __generator, x as Input, y as SearchOutlined, B as CloseOutlined, X, D as I, H, F as html2canvas$1, G as Remarkable, J as Drawer, K as HighlightJS, Z as ZoomInOutlined, N as DatePicker, O as
|
|
2
|
-
export { U as Affix, V as Alert, W as Anchor, a as AntdMessage, A as App, Y as AutoComplete, $ as Avatar, a1 as BackTop, a2 as Badge, a3 as Breadcrumb,
|
|
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 Icon, E as ExclamationCircleFilled, i as _to_consumable_array, P as Pagination$1, 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, L as LeftOutlined, R as RightOutlined, u as MinusOutlined, v as PlusOutlined, w as __generator, x as Input, y as SearchOutlined, B as CloseOutlined, X, D 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 _type_of } from './vendor.esm.es5.development.js';
|
|
2
|
+
export { U as Affix, V as Alert, W as Anchor, a as AntdMessage, A as App, Y as AutoComplete, $ as Avatar, a1 as BackTop, a2 as Badge, a3 as Breadcrumb, O as Button, a4 as Calendar, a5 as Card, a6 as Carousel, a7 as Cascader, a8 as Checkbox, a9 as Col, aa as Collapse, N as DatePicker, ab as Descriptions, ac as Divider, J as Drawer, ad as Dropdown, ae as Empty, a0 as FloatButton, af as Form, ag as Grid, ah as Image, x as Input, ai as InputNumber, aj as Layout, ak as List, al as Mentions, am as Menu, M as Modal, an as Popconfirm, ao as Popover, ap as Progress, aO as QRCode, aq as Radio, ar as Rate, as as Result, at as Row, au as Segmented, k as Select, av as Skeleton, aw as Slider, ax as Space, ay as Spin, az as Statistic, aA as Steps, aB as Switch, aC as Tabs, aD as Tag, aF as TimePicker, aG as Timeline, T as Tooltip, aH as Tour, aI as Transfer, aJ as Tree, aK as TreeSelect, aL as Typography, aM as Upload, aN as Watermark, aQ as en_US, b as notification, aE as theme, aP as version, z as zh_CN } from './vendor.esm.es5.development.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { useState, useRef, useEffect, useLayoutEffect, forwardRef, useImperativeHandle, useCallback } from 'react';
|
|
5
5
|
import { Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { render } from 'react-dom';
|
|
7
7
|
|
|
@@ -433,7 +433,22 @@ var zh_CN = {
|
|
|
433
433
|
清空条件: "清空条件",
|
|
434
434
|
noData: "暂无数据",
|
|
435
435
|
"系统繁忙,稍后重试!": "系统繁忙,稍后重试!",
|
|
436
|
-
Load: "正在加载..."
|
|
436
|
+
Load: "正在加载...",
|
|
437
|
+
确定: "确定",
|
|
438
|
+
此刻: "此刻",
|
|
439
|
+
今天: "今天",
|
|
440
|
+
一月: "一月",
|
|
441
|
+
二月: "二月",
|
|
442
|
+
三月: "三月",
|
|
443
|
+
四月: "四月",
|
|
444
|
+
五月: "五月",
|
|
445
|
+
六月: "六月",
|
|
446
|
+
七月: "七月",
|
|
447
|
+
八月: "八月",
|
|
448
|
+
九月: "九月",
|
|
449
|
+
十月: "十月",
|
|
450
|
+
十一月: "十一月",
|
|
451
|
+
十二月: "十二月"
|
|
437
452
|
};
|
|
438
453
|
var zh_CN$1 = zh_CN;
|
|
439
454
|
|
|
@@ -442,7 +457,22 @@ var en_US = {
|
|
|
442
457
|
清空条件: "Emptying condition",
|
|
443
458
|
noData: "No Data",
|
|
444
459
|
"系统繁忙,稍后重试!": "System busy, try again later!",
|
|
445
|
-
Load: "Loading..."
|
|
460
|
+
Load: "Loading...",
|
|
461
|
+
确定: "OK",
|
|
462
|
+
此刻: "Now",
|
|
463
|
+
今天: "Today",
|
|
464
|
+
一月: "Jan",
|
|
465
|
+
二月: "Feb",
|
|
466
|
+
三月: "Mar",
|
|
467
|
+
四月: "Apr",
|
|
468
|
+
五月: "May",
|
|
469
|
+
六月: "Jun",
|
|
470
|
+
七月: "Jul",
|
|
471
|
+
八月: "Aug",
|
|
472
|
+
九月: "Sep",
|
|
473
|
+
十月: "Oct",
|
|
474
|
+
十一月: "Nov",
|
|
475
|
+
十二月: "Dec"
|
|
446
476
|
};
|
|
447
477
|
var en_US$1 = en_US;
|
|
448
478
|
|
|
@@ -2355,16 +2385,16 @@ var BhdSelect$1 = BhdSelect;
|
|
|
2355
2385
|
var modules_63b47c51$2 = {"bhd_app_layout":"index_module_bhd_app_layout__32fa6256","bhd_app_layout_header":"index_module_bhd_app_layout_header__32fa6256","bhd_app_layout_main":"index_module_bhd_app_layout_main__32fa6256","bhd_app_layout_main_filter":"index_module_bhd_app_layout_main_filter__32fa6256","bhd_app_layout_main_filter_title":"index_module_bhd_app_layout_main_filter_title__32fa6256","bhd_app_layout_main_filter_ul":"index_module_bhd_app_layout_main_filter_ul__32fa6256","bhd_app_layout_main_filter_show_value":"index_module_bhd_app_layout_main_filter_show_value__32fa6256","bhd_app_layout_main_filter_clear":"index_module_bhd_app_layout_main_filter_clear__32fa6256","bhd_app_layout_main_table":"index_module_bhd_app_layout_main_table__32fa6256","bhd_app_layout_footer":"index_module_bhd_app_layout_footer__32fa6256"};
|
|
2356
2386
|
|
|
2357
2387
|
function BhdAppLayout(props) {
|
|
2358
|
-
var _filterRef_current, _headRef_current, _otherHeadRef_current, _otherContentRef_current;
|
|
2388
|
+
var _filterRef_current, _filterRef, _headRef_current, _headRef, _otherHeadRef_current, _otherHeadRef, _otherContentRef_current, _otherContentRef, _filterConfig, _filterConfig1, _footerConfig;
|
|
2359
2389
|
var className = props.className, headerClassName = props.headerClassName, tableBoxClassName = props.tableBoxClassName, headConfig = props.headConfig, filterConfig = props.filterConfig, headContent = props.headContent, otherContent = props.otherContent, tableConfig = props.tableConfig, footerConfig = props.footerConfig;
|
|
2360
2390
|
var _useState = _sliced_to_array(useState(""), 2); _useState[0]; var setScrollY = _useState[1];
|
|
2361
2391
|
var _useState1 = _sliced_to_array(useState(props.scrollConfig), 2), scrollConfig = _useState1[0], setScrollConfig = _useState1[1];
|
|
2362
2392
|
var windowChange = function() {
|
|
2363
|
-
var _headRef_current, _headRef_current1, _filterRef_current, _filterRef_current1, _otherHeadRef_current, _otherHeadRef_current1, _otherContentRef_current, _otherContentRef_current1;
|
|
2364
|
-
var headRefHeight = isNaN(headRef === null ||
|
|
2365
|
-
var filterRefHeight = isNaN(filterRef === null ||
|
|
2366
|
-
var otherHeadRefHeight = isNaN(otherHeadRef === null ||
|
|
2367
|
-
var otherContentRefHeight = isNaN(otherContentRef === null ||
|
|
2393
|
+
var _headRef_current, _headRef, _headRef_current1, _headRef1, _filterRef_current, _filterRef, _filterRef_current1, _filterRef1, _otherHeadRef_current, _otherHeadRef, _otherHeadRef_current1, _otherHeadRef1, _otherContentRef_current, _otherContentRef, _otherContentRef_current1, _otherContentRef1;
|
|
2394
|
+
var headRefHeight = isNaN((_headRef = headRef) === null || _headRef === void 0 ? void 0 : (_headRef_current = _headRef.current) === null || _headRef_current === void 0 ? void 0 : _headRef_current.offsetHeight) ? 0 : (_headRef1 = headRef) === null || _headRef1 === void 0 ? void 0 : (_headRef_current1 = _headRef1.current) === null || _headRef_current1 === void 0 ? void 0 : _headRef_current1.offsetHeight;
|
|
2395
|
+
var filterRefHeight = isNaN((_filterRef = filterRef) === null || _filterRef === void 0 ? void 0 : (_filterRef_current = _filterRef.current) === null || _filterRef_current === void 0 ? void 0 : _filterRef_current.offsetHeight) ? 0 : (_filterRef1 = filterRef) === null || _filterRef1 === void 0 ? void 0 : (_filterRef_current1 = _filterRef1.current) === null || _filterRef_current1 === void 0 ? void 0 : _filterRef_current1.offsetHeight;
|
|
2396
|
+
var otherHeadRefHeight = isNaN((_otherHeadRef = otherHeadRef) === null || _otherHeadRef === void 0 ? void 0 : (_otherHeadRef_current = _otherHeadRef.current) === null || _otherHeadRef_current === void 0 ? void 0 : _otherHeadRef_current.offsetHeight) ? 0 : (_otherHeadRef1 = otherHeadRef) === null || _otherHeadRef1 === void 0 ? void 0 : (_otherHeadRef_current1 = _otherHeadRef1.current) === null || _otherHeadRef_current1 === void 0 ? void 0 : _otherHeadRef_current1.offsetHeight;
|
|
2397
|
+
var otherContentRefHeight = isNaN((_otherContentRef = otherContentRef) === null || _otherContentRef === void 0 ? void 0 : (_otherContentRef_current = _otherContentRef.current) === null || _otherContentRef_current === void 0 ? void 0 : _otherContentRef_current.offsetHeight) ? 0 : (_otherContentRef1 = otherContentRef) === null || _otherContentRef1 === void 0 ? void 0 : (_otherContentRef_current1 = _otherContentRef1.current) === null || _otherContentRef_current1 === void 0 ? void 0 : _otherContentRef_current1.offsetHeight;
|
|
2368
2398
|
var height = headRefHeight + filterRefHeight + otherHeadRefHeight + otherContentRefHeight + 56 + 16 + 60 + 50;
|
|
2369
2399
|
var offsetHeight = "calc(100vh - ".concat(height, "px)");
|
|
2370
2400
|
setScrollY(offsetHeight);
|
|
@@ -2382,10 +2412,10 @@ function BhdAppLayout(props) {
|
|
|
2382
2412
|
useLayoutEffect(function() {
|
|
2383
2413
|
windowChange();
|
|
2384
2414
|
}, [
|
|
2385
|
-
filterRef === null ||
|
|
2386
|
-
headRef === null ||
|
|
2387
|
-
otherHeadRef === null ||
|
|
2388
|
-
otherContentRef === null ||
|
|
2415
|
+
(_filterRef = filterRef) === null || _filterRef === void 0 ? void 0 : (_filterRef_current = _filterRef.current) === null || _filterRef_current === void 0 ? void 0 : _filterRef_current.offsetHeight,
|
|
2416
|
+
(_headRef = headRef) === null || _headRef === void 0 ? void 0 : (_headRef_current = _headRef.current) === null || _headRef_current === void 0 ? void 0 : _headRef_current.offsetHeight,
|
|
2417
|
+
(_otherHeadRef = otherHeadRef) === null || _otherHeadRef === void 0 ? void 0 : (_otherHeadRef_current = _otherHeadRef.current) === null || _otherHeadRef_current === void 0 ? void 0 : _otherHeadRef_current.offsetHeight,
|
|
2418
|
+
(_otherContentRef = otherContentRef) === null || _otherContentRef === void 0 ? void 0 : (_otherContentRef_current = _otherContentRef.current) === null || _otherContentRef_current === void 0 ? void 0 : _otherContentRef_current.offsetHeight
|
|
2389
2419
|
]);
|
|
2390
2420
|
return /*#__PURE__*/ jsxs("div", {
|
|
2391
2421
|
className: "".concat(modules_63b47c51$2.bhd_app_layout, " ").concat(modules_63b47c51$2.className, " ").concat(className || ""),
|
|
@@ -2402,7 +2432,7 @@ function BhdAppLayout(props) {
|
|
|
2402
2432
|
/*#__PURE__*/ jsxs("main", {
|
|
2403
2433
|
className: modules_63b47c51$2.bhd_app_layout_main,
|
|
2404
2434
|
children: [
|
|
2405
|
-
(filterConfig === null ||
|
|
2435
|
+
((_filterConfig = filterConfig) === null || _filterConfig === void 0 ? void 0 : _filterConfig.filterArr) && filterConfig.filterArr.length ? /*#__PURE__*/ jsxs("div", {
|
|
2406
2436
|
ref: filterRef,
|
|
2407
2437
|
className: modules_63b47c51$2.bhd_app_layout_main_filter,
|
|
2408
2438
|
children: [
|
|
@@ -2441,7 +2471,7 @@ function BhdAppLayout(props) {
|
|
|
2441
2471
|
})
|
|
2442
2472
|
}),
|
|
2443
2473
|
/*#__PURE__*/ jsx("div", {
|
|
2444
|
-
onClick: filterConfig === null ||
|
|
2474
|
+
onClick: (_filterConfig1 = filterConfig) === null || _filterConfig1 === void 0 ? void 0 : _filterConfig1.onClearAll,
|
|
2445
2475
|
className: modules_63b47c51$2.bhd_app_layout_main_filter_clear,
|
|
2446
2476
|
children: i18Conversion$1("清空条件")
|
|
2447
2477
|
})
|
|
@@ -2464,7 +2494,7 @@ function BhdAppLayout(props) {
|
|
|
2464
2494
|
className: modules_63b47c51$2.bhd_app_layout_footer,
|
|
2465
2495
|
children: [
|
|
2466
2496
|
/*#__PURE__*/ jsx("div", {
|
|
2467
|
-
children: (footerConfig === null ||
|
|
2497
|
+
children: ((_footerConfig = footerConfig) === null || _footerConfig === void 0 ? void 0 : _footerConfig.leftDom) && footerConfig.leftDom
|
|
2468
2498
|
}),
|
|
2469
2499
|
/*#__PURE__*/ jsx(Pagination, _object_spread({}, footerConfig))
|
|
2470
2500
|
]
|
|
@@ -4936,13 +4966,14 @@ function saveCanvasToImage(context, startX, startY, width, height) {
|
|
|
4936
4966
|
// 获取裁剪框区域画布
|
|
4937
4967
|
var imgContext = getCanvas2dCtx(canvas, width, height);
|
|
4938
4968
|
if (imgContext) {
|
|
4969
|
+
var _plugInParameters;
|
|
4939
4970
|
// 将图片放进裁剪框内
|
|
4940
4971
|
imgContext.putImageData(img, 0, 0);
|
|
4941
4972
|
var a = document.createElement("a");
|
|
4942
4973
|
// 获取图片
|
|
4943
4974
|
a.href = canvas.toDataURL("png");
|
|
4944
4975
|
// 获取用户传入的文件名
|
|
4945
|
-
var imgName = (plugInParameters === null ||
|
|
4976
|
+
var imgName = ((_plugInParameters = plugInParameters) === null || _plugInParameters === void 0 ? void 0 : _plugInParameters.getSaveImgTitle()) || new Date().getTime();
|
|
4946
4977
|
// 下载图片
|
|
4947
4978
|
a.download = "".concat(imgName, ".png");
|
|
4948
4979
|
a.click();
|
|
@@ -4963,8 +4994,9 @@ function saveCanvasToBase64(context, startX, startY, width, height) {
|
|
|
4963
4994
|
// 将图片放进canvas中
|
|
4964
4995
|
imgContext.putImageData(img, 0, 0);
|
|
4965
4996
|
if (writeBase64) {
|
|
4966
|
-
// 将图片自动添加至剪贴板中
|
|
4967
|
-
|
|
4997
|
+
var // 将图片自动添加至剪贴板中
|
|
4998
|
+
_canvas;
|
|
4999
|
+
(_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toBlob(function(blob) {
|
|
4968
5000
|
var _navigator_clipboard;
|
|
4969
5001
|
if (blob == null) return;
|
|
4970
5002
|
var Clipboard = window.ClipboardItem;
|
|
@@ -5019,9 +5051,10 @@ function saveCanvasToBase64(context, startX, startY, width, height) {
|
|
|
5019
5051
|
* @private
|
|
5020
5052
|
*/ function drawCutOutBox(mouseX, mouseY, width, height, context, borderSize, controller, imageController) {
|
|
5021
5053
|
var drawBorders = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : true;
|
|
5054
|
+
var _controller, _controller1, _controller2, _controller3;
|
|
5022
5055
|
// 获取画布宽高
|
|
5023
|
-
var canvasWidth = controller === null ||
|
|
5024
|
-
var canvasHeight = controller === null ||
|
|
5056
|
+
var canvasWidth = (_controller = controller) === null || _controller === void 0 ? void 0 : _controller.width;
|
|
5057
|
+
var canvasHeight = (_controller1 = controller) === null || _controller1 === void 0 ? void 0 : _controller1.height;
|
|
5025
5058
|
var dpr = window.devicePixelRatio || 1;
|
|
5026
5059
|
var data = new PlugInParameters();
|
|
5027
5060
|
// 画布、图片不存在则return
|
|
@@ -5066,8 +5099,8 @@ function saveCanvasToBase64(context, startX, startY, width, height) {
|
|
|
5066
5099
|
context.globalCompositeOperation = "destination-over";
|
|
5067
5100
|
// 图片尺寸使用canvas容器的css中的尺寸
|
|
5068
5101
|
var _ref = {
|
|
5069
|
-
imgWidth: parseInt(controller === null ||
|
|
5070
|
-
imgHeight: parseInt(controller === null ||
|
|
5102
|
+
imgWidth: parseInt((_controller2 = controller) === null || _controller2 === void 0 ? void 0 : _controller2.style.width),
|
|
5103
|
+
imgHeight: parseInt((_controller3 = controller) === null || _controller3 === void 0 ? void 0 : _controller3.style.height)
|
|
5071
5104
|
}, imgWidth = _ref.imgWidth, imgHeight = _ref.imgHeight;
|
|
5072
5105
|
// 用户有传入截图dom绘制时使用其dom的尺寸
|
|
5073
5106
|
var screenShotDom = data.getScreenShotDom();
|
|
@@ -5407,6 +5440,7 @@ function hiddenColorPanelStatus() {
|
|
|
5407
5440
|
var CreateDom = /*#__PURE__*/ function() {
|
|
5408
5441
|
function CreateDom(options) {
|
|
5409
5442
|
_class_call_check(this, CreateDom);
|
|
5443
|
+
var _options, _options1, _options2;
|
|
5410
5444
|
// 截图区域canvas容器
|
|
5411
5445
|
_define_property(this, "screenShotController", void 0);
|
|
5412
5446
|
// 截图工具栏容器
|
|
@@ -5448,8 +5482,8 @@ var CreateDom = /*#__PURE__*/ function() {
|
|
|
5448
5482
|
this.optionController = document.createElement("div");
|
|
5449
5483
|
// this.cutBoxSizeContainer = document.createElement("div");
|
|
5450
5484
|
this.textInputController = document.createElement("div");
|
|
5451
|
-
this.completeCallback = options === null ||
|
|
5452
|
-
this.closeCallback = options === null ||
|
|
5485
|
+
this.completeCallback = (_options = options) === null || _options === void 0 ? void 0 : _options.completeCallback;
|
|
5486
|
+
this.closeCallback = (_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.closeCallback;
|
|
5453
5487
|
this.hiddenIcoArr = [];
|
|
5454
5488
|
this.optionController.addEventListener("click", function(evt) {
|
|
5455
5489
|
var target = evt.target;
|
|
@@ -5467,7 +5501,7 @@ var CreateDom = /*#__PURE__*/ function() {
|
|
|
5467
5501
|
};
|
|
5468
5502
|
}
|
|
5469
5503
|
// 筛选需要隐藏的图标
|
|
5470
|
-
if (options === null ||
|
|
5504
|
+
if ((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.hiddenToolIco) {
|
|
5471
5505
|
for(var iconKey in options.hiddenToolIco){
|
|
5472
5506
|
if (options.hiddenToolIco[iconKey]) {
|
|
5473
5507
|
this.filterHideIcon(iconKey);
|
|
@@ -6441,61 +6475,62 @@ var KeyboardEventHandle = /*#__PURE__*/ function() {
|
|
|
6441
6475
|
|
|
6442
6476
|
// 为插件的全局参数设置数据
|
|
6443
6477
|
function setPlugInParameters(options) {
|
|
6478
|
+
var _options, _options1, _options2, _options3, _options4, _options5, _options6, _options7, _options8, _options9, _options10, _options11, _options12, _options13, _options14;
|
|
6444
6479
|
var plugInParameters = new PlugInParameters();
|
|
6445
6480
|
// webrtc启用状态, 默认为true,如果设置了false则修改默认值
|
|
6446
|
-
if ((options === null ||
|
|
6481
|
+
if (((_options = options) === null || _options === void 0 ? void 0 : _options.enableWebRtc) === false) {
|
|
6447
6482
|
plugInParameters.setWebRtcStatus(false);
|
|
6448
6483
|
plugInParameters.setInitStatus(false);
|
|
6449
6484
|
}
|
|
6450
6485
|
// 读取并设置参数中的视频流数据
|
|
6451
|
-
if ((options === null ||
|
|
6486
|
+
if (((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.screenFlow) instanceof MediaStream) {
|
|
6452
6487
|
plugInParameters.setScreenFlow(options.screenFlow);
|
|
6453
6488
|
}
|
|
6454
6489
|
// 读取参数中的画布宽高, 两者都存在时才设置
|
|
6455
|
-
if ((options === null ||
|
|
6490
|
+
if (((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.canvasWidth) && ((_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.canvasHeight)) {
|
|
6456
6491
|
plugInParameters.setCanvasSize(options.canvasWidth, options.canvasHeight);
|
|
6457
6492
|
}
|
|
6458
6493
|
// 读取参数设置默认展示截屏数据的状态,默认为false,如果设置了true才修改
|
|
6459
|
-
if ((options === null ||
|
|
6494
|
+
if (((_options4 = options) === null || _options4 === void 0 ? void 0 : _options4.showScreenData) === true) {
|
|
6460
6495
|
plugInParameters.setShowScreenDataStatus(true);
|
|
6461
6496
|
}
|
|
6462
|
-
if ((options === null ||
|
|
6497
|
+
if (((_options5 = options) === null || _options5 === void 0 ? void 0 : _options5.maskColor) && typeof options.maskColor === "object") {
|
|
6463
6498
|
plugInParameters.setMaskColor(options.maskColor);
|
|
6464
6499
|
}
|
|
6465
6500
|
// 调用者关闭了剪切板写入,则修改全局变量(默认为true)
|
|
6466
|
-
if ((options === null ||
|
|
6501
|
+
if (((_options6 = options) === null || _options6 === void 0 ? void 0 : _options6.writeBase64) === false) {
|
|
6467
6502
|
plugInParameters.setWriteImgState(options.writeBase64);
|
|
6468
6503
|
}
|
|
6469
6504
|
// 调用者传入了截图dom
|
|
6470
|
-
if (options === null ||
|
|
6505
|
+
if ((_options7 = options) === null || _options7 === void 0 ? void 0 : _options7.screenShotDom) {
|
|
6471
6506
|
plugInParameters.setScreenShotDom(options.screenShotDom);
|
|
6472
6507
|
}
|
|
6473
6508
|
// 调用者传入了裁剪区域边框像素点颜色信息
|
|
6474
|
-
if (options === null ||
|
|
6509
|
+
if ((_options8 = options) === null || _options8 === void 0 ? void 0 : _options8.cutBoxBdColor) {
|
|
6475
6510
|
plugInParameters.setCutBoxBdColor(options.cutBoxBdColor);
|
|
6476
6511
|
}
|
|
6477
6512
|
// 调用者传入了保存截图回调
|
|
6478
|
-
if (options === null ||
|
|
6513
|
+
if ((_options9 = options) === null || _options9 === void 0 ? void 0 : _options9.saveCallback) {
|
|
6479
6514
|
plugInParameters.setSaveCallback(options.saveCallback);
|
|
6480
6515
|
}
|
|
6481
6516
|
// 设置最大撤销次数
|
|
6482
|
-
if (options === null ||
|
|
6517
|
+
if ((_options10 = options) === null || _options10 === void 0 ? void 0 : _options10.maxUndoNum) {
|
|
6483
6518
|
plugInParameters.setMaxUndoNum(options.maxUndoNum);
|
|
6484
6519
|
}
|
|
6485
6520
|
// 箭头绘制工具是否使用等比例绘制方式
|
|
6486
|
-
if (options === null ||
|
|
6521
|
+
if ((_options11 = options) === null || _options11 === void 0 ? void 0 : _options11.useRatioArrow) {
|
|
6487
6522
|
plugInParameters.setRatioArrow(options.useRatioArrow);
|
|
6488
6523
|
}
|
|
6489
6524
|
// 设置图片自适应开启状态
|
|
6490
|
-
if (options === null ||
|
|
6525
|
+
if ((_options12 = options) === null || _options12 === void 0 ? void 0 : _options12.imgAutoFit) {
|
|
6491
6526
|
plugInParameters.setImgAutoFit(options.imgAutoFit);
|
|
6492
6527
|
}
|
|
6493
6528
|
// 设置图片保存时的文件名称
|
|
6494
|
-
if (options === null ||
|
|
6529
|
+
if ((_options13 = options) === null || _options13 === void 0 ? void 0 : _options13.saveImgTitle) {
|
|
6495
6530
|
plugInParameters.setSaveImgTitle(options.saveImgTitle);
|
|
6496
6531
|
}
|
|
6497
6532
|
// 确认截图时,是否需要销毁dom
|
|
6498
|
-
if ((options === null ||
|
|
6533
|
+
if (((_options14 = options) === null || _options14 === void 0 ? void 0 : _options14.destroyContainer) === false) {
|
|
6499
6534
|
plugInParameters.setDestroyContainerState(options.destroyContainer);
|
|
6500
6535
|
}
|
|
6501
6536
|
}
|
|
@@ -6512,6 +6547,7 @@ function drawCrossImg(html) {
|
|
|
6512
6547
|
img.crossOrigin = "anonymous";
|
|
6513
6548
|
img.src = "".concat(href, "&time=").concat(+new Date().getTime());
|
|
6514
6549
|
img.onload = function() {
|
|
6550
|
+
var _canvas;
|
|
6515
6551
|
var width = element.width;
|
|
6516
6552
|
var height = element.height;
|
|
6517
6553
|
var canvas = document.createElement("canvas");
|
|
@@ -6519,7 +6555,7 @@ function drawCrossImg(html) {
|
|
|
6519
6555
|
canvas.height = height;
|
|
6520
6556
|
var ctx = canvas.getContext("2d");
|
|
6521
6557
|
ctx.drawImage(img, 0, 0, width, height);
|
|
6522
|
-
var base64 = canvas === null ||
|
|
6558
|
+
var base64 = (_canvas = canvas) === null || _canvas === void 0 ? void 0 : _canvas.toDataURL();
|
|
6523
6559
|
element.setAttribute("src", base64);
|
|
6524
6560
|
resolve("转换成功");
|
|
6525
6561
|
};
|
|
@@ -6633,6 +6669,7 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
6633
6669
|
function ScreenShot(options) {
|
|
6634
6670
|
var _this = this;
|
|
6635
6671
|
_class_call_check(this, ScreenShot);
|
|
6672
|
+
var _options, _options1, _options2, _options3;
|
|
6636
6673
|
// 当前实例的响应式data数据
|
|
6637
6674
|
_define_property(this, "data", void 0);
|
|
6638
6675
|
// video容器用于存放屏幕MediaStream流
|
|
@@ -7106,14 +7143,14 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7106
7143
|
// 获取截图区域canvas容器(获取的同时也会为InitData中的全局变量赋值)
|
|
7107
7144
|
this.setGlobalParameter();
|
|
7108
7145
|
// 修改截图容器可滚动状态
|
|
7109
|
-
this.data.setNoScrollStatus(options === null ||
|
|
7146
|
+
this.data.setNoScrollStatus((_options = options) === null || _options === void 0 ? void 0 : _options.noScroll);
|
|
7110
7147
|
// 加载截图组件
|
|
7111
|
-
this.load(options === null ||
|
|
7148
|
+
this.load((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.triggerCallback, (_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.cancelCallback);
|
|
7112
7149
|
if (this.toolController == null || this.screenShotContainer == null || this.textInputController == null) {
|
|
7113
7150
|
return;
|
|
7114
7151
|
}
|
|
7115
7152
|
// 截图组件加载完毕后,对层级进行调整
|
|
7116
|
-
this.adjustContainerLevels((options === null ||
|
|
7153
|
+
this.adjustContainerLevels(((_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.level) ? options.level : 0);
|
|
7117
7154
|
// 创建键盘事件监听
|
|
7118
7155
|
this.keyboardEventHandle = new KeyboardEventHandle(this.screenShotContainer, this.toolController);
|
|
7119
7156
|
// 给输入容器设置快捷键监听
|
|
@@ -7269,6 +7306,16 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7269
7306
|
// 将body内容绘制到图片容器里
|
|
7270
7307
|
imgContext.putImageData(bodyImgData, 0, 0);
|
|
7271
7308
|
} else {
|
|
7309
|
+
var // console.log("对视频容器的内容进行裁剪", {
|
|
7310
|
+
// wrcImgPosition: this.wrcImgPosition,
|
|
7311
|
+
// containerWidth,
|
|
7312
|
+
// containerHeight,
|
|
7313
|
+
// videoWidth,
|
|
7314
|
+
// videoHeight,
|
|
7315
|
+
// fixWidth,
|
|
7316
|
+
// fixHeight
|
|
7317
|
+
// });
|
|
7318
|
+
_imgContext;
|
|
7272
7319
|
// 对webrtc源提供的图像宽高进行修复
|
|
7273
7320
|
var fixWidth = containerWidth;
|
|
7274
7321
|
var fixHeight = videoHeight * containerWidth / videoWidth;
|
|
@@ -7279,16 +7326,7 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7279
7326
|
// 对视频容器的内容进行裁剪
|
|
7280
7327
|
fixWidth = _this.wrcImgPosition.w > 0 ? _this.wrcImgPosition.w : fixWidth;
|
|
7281
7328
|
fixHeight = _this.wrcImgPosition.h > 0 ? _this.wrcImgPosition.h : fixHeight;
|
|
7282
|
-
|
|
7283
|
-
// wrcImgPosition: this.wrcImgPosition,
|
|
7284
|
-
// containerWidth,
|
|
7285
|
-
// containerHeight,
|
|
7286
|
-
// videoWidth,
|
|
7287
|
-
// videoHeight,
|
|
7288
|
-
// fixWidth,
|
|
7289
|
-
// fixHeight
|
|
7290
|
-
// });
|
|
7291
|
-
imgContext === null || imgContext === void 0 ? void 0 : imgContext.drawImage(_this.videoController, _this.wrcImgPosition.x, _this.wrcImgPosition.y, fixWidth, fixHeight);
|
|
7329
|
+
(_imgContext = imgContext) === null || _imgContext === void 0 ? void 0 : _imgContext.drawImage(_this.videoController, _this.wrcImgPosition.x, _this.wrcImgPosition.y, fixWidth, fixHeight);
|
|
7292
7330
|
// // 要保存的字符串
|
|
7293
7331
|
// const stringData = imgContext.canvas.toDataURL("png");
|
|
7294
7332
|
// // dada 表示要转换的字符串数据,type 表示要转换的数据格式
|
|
@@ -7513,27 +7551,28 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7513
7551
|
{
|
|
7514
7552
|
key: "setOptionalParameter",
|
|
7515
7553
|
value: function setOptionalParameter(options) {
|
|
7554
|
+
var _options, _options1, _options2, _options3, _options4, _options5, _options6, _options7, _options8, _options9, _options10, _options11, _options12, _options13, _options14;
|
|
7516
7555
|
// 单击截取全屏启用状态,默认为false
|
|
7517
|
-
if ((options === null ||
|
|
7556
|
+
if (((_options = options) === null || _options === void 0 ? void 0 : _options.clickCutFullScreen) === true) {
|
|
7518
7557
|
this.clickCutFullScreen = true;
|
|
7519
7558
|
}
|
|
7520
7559
|
// 判断调用者是否传了截图进来
|
|
7521
|
-
if ((options === null ||
|
|
7560
|
+
if (((_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.imgSrc) != null) {
|
|
7522
7561
|
this.imgSrc = options.imgSrc;
|
|
7523
7562
|
}
|
|
7524
7563
|
// 是否加载跨域图片
|
|
7525
|
-
if ((options === null ||
|
|
7564
|
+
if (((_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.loadCrossImg) === true) {
|
|
7526
7565
|
this.loadCrossImg = true;
|
|
7527
7566
|
}
|
|
7528
7567
|
// 跨域时的代理服务器地址
|
|
7529
|
-
if (options === null ||
|
|
7568
|
+
if ((_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.proxyUrl) {
|
|
7530
7569
|
this.proxyUrl = options.proxyUrl;
|
|
7531
7570
|
}
|
|
7532
|
-
if (options === null ||
|
|
7571
|
+
if ((_options4 = options) === null || _options4 === void 0 ? void 0 : _options4.useCORS) {
|
|
7533
7572
|
this.useCORS = options.useCORS;
|
|
7534
7573
|
}
|
|
7535
7574
|
// 设置截图容器的位置信息
|
|
7536
|
-
if ((options === null ||
|
|
7575
|
+
if (((_options5 = options) === null || _options5 === void 0 ? void 0 : _options5.position) != null) {
|
|
7537
7576
|
var _options_position, _options_position1;
|
|
7538
7577
|
if (((_options_position = options.position) === null || _options_position === void 0 ? void 0 : _options_position.top) != null) {
|
|
7539
7578
|
this.position.top = options.position.top;
|
|
@@ -7543,30 +7582,30 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7543
7582
|
}
|
|
7544
7583
|
}
|
|
7545
7584
|
// 截图容器dom
|
|
7546
|
-
if (options === null ||
|
|
7585
|
+
if ((_options6 = options) === null || _options6 === void 0 ? void 0 : _options6.screenShotDom) {
|
|
7547
7586
|
this.screenShotDom = options.screenShotDom;
|
|
7548
7587
|
}
|
|
7549
7588
|
// webrtc截图等待时间
|
|
7550
|
-
if (options === null ||
|
|
7589
|
+
if ((_options7 = options) === null || _options7 === void 0 ? void 0 : _options7.wrcReplyTime) {
|
|
7551
7590
|
this.wrcReplyTime = options.wrcReplyTime;
|
|
7552
7591
|
}
|
|
7553
7592
|
// 是否初始化裁剪框
|
|
7554
|
-
if (options === null ||
|
|
7593
|
+
if ((_options8 = options) === null || _options8 === void 0 ? void 0 : _options8.cropBoxInfo) {
|
|
7555
7594
|
this.cropBoxInfo = options.cropBoxInfo;
|
|
7556
7595
|
}
|
|
7557
7596
|
// 是否需要更改工具栏的展示位置
|
|
7558
|
-
if (options === null ||
|
|
7597
|
+
if ((_options9 = options) === null || _options9 === void 0 ? void 0 : _options9.toolPosition) {
|
|
7559
7598
|
this.placement = options.toolPosition;
|
|
7560
7599
|
}
|
|
7561
7600
|
// 是否需要对webrtc模式下捕获到的内容进行裁剪
|
|
7562
|
-
if (options === null ||
|
|
7601
|
+
if ((_options10 = options) === null || _options10 === void 0 ? void 0 : _options10.wrcImgPosition) {
|
|
7563
7602
|
var _options_wrcImgPosition = options.wrcImgPosition, x = _options_wrcImgPosition.x, y = _options_wrcImgPosition.y;
|
|
7564
7603
|
// 坐标需要取负数才能正确的裁剪
|
|
7565
7604
|
this.wrcImgPosition.x = Math.abs(x) * -1;
|
|
7566
7605
|
this.wrcImgPosition.y = Math.abs(y) * -1;
|
|
7567
7606
|
}
|
|
7568
7607
|
// 是否隐藏滚动条
|
|
7569
|
-
if ((options === null ||
|
|
7608
|
+
if (((_options11 = options) === null || _options11 === void 0 ? void 0 : _options11.hiddenScrollBar) != null) {
|
|
7570
7609
|
var _options_hiddenScrollBar = options.hiddenScrollBar, state = _options_hiddenScrollBar.state, color = _options_hiddenScrollBar.color, fillWidth = _options_hiddenScrollBar.fillWidth, fillHeight = _options_hiddenScrollBar.fillHeight, fillState = _options_hiddenScrollBar.fillState;
|
|
7571
7610
|
this.hiddenScrollBar = {
|
|
7572
7611
|
state: state,
|
|
@@ -7583,13 +7622,13 @@ var ScreenShot = /*#__PURE__*/ function() {
|
|
|
7583
7622
|
}
|
|
7584
7623
|
}
|
|
7585
7624
|
// 是否启用窗口截图模式
|
|
7586
|
-
if ((options === null ||
|
|
7625
|
+
if (((_options12 = options) === null || _options12 === void 0 ? void 0 : _options12.wrcWindowMode) != null) {
|
|
7587
7626
|
this.wrcWindowMode = options.wrcWindowMode;
|
|
7588
7627
|
}
|
|
7589
|
-
if ((options === null ||
|
|
7628
|
+
if (((_options13 = options) === null || _options13 === void 0 ? void 0 : _options13.curTabState) != null) {
|
|
7590
7629
|
this.curTabState = options.curTabState;
|
|
7591
7630
|
}
|
|
7592
|
-
if ((options === null ||
|
|
7631
|
+
if (((_options14 = options) === null || _options14 === void 0 ? void 0 : _options14.customRightClickEvent) != null) {
|
|
7593
7632
|
this.customRightClickEvent = options.customRightClickEvent;
|
|
7594
7633
|
}
|
|
7595
7634
|
}
|
|
@@ -11450,27 +11489,64 @@ window.appendDom = function(root, props) {
|
|
|
11450
11489
|
};
|
|
11451
11490
|
var CustomerService$1 = CustomerService;
|
|
11452
11491
|
|
|
11453
|
-
var modules_63b47c51 = {"bhdDatePicker":"
|
|
11492
|
+
var modules_63b47c51 = {"bhdDatePicker":"index_module_bhdDatePicker__0bace134","bhdDatePickerPopup":"index_module_bhdDatePickerPopup__0bace134","singlePicker":"index_module_singlePicker__0bace134","rangePicker":"index_module_rangePicker__0bace134","extraPicker":"index_module_extraPicker__0bace134","showTime":"index_module_showTime__0bace134","showExtraFooter":"index_module_showExtraFooter__0bace134","readonly":"index_module_readonly__0bace134"};
|
|
11454
11493
|
|
|
11455
11494
|
var RangePicker = DatePicker.RangePicker;
|
|
11456
11495
|
var months = [
|
|
11457
|
-
"
|
|
11458
|
-
"
|
|
11459
|
-
"
|
|
11460
|
-
"
|
|
11461
|
-
"
|
|
11462
|
-
"
|
|
11463
|
-
"
|
|
11464
|
-
"
|
|
11465
|
-
"
|
|
11466
|
-
"
|
|
11467
|
-
"
|
|
11468
|
-
"
|
|
11496
|
+
"一月",
|
|
11497
|
+
"二月",
|
|
11498
|
+
"三月",
|
|
11499
|
+
"四月",
|
|
11500
|
+
"五月",
|
|
11501
|
+
"六月",
|
|
11502
|
+
"七月",
|
|
11503
|
+
"八月",
|
|
11504
|
+
"九月",
|
|
11505
|
+
"十月",
|
|
11506
|
+
"十一月",
|
|
11507
|
+
"十二月"
|
|
11469
11508
|
];
|
|
11509
|
+
//January_February_March_April_May_June_July_August_September_October_November_December
|
|
11470
11510
|
var BhdDatePicker = function(props) {
|
|
11471
|
-
|
|
11511
|
+
ConfigProvider.lang === "en" ? "en_US" : "zh_CN";
|
|
11512
|
+
// if (lang === "en_US") {
|
|
11513
|
+
// const enUS = require("dayjs/locale/en");
|
|
11514
|
+
// dayjs.locale(enUS);
|
|
11515
|
+
// } else {
|
|
11516
|
+
// const zhCN = require("dayjs/locale/zh-cn");
|
|
11517
|
+
// dayjs.locale(zhCN);
|
|
11518
|
+
// }
|
|
11519
|
+
var id = "BhdDatePicker_" + new Date().getTime();
|
|
11520
|
+
// 默认格式
|
|
11521
|
+
var getDefaultFormat = function() {
|
|
11522
|
+
if (props.format) {
|
|
11523
|
+
return props.format;
|
|
11524
|
+
} else {
|
|
11525
|
+
var fm = props.showTime ? "YYYY-MM-DD hh:mm:ss" : "YYYY-MM-DD";
|
|
11526
|
+
switch(props.picker){
|
|
11527
|
+
case undefined:
|
|
11528
|
+
case "date":
|
|
11529
|
+
break;
|
|
11530
|
+
case "week":
|
|
11531
|
+
fm = "YYYY-wo";
|
|
11532
|
+
break;
|
|
11533
|
+
case "month":
|
|
11534
|
+
fm = "YYYY-MM";
|
|
11535
|
+
break;
|
|
11536
|
+
case "quarter":
|
|
11537
|
+
fm = "YYYY-QQ";
|
|
11538
|
+
break;
|
|
11539
|
+
case "year":
|
|
11540
|
+
fm = "YYYY";
|
|
11541
|
+
break;
|
|
11542
|
+
}
|
|
11543
|
+
return fm;
|
|
11544
|
+
}
|
|
11545
|
+
};
|
|
11546
|
+
// 自己组件内使用的,或者自己处理的
|
|
11547
|
+
var _props_kind = props.kind, kind = _props_kind === void 0 ? "single" : _props_kind, extraItems = props.extraItems, _props_extraReadonly = props.extraReadonly, extraReadonly = _props_extraReadonly === void 0 ? false : _props_extraReadonly, _props_useType = props.useType, useType = _props_useType === void 0 ? "" : _props_useType, _props_open = props.open, open = _props_open === void 0 ? false : _props_open, mode = props.mode, picker = props.picker, _props_value = props.value, value = _props_value === void 0 ? props.kind === "range" ? [] : "" : _props_value, _props_format = props.format, format = _props_format === void 0 ? getDefaultFormat() : _props_format, _props_presets = props.presets, presets = _props_presets === void 0 ? [] : _props_presets, className = props.className, popupClassName = props.popupClassName, showTime = props.showTime, _props_showNow = props.showNow, showNow = _props_showNow === void 0 ? true : _props_showNow, _props_showToday = props.showToday, showToday = _props_showToday === void 0 ? true : _props_showToday, _props_allowClear = props.allowClear, allowClear = _props_allowClear === void 0 ? true : _props_allowClear, onClick = props.onClick, onBlur = props.onBlur, onChange = props.onChange, onOk = props.onOk, onCalendarChange = props.onCalendarChange, onOpenChange = props.onOpenChange, onPanelChange = props.onPanelChange, disabledDate = props.disabledDate, cellRender = props.cellRender, renderExtraFooter = props.renderExtraFooter;
|
|
11472
11548
|
var bhdDatePickerRef = useRef(null);
|
|
11473
|
-
var _useState = _sliced_to_array(useState(
|
|
11549
|
+
var _useState = _sliced_to_array(useState(open), 2), panelOpen = _useState[0], setPanelOpen = _useState[1];
|
|
11474
11550
|
var _useState1 = _sliced_to_array(useState("date"), 2), panelMode = _useState1[0], setPanelMode = _useState1[1];
|
|
11475
11551
|
var _useState2 = _sliced_to_array(useState([
|
|
11476
11552
|
"date",
|
|
@@ -11483,79 +11559,122 @@ var BhdDatePicker = function(props) {
|
|
|
11483
11559
|
var _useState5 = _sliced_to_array(useState(value), 2), selectedRangeDate = _useState5[0], setSelectedRangeDate = _useState5[1];
|
|
11484
11560
|
var _useState6 = _sliced_to_array(useState([]), 2), selectedRangeDateString = _useState6[0], setSelectedRangeDateString = _useState6[1];
|
|
11485
11561
|
var _useState7 = _sliced_to_array(useState(false), 2), rangeOpenChange = _useState7[0], setRangeOpenChange = _useState7[1]; // 用于范围选择失去焦点后,判断是否关闭
|
|
11486
|
-
var
|
|
11562
|
+
var isChange = useRef(false);
|
|
11487
11563
|
useEffect(function() {
|
|
11488
11564
|
setDefaultMode();
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
|
|
11502
|
-
|
|
11503
|
-
}, 0);
|
|
11565
|
+
if (kind === "range") {
|
|
11566
|
+
if (selectedRangeDate[0] && selectedRangeDate[1]) {
|
|
11567
|
+
setSelectedRangeDateString([
|
|
11568
|
+
selectedRangeDate[0].format(format),
|
|
11569
|
+
selectedRangeDate[1].format(format)
|
|
11570
|
+
]);
|
|
11571
|
+
}
|
|
11572
|
+
} else {
|
|
11573
|
+
if (selectedDate) {
|
|
11574
|
+
setSelectedDateString(function(prevState) {
|
|
11575
|
+
selectedDateStringRef.current = selectedDate.format(format);
|
|
11576
|
+
return selectedDateStringRef.current;
|
|
11577
|
+
});
|
|
11578
|
+
}
|
|
11504
11579
|
}
|
|
11505
11580
|
return function() {
|
|
11506
|
-
|
|
11581
|
+
var _document_getElementsByClassName__getElementsByClassName, _document_getElementsByClassName_, _document_getElementsByClassName, _btn;
|
|
11582
|
+
var btn = (_document_getElementsByClassName = document.getElementsByClassName(id)) === null || _document_getElementsByClassName === void 0 ? void 0 : (_document_getElementsByClassName_ = _document_getElementsByClassName[0]) === null || _document_getElementsByClassName_ === void 0 ? void 0 : (_document_getElementsByClassName__getElementsByClassName = _document_getElementsByClassName_.getElementsByClassName("bhd-picker-today-btn")) === null || _document_getElementsByClassName__getElementsByClassName === void 0 ? void 0 : _document_getElementsByClassName__getElementsByClassName[0];
|
|
11583
|
+
(_btn = btn) === null || _btn === void 0 ? void 0 : _btn.removeEventListener("click", todayClick);
|
|
11507
11584
|
};
|
|
11585
|
+
}, []);
|
|
11586
|
+
useEffect(function() {
|
|
11587
|
+
isChange.current = true;
|
|
11508
11588
|
}, [
|
|
11509
|
-
|
|
11510
|
-
|
|
11589
|
+
selectedDate,
|
|
11590
|
+
selectedRangeDate
|
|
11511
11591
|
]);
|
|
11592
|
+
// 传给 DatePicker 的props参数
|
|
11512
11593
|
var getConfig = function() {
|
|
11513
|
-
var config = _object_spread({
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
|
|
11517
|
-
|
|
11518
|
-
|
|
11519
|
-
|
|
11594
|
+
var config = _object_spread_props(_object_spread({
|
|
11595
|
+
prevIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11596
|
+
style: {
|
|
11597
|
+
transform: "rotate(90deg)"
|
|
11598
|
+
}
|
|
11599
|
+
}),
|
|
11600
|
+
nextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11601
|
+
style: {
|
|
11602
|
+
transform: "rotate(-90deg)"
|
|
11603
|
+
}
|
|
11604
|
+
}),
|
|
11605
|
+
superPrevIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11606
|
+
style: {
|
|
11607
|
+
transform: "rotate(90deg)"
|
|
11608
|
+
}
|
|
11609
|
+
}),
|
|
11610
|
+
superNextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11611
|
+
style: {
|
|
11612
|
+
transform: "rotate(-90deg)"
|
|
11613
|
+
}
|
|
11614
|
+
})
|
|
11615
|
+
}, props), {
|
|
11616
|
+
//--------------- 下边是需要处理的
|
|
11617
|
+
className: "".concat(className, " ").concat(useType === "table" ? "table-date-picker" : ""),
|
|
11618
|
+
popupClassName: popupClassName,
|
|
11619
|
+
allowClear: allowClear,
|
|
11620
|
+
showTime: showTime,
|
|
11621
|
+
cellRender: cellRender,
|
|
11622
|
+
renderExtraFooter: selfRenderExtraFooter
|
|
11623
|
+
});
|
|
11624
|
+
//组件支持传入,防止再次传入DatePicker,所以删掉
|
|
11625
|
+
delete config.mode;
|
|
11520
11626
|
delete config.open;
|
|
11521
11627
|
delete config.onOpenChange;
|
|
11522
|
-
delete config.renderExtraFooter;
|
|
11523
|
-
delete config.useType;
|
|
11524
|
-
delete config.showNow;
|
|
11525
11628
|
delete config.onClick;
|
|
11526
11629
|
delete config.onBlur;
|
|
11527
11630
|
delete config.onOk;
|
|
11528
11631
|
delete config.onChange;
|
|
11529
|
-
delete config.
|
|
11530
|
-
delete config.
|
|
11531
|
-
|
|
11532
|
-
|
|
11632
|
+
delete config.useType; // 组件自己定义的
|
|
11633
|
+
delete config.presets; // 必须删掉,因为预设由官网的左侧换到底部
|
|
11634
|
+
delete config.showNow; // 必须删掉,因为官网的今天按钮有bug,不受showNow的值控制
|
|
11635
|
+
if (!config.cellRender) {
|
|
11636
|
+
config.cellRender = selfCellRender;
|
|
11533
11637
|
}
|
|
11534
|
-
|
|
11535
|
-
|
|
11638
|
+
// 单选
|
|
11639
|
+
if (kind === "single") {
|
|
11640
|
+
config.popupClassName = "\n ".concat(modules_63b47c51.bhdDatePickerPopup, " ").concat(modules_63b47c51.singlePicker, " ").concat(popupClassName || "", " ").concat(showTime ? modules_63b47c51.showTime : "", " ").concat(renderExtraFooter ? modules_63b47c51.showExtraFooter : "");
|
|
11641
|
+
}
|
|
11642
|
+
// 范围选择
|
|
11643
|
+
if (kind === "range") {
|
|
11644
|
+
config.popupClassName = "".concat(modules_63b47c51.bhdDatePickerPopup, " ").concat(modules_63b47c51.rangePicker, " ").concat(popupClassName || "", " ").concat(showTime ? modules_63b47c51.showTime : "", " ").concat(renderExtraFooter ? modules_63b47c51.showExtraFooter : "");
|
|
11536
11645
|
}
|
|
11646
|
+
// 日常安排
|
|
11537
11647
|
if (kind === "extra") {
|
|
11538
|
-
delete config.
|
|
11648
|
+
delete config.showTime; // 日程安排的时候,不允许展示时间面板
|
|
11649
|
+
showTime = false; // 日程安排不选择时间
|
|
11650
|
+
config.popupClassName = "".concat(modules_63b47c51.bhdDatePickerPopup, " ").concat(modules_63b47c51.extraPicker, " ").concat(extraReadonly ? modules_63b47c51.readonly : "", " ").concat(popupClassName || "", " ").concat(showTime ? modules_63b47c51.showTime : "", " ").concat(renderExtraFooter ? modules_63b47c51.showExtraFooter : "");
|
|
11651
|
+
if (extraReadonly) {
|
|
11652
|
+
config.allowClear = false; // 日程安排查看时,不显示清除按钮
|
|
11653
|
+
}
|
|
11539
11654
|
}
|
|
11655
|
+
config.popupClassName = "".concat(config.popupClassName, " ").concat(id);
|
|
11540
11656
|
return config;
|
|
11541
11657
|
};
|
|
11542
11658
|
// 设置默认mode
|
|
11543
11659
|
var setDefaultMode = function() {
|
|
11660
|
+
if (kind === "single" || kind === "extra") {
|
|
11661
|
+
setPanelMode(mode || picker || "date");
|
|
11662
|
+
}
|
|
11544
11663
|
if (kind === "range") {
|
|
11664
|
+
var _mode, _mode1;
|
|
11545
11665
|
setRangePanelMode([
|
|
11546
|
-
picker || "date",
|
|
11547
|
-
picker || "date"
|
|
11666
|
+
((_mode = mode) === null || _mode === void 0 ? void 0 : _mode[0]) || picker || "date",
|
|
11667
|
+
((_mode1 = mode) === null || _mode1 === void 0 ? void 0 : _mode1[1]) || picker || "date"
|
|
11548
11668
|
]);
|
|
11549
|
-
} else {
|
|
11550
|
-
setPanelMode(picker || "date");
|
|
11551
11669
|
}
|
|
11552
11670
|
};
|
|
11553
11671
|
//单元格渲染
|
|
11554
|
-
var
|
|
11672
|
+
var selfCellRender = function(current, info) {
|
|
11555
11673
|
if (info.type === "date") {
|
|
11556
11674
|
var extraItem = null;
|
|
11557
11675
|
if (kind === "extra") {
|
|
11558
|
-
|
|
11676
|
+
var _extraItems;
|
|
11677
|
+
extraItem = (_extraItems = extraItems) === null || _extraItems === void 0 ? void 0 : _extraItems.find(function(item) {
|
|
11559
11678
|
return item.date.format("YYYYMMDD") === current.format("YYYYMMDD");
|
|
11560
11679
|
});
|
|
11561
11680
|
}
|
|
@@ -11572,71 +11691,115 @@ var BhdDatePicker = function(props) {
|
|
|
11572
11691
|
})
|
|
11573
11692
|
});
|
|
11574
11693
|
}
|
|
11694
|
+
// 月份 中文模式下显示全名称(例:一月),英文模式下显示短名称(例:Jan)
|
|
11575
11695
|
if (info.type === "month") {
|
|
11696
|
+
// return (
|
|
11697
|
+
// <div className={`${"bhd-picker-cell-inner"}`}>
|
|
11698
|
+
// {current.format(dayjs.locale() === "zh-cn" ? "MMMM" : "MMM")}
|
|
11699
|
+
// </div>
|
|
11700
|
+
// );
|
|
11576
11701
|
return /*#__PURE__*/ jsx("div", {
|
|
11577
11702
|
className: "bhd-picker-cell-inner",
|
|
11578
|
-
children: months[Number(current.format("M")) - 1]
|
|
11703
|
+
children: i18Conversion$1(months[Number(current.format("M")) - 1])
|
|
11579
11704
|
});
|
|
11580
11705
|
}
|
|
11581
11706
|
return info.originNode;
|
|
11582
11707
|
};
|
|
11583
11708
|
//日期禁用
|
|
11584
|
-
var
|
|
11585
|
-
//
|
|
11586
|
-
|
|
11587
|
-
|
|
11709
|
+
var selfDisabledDate = function(current) {
|
|
11710
|
+
// 或者是传过来的
|
|
11711
|
+
if (disabledDate) {
|
|
11712
|
+
return disabledDate(current);
|
|
11713
|
+
}
|
|
11588
11714
|
// 不能选择的是没有日程安排的
|
|
11589
11715
|
var extraItem = null;
|
|
11590
11716
|
if (kind === "extra") {
|
|
11591
|
-
|
|
11717
|
+
var _extraItems;
|
|
11718
|
+
extraItem = (_extraItems = extraItems) === null || _extraItems === void 0 ? void 0 : _extraItems.find(function(item) {
|
|
11592
11719
|
return item.date.format("YYYYMMDD") === current.format("YYYYMMDD");
|
|
11593
11720
|
});
|
|
11594
11721
|
if (extraReadonly && extraItem) {
|
|
11595
11722
|
return false;
|
|
11596
11723
|
}
|
|
11724
|
+
return !extraItem || current && extraItem.status === "noselectable";
|
|
11597
11725
|
}
|
|
11598
|
-
return
|
|
11726
|
+
return false;
|
|
11599
11727
|
};
|
|
11600
|
-
//
|
|
11601
|
-
var
|
|
11602
|
-
|
|
11603
|
-
|
|
11728
|
+
// 渲染底部扩展内容(包括确定按钮、今天按钮、预设、传入的底部扩展)
|
|
11729
|
+
var selfRenderExtraFooter = function(mode) {
|
|
11730
|
+
var _selectedRangeDate, _selectedRangeDate1;
|
|
11731
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
11604
11732
|
children: [
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
}).length > 0) && mode === "date" && /*#__PURE__*/ jsx("li", {
|
|
11609
|
-
className: "bhd-picker-now",
|
|
11610
|
-
children: /*#__PURE__*/ jsx("a", {
|
|
11611
|
-
className: "bhd-picker-now-btn",
|
|
11612
|
-
onClick: todayClick,
|
|
11613
|
-
children: showTime ? "此刻" : "今天"
|
|
11614
|
-
})
|
|
11733
|
+
renderExtraFooter && /*#__PURE__*/ jsx("div", {
|
|
11734
|
+
className: "bhddatepicker-picker-footer-extra-extend",
|
|
11735
|
+
children: renderExtraFooter(mode)
|
|
11615
11736
|
}),
|
|
11616
|
-
/*#__PURE__*/ jsx(
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11737
|
+
!showTime ? /*#__PURE__*/ jsx(Fragment, {
|
|
11738
|
+
children: /*#__PURE__*/ jsxs("ul", {
|
|
11739
|
+
className: "bhd-picker-ranges",
|
|
11740
|
+
children: [
|
|
11741
|
+
selfRenderPresets(),
|
|
11742
|
+
renderToday(),
|
|
11743
|
+
/*#__PURE__*/ jsx("li", {
|
|
11744
|
+
className: "bhd-picker-ok",
|
|
11745
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
11746
|
+
type: "primary",
|
|
11747
|
+
disabled: kind === "range" ? !(((_selectedRangeDate = selectedRangeDate) === null || _selectedRangeDate === void 0 ? void 0 : _selectedRangeDate[0]) && ((_selectedRangeDate1 = selectedRangeDate) === null || _selectedRangeDate1 === void 0 ? void 0 : _selectedRangeDate1[1])) : !(selectedDate && selectedDateString),
|
|
11748
|
+
onClick: okClick,
|
|
11749
|
+
children: i18Conversion$1("确定")
|
|
11750
|
+
})
|
|
11751
|
+
})
|
|
11752
|
+
]
|
|
11623
11753
|
})
|
|
11754
|
+
}) : /*#__PURE__*/ jsx("ul", {
|
|
11755
|
+
className: "bhd-picker-ranges showPresets ".concat(showNow ? "showNow" : ""),
|
|
11756
|
+
children: selfRenderPresets()
|
|
11624
11757
|
})
|
|
11625
11758
|
]
|
|
11626
|
-
}) : /*#__PURE__*/ jsx("ul", {
|
|
11627
|
-
className: "bhd-picker-ranges",
|
|
11628
|
-
children: renderPresets()
|
|
11629
11759
|
});
|
|
11630
11760
|
};
|
|
11761
|
+
// 渲染今天
|
|
11762
|
+
var renderToday = function() {
|
|
11763
|
+
// 显示now
|
|
11764
|
+
if (showToday) {
|
|
11765
|
+
var _extraItems;
|
|
11766
|
+
// 日程安排时: extraItems中今天是否是可选或者已选择状态
|
|
11767
|
+
var hasNow = ((_extraItems = extraItems) === null || _extraItems === void 0 ? void 0 : _extraItems.filter(function(item) {
|
|
11768
|
+
return item.status !== "noselectable" && // item.date.format(format) === dayjs().format(format)
|
|
11769
|
+
item.date.format("YYYYMMDD") === getToday();
|
|
11770
|
+
}).length) > 0;
|
|
11771
|
+
if (kind === "single" || kind === "extra" && hasNow) {
|
|
11772
|
+
if (mode === "date" || mode === undefined) {
|
|
11773
|
+
return /*#__PURE__*/ jsx("li", {
|
|
11774
|
+
className: "bhd-picker-now",
|
|
11775
|
+
children: /*#__PURE__*/ jsx("a", {
|
|
11776
|
+
className: "bhd-picker-now-btn",
|
|
11777
|
+
style: {
|
|
11778
|
+
visibility: "hidden"
|
|
11779
|
+
},
|
|
11780
|
+
onClick: todayClick,
|
|
11781
|
+
children: i18Conversion$1("今天")
|
|
11782
|
+
})
|
|
11783
|
+
});
|
|
11784
|
+
}
|
|
11785
|
+
}
|
|
11786
|
+
}
|
|
11787
|
+
return null;
|
|
11788
|
+
};
|
|
11789
|
+
// 获取到年月日
|
|
11790
|
+
var getToday = function() {
|
|
11791
|
+
var date = new Date();
|
|
11792
|
+
return date.getFullYear().toString() + date.getMonth().toString().padStart(2, "0") + date.getDay().toString().padStart(2, "0");
|
|
11793
|
+
};
|
|
11631
11794
|
// 渲染预设
|
|
11632
|
-
var
|
|
11795
|
+
var selfRenderPresets = function() {
|
|
11633
11796
|
return /*#__PURE__*/ jsx("li", {
|
|
11634
11797
|
className: "bhd-picker-presets",
|
|
11635
11798
|
children: presets.map(function(item, index) {
|
|
11636
11799
|
return /*#__PURE__*/ jsx("a", {
|
|
11637
11800
|
className: "bhd-picker-preset-btn",
|
|
11638
11801
|
onClick: function() {
|
|
11639
|
-
presetClick(item
|
|
11802
|
+
presetClick(item);
|
|
11640
11803
|
},
|
|
11641
11804
|
children: item.label
|
|
11642
11805
|
}, index);
|
|
@@ -11648,77 +11811,87 @@ var BhdDatePicker = function(props) {
|
|
|
11648
11811
|
if (kind === "range") {
|
|
11649
11812
|
if (selectedRangeDate[0] && selectedRangeDate[1] && selectedRangeDateString[0] && selectedRangeDateString[1]) {
|
|
11650
11813
|
onChange && onChange(selectedRangeDate, selectedRangeDateString);
|
|
11651
|
-
|
|
11814
|
+
setPanelOpen(false);
|
|
11652
11815
|
} else {
|
|
11653
|
-
|
|
11816
|
+
setPanelOpen(true);
|
|
11654
11817
|
}
|
|
11655
11818
|
} else {
|
|
11656
|
-
if (
|
|
11657
|
-
onChange && onChange(
|
|
11658
|
-
|
|
11819
|
+
if (selectedDateRef.current && selectedDateStringRef.current) {
|
|
11820
|
+
onChange && onChange(selectedDateRef.current, selectedDateStringRef.current);
|
|
11821
|
+
setPanelOpen(false);
|
|
11659
11822
|
}
|
|
11660
11823
|
}
|
|
11661
11824
|
};
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11665
|
-
|
|
11666
|
-
|
|
11667
|
-
|
|
11668
|
-
|
|
11825
|
+
// 今天点击
|
|
11826
|
+
var todayClick = useCallback(function() {
|
|
11827
|
+
setTimeout(function() {
|
|
11828
|
+
okClick();
|
|
11829
|
+
}, 0);
|
|
11830
|
+
}, []);
|
|
11831
|
+
var todayClickEventListener = function(value) {
|
|
11832
|
+
if (!value) return;
|
|
11833
|
+
if (showToday) {
|
|
11834
|
+
var _document_getElementsByClassName__getElementsByClassName, _document_getElementsByClassName_, _document_getElementsByClassName;
|
|
11835
|
+
var btn = (_document_getElementsByClassName = document.getElementsByClassName(id)) === null || _document_getElementsByClassName === void 0 ? void 0 : (_document_getElementsByClassName_ = _document_getElementsByClassName[0]) === null || _document_getElementsByClassName_ === void 0 ? void 0 : (_document_getElementsByClassName__getElementsByClassName = _document_getElementsByClassName_.getElementsByClassName("bhd-picker-today-btn")) === null || _document_getElementsByClassName__getElementsByClassName === void 0 ? void 0 : _document_getElementsByClassName__getElementsByClassName[0];
|
|
11836
|
+
if (value) {
|
|
11837
|
+
var _btn, _btn1;
|
|
11838
|
+
(_btn = btn) === null || _btn === void 0 ? void 0 : _btn.removeEventListener("click", todayClick);
|
|
11839
|
+
(_btn1 = btn) === null || _btn1 === void 0 ? void 0 : _btn1.addEventListener("click", todayClick, {
|
|
11840
|
+
once: true
|
|
11841
|
+
});
|
|
11842
|
+
}
|
|
11843
|
+
}
|
|
11669
11844
|
};
|
|
11670
11845
|
//预设点击
|
|
11671
|
-
var presetClick = function(
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11846
|
+
var presetClick = function(info) {
|
|
11847
|
+
console.log(_type_of(info.value));
|
|
11848
|
+
var value = typeof info.value === "function" ? info.value() : info.value;
|
|
11849
|
+
if (kind === "range") {
|
|
11850
|
+
var valueString = [
|
|
11851
|
+
value[0].format(format),
|
|
11852
|
+
value[1].format(format)
|
|
11853
|
+
];
|
|
11854
|
+
setSelectedRangeDate(value);
|
|
11855
|
+
setSelectedRangeDateString(valueString);
|
|
11856
|
+
onChange && onChange(value, valueString);
|
|
11857
|
+
setPanelOpen(false);
|
|
11858
|
+
} else {
|
|
11859
|
+
var valueString1 = value.format(format);
|
|
11860
|
+
setSelectedDate(function(prevState) {
|
|
11861
|
+
selectedDateRef.current = value;
|
|
11862
|
+
return selectedDateRef.current;
|
|
11863
|
+
});
|
|
11864
|
+
setSelectedDateString(function(prevState) {
|
|
11865
|
+
selectedDateStringRef.current = valueString1;
|
|
11866
|
+
return selectedDateStringRef.current;
|
|
11867
|
+
});
|
|
11868
|
+
onChange && onChange(value, valueString1);
|
|
11869
|
+
setPanelOpen(false);
|
|
11870
|
+
}
|
|
11677
11871
|
};
|
|
11678
11872
|
return /*#__PURE__*/ jsxs("span", {
|
|
11679
11873
|
className: "".concat(modules_63b47c51.bhdDatePicker),
|
|
11680
11874
|
ref: bhdDatePickerRef,
|
|
11681
11875
|
children: [
|
|
11682
|
-
kind === "single" && /*#__PURE__*/ jsx(Fragment, {
|
|
11876
|
+
(kind === "single" || kind === "extra") && /*#__PURE__*/ jsx(Fragment, {
|
|
11683
11877
|
children: /*#__PURE__*/ jsx(DatePicker, _object_spread_props(_object_spread({}, getConfig()), {
|
|
11684
|
-
id:
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
style: {
|
|
11690
|
-
transform: "rotate(90deg)"
|
|
11691
|
-
}
|
|
11692
|
-
}),
|
|
11693
|
-
nextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11694
|
-
style: {
|
|
11695
|
-
transform: "rotate(-90deg)"
|
|
11696
|
-
}
|
|
11697
|
-
}),
|
|
11698
|
-
superPrevIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11699
|
-
style: {
|
|
11700
|
-
transform: "rotate(90deg)"
|
|
11701
|
-
}
|
|
11702
|
-
}),
|
|
11703
|
-
superNextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11704
|
-
style: {
|
|
11705
|
-
transform: "rotate(-90deg)"
|
|
11706
|
-
}
|
|
11707
|
-
}),
|
|
11878
|
+
id: id,
|
|
11879
|
+
value: selectedDate,
|
|
11880
|
+
mode: panelMode,
|
|
11881
|
+
open: panelOpen,
|
|
11882
|
+
disabledDate: selfDisabledDate,
|
|
11708
11883
|
onPanelChange: function(value, mode) {
|
|
11709
11884
|
setPanelMode(mode);
|
|
11885
|
+
onPanelChange && onPanelChange(value, mode);
|
|
11710
11886
|
},
|
|
11711
|
-
mode: panelMode,
|
|
11712
|
-
open: open,
|
|
11713
11887
|
onOpenChange: function(value) {
|
|
11714
11888
|
// 打开设置默认mode
|
|
11715
11889
|
if (value) {
|
|
11716
11890
|
setDefaultMode();
|
|
11891
|
+
todayClickEventListener(value);
|
|
11717
11892
|
}
|
|
11893
|
+
onOpenChange && onOpenChange(value);
|
|
11718
11894
|
},
|
|
11719
|
-
showNow: showTime ? showNow : false,
|
|
11720
|
-
defaultPickerValue: selectedDate,
|
|
11721
|
-
value: selectedDate,
|
|
11722
11895
|
onChange: function(date, dateString) {
|
|
11723
11896
|
setSelectedDate(function(prevState) {
|
|
11724
11897
|
selectedDateRef.current = date;
|
|
@@ -11729,149 +11902,67 @@ var BhdDatePicker = function(props) {
|
|
|
11729
11902
|
return selectedDateStringRef.current;
|
|
11730
11903
|
});
|
|
11731
11904
|
},
|
|
11732
|
-
onOk: function() {
|
|
11905
|
+
onOk: function(date) {
|
|
11733
11906
|
if (showTime) {
|
|
11734
11907
|
setTimeout(function() {
|
|
11735
|
-
console.log({
|
|
11736
|
-
selectedDate: selectedDateRef.current,
|
|
11737
|
-
selectedDateString: selectedDateStringRef.current
|
|
11738
|
-
});
|
|
11739
11908
|
onChange && onChange(selectedDateRef.current, selectedDateStringRef.current);
|
|
11740
|
-
|
|
11909
|
+
setPanelOpen(false);
|
|
11741
11910
|
}, 0);
|
|
11742
11911
|
}
|
|
11743
|
-
onOk && onOk();
|
|
11912
|
+
onOk && onOk(date);
|
|
11744
11913
|
},
|
|
11745
|
-
onClick: function() {
|
|
11746
|
-
|
|
11747
|
-
onClick && onClick();
|
|
11914
|
+
onClick: function(e) {
|
|
11915
|
+
setPanelOpen(true);
|
|
11916
|
+
onClick && onClick(e);
|
|
11748
11917
|
},
|
|
11749
|
-
onBlur: function() {
|
|
11918
|
+
onBlur: function(e) {
|
|
11750
11919
|
okClick();
|
|
11751
|
-
|
|
11752
|
-
onBlur && onBlur();
|
|
11753
|
-
}
|
|
11754
|
-
renderExtraFooter: renderExtraFooter
|
|
11920
|
+
setPanelOpen(false);
|
|
11921
|
+
onBlur && onBlur(e);
|
|
11922
|
+
}
|
|
11755
11923
|
}))
|
|
11756
11924
|
}),
|
|
11757
11925
|
kind === "range" && /*#__PURE__*/ jsx(Fragment, {
|
|
11758
11926
|
children: /*#__PURE__*/ jsx(RangePicker, _object_spread_props(_object_spread({}, getConfig()), {
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
style: {
|
|
11764
|
-
transform: "rotate(90deg)"
|
|
11765
|
-
}
|
|
11766
|
-
}),
|
|
11767
|
-
nextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11768
|
-
style: {
|
|
11769
|
-
transform: "rotate(-90deg)"
|
|
11770
|
-
}
|
|
11771
|
-
}),
|
|
11772
|
-
superPrevIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11773
|
-
style: {
|
|
11774
|
-
transform: "rotate(90deg)"
|
|
11775
|
-
}
|
|
11776
|
-
}),
|
|
11777
|
-
superNextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11778
|
-
style: {
|
|
11779
|
-
transform: "rotate(-90deg)"
|
|
11780
|
-
}
|
|
11781
|
-
}),
|
|
11927
|
+
value: selectedRangeDate,
|
|
11928
|
+
mode: rangePanelMode,
|
|
11929
|
+
open: panelOpen,
|
|
11930
|
+
disabledDate: selfDisabledDate,
|
|
11782
11931
|
onPanelChange: function(value, mode) {
|
|
11783
11932
|
setRangePanelMode(mode);
|
|
11933
|
+
onPanelChange && onPanelChange(value, mode);
|
|
11784
11934
|
},
|
|
11785
|
-
mode: rangePanelMode,
|
|
11786
|
-
open: open,
|
|
11787
11935
|
onOpenChange: function(value) {
|
|
11788
11936
|
if (value) {
|
|
11789
11937
|
setDefaultMode();
|
|
11790
11938
|
}
|
|
11939
|
+
if (showTime) {
|
|
11940
|
+
setPanelOpen(value);
|
|
11941
|
+
}
|
|
11791
11942
|
setRangeOpenChange(value);
|
|
11943
|
+
onOpenChange && onOpenChange(value);
|
|
11792
11944
|
},
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
onClick: function() {
|
|
11797
|
-
setOpen(true);
|
|
11798
|
-
onClick && onClick();
|
|
11945
|
+
onClick: function(e) {
|
|
11946
|
+
setPanelOpen(true);
|
|
11947
|
+
onClick && onClick(e);
|
|
11799
11948
|
},
|
|
11800
11949
|
onCalendarChange: function(dates, dateStrings, info) {
|
|
11801
11950
|
setSelectedRangeDate(dates);
|
|
11802
11951
|
setSelectedRangeDateString(dateStrings);
|
|
11952
|
+
onCalendarChange && onCalendarChange(dates, dateStrings, info);
|
|
11803
11953
|
},
|
|
11804
|
-
onBlur: function() {
|
|
11805
|
-
|
|
11954
|
+
onBlur: function(e) {
|
|
11955
|
+
var _selectedRangeDate, _selectedRangeDate1, _selectedRangeDate2, _selectedRangeDate3;
|
|
11956
|
+
if (((_selectedRangeDate = selectedRangeDate) === null || _selectedRangeDate === void 0 ? void 0 : _selectedRangeDate[0]) && ((_selectedRangeDate1 = selectedRangeDate) === null || _selectedRangeDate1 === void 0 ? void 0 : _selectedRangeDate1[1])) {
|
|
11806
11957
|
okClick();
|
|
11807
|
-
|
|
11808
|
-
} else if (!(selectedRangeDate === null ||
|
|
11809
|
-
|
|
11958
|
+
setPanelOpen(false);
|
|
11959
|
+
} else if (!((_selectedRangeDate2 = selectedRangeDate) === null || _selectedRangeDate2 === void 0 ? void 0 : _selectedRangeDate2[0]) || !((_selectedRangeDate3 = selectedRangeDate) === null || _selectedRangeDate3 === void 0 ? void 0 : _selectedRangeDate3[1])) {
|
|
11960
|
+
setPanelOpen(rangeOpenChange);
|
|
11810
11961
|
}
|
|
11811
|
-
onBlur && onBlur();
|
|
11812
|
-
},
|
|
11813
|
-
panelRender: function(panelNode) {
|
|
11814
|
-
return panelNode;
|
|
11815
|
-
},
|
|
11816
|
-
renderExtraFooter: renderExtraFooter
|
|
11817
|
-
}))
|
|
11818
|
-
}),
|
|
11819
|
-
kind === "extra" && /*#__PURE__*/ jsx(DatePicker, _object_spread_props(_object_spread({}, getConfig()), {
|
|
11820
|
-
className: "".concat(className, " ").concat(useType === "table" ? "hide" : ""),
|
|
11821
|
-
popupClassName: "".concat(modules_63b47c51.bhdDatePickerPopup, " ").concat(modules_63b47c51.extraPicker, " ").concat(extraReadonly ? modules_63b47c51.readonly : "", " ").concat(popupClassName || ""),
|
|
11822
|
-
cellRender: cellRender,
|
|
11823
|
-
prevIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11824
|
-
style: {
|
|
11825
|
-
transform: "rotate(90deg)"
|
|
11962
|
+
onBlur && onBlur(e);
|
|
11826
11963
|
}
|
|
11827
|
-
})
|
|
11828
|
-
|
|
11829
|
-
style: {
|
|
11830
|
-
transform: "rotate(-90deg)"
|
|
11831
|
-
}
|
|
11832
|
-
}),
|
|
11833
|
-
superPrevIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11834
|
-
style: {
|
|
11835
|
-
transform: "rotate(90deg)"
|
|
11836
|
-
}
|
|
11837
|
-
}),
|
|
11838
|
-
superNextIcon: /*#__PURE__*/ jsx(CustomArrow$1, {
|
|
11839
|
-
style: {
|
|
11840
|
-
transform: "rotate(-90deg)"
|
|
11841
|
-
}
|
|
11842
|
-
}),
|
|
11843
|
-
disabledDate: disabledDate,
|
|
11844
|
-
allowClear: !extraReadonly,
|
|
11845
|
-
onPanelChange: function(value, mode) {
|
|
11846
|
-
setPanelMode(mode);
|
|
11847
|
-
},
|
|
11848
|
-
mode: panelMode,
|
|
11849
|
-
onOpenChange: function(value) {
|
|
11850
|
-
if (value) {
|
|
11851
|
-
setDefaultMode();
|
|
11852
|
-
}
|
|
11853
|
-
},
|
|
11854
|
-
open: open,
|
|
11855
|
-
showNow: false,
|
|
11856
|
-
defaultPickerValue: selectedDate,
|
|
11857
|
-
value: selectedDate,
|
|
11858
|
-
onChange: function(date, dateString) {
|
|
11859
|
-
setSelectedDate(date);
|
|
11860
|
-
setSelectedDateString(dateString);
|
|
11861
|
-
},
|
|
11862
|
-
onClick: function() {
|
|
11863
|
-
setOpen(true);
|
|
11864
|
-
onClick && onClick();
|
|
11865
|
-
},
|
|
11866
|
-
onBlur: function() {
|
|
11867
|
-
if (!extraReadonly) {
|
|
11868
|
-
okClick();
|
|
11869
|
-
}
|
|
11870
|
-
setOpen(false);
|
|
11871
|
-
onBlur && onBlur();
|
|
11872
|
-
},
|
|
11873
|
-
renderExtraFooter: extraReadonly ? null : renderExtraFooter
|
|
11874
|
-
}))
|
|
11964
|
+
}))
|
|
11965
|
+
})
|
|
11875
11966
|
]
|
|
11876
11967
|
});
|
|
11877
11968
|
};
|