@pisell/date-picker 1.0.87 → 1.0.89
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/es/ActionBar/index.less +1 -1
- package/es/OldActionBar/index.js +113 -0
- package/es/OldActionBar/index.less +18 -0
- package/es/OldPisellDateRangePicker/index.js +264 -0
- package/es/OldPisellDateRangePicker/index.less +102 -0
- package/es/index.js +2 -0
- package/lib/ActionBar/index.less +1 -1
- package/lib/OldActionBar/index.js +129 -0
- package/lib/OldActionBar/index.less +18 -0
- package/lib/OldPisellDateRangePicker/index.js +281 -0
- package/lib/OldPisellDateRangePicker/index.less +102 -0
- package/lib/index.js +3 -0
- package/package.json +2 -2
- package/es/ActionBar/index.d.ts +0 -18
- package/es/CustomCalendarHeader/index.d.ts +0 -2
- package/es/Dialog/index.d.ts +0 -2
- package/es/Drawer/index.d.ts +0 -11
- package/es/PisellDateRangePicker/LocaleContext.d.ts +0 -2
- package/es/PisellDateRangePicker/index.d.ts +0 -81
- package/es/Shortcuts/index.d.ts +0 -15
- package/es/Toolbar/index.d.ts +0 -3
- package/es/browserSelect/index.d.ts +0 -15
- package/es/constants.d.ts +0 -58
- package/es/hooks/useDocumentVisibility.d.ts +0 -2
- package/es/hooks/useNextDay.d.ts +0 -2
- package/es/hooks/useUpdateEffect.d.ts +0 -2
- package/es/icon/ChevronLeft.d.ts +0 -5
- package/es/icon/ChevronLeftDouble.d.ts +0 -5
- package/es/icon/ChevronRight.d.ts +0 -5
- package/es/icon/ChevronRightDouble.d.ts +0 -5
- package/es/icon/CloseCircle.d.ts +0 -5
- package/es/index.d.ts +0 -24
- package/es/locales/en-US.d.ts +0 -26
- package/es/locales/index.d.ts +0 -2
- package/es/locales/zh-CN.d.ts +0 -26
- package/es/locales/zh-TW.d.ts +0 -26
- package/es/utils/index.d.ts +0 -42
- package/lib/ActionBar/index.d.ts +0 -18
- package/lib/CustomCalendarHeader/index.d.ts +0 -2
- package/lib/Dialog/index.d.ts +0 -2
- package/lib/Drawer/index.d.ts +0 -11
- package/lib/PisellDateRangePicker/LocaleContext.d.ts +0 -2
- package/lib/PisellDateRangePicker/index.d.ts +0 -81
- package/lib/Shortcuts/index.d.ts +0 -15
- package/lib/Toolbar/index.d.ts +0 -3
- package/lib/browserSelect/index.d.ts +0 -15
- package/lib/constants.d.ts +0 -58
- package/lib/hooks/useDocumentVisibility.d.ts +0 -2
- package/lib/hooks/useNextDay.d.ts +0 -2
- package/lib/hooks/useUpdateEffect.d.ts +0 -2
- package/lib/icon/ChevronLeft.d.ts +0 -5
- package/lib/icon/ChevronLeftDouble.d.ts +0 -5
- package/lib/icon/ChevronRight.d.ts +0 -5
- package/lib/icon/ChevronRightDouble.d.ts +0 -5
- package/lib/icon/CloseCircle.d.ts +0 -5
- package/lib/index.d.ts +0 -24
- package/lib/locales/en-US.d.ts +0 -26
- package/lib/locales/index.d.ts +0 -2
- package/lib/locales/zh-CN.d.ts +0 -26
- package/lib/locales/zh-TW.d.ts +0 -26
- package/lib/utils/index.d.ts +0 -42
package/es/ActionBar/index.less
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
import React, { useMemo, useContext } from "react";
|
|
15
|
+
import classNames from "classnames";
|
|
16
|
+
import { Button, Space, TimePicker } from "antd";
|
|
17
|
+
import { MuiPickersAdapterContext } from "@mui/x-date-pickers";
|
|
18
|
+
import { isArr, isMobile } from "@pisell/utils";
|
|
19
|
+
import dayjs from "dayjs";
|
|
20
|
+
import { getText, pLocaleMap } from "../locales";
|
|
21
|
+
import "./index.less";
|
|
22
|
+
var ActionBar = function ActionBar(props) {
|
|
23
|
+
var ownerState = props.ownerState,
|
|
24
|
+
onCancel = props.onCancel,
|
|
25
|
+
onOk = props.onOk,
|
|
26
|
+
onChange = props.onChange,
|
|
27
|
+
showTime = props.showTime,
|
|
28
|
+
_props$value = props.value,
|
|
29
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
30
|
+
okButtonProps = props.okButtonProps,
|
|
31
|
+
cancelButtonProps = props.cancelButtonProps;
|
|
32
|
+
var local = useContext(MuiPickersAdapterContext);
|
|
33
|
+
var locale = useMemo(function () {
|
|
34
|
+
return local.utils.locale || "en";
|
|
35
|
+
}, [local.utils.locale]);
|
|
36
|
+
var slotProps = ownerState.slotProps;
|
|
37
|
+
var _ref = (slotProps === null || slotProps === void 0 ? void 0 : slotProps.shortcuts) || {},
|
|
38
|
+
items = _ref.items;
|
|
39
|
+
var hasShortcuts = !!items.length;
|
|
40
|
+
var handleStartChange = function handleStartChange(val) {
|
|
41
|
+
var _start$set, _start$set$set;
|
|
42
|
+
var newValue = _toConsumableArray(value);
|
|
43
|
+
var start = newValue[0] || dayjs();
|
|
44
|
+
newValue[0] = (start === null || start === void 0 ? void 0 : (_start$set = start.set("hour", (val === null || val === void 0 ? void 0 : val.get("hour")) || 0)) === null || _start$set === void 0 ? void 0 : (_start$set$set = _start$set.set("minute", (val === null || val === void 0 ? void 0 : val.get("minute")) || 0)) === null || _start$set$set === void 0 ? void 0 : _start$set$set.set("second", (val === null || val === void 0 ? void 0 : val.get("second")) || 0)) || null;
|
|
45
|
+
onChange(newValue, "time");
|
|
46
|
+
};
|
|
47
|
+
var handleEndChange = function handleEndChange(val) {
|
|
48
|
+
var _end$set, _end$set$set;
|
|
49
|
+
var newValue = _toConsumableArray(value);
|
|
50
|
+
var end = newValue[1] || dayjs();
|
|
51
|
+
newValue[1] = (end === null || end === void 0 ? void 0 : (_end$set = end.set("hour", (val === null || val === void 0 ? void 0 : val.get("hour")) || 0)) === null || _end$set === void 0 ? void 0 : (_end$set$set = _end$set.set("minute", (val === null || val === void 0 ? void 0 : val.get("minute")) || 0)) === null || _end$set$set === void 0 ? void 0 : _end$set$set.set("second", (val === null || val === void 0 ? void 0 : val.get("second")) || 0)) || null;
|
|
52
|
+
onChange(newValue, "time");
|
|
53
|
+
};
|
|
54
|
+
var spaceStyle = useMemo(function () {
|
|
55
|
+
return isMobile() ? {
|
|
56
|
+
display: "flex",
|
|
57
|
+
justifyContent: "end",
|
|
58
|
+
marginBottom: 12
|
|
59
|
+
} : {
|
|
60
|
+
display: "flex"
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
var startTimeProps = useMemo(function () {
|
|
64
|
+
if (isArr(showTime) && showTime[0]) {
|
|
65
|
+
return showTime[0];
|
|
66
|
+
}
|
|
67
|
+
return {};
|
|
68
|
+
}, [showTime]);
|
|
69
|
+
var endTimeProps = useMemo(function () {
|
|
70
|
+
if (isArr(showTime) && showTime[1]) {
|
|
71
|
+
return showTime[1];
|
|
72
|
+
}
|
|
73
|
+
return {};
|
|
74
|
+
}, [showTime]);
|
|
75
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: classNames(props.className, "date-picker-action-bar")
|
|
77
|
+
}, hasShortcuts && /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: "date-picker-action-bar-left"
|
|
79
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: "date-picker-action-bar-right",
|
|
81
|
+
style: isMobile() ? {
|
|
82
|
+
display: "block"
|
|
83
|
+
} : {}
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
85
|
+
split: "-",
|
|
86
|
+
style: _objectSpread({}, spaceStyle)
|
|
87
|
+
}, showTime ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TimePicker, _extends({
|
|
88
|
+
placeholder: getText("action-bar-start.time", pLocaleMap[locale])
|
|
89
|
+
}, startTimeProps, {
|
|
90
|
+
value: value[0],
|
|
91
|
+
popupClassName: "date-picker-action-bar-time-picker-popup",
|
|
92
|
+
onChange: handleStartChange,
|
|
93
|
+
inputReadOnly: true
|
|
94
|
+
})), /*#__PURE__*/React.createElement(TimePicker, _extends({
|
|
95
|
+
placeholder: getText("action-bar-end.time", pLocaleMap[locale])
|
|
96
|
+
}, endTimeProps, {
|
|
97
|
+
value: value[1],
|
|
98
|
+
popupClassName: "date-picker-action-bar-time-picker-popup",
|
|
99
|
+
onChange: handleEndChange,
|
|
100
|
+
inputReadOnly: true
|
|
101
|
+
}))) : /*#__PURE__*/React.createElement("div", null)), /*#__PURE__*/React.createElement(Space, {
|
|
102
|
+
style: _objectSpread(_objectSpread({}, spaceStyle), {}, {
|
|
103
|
+
margin: 0
|
|
104
|
+
})
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({}, cancelButtonProps || {}, {
|
|
106
|
+
onClick: onCancel
|
|
107
|
+
}), getText("action-bar-cancel", pLocaleMap[locale])), /*#__PURE__*/React.createElement(Button, _extends({
|
|
108
|
+
type: "primary"
|
|
109
|
+
}, okButtonProps || {}, {
|
|
110
|
+
onClick: onOk
|
|
111
|
+
}), getText("action-bar-apply", pLocaleMap[locale])))));
|
|
112
|
+
};
|
|
113
|
+
export default ActionBar;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.date-picker-action-bar {
|
|
2
|
+
display: flex;
|
|
3
|
+
.date-picker-action-bar-left {
|
|
4
|
+
width: 192px;
|
|
5
|
+
border-right: 1px solid rgba(0, 0, 0, 0.12);
|
|
6
|
+
}
|
|
7
|
+
.date-picker-action-bar-right {
|
|
8
|
+
flex: 1;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
padding: 16px;
|
|
12
|
+
border-top: 1px solid rgba(0, 0, 0, 0.12);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.date-picker-action-bar-time-picker-popup {
|
|
17
|
+
z-index: 1400;
|
|
18
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useState, useEffect, useMemo, useContext } from 'react';
|
|
14
|
+
import { DateRangePicker } from "../DateRangePicker";
|
|
15
|
+
import ActionBar from "../OldActionBar";
|
|
16
|
+
import Shortcuts from "../Shortcuts";
|
|
17
|
+
import { SingleInputDateRangeField } from "../SingleInputDateRangeField";
|
|
18
|
+
import classNames from 'classnames';
|
|
19
|
+
import { isArr, isBoolean } from '@pisell/utils';
|
|
20
|
+
import useCssVariables from "../PisellDateRangePicker/useCssVariables";
|
|
21
|
+
import CloseCircle from "../icon/CloseCircle";
|
|
22
|
+
import 'dayjs/locale/zh-cn';
|
|
23
|
+
import 'dayjs/locale/en';
|
|
24
|
+
import 'dayjs/locale/zh-tw';
|
|
25
|
+
import { getCurrentLocale, isMobile } from "../utils";
|
|
26
|
+
import { LocaleContext } from "../PisellDateRangePicker/LocaleContext";
|
|
27
|
+
import { pLocaleMap } from "../locales";
|
|
28
|
+
import "./index.less";
|
|
29
|
+
var transDayjsArr = function transDayjsArr(dayjsArr, defaultValue) {
|
|
30
|
+
var _newArr;
|
|
31
|
+
var newArr = dayjsArr || defaultValue || [null, null];
|
|
32
|
+
if ((dayjsArr === null || dayjsArr === void 0 ? void 0 : dayjsArr.length) === 0) {
|
|
33
|
+
newArr = defaultValue || [null, null];
|
|
34
|
+
}
|
|
35
|
+
return (_newArr = newArr) === null || _newArr === void 0 ? void 0 : _newArr.map(function (item) {
|
|
36
|
+
return item ? item : null;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
// api详情
|
|
40
|
+
// https://mui.com/x/api/date-pickers/date-range-picker/
|
|
41
|
+
var PisellDateRangePicker = function PisellDateRangePicker(props) {
|
|
42
|
+
var propsOnChange = props.onChange,
|
|
43
|
+
propsValue = props.value,
|
|
44
|
+
_props$presets = props.presets,
|
|
45
|
+
presets = _props$presets === void 0 ? [] : _props$presets,
|
|
46
|
+
className = props.className,
|
|
47
|
+
showTime = props.showTime,
|
|
48
|
+
placeholder = props.placeholder,
|
|
49
|
+
disabledDate = props.disabledDate,
|
|
50
|
+
propsFormat = props.format,
|
|
51
|
+
defaultValue = props.defaultValue,
|
|
52
|
+
suffixIcon = props.suffixIcon,
|
|
53
|
+
_props$bordered = props.bordered,
|
|
54
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
55
|
+
propsOpen = props.open,
|
|
56
|
+
onClose = props.onClose,
|
|
57
|
+
_props$popupWidth = props.popupWidth,
|
|
58
|
+
popupWidth = _props$popupWidth === void 0 ? 625 : _props$popupWidth,
|
|
59
|
+
clearEndOnSelection = props.clearEndOnSelection,
|
|
60
|
+
minDate = props.minDate,
|
|
61
|
+
maxDate = props.maxDate,
|
|
62
|
+
onOpen = props.onOpen,
|
|
63
|
+
onMonthChange = props.onMonthChange,
|
|
64
|
+
popupClassName = props.popupClassName,
|
|
65
|
+
defaultCalendarMonth = props.defaultCalendarMonth,
|
|
66
|
+
okButtonProps = props.okButtonProps,
|
|
67
|
+
cancelButtonProps = props.cancelButtonProps,
|
|
68
|
+
onDateChange = props.onDateChange,
|
|
69
|
+
desktopModeMediaQuery = props.desktopModeMediaQuery,
|
|
70
|
+
style = props.style,
|
|
71
|
+
allowClear = props.allowClear,
|
|
72
|
+
disablePortal = props.disablePortal,
|
|
73
|
+
_props$placement = props.placement,
|
|
74
|
+
placement = _props$placement === void 0 ? 'auto' : _props$placement,
|
|
75
|
+
inputReadOnly = props.inputReadOnly;
|
|
76
|
+
var _useState = useState(propsOpen !== null && propsOpen !== void 0 ? propsOpen : false),
|
|
77
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
78
|
+
open = _useState2[0],
|
|
79
|
+
setOpen = _useState2[1];
|
|
80
|
+
var _ref = useContext(LocaleContext) || {},
|
|
81
|
+
locale = _ref.locale;
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
isBoolean(propsOpen) && setOpen(propsOpen);
|
|
84
|
+
}, [propsOpen]);
|
|
85
|
+
var _useState3 = useState(function () {
|
|
86
|
+
return transDayjsArr(propsValue, defaultValue);
|
|
87
|
+
}),
|
|
88
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
89
|
+
_value = _useState4[0],
|
|
90
|
+
setValue = _useState4[1];
|
|
91
|
+
useEffect(function () {
|
|
92
|
+
setValue(transDayjsArr(propsValue, defaultValue));
|
|
93
|
+
}, [propsValue]);
|
|
94
|
+
var handleOpen = function handleOpen() {
|
|
95
|
+
setOpen(true);
|
|
96
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
97
|
+
};
|
|
98
|
+
var handleClose = function handleClose() {
|
|
99
|
+
setOpen(false);
|
|
100
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
101
|
+
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(transDayjsArr(propsValue, defaultValue));
|
|
102
|
+
setValue(transDayjsArr(propsValue, defaultValue));
|
|
103
|
+
};
|
|
104
|
+
var handleOk = function handleOk() {
|
|
105
|
+
setOpen(false);
|
|
106
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
107
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(_value);
|
|
108
|
+
};
|
|
109
|
+
var _presets = useMemo(function () {
|
|
110
|
+
if (isMobile()) return [];
|
|
111
|
+
return presets.map(function (item) {
|
|
112
|
+
var getValue = function getValue() {
|
|
113
|
+
if (typeof item.getValue === 'function') {
|
|
114
|
+
return item.getValue();
|
|
115
|
+
}
|
|
116
|
+
return item === null || item === void 0 ? void 0 : item.value;
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
label: item.label,
|
|
120
|
+
getValue: getValue
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
}, [presets]);
|
|
124
|
+
var handleChange = function handleChange(val, type) {
|
|
125
|
+
var newVal = val;
|
|
126
|
+
if (isArr(showTime) && type !== 'time') {
|
|
127
|
+
newVal = newVal.map(function (item, index) {
|
|
128
|
+
var _showTime$index;
|
|
129
|
+
if (showTime !== null && showTime !== void 0 && (_showTime$index = showTime[index]) !== null && _showTime$index !== void 0 && _showTime$index.defaultValue) {
|
|
130
|
+
var _showTime$index2, _showTime$index2$defa, _showTime$index3, _showTime$index3$defa, _showTime$index4, _showTime$index4$defa;
|
|
131
|
+
return (item === null || item === void 0 ? void 0 : item.set('hour', (_showTime$index2 = showTime[index]) === null || _showTime$index2 === void 0 ? void 0 : (_showTime$index2$defa = _showTime$index2.defaultValue) === null || _showTime$index2$defa === void 0 ? void 0 : _showTime$index2$defa.get('hour')).set('minute', (_showTime$index3 = showTime[index]) === null || _showTime$index3 === void 0 ? void 0 : (_showTime$index3$defa = _showTime$index3.defaultValue) === null || _showTime$index3$defa === void 0 ? void 0 : _showTime$index3$defa.get('minute')).set('second', (_showTime$index4 = showTime[index]) === null || _showTime$index4 === void 0 ? void 0 : (_showTime$index4$defa = _showTime$index4.defaultValue) === null || _showTime$index4$defa === void 0 ? void 0 : _showTime$index4$defa.get('second'))) || null;
|
|
132
|
+
}
|
|
133
|
+
return item || null;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (clearEndOnSelection && type !== 'set' && _value.filter(Boolean).length === 2) {
|
|
137
|
+
newVal = [newVal[0], null];
|
|
138
|
+
}
|
|
139
|
+
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(newVal);
|
|
140
|
+
setValue(newVal);
|
|
141
|
+
};
|
|
142
|
+
var hasPreset = (_presets === null || _presets === void 0 ? void 0 : _presets.length) > 0;
|
|
143
|
+
useCssVariables({
|
|
144
|
+
variables: {
|
|
145
|
+
'--pisell-date-range-picker-popup-width': "".concat(hasPreset ? popupWidth + 192 : popupWidth, "px")
|
|
146
|
+
},
|
|
147
|
+
dom: document.body
|
|
148
|
+
});
|
|
149
|
+
var handleClear = function handleClear(e) {
|
|
150
|
+
e.stopPropagation();
|
|
151
|
+
setValue([null, null]);
|
|
152
|
+
setOpen(false);
|
|
153
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
154
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange([null, null]);
|
|
155
|
+
};
|
|
156
|
+
var endAdornment = useMemo(function () {
|
|
157
|
+
if (!allowClear) {
|
|
158
|
+
return suffixIcon;
|
|
159
|
+
}
|
|
160
|
+
if (_value !== null && _value !== void 0 && _value.some(function (item) {
|
|
161
|
+
return !!item;
|
|
162
|
+
})) {
|
|
163
|
+
return /*#__PURE__*/React.createElement(CloseCircle, {
|
|
164
|
+
className: "pisell-date-range-picker-clear",
|
|
165
|
+
onClick: handleClear
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}, [suffixIcon, allowClear, _value]);
|
|
169
|
+
var readOnlyProps = useMemo(function () {
|
|
170
|
+
if (inputReadOnly) {
|
|
171
|
+
return {
|
|
172
|
+
readOnly: true,
|
|
173
|
+
selectedSections: null
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {};
|
|
177
|
+
}, [inputReadOnly]);
|
|
178
|
+
var format = useMemo(function () {
|
|
179
|
+
if (propsFormat) {
|
|
180
|
+
return propsFormat;
|
|
181
|
+
}
|
|
182
|
+
var localeValue = locale;
|
|
183
|
+
if (!localeValue) {
|
|
184
|
+
localeValue = pLocaleMap[getCurrentLocale()];
|
|
185
|
+
}
|
|
186
|
+
return localeValue === 'en' || localeValue === 'en-US' ? 'DD/MM/YYYY' : 'YYYY/MM/DD';
|
|
187
|
+
}, [propsFormat, locale]);
|
|
188
|
+
console.log(_presets, presets, '_presets');
|
|
189
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
190
|
+
className: classNames(className, 'pisell-date-range-picker', 'pisell-date-range-picker-old', {
|
|
191
|
+
'pisell-date-range-picker-no-border': !bordered
|
|
192
|
+
}),
|
|
193
|
+
style: style,
|
|
194
|
+
onClick: function onClick(e) {
|
|
195
|
+
return e.stopPropagation();
|
|
196
|
+
}
|
|
197
|
+
}, /*#__PURE__*/React.createElement(DateRangePicker
|
|
198
|
+
// defaultValue={defaultValue}
|
|
199
|
+
// key={`${_value?.[0]?.valueOf()}-${_value?.[1]?.valueOf()}`}
|
|
200
|
+
, {
|
|
201
|
+
desktopModeMediaQuery: desktopModeMediaQuery,
|
|
202
|
+
onMonthChange: onMonthChange,
|
|
203
|
+
minDate: minDate,
|
|
204
|
+
maxDate: maxDate,
|
|
205
|
+
format: format,
|
|
206
|
+
label: placeholder,
|
|
207
|
+
value: _value,
|
|
208
|
+
closeOnSelect: false,
|
|
209
|
+
onClose: handleClose,
|
|
210
|
+
onChange: handleChange,
|
|
211
|
+
onOpen: handleOpen,
|
|
212
|
+
open: open,
|
|
213
|
+
defaultCalendarMonth: defaultCalendarMonth,
|
|
214
|
+
shouldDisableDate: function shouldDisableDate(current, position) {
|
|
215
|
+
return disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(current, position, _value);
|
|
216
|
+
},
|
|
217
|
+
slots: {
|
|
218
|
+
actionBar: ActionBar,
|
|
219
|
+
shortcuts: Shortcuts,
|
|
220
|
+
field: SingleInputDateRangeField
|
|
221
|
+
},
|
|
222
|
+
dayOfWeekFormatter: function dayOfWeekFormatter(day) {
|
|
223
|
+
return day;
|
|
224
|
+
},
|
|
225
|
+
slotProps: {
|
|
226
|
+
shortcuts: {
|
|
227
|
+
items: _presets,
|
|
228
|
+
changeImportance: 'set',
|
|
229
|
+
onChange: handleChange
|
|
230
|
+
},
|
|
231
|
+
actionBar: {
|
|
232
|
+
onOk: handleOk,
|
|
233
|
+
onCancel: handleClose,
|
|
234
|
+
showTime: showTime,
|
|
235
|
+
onChange: handleChange,
|
|
236
|
+
value: _value,
|
|
237
|
+
okButtonProps: okButtonProps,
|
|
238
|
+
cancelButtonProps: cancelButtonProps
|
|
239
|
+
},
|
|
240
|
+
field: _objectSpread({
|
|
241
|
+
value: _value,
|
|
242
|
+
size: 'small',
|
|
243
|
+
fullWidth: true,
|
|
244
|
+
// variant: "standard",
|
|
245
|
+
// hiddenLabel: true,
|
|
246
|
+
InputProps: {
|
|
247
|
+
endAdornment: endAdornment
|
|
248
|
+
}
|
|
249
|
+
}, readOnlyProps),
|
|
250
|
+
popper: {
|
|
251
|
+
className: classNames(popupClassName, "pisell-date-range-picker-popper-old"),
|
|
252
|
+
disablePortal: disablePortal,
|
|
253
|
+
placement: placement
|
|
254
|
+
},
|
|
255
|
+
dialog: {
|
|
256
|
+
disablePortal: disablePortal
|
|
257
|
+
},
|
|
258
|
+
mobilePaper: {
|
|
259
|
+
className: popupClassName
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}));
|
|
263
|
+
};
|
|
264
|
+
export default PisellDateRangePicker;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.pisell-date-range-picker {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
//width: 350px;
|
|
5
|
+
//.MuiInputBase-input {
|
|
6
|
+
// padding: 10px;
|
|
7
|
+
//}
|
|
8
|
+
label {
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
}
|
|
11
|
+
.pisell-date-range-picker-clear {
|
|
12
|
+
color: rgba(0, 0, 0, 0.25);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
display: none;
|
|
15
|
+
line-height: 0;
|
|
16
|
+
:hover {
|
|
17
|
+
color: rgba(0, 0, 0, 0.45);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
:hover {
|
|
21
|
+
.pisell-date-range-picker-clear {
|
|
22
|
+
display: block;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.pisell-date-range-picker-no-border {
|
|
27
|
+
.MuiOutlinedInput-notchedOutline {
|
|
28
|
+
border: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.MuiOutlinedInput-notchedOutline {
|
|
32
|
+
legend {
|
|
33
|
+
color: inherit !important;
|
|
34
|
+
width: auto !important;
|
|
35
|
+
margin-bottom: 0.5em !important;
|
|
36
|
+
font-size: 1.5em !important;
|
|
37
|
+
line-height: 11px !important;
|
|
38
|
+
border: none !important;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.MuiPickersPopper-root {
|
|
43
|
+
.MuiPickersLayout-root {
|
|
44
|
+
width: var(--pisell-date-range-picker-popup-width, 625px);
|
|
45
|
+
.MuiDateRangeCalendar-root {
|
|
46
|
+
width: 100%;
|
|
47
|
+
flex: 1;
|
|
48
|
+
.MuiDateRangeCalendar-monthContainer {
|
|
49
|
+
width: 50%;
|
|
50
|
+
.MuiDayCalendar-header {
|
|
51
|
+
padding: 0 20px;
|
|
52
|
+
.MuiDayCalendar-weekDayLabel {
|
|
53
|
+
flex: 1;
|
|
54
|
+
width: 100%;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
.MuiPickersSlideTransition-root {
|
|
58
|
+
min-width: 200px;
|
|
59
|
+
//min-height: auto;
|
|
60
|
+
&::before {
|
|
61
|
+
content: "";
|
|
62
|
+
display: block;
|
|
63
|
+
padding-top: 67%;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
.MuiDayCalendar-monthContainer {
|
|
67
|
+
padding: 0 20px;
|
|
68
|
+
}
|
|
69
|
+
.MuiDayCalendar-weekContainer {
|
|
70
|
+
.MuiDateRangePickerDay-root {
|
|
71
|
+
flex: 1;
|
|
72
|
+
.MuiDateRangePickerDay-day {
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: auto;
|
|
75
|
+
&::before {
|
|
76
|
+
content: "";
|
|
77
|
+
display: block;
|
|
78
|
+
padding-top: 100%;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.MuiDialog-root {
|
|
89
|
+
.MuiPickersLayout-toolbar {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.MuiPickersLayout-shortcuts {
|
|
95
|
+
grid-column: 1 !important;
|
|
96
|
+
grid-row: 1/3 !important;
|
|
97
|
+
}
|
|
98
|
+
.pisell-date-range-picker-popper-old {
|
|
99
|
+
.MuiPickersLayout-root {
|
|
100
|
+
display: grid !important;
|
|
101
|
+
}
|
|
102
|
+
}
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConfigProvider } from 'antd';
|
|
2
2
|
import PisellDateRangePicker from "./PisellDateRangePicker";
|
|
3
|
+
import OldPisellDateRangePicker from "./OldPisellDateRangePicker";
|
|
3
4
|
import { LocaleContext, LocaleProvider } from "./PisellDateRangePicker/LocaleContext";
|
|
4
5
|
export * from "@mui/x-date-pickers";
|
|
5
6
|
export * from "@mui/material/styles";
|
|
@@ -24,6 +25,7 @@ export * from "./StaticDateRangePicker";
|
|
|
24
25
|
// View renderers
|
|
25
26
|
export * from "./dateRangeViewRenderers";
|
|
26
27
|
export { PisellDateRangePicker as RangePicker };
|
|
28
|
+
export { OldPisellDateRangePicker };
|
|
27
29
|
export { LocaleContext, LocaleProvider, ConfigProvider };
|
|
28
30
|
export { getDatePickerValueByShortcut, formatPresets, getShortcutValue, getPresetLabel, getDatePickerValue } from "./utils/index";
|
|
29
31
|
export * from "./models";
|
package/lib/ActionBar/index.less
CHANGED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/OldActionBar/index.tsx
|
|
30
|
+
var OldActionBar_exports = {};
|
|
31
|
+
__export(OldActionBar_exports, {
|
|
32
|
+
default: () => OldActionBar_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(OldActionBar_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_x_date_pickers = require("@mui/x-date-pickers");
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
41
|
+
var import_locales = require("../locales");
|
|
42
|
+
var import_index = require("./index.less");
|
|
43
|
+
var ActionBar = (props) => {
|
|
44
|
+
const {
|
|
45
|
+
ownerState,
|
|
46
|
+
onCancel,
|
|
47
|
+
onOk,
|
|
48
|
+
onChange,
|
|
49
|
+
showTime,
|
|
50
|
+
value = [],
|
|
51
|
+
okButtonProps,
|
|
52
|
+
cancelButtonProps
|
|
53
|
+
} = props;
|
|
54
|
+
const local = (0, import_react.useContext)(import_x_date_pickers.MuiPickersAdapterContext);
|
|
55
|
+
const locale = (0, import_react.useMemo)(() => {
|
|
56
|
+
return local.utils.locale || "en";
|
|
57
|
+
}, [local.utils.locale]);
|
|
58
|
+
const { slotProps } = ownerState;
|
|
59
|
+
const { items } = (slotProps == null ? void 0 : slotProps.shortcuts) || {};
|
|
60
|
+
const hasShortcuts = !!items.length;
|
|
61
|
+
const handleStartChange = (val) => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
const newValue = [...value];
|
|
64
|
+
const start = newValue[0] || (0, import_dayjs.default)();
|
|
65
|
+
newValue[0] = ((_b = (_a = start == null ? void 0 : start.set("hour", (val == null ? void 0 : val.get("hour")) || 0)) == null ? void 0 : _a.set("minute", (val == null ? void 0 : val.get("minute")) || 0)) == null ? void 0 : _b.set("second", (val == null ? void 0 : val.get("second")) || 0)) || null;
|
|
66
|
+
onChange(newValue, "time");
|
|
67
|
+
};
|
|
68
|
+
const handleEndChange = (val) => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
const newValue = [...value];
|
|
71
|
+
const end = newValue[1] || (0, import_dayjs.default)();
|
|
72
|
+
newValue[1] = ((_b = (_a = end == null ? void 0 : end.set("hour", (val == null ? void 0 : val.get("hour")) || 0)) == null ? void 0 : _a.set("minute", (val == null ? void 0 : val.get("minute")) || 0)) == null ? void 0 : _b.set("second", (val == null ? void 0 : val.get("second")) || 0)) || null;
|
|
73
|
+
onChange(newValue, "time");
|
|
74
|
+
};
|
|
75
|
+
const spaceStyle = (0, import_react.useMemo)(() => {
|
|
76
|
+
return (0, import_utils.isMobile)() ? {
|
|
77
|
+
display: "flex",
|
|
78
|
+
justifyContent: "end",
|
|
79
|
+
marginBottom: 12
|
|
80
|
+
} : {
|
|
81
|
+
display: "flex"
|
|
82
|
+
};
|
|
83
|
+
}, []);
|
|
84
|
+
const startTimeProps = (0, import_react.useMemo)(() => {
|
|
85
|
+
if ((0, import_utils.isArr)(showTime) && showTime[0]) {
|
|
86
|
+
return showTime[0];
|
|
87
|
+
}
|
|
88
|
+
return {};
|
|
89
|
+
}, [showTime]);
|
|
90
|
+
const endTimeProps = (0, import_react.useMemo)(() => {
|
|
91
|
+
if ((0, import_utils.isArr)(showTime) && showTime[1]) {
|
|
92
|
+
return showTime[1];
|
|
93
|
+
}
|
|
94
|
+
return {};
|
|
95
|
+
}, [showTime]);
|
|
96
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(props.className, "date-picker-action-bar") }, hasShortcuts && /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-action-bar-left" }), /* @__PURE__ */ import_react.default.createElement(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: "date-picker-action-bar-right",
|
|
100
|
+
style: (0, import_utils.isMobile)() ? { display: "block" } : {}
|
|
101
|
+
},
|
|
102
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { split: "-", style: { ...spaceStyle } }, showTime ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
103
|
+
import_antd.TimePicker,
|
|
104
|
+
{
|
|
105
|
+
placeholder: (0, import_locales.getText)(
|
|
106
|
+
"action-bar-start.time",
|
|
107
|
+
import_locales.pLocaleMap[locale]
|
|
108
|
+
),
|
|
109
|
+
...startTimeProps,
|
|
110
|
+
value: value[0],
|
|
111
|
+
popupClassName: "date-picker-action-bar-time-picker-popup",
|
|
112
|
+
onChange: handleStartChange,
|
|
113
|
+
inputReadOnly: true
|
|
114
|
+
}
|
|
115
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
116
|
+
import_antd.TimePicker,
|
|
117
|
+
{
|
|
118
|
+
placeholder: (0, import_locales.getText)("action-bar-end.time", import_locales.pLocaleMap[locale]),
|
|
119
|
+
...endTimeProps,
|
|
120
|
+
value: value[1],
|
|
121
|
+
popupClassName: "date-picker-action-bar-time-picker-popup",
|
|
122
|
+
onChange: handleEndChange,
|
|
123
|
+
inputReadOnly: true
|
|
124
|
+
}
|
|
125
|
+
)) : /* @__PURE__ */ import_react.default.createElement("div", null)),
|
|
126
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { style: { ...spaceStyle, margin: 0 } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...cancelButtonProps || {}, onClick: onCancel }, (0, import_locales.getText)("action-bar-cancel", import_locales.pLocaleMap[locale])), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", ...okButtonProps || {}, onClick: onOk }, (0, import_locales.getText)("action-bar-apply", import_locales.pLocaleMap[locale])))
|
|
127
|
+
));
|
|
128
|
+
};
|
|
129
|
+
var OldActionBar_default = ActionBar;
|