ztxkui 2.8.2 → 2.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DemoCom/BasicDemo.d.ts +1 -0
- package/dist/DemoCom/BasicDemo.js +53 -3
- package/dist/DemoCom/PrintDemo.js +13 -10
- package/dist/components/DatePicker/data-picker.js +16 -20
- package/dist/components/EnhanceSelect/index.js +3 -1
- package/dist/components/RangePicker/index.d.ts +2 -0
- package/dist/components/RangePicker/index.js +2 -0
- package/dist/components/RangePicker/range-picker.d.ts +11 -0
- package/dist/components/RangePicker/range-picker.js +114 -0
- package/dist/components/Select/select.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +73 -98
- package/package.json +1 -1
|
@@ -1,12 +1,56 @@
|
|
|
1
1
|
import InputNumber from 'components/InputNumber';
|
|
2
2
|
import Tag from 'components/Tag';
|
|
3
3
|
import Input from 'components/Input';
|
|
4
|
-
import { FormList } from '../index';
|
|
4
|
+
import { FormList, RangePicker } from '../index';
|
|
5
5
|
import GridList from 'components/business/NewList';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import './style.scss';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
|
|
10
|
+
dayjs.extend(quarterOfYear);
|
|
11
|
+
var getLastMonth = function () {
|
|
12
|
+
var date = [];
|
|
13
|
+
var start = dayjs().subtract(1, 'month').format('YYYY-MM') + '-01';
|
|
14
|
+
var end = dayjs(start)
|
|
15
|
+
.subtract(-1, 'month')
|
|
16
|
+
.add(-1, 'days')
|
|
17
|
+
.format('YYYY-MM-DD');
|
|
18
|
+
date.push(dayjs(start));
|
|
19
|
+
date.push(dayjs(end));
|
|
20
|
+
return date;
|
|
21
|
+
};
|
|
22
|
+
// 日期选择下边的按钮配置
|
|
23
|
+
export var RANGEPICKER_RANGES = {
|
|
24
|
+
此刻: [dayjs(), dayjs()],
|
|
25
|
+
最近7天: [dayjs().subtract(6, 'days'), dayjs().subtract(0, 'days')],
|
|
26
|
+
最近30天: [dayjs().subtract(29, 'days'), dayjs().subtract(0, 'days')],
|
|
27
|
+
上月: getLastMonth(),
|
|
28
|
+
本月: [dayjs().startOf('month'), dayjs().endOf('month')],
|
|
29
|
+
上季度: [
|
|
30
|
+
dayjs()
|
|
31
|
+
.quarter(dayjs().quarter() - 1)
|
|
32
|
+
.startOf('quarter'),
|
|
33
|
+
dayjs()
|
|
34
|
+
.quarter(dayjs().quarter() - 1)
|
|
35
|
+
.endOf('quarter'),
|
|
36
|
+
],
|
|
37
|
+
本季度: [dayjs().startOf('quarter'), dayjs().endOf('quarter')],
|
|
38
|
+
上一年: [
|
|
39
|
+
dayjs()
|
|
40
|
+
.year(dayjs().year() - 1)
|
|
41
|
+
.startOf('year'),
|
|
42
|
+
dayjs()
|
|
43
|
+
.year(dayjs().year() - 1)
|
|
44
|
+
.endOf('year'),
|
|
45
|
+
],
|
|
46
|
+
本年: [dayjs().startOf('year'), dayjs().endOf('year')],
|
|
47
|
+
};
|
|
8
48
|
function BasicDemo() {
|
|
9
49
|
var _a = useState(10), value = _a[0], setValue = _a[1];
|
|
50
|
+
var _b = useState([
|
|
51
|
+
dayjs('2022-05-11'),
|
|
52
|
+
dayjs('9999-12-31'),
|
|
53
|
+
]), rangeValue = _b[0], setRangeValue = _b[1];
|
|
10
54
|
return (React.createElement(React.Fragment, null,
|
|
11
55
|
React.createElement(InputNumber, { value: value, onChange: function (value) {
|
|
12
56
|
console.log(value);
|
|
@@ -18,7 +62,12 @@ function BasicDemo() {
|
|
|
18
62
|
React.createElement(Tag, { type: "processing" }, "\u4F60\u597D"),
|
|
19
63
|
React.createElement(Tag, { type: "warning" }, "\u4F60\u597D")),
|
|
20
64
|
React.createElement("div", { className: "placeholder" },
|
|
21
|
-
React.createElement("button", { onClick: function () {
|
|
65
|
+
React.createElement("button", { onClick: function () {
|
|
66
|
+
var _a, _b, _c, _d;
|
|
67
|
+
console.log(value, rangeValue);
|
|
68
|
+
console.log((_b = (_a = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue[0]) === null || _a === void 0 ? void 0 : _a.format) === null || _b === void 0 ? void 0 : _b.call(_a, 'YYYY-MM-DD'));
|
|
69
|
+
console.log((_d = (_c = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue[1]) === null || _c === void 0 ? void 0 : _c.format) === null || _d === void 0 ? void 0 : _d.call(_c, 'YYYY-MM-DD'));
|
|
70
|
+
} }, "\u83B7\u53D6\u6570\u636E")),
|
|
22
71
|
React.createElement(Input.TextArea, { className: "placeholder" }),
|
|
23
72
|
React.createElement("div", { style: { border: '1px solid red' } },
|
|
24
73
|
React.createElement(FormList, { gutter: 16 },
|
|
@@ -61,6 +110,7 @@ function BasicDemo() {
|
|
|
61
110
|
React.createElement(GridList.FormItem, { span: 6, title: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
62
111
|
React.createElement(GridList.FormItem, { span: 6, title: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
63
112
|
React.createElement(GridList.FormItem, { span: 6, title: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5" }, "\u518D\u89C1"),
|
|
64
|
-
React.createElement(GridList.FormItem, { span: 6, title: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5" }, "\u518D\u89C1")))
|
|
113
|
+
React.createElement(GridList.FormItem, { span: 6, title: "\u6D4B\u8BD5\u6D4B\u8BD5\u6D4B\u8BD5" }, "\u518D\u89C1"))),
|
|
114
|
+
React.createElement(RangePicker, { showFar: true, ranges: RANGEPICKER_RANGES, value: rangeValue, onChange: function (value) { return setRangeValue(value); } })));
|
|
65
115
|
}
|
|
66
116
|
export default BasicDemo;
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* @author 陈亚雄
|
|
3
3
|
* @description
|
|
4
4
|
*/
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
// import { findDOMNode } from 'react-dom';
|
|
7
|
-
import { Button } from '../index';
|
|
7
|
+
import { Button, ZtIcon } from '../index';
|
|
8
8
|
import Table from 'components/Table';
|
|
9
|
-
import { useReactToPrint } from 'react-to-print';
|
|
10
9
|
var dataSource = new Array(10).fill('1').map(function (item, index) { return ({
|
|
11
10
|
test1: "\u6D4B\u8BD5\u4E00" + index,
|
|
12
11
|
test2: "\u6D4B\u8BD5\u4E8C" + index,
|
|
@@ -15,7 +14,6 @@ var dataSource = new Array(10).fill('1').map(function (item, index) { return ({
|
|
|
15
14
|
id: "" + index,
|
|
16
15
|
}); });
|
|
17
16
|
var PrintDemo = function () {
|
|
18
|
-
var componentRef = useRef();
|
|
19
17
|
var columns = [
|
|
20
18
|
{
|
|
21
19
|
title: '测试一',
|
|
@@ -42,16 +40,21 @@ var PrintDemo = function () {
|
|
|
42
40
|
key: 'test4',
|
|
43
41
|
},
|
|
44
42
|
];
|
|
45
|
-
var handlePrint = useReactToPrint({
|
|
46
|
-
content: function () { return componentRef.current; },
|
|
47
|
-
});
|
|
48
43
|
return (React.createElement(React.Fragment, null,
|
|
49
44
|
React.createElement("div", null,
|
|
50
45
|
React.createElement(Button, { onClick: function () {
|
|
51
|
-
|
|
46
|
+
var styleDom = document.createElement('style');
|
|
47
|
+
styleDom.setAttribute('type', 'text/css');
|
|
48
|
+
styleDom.innerText =
|
|
49
|
+
'@media print{ .test1, .test2 { display: none; } }';
|
|
50
|
+
document.head.appendChild(styleDom);
|
|
51
|
+
window.print();
|
|
52
52
|
} }, "\u6253\u5370")),
|
|
53
|
-
React.createElement("div", {
|
|
53
|
+
React.createElement("div", { className: "print-container" },
|
|
54
|
+
React.createElement(ZtIcon, { type: "iconwenjian1" }),
|
|
54
55
|
React.createElement(Table, { columns: columns, dataSource: dataSource, rowKey: "id" }),
|
|
55
|
-
React.createElement("iframe", { style: { width: '1000px', height: '400px' }, title: "\u6D4B\u8BD5iframe\u6253\u5370", src: "http://localhost:8787/
|
|
56
|
+
React.createElement("iframe", { style: { width: '1000px', height: '400px' }, title: "\u6D4B\u8BD5iframe\u6253\u5370", src: "http://localhost:8787/print" })),
|
|
57
|
+
React.createElement("div", { className: "test1" }, "\u6211\u662F\u591A\u4F59\u7684\u6570\u636E \u6211\u662F\u591A\u4F59\u7684\u6570\u636E"),
|
|
58
|
+
React.createElement("div", { className: "test2" }, "\u6211\u662F\u591A\u4F59\u7684\u6570\u636E \u6211\u662F\u591A\u4F59\u7684\u6570\u636E")));
|
|
56
59
|
};
|
|
57
60
|
export default PrintDemo;
|
|
@@ -2,24 +2,20 @@ import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs';
|
|
|
2
2
|
import generatePicker from 'antd/es/date-picker/generatePicker';
|
|
3
3
|
import 'antd/es/date-picker/style/index';
|
|
4
4
|
var DatePicker = generatePicker(dayjsGenerateConfig);
|
|
5
|
-
if (DatePicker.defaultProps) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
DatePicker.RangePicker.defaultProps = {
|
|
22
|
-
getPopupContainer: function (trigger) { return trigger || document.body; },
|
|
23
|
-
};
|
|
24
|
-
}
|
|
5
|
+
// if (DatePicker.defaultProps) {
|
|
6
|
+
// DatePicker.defaultProps.getPopupContainer = (trigger) =>
|
|
7
|
+
// trigger || document.body;
|
|
8
|
+
// } else {
|
|
9
|
+
// DatePicker.defaultProps = {
|
|
10
|
+
// getPopupContainer: (trigger) => trigger || document.body,
|
|
11
|
+
// };
|
|
12
|
+
// }
|
|
13
|
+
// if (DatePicker.RangePicker.defaultProps) {
|
|
14
|
+
// DatePicker.RangePicker.defaultProps.getPopupContainer = (trigger) =>
|
|
15
|
+
// trigger || document.body;
|
|
16
|
+
// } else {
|
|
17
|
+
// DatePicker.RangePicker.defaultProps = {
|
|
18
|
+
// getPopupContainer: (trigger) => trigger || document.body,
|
|
19
|
+
// };
|
|
20
|
+
// }
|
|
25
21
|
export default DatePicker;
|
|
@@ -498,6 +498,8 @@ function EnhanceSelect(_a) {
|
|
|
498
498
|
}
|
|
499
499
|
currentClick.current = true;
|
|
500
500
|
};
|
|
501
|
-
return (React.createElement(Select, __assign({ defaultValue: showAll ? '' : undefined, allowClear: true, showSearch: true, filterOption: remoteSearch ? false : filterOptionHandle, onSearch: remoteSearch ? onSearchHandle : onSearch, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle,
|
|
501
|
+
return (React.createElement(Select, __assign({ defaultValue: showAll ? '' : undefined, allowClear: true, showSearch: true, filterOption: remoteSearch ? false : filterOptionHandle, onSearch: remoteSearch ? onSearchHandle : onSearch, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle,
|
|
502
|
+
// getPopupContainer={(trigger) => trigger || document.body}
|
|
503
|
+
open: isOpen }, restProps, { disabled: remoteSearch ? restProps.disabled : loading || restProps.disabled }), renderSelectOption()));
|
|
502
504
|
}
|
|
503
505
|
export default memo(EnhanceSelect);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RangePickerProps } from 'antd/es/date-picker/generatePicker';
|
|
3
|
+
import { Dayjs } from 'dayjs';
|
|
4
|
+
interface IProps {
|
|
5
|
+
/** 是否显示至今选项 */
|
|
6
|
+
showFar?: boolean;
|
|
7
|
+
/** 至今选项是否选中 */
|
|
8
|
+
farChecked?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function RangePicker({ showFar, farChecked, picker, ...restProps }: IProps & RangePickerProps<Dayjs>): JSX.Element;
|
|
11
|
+
export default RangePicker;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 包含至今的范围选择器
|
|
25
|
+
*/
|
|
26
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
27
|
+
import { DatePicker, Checkbox } from '../../index';
|
|
28
|
+
import dayjs from 'dayjs';
|
|
29
|
+
var AntRangePicker = DatePicker.RangePicker;
|
|
30
|
+
var dateFormat = 'YYYY-MM-DD';
|
|
31
|
+
var monthFormat = 'YYYY-MM';
|
|
32
|
+
var timeFormat = 'HH-mm-ss';
|
|
33
|
+
var yearFormat = 'YYYY';
|
|
34
|
+
function getFormat(picker) {
|
|
35
|
+
switch (picker) {
|
|
36
|
+
case 'date':
|
|
37
|
+
return dateFormat;
|
|
38
|
+
case 'month':
|
|
39
|
+
return monthFormat;
|
|
40
|
+
case 'time':
|
|
41
|
+
return timeFormat;
|
|
42
|
+
case 'year':
|
|
43
|
+
return yearFormat;
|
|
44
|
+
default:
|
|
45
|
+
return dateFormat;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var noformat = ['quarter', 'week'];
|
|
49
|
+
function RangePicker(_a) {
|
|
50
|
+
var _b = _a.showFar, showFar = _b === void 0 ? false : _b, _c = _a.farChecked, farChecked = _c === void 0 ? false : _c, _d = _a.picker, picker = _d === void 0 ? 'date' : _d, restProps = __rest(_a, ["showFar", "farChecked", "picker"]);
|
|
51
|
+
var _e = useState(farChecked), checked = _e[0], setChecked = _e[1];
|
|
52
|
+
var _f = useState(), datePickerValue = _f[0], setDatePickerValue = _f[1];
|
|
53
|
+
/**
|
|
54
|
+
* @description 获取formatString
|
|
55
|
+
*/
|
|
56
|
+
var formatString = useMemo(function () { return getFormat(picker); }, [picker]);
|
|
57
|
+
/**
|
|
58
|
+
* @description 初始化设置是否选中至今
|
|
59
|
+
*/
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
setChecked(farChecked);
|
|
62
|
+
}, [farChecked]);
|
|
63
|
+
/**
|
|
64
|
+
* @description 监听值改变触发单独选择框的值改变
|
|
65
|
+
*/
|
|
66
|
+
useEffect(function () {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
if (Array.isArray(restProps.value)) {
|
|
69
|
+
setDatePickerValue(restProps.value[0]);
|
|
70
|
+
if (showFar &&
|
|
71
|
+
restProps.value[1] &&
|
|
72
|
+
['9999', '9999-12-31', '9999-12'].includes((_b = (_a = restProps.value[1]) === null || _a === void 0 ? void 0 : _a.format) === null || _b === void 0 ? void 0 : _b.call(_a, formatString))) {
|
|
73
|
+
setChecked(true);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, [restProps.value, formatString, showFar]);
|
|
77
|
+
/**至今组件切换 */
|
|
78
|
+
var onFarChangeHandle = function (e) {
|
|
79
|
+
// if (
|
|
80
|
+
// e.target.checked &&
|
|
81
|
+
// Array.isArray(restProps.value) &&
|
|
82
|
+
// restProps.value[0]
|
|
83
|
+
// ) {
|
|
84
|
+
// const firstValue = restProps.value[0];
|
|
85
|
+
// restProps.onChange &&
|
|
86
|
+
// restProps.onChange(
|
|
87
|
+
// [firstValue, dayjs('9999-12-31')],
|
|
88
|
+
// [firstValue.format(formatString), '9999-12-31']
|
|
89
|
+
// );
|
|
90
|
+
// setDatePickerValue(firstValue);
|
|
91
|
+
// }
|
|
92
|
+
restProps.onChange && restProps.onChange([null, null], ['', '']);
|
|
93
|
+
setChecked(e.target.checked);
|
|
94
|
+
};
|
|
95
|
+
/**至今组件 */
|
|
96
|
+
var renderExtraFooterHandle = function () {
|
|
97
|
+
return (React.createElement(Checkbox, { checked: checked, onChange: onFarChangeHandle }, "\u81F3\u4ECA"));
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @description 如果是至今转换参数
|
|
101
|
+
*/
|
|
102
|
+
var formatHandle = function (value) {
|
|
103
|
+
return value.format(formatString) + " -> \u81F3\u4ECA";
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* @description 单独传递参数
|
|
107
|
+
*/
|
|
108
|
+
var onDatePickerChangeHandle = function (value, dateString) {
|
|
109
|
+
restProps.onChange &&
|
|
110
|
+
restProps.onChange([value, dayjs('9999-12-31')], [value.format(formatString), '9999-12-31']);
|
|
111
|
+
};
|
|
112
|
+
return checked ? (React.createElement(DatePicker, { value: datePickerValue, onChange: onDatePickerChangeHandle, renderExtraFooter: showFar ? renderExtraFooterHandle : undefined, format: noformat.includes(picker) ? undefined : formatHandle })) : (React.createElement(AntRangePicker, __assign({ renderExtraFooter: showFar ? renderExtraFooterHandle : undefined, picker: picker }, restProps)));
|
|
113
|
+
}
|
|
114
|
+
export default RangePicker;
|
|
@@ -72,7 +72,7 @@ function Select(props) {
|
|
|
72
72
|
}
|
|
73
73
|
currentClick.current = true;
|
|
74
74
|
};
|
|
75
|
-
return (React.createElement(AntSelect, __assign({ onChange: onChangeHandle, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle, open: isOpen
|
|
75
|
+
return (React.createElement(AntSelect, __assign({ onChange: onChangeHandle, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle, open: isOpen }, restProps), children));
|
|
76
76
|
}
|
|
77
77
|
Select.Option = AntSelect.Option;
|
|
78
78
|
Select.OptGroup = AntSelect.OptGroup;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as Button } from './components/Button';
|
|
|
2
2
|
export { default as Calendar } from './components/Calendar';
|
|
3
3
|
export { default as Checkbox } from './components/Checkbox';
|
|
4
4
|
export { default as DatePicker } from './components/DatePicker';
|
|
5
|
+
export { default as RangePicker } from './components/RangePicker';
|
|
5
6
|
export { default as Input } from './components/Input';
|
|
6
7
|
export { default as InputNumber } from './components/InputNumber';
|
|
7
8
|
export { default as Radio } from './components/Radio';
|
package/dist/index.js
CHANGED
|
@@ -1,105 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
// </Route>
|
|
74
|
-
// <Route exact path="/test">
|
|
75
|
-
// <div>
|
|
76
|
-
// <h1>
|
|
77
|
-
// <Link to="/select">select</Link>
|
|
78
|
-
// </h1>
|
|
79
|
-
// <h1>
|
|
80
|
-
// <Link to="/tree-select">tree select</Link>
|
|
81
|
-
// </h1>
|
|
82
|
-
// <h1>
|
|
83
|
-
// <Link to="/tree">tree</Link>
|
|
84
|
-
// </h1>
|
|
85
|
-
// <h1>
|
|
86
|
-
// <Link to="/upload">upload</Link>
|
|
87
|
-
// </h1>
|
|
88
|
-
// <h1>
|
|
89
|
-
// <Link to="/drag-sort">drag-sort</Link>
|
|
90
|
-
// </h1>
|
|
91
|
-
// </div>
|
|
92
|
-
// </Route>
|
|
93
|
-
// </Switch>
|
|
94
|
-
// </BrowserRouter>
|
|
95
|
-
// </ConfigProvider>,
|
|
96
|
-
// // </React.StrictMode>,
|
|
97
|
-
// document.getElementById('root')
|
|
98
|
-
// );
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import App from './App';
|
|
4
|
+
import { ConfigProvider } from 'antd';
|
|
5
|
+
import zhCN from 'antd/lib/locale/zh_CN';
|
|
6
|
+
import * as dayjs from 'dayjs';
|
|
7
|
+
import zhCn from 'dayjs/locale/zh-cn';
|
|
8
|
+
import { BrowserRouter, Switch, Route, Link } from 'react-router-dom';
|
|
9
|
+
import Demo from './Demo';
|
|
10
|
+
import TreeSelectDemo from './TreeSelectDemo';
|
|
11
|
+
import TreeDemo from './TreeDemo';
|
|
12
|
+
import UploadDemo from './UploadDemo';
|
|
13
|
+
import CollapseDemo from './DemoCom/CollapseDemo';
|
|
14
|
+
import TimelineDemo from './DemoCom/TimelineDemo';
|
|
15
|
+
import WeChatDemo from './DemoCom/WechatDemo';
|
|
16
|
+
import TableDemo from './DemoCom/TableDemo';
|
|
17
|
+
import TableDemo1 from './DemoCom/TableDemo1';
|
|
18
|
+
import BasicDemo from './DemoCom/BasicDemo';
|
|
19
|
+
import FormDemo from './DemoCom/FormDemo';
|
|
20
|
+
import TableAnalyse from './DemoCom/TableAnalyse';
|
|
21
|
+
import DragSort from './DemoCom/DragSort';
|
|
22
|
+
import PrintDemo from './DemoCom/PrintDemo';
|
|
23
|
+
dayjs.locale(zhCn);
|
|
24
|
+
ReactDOM.render(
|
|
25
|
+
// <React.StrictMode>
|
|
26
|
+
React.createElement(ConfigProvider, { locale: zhCN },
|
|
27
|
+
React.createElement(BrowserRouter, null,
|
|
28
|
+
React.createElement(Switch, null,
|
|
29
|
+
React.createElement(Route, { exact: true, path: "/" },
|
|
30
|
+
React.createElement(App, null)),
|
|
31
|
+
React.createElement(Route, { exact: true, path: "/select" },
|
|
32
|
+
React.createElement(Demo, null)),
|
|
33
|
+
React.createElement(Route, { exact: true, path: "/tree-select" },
|
|
34
|
+
React.createElement(TreeSelectDemo, null)),
|
|
35
|
+
React.createElement(Route, { exact: true, path: "/tree" },
|
|
36
|
+
React.createElement(TreeDemo, null)),
|
|
37
|
+
React.createElement(Route, { exact: true, path: "/upload" },
|
|
38
|
+
React.createElement(UploadDemo, null)),
|
|
39
|
+
React.createElement(Route, { exact: true, path: "/collapse" },
|
|
40
|
+
React.createElement(CollapseDemo, null)),
|
|
41
|
+
React.createElement(Route, { exact: true, path: "/timeline" },
|
|
42
|
+
React.createElement(TimelineDemo, null)),
|
|
43
|
+
React.createElement(Route, { exact: true, path: "/wechat" },
|
|
44
|
+
React.createElement(WeChatDemo, null)),
|
|
45
|
+
React.createElement(Route, { exact: true, path: "/table" },
|
|
46
|
+
React.createElement(TableDemo, null)),
|
|
47
|
+
React.createElement(Route, { exact: true, path: "/table1" },
|
|
48
|
+
React.createElement(TableDemo1, null)),
|
|
49
|
+
React.createElement(Route, { exact: true, path: "/basic" },
|
|
50
|
+
React.createElement(BasicDemo, null)),
|
|
51
|
+
React.createElement(Route, { exact: true, path: "/form" },
|
|
52
|
+
React.createElement(FormDemo, null)),
|
|
53
|
+
React.createElement(Route, { exact: true, path: "/print" },
|
|
54
|
+
React.createElement(PrintDemo, null)),
|
|
55
|
+
React.createElement(Route, { exact: true, path: "/table-analyse" },
|
|
56
|
+
React.createElement(TableAnalyse, null)),
|
|
57
|
+
React.createElement(Route, { exact: true, path: "/drag-sort" },
|
|
58
|
+
React.createElement(DragSort, null)),
|
|
59
|
+
React.createElement(Route, { exact: true, path: "/test" },
|
|
60
|
+
React.createElement("div", null,
|
|
61
|
+
React.createElement("h1", null,
|
|
62
|
+
React.createElement(Link, { to: "/select" }, "select")),
|
|
63
|
+
React.createElement("h1", null,
|
|
64
|
+
React.createElement(Link, { to: "/tree-select" }, "tree select")),
|
|
65
|
+
React.createElement("h1", null,
|
|
66
|
+
React.createElement(Link, { to: "/tree" }, "tree")),
|
|
67
|
+
React.createElement("h1", null,
|
|
68
|
+
React.createElement(Link, { to: "/upload" }, "upload")),
|
|
69
|
+
React.createElement("h1", null,
|
|
70
|
+
React.createElement(Link, { to: "/drag-sort" }, "drag-sort"))))))),
|
|
71
|
+
// </React.StrictMode>,
|
|
72
|
+
document.getElementById('root'));
|
|
99
73
|
export { default as Button } from './components/Button';
|
|
100
74
|
export { default as Calendar } from './components/Calendar';
|
|
101
75
|
export { default as Checkbox } from './components/Checkbox';
|
|
102
76
|
export { default as DatePicker } from './components/DatePicker';
|
|
77
|
+
export { default as RangePicker } from './components/RangePicker';
|
|
103
78
|
export { default as Input } from './components/Input';
|
|
104
79
|
export { default as InputNumber } from './components/InputNumber';
|
|
105
80
|
export { default as Radio } from './components/Radio';
|