bhd-components 0.8.1 → 0.9.0
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/{f460f54e.esm.es5.production.js → 256789e0.esm.es5.production.js} +10 -10
- package/dist/{3f8529e7.esm.es5.development.js → f8c2008a.esm.es5.development.js} +18 -9
- package/dist/index.esm.es5.development.css +2245 -1007
- package/dist/index.esm.es5.development.js +506 -141
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.esm.es5.development.css +84 -83
- package/dist/vendor.esm.es5.production.esm.es5.production.css +10 -8
- package/es2017/bhdDatePicker/index.d.ts +17 -0
- package/es2017/bhdDatePicker/index.js +360 -0
- package/es2017/bhdDatePicker/index.module.less +851 -0
- package/es2017/customerService/historyFun.d.ts +1 -1
- package/es2017/customerService/historyFun.js +2 -1
- package/es2017/customerService/html2canvas.test.js +1234 -1233
- package/es2017/customerService/index.d.ts +1 -1
- package/es2017/customerService/index.js +14 -11
- package/es2017/customerService/index.module.less +7 -5
- package/es2017/customerService/index2.module.less +7 -5
- package/es2017/customerService/screenshotTool.js +3 -0
- package/es2017/index.d.ts +1 -0
- package/es2017/index.js +1 -0
- package/esm/bhdDatePicker/index.d.ts +17 -0
- package/esm/bhdDatePicker/index.js +367 -0
- package/esm/bhdDatePicker/index.module.less +851 -0
- package/esm/customerService/historyFun.d.ts +1 -1
- package/esm/customerService/historyFun.js +2 -1
- package/esm/customerService/html2canvas.test.js +34 -34
- package/esm/customerService/index.d.ts +1 -1
- package/esm/customerService/index.js +14 -11
- package/esm/customerService/index.module.less +7 -5
- package/esm/customerService/index2.module.less +7 -5
- package/esm/customerService/screenshotTool.js +3 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/package.json +1 -1
|
@@ -20,7 +20,8 @@ import TeacherList from "./teacherList";
|
|
|
20
20
|
import { parseDate } from "../utils/Date";
|
|
21
21
|
import { Remarkable } from "remarkable";
|
|
22
22
|
import hljs from "highlight.js";
|
|
23
|
-
import "highlight.js/styles/default.css";
|
|
23
|
+
//import "highlight.js/styles/default.css";
|
|
24
|
+
import "highlight.js/styles/github.css";
|
|
24
25
|
import { render } from "react-dom";
|
|
25
26
|
import Provider from "../provider";
|
|
26
27
|
const { TextArea } = Input;
|
|
@@ -192,6 +193,7 @@ const CustomerService = (props)=>{
|
|
|
192
193
|
if (content) {
|
|
193
194
|
content.removeEventListener("scroll", handleScroll);
|
|
194
195
|
}
|
|
196
|
+
// window.removeEventListener('resize',handlerHtml2canvas)
|
|
195
197
|
};
|
|
196
198
|
}, [
|
|
197
199
|
historyMessageList,
|
|
@@ -1668,11 +1670,18 @@ const CustomerService = (props)=>{
|
|
|
1668
1670
|
/*#__PURE__*/ _jsxs("div", {
|
|
1669
1671
|
className: styles.operate,
|
|
1670
1672
|
children: [
|
|
1671
|
-
/*#__PURE__*/
|
|
1673
|
+
/*#__PURE__*/ _jsxs("i", {
|
|
1674
|
+
className: styles.popover_main,
|
|
1672
1675
|
onClick: ()=>{
|
|
1673
1676
|
setShowHistory(true);
|
|
1674
1677
|
},
|
|
1675
|
-
children:
|
|
1678
|
+
children: [
|
|
1679
|
+
/*#__PURE__*/ _jsx(CustomRecord, {}),
|
|
1680
|
+
/*#__PURE__*/ _jsx("span", {
|
|
1681
|
+
className: styles.popover,
|
|
1682
|
+
children: "历史记录"
|
|
1683
|
+
})
|
|
1684
|
+
]
|
|
1676
1685
|
}),
|
|
1677
1686
|
/*#__PURE__*/ _jsx("span", {
|
|
1678
1687
|
className: styles.line
|
|
@@ -1692,20 +1701,14 @@ const CustomerService = (props)=>{
|
|
|
1692
1701
|
})
|
|
1693
1702
|
]
|
|
1694
1703
|
}),
|
|
1695
|
-
/*#__PURE__*/
|
|
1704
|
+
/*#__PURE__*/ _jsx("i", {
|
|
1696
1705
|
className: styles.popover_main,
|
|
1697
1706
|
onClick: ()=>{
|
|
1698
1707
|
onEvent(serverName + serverUrl(), "click_智能问答_退出全屏", "提交");
|
|
1699
1708
|
setShowType(3);
|
|
1700
1709
|
setFirstLoad(false); //重启滚动条在最上方
|
|
1701
1710
|
},
|
|
1702
|
-
children:
|
|
1703
|
-
/*#__PURE__*/ _jsx(CloseOutlined, {}),
|
|
1704
|
-
/*#__PURE__*/ _jsx("span", {
|
|
1705
|
-
className: styles.popover,
|
|
1706
|
-
children: "退出全屏"
|
|
1707
|
-
})
|
|
1708
|
-
]
|
|
1711
|
+
children: /*#__PURE__*/ _jsx(CloseOutlined, {})
|
|
1709
1712
|
})
|
|
1710
1713
|
]
|
|
1711
1714
|
})
|
|
@@ -1177,8 +1177,8 @@
|
|
|
1177
1177
|
max-height: 36px;
|
|
1178
1178
|
word-break: break-all;
|
|
1179
1179
|
|
|
1180
|
-
display: flex;
|
|
1181
|
-
align-items: center;
|
|
1180
|
+
//display: flex;
|
|
1181
|
+
//align-items: center;
|
|
1182
1182
|
img{
|
|
1183
1183
|
margin-right: 8px;
|
|
1184
1184
|
width: 60px;
|
|
@@ -1866,7 +1866,7 @@
|
|
|
1866
1866
|
width: 417px;
|
|
1867
1867
|
height: calc(100% - 48px);
|
|
1868
1868
|
right: 0;
|
|
1869
|
-
top:
|
|
1869
|
+
top: 38px;
|
|
1870
1870
|
border-radius: 0;
|
|
1871
1871
|
background: transparent;
|
|
1872
1872
|
overflow: visible;
|
|
@@ -1918,7 +1918,7 @@
|
|
|
1918
1918
|
background-color: transparent !important;
|
|
1919
1919
|
// background-color: burlywood;
|
|
1920
1920
|
.ReactCrop{
|
|
1921
|
-
|
|
1921
|
+
cursor: default !important;
|
|
1922
1922
|
}
|
|
1923
1923
|
:global{
|
|
1924
1924
|
.ReactCrop__child-wrapper{
|
|
@@ -1926,7 +1926,8 @@
|
|
|
1926
1926
|
width: 100% !important;
|
|
1927
1927
|
height: 100% !important;
|
|
1928
1928
|
top: 0 !important;
|
|
1929
|
-
left: 0 !important
|
|
1929
|
+
left: 0 !important;
|
|
1930
|
+
cursor: default !important;
|
|
1930
1931
|
}
|
|
1931
1932
|
}
|
|
1932
1933
|
:global{
|
|
@@ -1935,6 +1936,7 @@
|
|
|
1935
1936
|
height: 100% !important;
|
|
1936
1937
|
top: 0 !important;
|
|
1937
1938
|
left: 0 !important;
|
|
1939
|
+
cursor: default !important;
|
|
1938
1940
|
}
|
|
1939
1941
|
|
|
1940
1942
|
}
|
|
@@ -1175,8 +1175,8 @@
|
|
|
1175
1175
|
max-height: 36px;
|
|
1176
1176
|
word-break: break-all;
|
|
1177
1177
|
|
|
1178
|
-
display: flex;
|
|
1179
|
-
align-items: center;
|
|
1178
|
+
//display: flex;
|
|
1179
|
+
//align-items: center;
|
|
1180
1180
|
img{
|
|
1181
1181
|
margin-right: 8px;
|
|
1182
1182
|
width: 60px;
|
|
@@ -1860,7 +1860,7 @@
|
|
|
1860
1860
|
width: 417px;
|
|
1861
1861
|
height: calc(100% - 48px);
|
|
1862
1862
|
right: 0;
|
|
1863
|
-
top:
|
|
1863
|
+
top: 38px;
|
|
1864
1864
|
border-radius: 0;
|
|
1865
1865
|
background: transparent;
|
|
1866
1866
|
overflow: visible;
|
|
@@ -1904,7 +1904,7 @@
|
|
|
1904
1904
|
background-color: transparent !important;
|
|
1905
1905
|
// background-color: burlywood;
|
|
1906
1906
|
.ReactCrop{
|
|
1907
|
-
|
|
1907
|
+
cursor: default !important;
|
|
1908
1908
|
}
|
|
1909
1909
|
:global{
|
|
1910
1910
|
.ReactCrop__child-wrapper{
|
|
@@ -1912,7 +1912,8 @@
|
|
|
1912
1912
|
width: 100% !important;
|
|
1913
1913
|
height: 100% !important;
|
|
1914
1914
|
top: 0 !important;
|
|
1915
|
-
left: 0 !important
|
|
1915
|
+
left: 0 !important;
|
|
1916
|
+
cursor: default !important;
|
|
1916
1917
|
}
|
|
1917
1918
|
}
|
|
1918
1919
|
:global{
|
|
@@ -1921,6 +1922,7 @@
|
|
|
1921
1922
|
height: 100% !important;
|
|
1922
1923
|
top: 0 !important;
|
|
1923
1924
|
left: 0 !important;
|
|
1925
|
+
cursor: default !important;
|
|
1924
1926
|
}
|
|
1925
1927
|
|
|
1926
1928
|
}
|
package/es2017/index.d.ts
CHANGED
|
@@ -80,3 +80,4 @@ export { default as BhdTipModal } from "./bhdTipModal";
|
|
|
80
80
|
export { default as BhdSelect } from "./bhdSelect";
|
|
81
81
|
export { default as BhdAppLayout } from "./bhdAppLayout";
|
|
82
82
|
export { default as CustomerService } from "./customerService";
|
|
83
|
+
export { default as BhdDatePicker } from "./bhdDatePicker";
|
package/es2017/index.js
CHANGED
|
@@ -85,3 +85,4 @@ export { default as BhdTipModal } from "./bhdTipModal/index"; //提示框
|
|
|
85
85
|
export { default as BhdSelect } from "./bhdSelect/index"; //封装 bhdSelect
|
|
86
86
|
export { default as BhdAppLayout } from "./bhdAppLayout/index"; //封装 BhdAppLayout
|
|
87
87
|
export { default as CustomerService } from "./customerService/index"; //封装 智能客服
|
|
88
|
+
export { default as BhdDatePicker } from "./bhdDatePicker/index"; //封装 日历组件
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
|
+
export interface BhdDateExtraPicker {
|
|
4
|
+
date: Dayjs;
|
|
5
|
+
text: string;
|
|
6
|
+
status: "selectable" | "noselectable" | "selected";
|
|
7
|
+
}
|
|
8
|
+
interface BhdDatePickerProps {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
kind: "single" | "range" | "extra";
|
|
11
|
+
useType?: string;
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
extraItems?: BhdDateExtraPicker[];
|
|
14
|
+
extraReadonly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const BhdDatePicker: (props: BhdDatePickerProps) => React.JSX.Element;
|
|
17
|
+
export default BhdDatePicker;
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { useState, useRef } from "react";
|
|
7
|
+
import styles from "./index.module.less";
|
|
8
|
+
import { Button, DatePicker } from "antd";
|
|
9
|
+
import { CustomArrow, CalendarOutlined } from "../icons/index";
|
|
10
|
+
import dayjs from "dayjs";
|
|
11
|
+
var RangePicker = DatePicker.RangePicker;
|
|
12
|
+
var BhdDatePicker = function(props) {
|
|
13
|
+
var _props_kind = props.kind, kind = _props_kind === void 0 ? "single" : _props_kind, _props_value = props.value, value = _props_value === void 0 ? props.kind === "range" ? [] : "" : _props_value, extraItems = props.extraItems, _props_extraReadonly = props.extraReadonly, extraReadonly = _props_extraReadonly === void 0 ? false : _props_extraReadonly, picker = props.picker, _props_useType = props.useType, useType = _props_useType === void 0 ? "" : _props_useType, _props_label = props.label, label = _props_label === void 0 ? "" : _props_label, className = props.className, popupClassName = props.popupClassName, showTime = props.showTime, _props_showNow = props.showNow, showNow = _props_showNow === void 0 ? true : _props_showNow, onClick = props.onClick, onBlur = props.onBlur, onChange = props.onChange, onOk = props.onOk, _props_presets = props.presets, presets = _props_presets === void 0 ? [] : _props_presets;
|
|
14
|
+
var bhdDatePickerRef = useRef(null);
|
|
15
|
+
var _useState = _sliced_to_array(useState(false), 2), open = _useState[0], setOpen = _useState[1];
|
|
16
|
+
var _useState1 = _sliced_to_array(useState(value), 2), selectedDate = _useState1[0], setSelectedDate = _useState1[1];
|
|
17
|
+
var _useState2 = _sliced_to_array(useState(null), 2), selectedDateString = _useState2[0], setSelectedDateString = _useState2[1];
|
|
18
|
+
var selectedDateRef = useRef(value);
|
|
19
|
+
var selectedDateStringRef = useRef(null);
|
|
20
|
+
var _useState3 = _sliced_to_array(useState(value), 2), selectedRangeDate = _useState3[0], setSelectedRangeDate = _useState3[1];
|
|
21
|
+
var _useState4 = _sliced_to_array(useState([]), 2), selectedRangeDateString = _useState4[0], setSelectedRangeDateString = _useState4[1];
|
|
22
|
+
var getConfig = function() {
|
|
23
|
+
var config = _object_spread({}, props);
|
|
24
|
+
delete config.cellRender;
|
|
25
|
+
delete config.className;
|
|
26
|
+
delete config.prevIcon;
|
|
27
|
+
delete config.nextIcon;
|
|
28
|
+
delete config.superPrevIcon;
|
|
29
|
+
delete config.superNextIcon;
|
|
30
|
+
delete config.open;
|
|
31
|
+
delete config.onOpenChange;
|
|
32
|
+
delete config.renderExtraFooter;
|
|
33
|
+
delete config.useType;
|
|
34
|
+
delete config.showNow;
|
|
35
|
+
delete config.onClick;
|
|
36
|
+
delete config.onBlur;
|
|
37
|
+
delete config.onOk;
|
|
38
|
+
delete config.onChange;
|
|
39
|
+
delete config.presets;
|
|
40
|
+
if (kind === "single" || kind === "extra") {
|
|
41
|
+
delete config.value;
|
|
42
|
+
}
|
|
43
|
+
if (kind === "extra" && picker !== "date") {
|
|
44
|
+
delete config.extraItems;
|
|
45
|
+
}
|
|
46
|
+
if (kind === "extra") {
|
|
47
|
+
delete config.disabledDate;
|
|
48
|
+
}
|
|
49
|
+
return config;
|
|
50
|
+
};
|
|
51
|
+
//单元格渲染
|
|
52
|
+
var cellRender = function(current, info) {
|
|
53
|
+
if (info.type !== "date") {
|
|
54
|
+
return info.originNode;
|
|
55
|
+
}
|
|
56
|
+
if (typeof current === "number" || typeof current === "string") {
|
|
57
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
58
|
+
className: "bhd-picker-cell-inner",
|
|
59
|
+
children: current
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
var extraItem = null;
|
|
63
|
+
if (kind === "extra") {
|
|
64
|
+
extraItem = extraItems === null || extraItems === void 0 ? void 0 : extraItems.find(function(item) {
|
|
65
|
+
return item.date.format("YYYYMMDD") === current.format("YYYYMMDD");
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
69
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
70
|
+
className: "bhd-picker-cell-inner",
|
|
71
|
+
children: [
|
|
72
|
+
current.format("DD"),
|
|
73
|
+
kind === "extra" && extraItem && /*#__PURE__*/ _jsx("div", {
|
|
74
|
+
className: "extraText ".concat(extraItem.status),
|
|
75
|
+
children: extraItem.text
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
//日期禁用
|
|
82
|
+
var disabledDate = function(current) {
|
|
83
|
+
if (extraReadonly) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
// 不能选择的是没有日程安排的
|
|
87
|
+
var extraItem = null;
|
|
88
|
+
if (kind === "extra") {
|
|
89
|
+
extraItem = extraItems === null || extraItems === void 0 ? void 0 : extraItems.find(function(item) {
|
|
90
|
+
return item.date.format("YYYYMMDD") === current.format("YYYYMMDD");
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return !extraItem || current && extraItem.status === "noselectable";
|
|
94
|
+
};
|
|
95
|
+
// 渲染底部扩展内容
|
|
96
|
+
var renderExtraFooter = function(mode) {
|
|
97
|
+
return !showTime ? /*#__PURE__*/ _jsxs("ul", {
|
|
98
|
+
className: "bhd-picker-ranges",
|
|
99
|
+
children: [
|
|
100
|
+
renderPresets(),
|
|
101
|
+
showNow && (kind === "single" || kind === "extra" && extraItems.filter(function(item) {
|
|
102
|
+
return item.status !== "noselectable" && item.date.format("YYYY-MM-DD") === dayjs().format("YYYY-MM-DD");
|
|
103
|
+
}).length > 0) && mode === "date" && /*#__PURE__*/ _jsx("li", {
|
|
104
|
+
className: "bhd-picker-now",
|
|
105
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
106
|
+
className: "bhd-picker-now-btn",
|
|
107
|
+
onClick: todayClick,
|
|
108
|
+
children: showTime ? "此刻" : "今天"
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
/*#__PURE__*/ _jsx("li", {
|
|
112
|
+
className: "bhd-picker-ok",
|
|
113
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
114
|
+
type: "primary",
|
|
115
|
+
disabled: kind === "range" ? !((selectedRangeDate === null || selectedRangeDate === void 0 ? void 0 : selectedRangeDate[0]) && (selectedRangeDate === null || selectedRangeDate === void 0 ? void 0 : selectedRangeDate[1])) : !(selectedDate && selectedDateString),
|
|
116
|
+
onClick: okClick,
|
|
117
|
+
children: "确定"
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}) : /*#__PURE__*/ _jsx("ul", {
|
|
122
|
+
className: "bhd-picker-ranges",
|
|
123
|
+
children: renderPresets()
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
// 渲染预设
|
|
127
|
+
var renderPresets = function() {
|
|
128
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
129
|
+
className: "bhd-picker-presets",
|
|
130
|
+
children: presets.map(function(item) {
|
|
131
|
+
return /*#__PURE__*/ _jsx("a", {
|
|
132
|
+
className: "bhd-picker-preset-btn",
|
|
133
|
+
onClick: function() {
|
|
134
|
+
presetClick(item.value);
|
|
135
|
+
},
|
|
136
|
+
children: item.label
|
|
137
|
+
});
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
// 日期选择确认
|
|
142
|
+
var okClick = function() {
|
|
143
|
+
if (kind === "range") {
|
|
144
|
+
if (selectedRangeDate && selectedRangeDateString) {
|
|
145
|
+
onChange && onChange(selectedRangeDate, selectedRangeDateString);
|
|
146
|
+
setOpen(false);
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
if (selectedDate && selectedDateString) {
|
|
150
|
+
onChange && onChange(selectedDate, selectedDateString);
|
|
151
|
+
setOpen(false);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var todayClick = function() {
|
|
156
|
+
var today = dayjs();
|
|
157
|
+
var todayString = today.format(showTime ? "YYYY-MM-DD hh:mm:ss" : "YYYY-MM-DD");
|
|
158
|
+
setSelectedDate(today);
|
|
159
|
+
setSelectedDateString(todayString);
|
|
160
|
+
onChange && onChange(today, todayString);
|
|
161
|
+
setOpen(false);
|
|
162
|
+
};
|
|
163
|
+
//预设点击
|
|
164
|
+
var presetClick = function(value) {
|
|
165
|
+
var todayString = value.format(showTime ? "YYYY-MM-DD hh:mm:ss" : "YYYY-MM-DD");
|
|
166
|
+
setSelectedDate(value);
|
|
167
|
+
setSelectedDateString(todayString);
|
|
168
|
+
onChange && onChange(value, todayString);
|
|
169
|
+
setOpen(false);
|
|
170
|
+
};
|
|
171
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
172
|
+
className: "".concat(styles.bhdDatePicker),
|
|
173
|
+
ref: bhdDatePickerRef,
|
|
174
|
+
children: [
|
|
175
|
+
kind === "single" && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
176
|
+
children: [
|
|
177
|
+
useType === "table" && /*#__PURE__*/ _jsxs("span", {
|
|
178
|
+
className: styles.pickerLabel,
|
|
179
|
+
onClick: function() {
|
|
180
|
+
setOpen(true);
|
|
181
|
+
},
|
|
182
|
+
children: [
|
|
183
|
+
label,
|
|
184
|
+
/*#__PURE__*/ _jsx(CalendarOutlined, {})
|
|
185
|
+
]
|
|
186
|
+
}),
|
|
187
|
+
/*#__PURE__*/ _jsx(DatePicker, _object_spread_props(_object_spread({}, getConfig()), {
|
|
188
|
+
className: "".concat(className, " ").concat(useType === "table" ? "hide" : ""),
|
|
189
|
+
popupClassName: "".concat(styles.bhdDatePickerPopup, " ").concat(styles.singlePicker, " ").concat(popupClassName || ""),
|
|
190
|
+
cellRender: cellRender,
|
|
191
|
+
prevIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
192
|
+
style: {
|
|
193
|
+
transform: "rotate(90deg)"
|
|
194
|
+
}
|
|
195
|
+
}),
|
|
196
|
+
nextIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
197
|
+
style: {
|
|
198
|
+
transform: "rotate(-90deg)"
|
|
199
|
+
}
|
|
200
|
+
}),
|
|
201
|
+
superPrevIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
202
|
+
style: {
|
|
203
|
+
transform: "rotate(90deg)"
|
|
204
|
+
}
|
|
205
|
+
}),
|
|
206
|
+
superNextIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
207
|
+
style: {
|
|
208
|
+
transform: "rotate(-90deg)"
|
|
209
|
+
}
|
|
210
|
+
}),
|
|
211
|
+
open: open,
|
|
212
|
+
showNow: showTime ? showNow : false,
|
|
213
|
+
value: selectedDate,
|
|
214
|
+
onChange: function(date, dateString) {
|
|
215
|
+
setSelectedDate(function(prevState) {
|
|
216
|
+
selectedDateRef.current = date;
|
|
217
|
+
return selectedDateRef.current;
|
|
218
|
+
});
|
|
219
|
+
setSelectedDateString(function(prevState) {
|
|
220
|
+
selectedDateStringRef.current = dateString;
|
|
221
|
+
return selectedDateStringRef.current;
|
|
222
|
+
});
|
|
223
|
+
console.log({
|
|
224
|
+
selectedDate: selectedDateRef.current,
|
|
225
|
+
selectedDateString: selectedDateStringRef.current
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
onOk: function() {
|
|
229
|
+
if (showTime) {
|
|
230
|
+
setTimeout(function() {
|
|
231
|
+
console.log({
|
|
232
|
+
selectedDate: selectedDateRef.current,
|
|
233
|
+
selectedDateString: selectedDateStringRef.current
|
|
234
|
+
});
|
|
235
|
+
onChange && onChange(selectedDateRef.current, selectedDateStringRef.current);
|
|
236
|
+
setOpen(false);
|
|
237
|
+
}, 0);
|
|
238
|
+
}
|
|
239
|
+
onOk && onOk();
|
|
240
|
+
},
|
|
241
|
+
onClick: function() {
|
|
242
|
+
setOpen(true);
|
|
243
|
+
onClick && onClick();
|
|
244
|
+
},
|
|
245
|
+
onBlur: function() {
|
|
246
|
+
okClick();
|
|
247
|
+
setOpen(false);
|
|
248
|
+
onBlur && onBlur();
|
|
249
|
+
},
|
|
250
|
+
renderExtraFooter: renderExtraFooter
|
|
251
|
+
}))
|
|
252
|
+
]
|
|
253
|
+
}),
|
|
254
|
+
kind === "range" && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
255
|
+
children: [
|
|
256
|
+
useType === "table" && /*#__PURE__*/ _jsxs("span", {
|
|
257
|
+
className: styles.pickerLabel,
|
|
258
|
+
onClick: function() {
|
|
259
|
+
setOpen(true);
|
|
260
|
+
},
|
|
261
|
+
children: [
|
|
262
|
+
label,
|
|
263
|
+
/*#__PURE__*/ _jsx(CalendarOutlined, {})
|
|
264
|
+
]
|
|
265
|
+
}),
|
|
266
|
+
/*#__PURE__*/ _jsx(RangePicker, _object_spread_props(_object_spread({}, getConfig()), {
|
|
267
|
+
className: "".concat(className, " ").concat(useType === "table" ? "hide" : ""),
|
|
268
|
+
popupClassName: "".concat(styles.bhdDatePickerPopup, " ").concat(styles.rangePicker, " ").concat(popupClassName || ""),
|
|
269
|
+
cellRender: cellRender,
|
|
270
|
+
prevIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
271
|
+
style: {
|
|
272
|
+
transform: "rotate(90deg)"
|
|
273
|
+
}
|
|
274
|
+
}),
|
|
275
|
+
nextIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
276
|
+
style: {
|
|
277
|
+
transform: "rotate(-90deg)"
|
|
278
|
+
}
|
|
279
|
+
}),
|
|
280
|
+
superPrevIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
281
|
+
style: {
|
|
282
|
+
transform: "rotate(90deg)"
|
|
283
|
+
}
|
|
284
|
+
}),
|
|
285
|
+
superNextIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
286
|
+
style: {
|
|
287
|
+
transform: "rotate(-90deg)"
|
|
288
|
+
}
|
|
289
|
+
}),
|
|
290
|
+
open: open,
|
|
291
|
+
showNow: false,
|
|
292
|
+
value: selectedRangeDate,
|
|
293
|
+
onClick: function() {
|
|
294
|
+
setOpen(true);
|
|
295
|
+
onClick && onClick();
|
|
296
|
+
},
|
|
297
|
+
onCalendarChange: function(dates, dateStrings, info) {
|
|
298
|
+
setSelectedRangeDate(dates);
|
|
299
|
+
setSelectedRangeDateString(dateStrings);
|
|
300
|
+
},
|
|
301
|
+
onBlur: function() {
|
|
302
|
+
if ((selectedRangeDate === null || selectedRangeDate === void 0 ? void 0 : selectedRangeDate[0]) && (selectedRangeDate === null || selectedRangeDate === void 0 ? void 0 : selectedRangeDate[1])) {
|
|
303
|
+
okClick();
|
|
304
|
+
setOpen(false);
|
|
305
|
+
} else if (!(selectedRangeDate === null || selectedRangeDate === void 0 ? void 0 : selectedRangeDate[0]) && !(selectedRangeDate === null || selectedRangeDate === void 0 ? void 0 : selectedRangeDate[1])) {
|
|
306
|
+
setOpen(false);
|
|
307
|
+
}
|
|
308
|
+
onBlur && onBlur();
|
|
309
|
+
},
|
|
310
|
+
renderExtraFooter: renderExtraFooter
|
|
311
|
+
}))
|
|
312
|
+
]
|
|
313
|
+
}),
|
|
314
|
+
kind === "extra" && /*#__PURE__*/ _jsx(DatePicker, _object_spread_props(_object_spread({}, getConfig()), {
|
|
315
|
+
className: "".concat(className, " ").concat(useType === "table" ? "hide" : ""),
|
|
316
|
+
popupClassName: "".concat(styles.bhdDatePickerPopup, " ").concat(styles.extraPicker, " ").concat(extraReadonly ? styles.readonly : "", " ").concat(popupClassName || ""),
|
|
317
|
+
cellRender: cellRender,
|
|
318
|
+
prevIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
319
|
+
style: {
|
|
320
|
+
transform: "rotate(90deg)"
|
|
321
|
+
}
|
|
322
|
+
}),
|
|
323
|
+
nextIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
324
|
+
style: {
|
|
325
|
+
transform: "rotate(-90deg)"
|
|
326
|
+
}
|
|
327
|
+
}),
|
|
328
|
+
superPrevIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
329
|
+
style: {
|
|
330
|
+
transform: "rotate(90deg)"
|
|
331
|
+
}
|
|
332
|
+
}),
|
|
333
|
+
superNextIcon: /*#__PURE__*/ _jsx(CustomArrow, {
|
|
334
|
+
style: {
|
|
335
|
+
transform: "rotate(-90deg)"
|
|
336
|
+
}
|
|
337
|
+
}),
|
|
338
|
+
disabledDate: disabledDate,
|
|
339
|
+
allowClear: !extraReadonly,
|
|
340
|
+
open: open,
|
|
341
|
+
showNow: false,
|
|
342
|
+
value: selectedDate,
|
|
343
|
+
onChange: function(date, dateString) {
|
|
344
|
+
setSelectedDate(date);
|
|
345
|
+
setSelectedDateString(dateString);
|
|
346
|
+
},
|
|
347
|
+
onClick: function() {
|
|
348
|
+
setOpen(true);
|
|
349
|
+
onClick && onClick();
|
|
350
|
+
},
|
|
351
|
+
onBlur: function() {
|
|
352
|
+
if (!extraReadonly) {
|
|
353
|
+
okClick();
|
|
354
|
+
}
|
|
355
|
+
setOpen(false);
|
|
356
|
+
onBlur && onBlur();
|
|
357
|
+
},
|
|
358
|
+
panelRender: function(panelNode) {
|
|
359
|
+
console.log(panelNode);
|
|
360
|
+
return panelNode;
|
|
361
|
+
},
|
|
362
|
+
renderExtraFooter: extraReadonly ? null : renderExtraFooter
|
|
363
|
+
}))
|
|
364
|
+
]
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
export default BhdDatePicker;
|