@zykj2024/much-library 1.1.9-beta.3 → 1.2.0-beta.1

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.
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import '../index.less';
3
+ type PropsType = {
4
+ placeholder?: string;
5
+ value?: number;
6
+ onChange?: (value?: number) => void;
7
+ onBlur?: () => void;
8
+ };
9
+ declare const _default: import("react").NamedExoticComponent<PropsType>;
10
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import { InputNumber } from 'antd';
2
+ import { memo } from 'react';
3
+ import "../index.css";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ var NumberInput = function NumberInput(_ref) {
7
+ var placeholder = _ref.placeholder,
8
+ value = _ref.value,
9
+ _onChange = _ref.onChange,
10
+ onBlur = _ref.onBlur;
11
+ return /*#__PURE__*/_jsxs("div", {
12
+ className: "mc-date-range-pro__presets__item__number-input",
13
+ children: [/*#__PURE__*/_jsx("div", {
14
+ className: "mc-date-range-pro__presets__item__number-input__place",
15
+ children: value
16
+ }), /*#__PURE__*/_jsx(InputNumber, {
17
+ size: "small",
18
+ controls: false,
19
+ min: 0,
20
+ max: 10000,
21
+ precision: 0,
22
+ placeholder: placeholder,
23
+ onClick: function onClick(e) {
24
+ return e.stopPropagation();
25
+ },
26
+ value: value,
27
+ onChange: function onChange(v) {
28
+ var _v = v === null ? undefined : v;
29
+ _onChange === null || _onChange === void 0 || _onChange(_v);
30
+ },
31
+ onBlur: onBlur
32
+ })]
33
+ });
34
+ };
35
+ export default /*#__PURE__*/memo(NumberInput);
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import '../index.less';
3
+ export type CodeType = '0_0' | '-1_-1' | '-6_0' | '-29_0' | '-59_0' | '-89_0' | '-n_0' | '-n_-1' | '0_n' | 'm_n';
4
+ export declare const CODE_LABEL_MAP: any;
5
+ type PropsType = {
6
+ code: CodeType;
7
+ inActiveArea?: boolean;
8
+ active?: boolean;
9
+ onActive?: (dates: (number | undefined)[]) => void;
10
+ onInactive?: () => void;
11
+ onSelected?: (dates: number[]) => void;
12
+ ref?: any;
13
+ };
14
+ declare const _default: import("react").NamedExoticComponent<PropsType>;
15
+ export default _default;
@@ -0,0 +1,133 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import { message } from 'antd';
3
+ import classNames from 'classnames';
4
+ import { forwardRef, memo, useImperativeHandle, useState } from 'react';
5
+ import "../index.css";
6
+ import NumberInput from "./NumberInput";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ // 未来m日 - 未来n日
11
+
12
+ export var CODE_LABEL_MAP = {
13
+ '0_0': '今天',
14
+ '-1_-1': '昨天',
15
+ '-6_0': '最近7天',
16
+ '-29_0': '最近30天',
17
+ '-59_0': '最近60天',
18
+ '-89_0': '最近90天',
19
+ '-n_0': '最近',
20
+ '-n_-1': '过去',
21
+ '0_n': '今天 - 未来',
22
+ m_n: '未来'
23
+ };
24
+ var ShortcutItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
25
+ var code = _ref.code,
26
+ inActiveArea = _ref.inActiveArea,
27
+ _ref$active = _ref.active,
28
+ active = _ref$active === void 0 ? false : _ref$active,
29
+ onActive = _ref.onActive,
30
+ onInactive = _ref.onInactive,
31
+ onSelected = _ref.onSelected;
32
+ var _useState = useState(),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ n1 = _useState2[0],
35
+ setN1 = _useState2[1];
36
+ var _useState3 = useState(),
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ n2 = _useState4[0],
39
+ setN2 = _useState4[1];
40
+
41
+ // 激活(鼠标移入)事件
42
+ var activeHandle = function activeHandle() {
43
+ if (['-n_0', '-n_-1', '0_n', 'm_n'].includes(code)) {
44
+ code === '-n_0' && (onActive === null || onActive === void 0 ? void 0 : onActive([n1 ? -n1 + 1 : undefined, 0]));
45
+ code === '-n_-1' && (onActive === null || onActive === void 0 ? void 0 : onActive([n1 ? -n1 : undefined, -1]));
46
+ code === '0_n' && (onActive === null || onActive === void 0 ? void 0 : onActive([0, n1]));
47
+ code === 'm_n' && (onActive === null || onActive === void 0 ? void 0 : onActive([n1, n2]));
48
+ } else {
49
+ onActive === null || onActive === void 0 || onActive(code.split('_').map(function (v) {
50
+ return +v;
51
+ }));
52
+ }
53
+ };
54
+
55
+ // 选择(点击)事件
56
+ var selectHandle = function selectHandle() {
57
+ if (['-n_0', '-n_-1', '0_n', 'm_n'].includes(code)) {
58
+ if (code === 'm_n') {
59
+ if (n1 && n2) {
60
+ n1 > n2 ? message.warning('开始日期不能大于结束日期') : onSelected === null || onSelected === void 0 ? void 0 : onSelected([n1, n2]);
61
+ } else {
62
+ !n1 && message.warning('开始日期需为正整数');
63
+ !n2 && message.warning('结束日期需为正整数');
64
+ }
65
+ } else {
66
+ if (n1) {
67
+ code === '-n_0' && (onSelected === null || onSelected === void 0 ? void 0 : onSelected([-n1 + 1, 0]));
68
+ code === '-n_-1' && (onSelected === null || onSelected === void 0 ? void 0 : onSelected([-n1, -1]));
69
+ code === '0_n' && (onSelected === null || onSelected === void 0 ? void 0 : onSelected([0, n1]));
70
+ } else {
71
+ message.warning("".concat(code === '0_n' ? '结束' : '开始', "\u65E5\u671F\u9700\u4E3A\u6B63\u6574\u6570"));
72
+ }
73
+ }
74
+ } else {
75
+ onSelected === null || onSelected === void 0 || onSelected(code.split('_').map(function (v) {
76
+ return +v;
77
+ }));
78
+ }
79
+ };
80
+
81
+ // 重置m、n的值
82
+ var resetNs = function resetNs(value) {
83
+ var _split$map = (value || 'M_N').split('_').map(function (v) {
84
+ return isNaN(+v) ? undefined : +v;
85
+ }),
86
+ _split$map2 = _slicedToArray(_split$map, 2),
87
+ m = _split$map2[0],
88
+ n = _split$map2[1];
89
+ if (code === '-n_0') {
90
+ setN1(m === undefined ? undefined : -m + 1);
91
+ } else if (code === '-n_-1') {
92
+ setN1(m === undefined ? undefined : -m);
93
+ } else if (code === '0_n') {
94
+ setN1(n);
95
+ } else if (code === 'm_n') {
96
+ setN1(m);
97
+ setN2(n);
98
+ }
99
+ };
100
+ useImperativeHandle(ref, function () {
101
+ return {
102
+ resetNs: resetNs
103
+ };
104
+ });
105
+ return /*#__PURE__*/_jsxs("div", {
106
+ className: classNames('mc-date-range-pro__presets__item', active && 'mc-date-range-pro__presets__item--active'),
107
+ onMouseEnter: activeHandle,
108
+ onMouseLeave: onInactive,
109
+ onClick: selectHandle,
110
+ children: [CODE_LABEL_MAP[code], ['-n_0', '-n_-1', '0_n', 'm_n'].includes(code) && /*#__PURE__*/_jsxs(_Fragment, {
111
+ children: [/*#__PURE__*/_jsx(NumberInput, {
112
+ placeholder: code === 'm_n' ? 'm' : 'n',
113
+ value: n1,
114
+ onChange: setN1,
115
+ onBlur: function onBlur() {
116
+ if (inActiveArea) return;
117
+ (code === 'm_n' ? n2 !== undefined : true) && setTimeout(selectHandle);
118
+ }
119
+ }), "\u65E5"]
120
+ }), code === 'm_n' && /*#__PURE__*/_jsxs(_Fragment, {
121
+ children: [' ', "- \u672A\u6765", /*#__PURE__*/_jsx(NumberInput, {
122
+ placeholder: "n",
123
+ value: n2,
124
+ onChange: setN2,
125
+ onBlur: function onBlur() {
126
+ if (inActiveArea) return;
127
+ n1 !== undefined && setTimeout(selectHandle);
128
+ }
129
+ }), "\u65E5"]
130
+ })]
131
+ });
132
+ });
133
+ export default /*#__PURE__*/memo(ShortcutItem);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * title: 基础用法
3
+ * description: 基础用法的交互和普通的日期选择器交互基本一致,无左侧快捷栏。
4
+ */
5
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ /**
3
+ * title: 基础用法
4
+ * description: 基础用法的交互和普通的日期选择器交互基本一致,无左侧快捷栏。
5
+ */
6
+
7
+ import { McDateRangePro } from "../..";
8
+ import { useState } from 'react';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export default (function () {
11
+ var _useState = useState(),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ value = _useState2[0],
14
+ setValue = _useState2[1];
15
+ return /*#__PURE__*/_jsx(McDateRangePro, {
16
+ value: value,
17
+ style: {
18
+ width: 300
19
+ },
20
+ onChange: setValue
21
+ });
22
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * title: 支持静态和动态日期范围的左侧快捷栏
3
+ * description: 设置`dynamic`为`true`,并设置`dateType`为`future`或`past`,可开启动态日期范围的左侧快捷栏。
4
+ */
5
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ /**
3
+ * title: 支持静态和动态日期范围的左侧快捷栏
4
+ * description: 设置`dynamic`为`true`,并设置`dateType`为`future`或`past`,可开启动态日期范围的左侧快捷栏。
5
+ */
6
+
7
+ import { McDateRangePro } from "../..";
8
+ import { useState } from 'react';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export default (function () {
11
+ var _useState = useState(),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ value = _useState2[0],
14
+ setValue = _useState2[1];
15
+ return /*#__PURE__*/_jsx(McDateRangePro, {
16
+ value: value,
17
+ style: {
18
+ width: 300
19
+ },
20
+ dynamic: true,
21
+ dateType: "future",
22
+ onChange: setValue
23
+ });
24
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * title: 作为表单项
3
+ * description: 与其他表单项用法一致,需注意静态和动态的值不同,静态值示例:['2025-08-11', '2025-08-11']表示静态今天,动态值示例:'0_0'表示动态今天。
4
+ */
5
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1,62 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ /**
5
+ * title: 作为表单项
6
+ * description: 与其他表单项用法一致,需注意静态和动态的值不同,静态值示例:['2025-08-11', '2025-08-11']表示静态今天,动态值示例:'0_0'表示动态今天。
7
+ */
8
+
9
+ import { Button, Form, message, Space } from 'antd';
10
+ import { McDateRangePro } from "../..";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ export default (function () {
14
+ var _Form$useForm = Form.useForm(),
15
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
16
+ form = _Form$useForm2[0];
17
+ return /*#__PURE__*/_jsxs(Form, {
18
+ form: form,
19
+ onFinish: ( /*#__PURE__*/function () {
20
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
21
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
22
+ while (1) switch (_context.prev = _context.next) {
23
+ case 0:
24
+ message.success("\u63D0\u4EA4\u6210\u529F\uFF0C\u5F53\u524D\u8868\u5355\u503C\uFF1A".concat(JSON.stringify(values)));
25
+ return _context.abrupt("return", true);
26
+ case 2:
27
+ case "end":
28
+ return _context.stop();
29
+ }
30
+ }, _callee);
31
+ }));
32
+ return function (_x) {
33
+ return _ref.apply(this, arguments);
34
+ };
35
+ }()),
36
+ children: [/*#__PURE__*/_jsx(Form.Item, {
37
+ name: "dateRange",
38
+ label: "\u52A8\u6001\u65E5\u671F\u8303\u56F4",
39
+ rules: [{
40
+ required: true,
41
+ message: '请选择动态日期范围'
42
+ }],
43
+ children: /*#__PURE__*/_jsx(McDateRangePro, {
44
+ style: {
45
+ width: 300
46
+ },
47
+ dateType: "future",
48
+ dynamic: true
49
+ })
50
+ }), /*#__PURE__*/_jsxs(Space, {
51
+ children: [/*#__PURE__*/_jsx(Button, {
52
+ type: "primary",
53
+ htmlType: "submit",
54
+ children: "\u63D0\u4EA4"
55
+ }), /*#__PURE__*/_jsx(Button, {
56
+ type: "primary",
57
+ htmlType: "reset",
58
+ children: "\u91CD\u7F6E"
59
+ })]
60
+ })]
61
+ });
62
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * title: 作为列表搜索项
3
+ * description: 在McContainer中的queryItems中配置McDateRangePro组件,实现动态日期范围搜索功能。需注意静态和动态的值不同,静态值示例:['2025-08-11', '2025-08-11']表示静态今天,动态值示例:'0_0'表示动态今天。
4
+ */
5
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1,84 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ /**
3
+ * title: 作为列表搜索项
4
+ * description: 在McContainer中的queryItems中配置McDateRangePro组件,实现动态日期范围搜索功能。需注意静态和动态的值不同,静态值示例:['2025-08-11', '2025-08-11']表示静态今天,动态值示例:'0_0'表示动态今天。
5
+ */
6
+
7
+ import { message } from 'antd';
8
+ import { McContainer, McDateRangePro } from "../..";
9
+ import { useState } from 'react';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { Fragment as _Fragment } from "react/jsx-runtime";
12
+ var tableData = Array.from({
13
+ length: 5
14
+ }, function (_, index) {
15
+ return {
16
+ id: index + 1,
17
+ name: "\u59D3\u540D".concat(index + 1),
18
+ age: 18 + index
19
+ };
20
+ });
21
+ export default (function () {
22
+ var _useState = useState(tableData),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ dataSource = _useState2[0],
25
+ setDataSource = _useState2[1];
26
+ var _useState3 = useState(false),
27
+ _useState4 = _slicedToArray(_useState3, 2),
28
+ loading = _useState4[0],
29
+ setLoading = _useState4[1];
30
+ var columns = [{
31
+ title: 'ID',
32
+ dataIndex: 'id'
33
+ }, {
34
+ title: '姓名',
35
+ dataIndex: 'name'
36
+ }, {
37
+ title: '年龄',
38
+ dataIndex: 'age'
39
+ }, {
40
+ title: '操作',
41
+ dataIndex: 'option',
42
+ width: 100,
43
+ render: function render() {
44
+ return /*#__PURE__*/_jsx("a", {
45
+ children: "\u7F16\u8F91"
46
+ });
47
+ }
48
+ }];
49
+ var queryItems = /*#__PURE__*/_jsx(_Fragment, {
50
+ children: /*#__PURE__*/_jsx(McDateRangePro, {
51
+ label: "\u52A8\u6001\u65E5\u671F\u8303\u56F4",
52
+ name: "dataRange",
53
+ dynamic: true,
54
+ dateType: "future",
55
+ style: {
56
+ width: 350
57
+ }
58
+ })
59
+ });
60
+ var onQuery = function onQuery(values) {
61
+ return new Promise(function (resolve) {
62
+ message.success("\u5F00\u59CB\u67E5\u8BE2\uFF0C\u5F53\u524D\u67E5\u8BE2\u6761\u4EF6\uFF1A".concat(JSON.stringify(values)));
63
+ setLoading(true);
64
+ setTimeout(function () {
65
+ setDataSource(tableData);
66
+ setLoading(false);
67
+ resolve();
68
+ }, 1000);
69
+ });
70
+ };
71
+ return /*#__PURE__*/_jsx(McContainer, {
72
+ height: "100%",
73
+ immediateQuery: false,
74
+ loading: loading,
75
+ loadingText: "\u52A0\u8F7D\u4E2D",
76
+ onQuery: onQuery,
77
+ queryItems: queryItems,
78
+ tableProps: {
79
+ columns: columns,
80
+ dataSource: dataSource,
81
+ rowKey: 'id'
82
+ }
83
+ });
84
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * title: 仅支持静态日期范围的左侧快捷栏
3
+ * description: 设置`dateType`为`future`或`past`,可显示左侧快捷栏。`dynamic`默认为`false`,即默认关闭动态日期范围选择。
4
+ */
5
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ /**
3
+ * title: 仅支持静态日期范围的左侧快捷栏
4
+ * description: 设置`dateType`为`future`或`past`,可显示左侧快捷栏。`dynamic`默认为`false`,即默认关闭动态日期范围选择。
5
+ */
6
+
7
+ import { McDateRangePro } from "../..";
8
+ import { useState } from 'react';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export default (function () {
11
+ var _useState = useState(),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ value = _useState2[0],
14
+ setValue = _useState2[1];
15
+ return /*#__PURE__*/_jsx(McDateRangePro, {
16
+ value: value,
17
+ style: {
18
+ width: 300
19
+ },
20
+ dateType: "future",
21
+ onChange: setValue
22
+ });
23
+ });
@@ -0,0 +1,163 @@
1
+ .mc-date-range-pro {
2
+ position: relative;
3
+ height: 32px;
4
+ }
5
+ .mc-date-range-pro:hover .mc-date-range-pro__content {
6
+ border-color: #325cf7;
7
+ }
8
+ .mc-date-range-pro__label {
9
+ position: absolute;
10
+ top: 0;
11
+ left: 11px;
12
+ z-index: 2;
13
+ display: -webkit-box;
14
+ display: -ms-flexbox;
15
+ display: flex;
16
+ -webkit-box-align: center;
17
+ -ms-flex-align: center;
18
+ align-items: center;
19
+ height: 100%;
20
+ color: #262626;
21
+ font-size: 14px;
22
+ }
23
+ .mc-date-range-pro__label::after {
24
+ margin-left: 2px;
25
+ content: '\FF1A';
26
+ }
27
+ .mc-date-range-pro__label.mc-date-range-pro--disabled {
28
+ color: rgba(0, 0, 0, 0.25);
29
+ cursor: no-drop;
30
+ }
31
+ .mc-date-range-pro__content {
32
+ width: 100%;
33
+ height: 100%;
34
+ }
35
+ .mc-date-range-pro__popup .ant-picker-panel-layout > div {
36
+ display: -webkit-box;
37
+ display: -ms-flexbox;
38
+ display: flex;
39
+ }
40
+ .mc-date-range-pro__popup .ant-picker-panel-layout > div .ant-picker-panels,
41
+ .mc-date-range-pro__popup .ant-picker-panel-layout > div .ant-picker-panel {
42
+ -webkit-box-ordinal-group: 2;
43
+ -ms-flex-order: 1;
44
+ order: 1;
45
+ }
46
+ .mc-date-range-pro__popup .ant-picker-panel-layout > div .ant-picker-footer {
47
+ -webkit-box-ordinal-group: 1;
48
+ -ms-flex-order: 0;
49
+ order: 0;
50
+ border-top: 0;
51
+ border-right: 1px solid rgba(5, 5, 5, 0.06);
52
+ }
53
+ .mc-date-range-pro__popup .ant-picker-panel-layout > div .ant-picker-footer .ant-picker-footer-extra {
54
+ height: 100%;
55
+ padding: 0;
56
+ line-height: normal;
57
+ }
58
+ .mc-date-range-pro__popup.mc-date-range-pro__popup--time .ant-picker-panel-container {
59
+ height: 366px;
60
+ }
61
+ .mc-date-range-pro__popup.mc-date-range-pro__popup--time .ant-picker-panel-container .ant-picker-ranges {
62
+ position: absolute;
63
+ right: 0;
64
+ bottom: 0;
65
+ width: 100%;
66
+ border-top: 1px solid rgba(5, 5, 5, 0.06);
67
+ border-left: 1px solid rgba(5, 5, 5, 0.06);
68
+ }
69
+ .mc-date-range-pro__popup.mc-date-range-pro__popup--time .ant-picker-panel-container .ant-picker-panel-layout > div .ant-picker-footer .ant-picker-footer-extra {
70
+ height: calc(100% + 43px);
71
+ border-bottom: 0;
72
+ }
73
+ .mc-date-range-pro__presets {
74
+ position: relative;
75
+ height: 100%;
76
+ }
77
+ .mc-date-range-pro__presets__types .ant-tabs-nav {
78
+ margin-bottom: 0;
79
+ padding: 0 8px;
80
+ }
81
+ .mc-date-range-pro__presets__types .ant-tabs-nav .ant-tabs-tab {
82
+ padding: 11px 16px 8px;
83
+ }
84
+ .mc-date-range-pro__presets__types .ant-tabs-nav .ant-tabs-tab + .ant-tabs-tab {
85
+ margin-left: 16px;
86
+ }
87
+ .mc-date-range-pro__presets__list {
88
+ position: absolute;
89
+ top: 41px;
90
+ right: 0;
91
+ bottom: 0;
92
+ left: 0;
93
+ padding: 8px;
94
+ overflow: auto;
95
+ }
96
+ .mc-date-range-pro__presets__item {
97
+ display: -webkit-box;
98
+ display: -ms-flexbox;
99
+ display: flex;
100
+ -ms-flex-wrap: wrap;
101
+ flex-wrap: wrap;
102
+ -webkit-box-align: center;
103
+ -ms-flex-align: center;
104
+ align-items: center;
105
+ padding: 4px 8px;
106
+ line-height: 24px;
107
+ border-radius: 4px;
108
+ }
109
+ .mc-date-range-pro__presets__item:hover {
110
+ cursor: pointer;
111
+ }
112
+ .mc-date-range-pro__presets__item.mc-date-range-pro__presets__item--active {
113
+ background: #eaeefe;
114
+ }
115
+ .mc-date-range-pro__presets__item__number-input {
116
+ position: relative;
117
+ margin: 0 4px;
118
+ }
119
+ .mc-date-range-pro__presets__item__number-input__place {
120
+ min-width: 24px;
121
+ height: 24px;
122
+ padding: 0 8px;
123
+ }
124
+ .mc-date-range-pro__presets__item__number-input .ant-input-number {
125
+ position: absolute;
126
+ top: 0;
127
+ right: 0;
128
+ bottom: 0;
129
+ left: 0;
130
+ width: auto;
131
+ background: #fff !important;
132
+ border-color: transparent !important;
133
+ -webkit-box-shadow: none !important;
134
+ box-shadow: none !important;
135
+ }
136
+ .mc-date-range-pro__presets__item__number-input .ant-input-number:hover,
137
+ .mc-date-range-pro__presets__item__number-input .ant-input-number:focus {
138
+ border-color: #325cf7 !important;
139
+ }
140
+ .mc-date-range-pro__presets__item__number-input .ant-input-number .ant-input-number-input-wrap .ant-input-number-input {
141
+ height: 22px;
142
+ padding: 0 7px;
143
+ -webkit-transition: none;
144
+ transition: none;
145
+ }
146
+ .mc-date-range-pro__presets__item__number-input .ant-input-number .ant-input-number-input-wrap .ant-input-number-input:not(:focus):empty {
147
+ padding: 0;
148
+ text-align: center;
149
+ }
150
+ .mc-date-range-pro__dynamic-value {
151
+ position: absolute;
152
+ top: 5px;
153
+ right: 30px;
154
+ bottom: 5px;
155
+ left: 12px;
156
+ display: -webkit-box;
157
+ display: -ms-flexbox;
158
+ display: flex;
159
+ -webkit-box-align: center;
160
+ -ms-flex-align: center;
161
+ align-items: center;
162
+ background: #f0f2f5;
163
+ }
@@ -0,0 +1,23 @@
1
+ import { RangePickerProps } from 'antd/es/date-picker';
2
+ import { FC, ReactNode } from 'react';
3
+ import './index.less';
4
+ export declare const getDynamicLabel: (dynamicValue?: string) => any;
5
+ export type McDateRangeProProps = Omit<RangePickerProps, 'value' | 'onChange' | 'open' | 'onOpenChange' | 'presets' | 'renderExtraFooter' | 'needConfirm'> & {
6
+ /** 查询项的字段名(配合McContainer组件的查询功能使用) */
7
+ name?: string;
8
+ /** 查询项的标签文字(若未设置,样式为表单项形态) */
9
+ label?: ReactNode;
10
+ /** 日期范围值的格式,默认 'YYYY-MM-DD'(showTime时,默认 'YYYY-MM-DD HH:mm:ss') */
11
+ valueFormat?: string;
12
+ /** 日期类型(设置该属性时显示左侧快捷栏):'past'过去(默认禁用未来日期,可设置maxDate={undefined}解除禁用) | 'future'未来(默认禁用过去日期,可设置minDate={undefined}解除禁用) */
13
+ dateType?: 'past' | 'future';
14
+ /** 是否支持动态日期(设置日期类型后有效),默认false */
15
+ dynamic?: boolean;
16
+ /** value为string[]类型表示静态日期,如['2025-01-16', '2025-01-18'];value为string类型表示动态日期,如'-4_0' */
17
+ value?: string | string[];
18
+ /** 当为静态日期时,返回的value为string[]类型,,如['2025-01-16', '2025-01-18'];当为动态日期时,返回的value为string类型,如'-4_0',且第二参数返回当前日期范围值,如['2025-01-14', '2025-01-18'] */
19
+ onChange?: (value?: string | string[], dateStrings?: string[]) => void;
20
+ ref?: any;
21
+ };
22
+ declare const McDateRangePro: FC<McDateRangeProProps>;
23
+ export default McDateRangePro;