@pisell/date-picker 1.0.63 → 1.0.65

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.
@@ -41,14 +41,14 @@ var ActionBar = function ActionBar(props) {
41
41
  var _start$set, _start$set$set;
42
42
  var newValue = _toConsumableArray(value);
43
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"))) === null || _start$set === void 0 ? void 0 : (_start$set$set = _start$set.set("minute", val === null || val === void 0 ? void 0 : val.get("minute"))) === null || _start$set$set === void 0 ? void 0 : _start$set$set.set("second", val === null || val === void 0 ? void 0 : val.get("second"))) || null;
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
45
  onChange(newValue, "time");
46
46
  };
47
47
  var handleEndChange = function handleEndChange(val) {
48
48
  var _end$set, _end$set$set;
49
49
  var newValue = _toConsumableArray(value);
50
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"))) === null || _end$set === void 0 ? void 0 : (_end$set$set = _end$set.set("minute", val === null || val === void 0 ? void 0 : val.get("minute"))) === null || _end$set$set === void 0 ? void 0 : _end$set$set.set("second", val === null || val === void 0 ? void 0 : val.get("second"))) || null;
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
52
  onChange(newValue, "time");
53
53
  };
54
54
  var spaceStyle = useMemo(function () {
@@ -2,6 +2,9 @@ import { Dayjs } from "dayjs";
2
2
  import React from "react";
3
3
  import { ButtonProps } from "antd";
4
4
  import { PresetType } from "../Shortcuts";
5
+ import 'dayjs/locale/zh-cn';
6
+ import 'dayjs/locale/en';
7
+ import 'dayjs/locale/zh-tw';
5
8
  import "./index.less";
6
9
  export interface PisellDateRangePickerProps {
7
10
  /** 再次选择日期时是否清除结束时间 */
@@ -64,6 +67,8 @@ export interface PisellDateRangePickerProps {
64
67
  style?: React.CSSProperties;
65
68
  /** 是否展示清除按钮 */
66
69
  allowClear?: boolean;
70
+ /** true 将弹窗当前DOM层次结构下 false 追加到body */
71
+ disablePortal?: boolean;
67
72
  }
68
73
  declare const PisellDateRangePicker: (props: PisellDateRangePickerProps) => JSX.Element;
69
74
  export default PisellDateRangePicker;
@@ -13,6 +13,9 @@ import classNames from "classnames";
13
13
  import { isArr, isBoolean } from "@pisell/utils";
14
14
  import useCssVariables from "./useCssVariables";
15
15
  import CloseCircle from "./CloseCircle";
16
+ import 'dayjs/locale/zh-cn';
17
+ import 'dayjs/locale/en';
18
+ import 'dayjs/locale/zh-tw';
16
19
  import "./index.less";
17
20
  var transDayjsArr = function transDayjsArr(dayjsArr, defaultValue) {
18
21
  var _newArr;
@@ -56,7 +59,8 @@ var PisellDateRangePicker = function PisellDateRangePicker(props) {
56
59
  onDateChange = props.onDateChange,
57
60
  desktopModeMediaQuery = props.desktopModeMediaQuery,
58
61
  style = props.style,
59
- allowClear = props.allowClear;
62
+ allowClear = props.allowClear,
63
+ disablePortal = props.disablePortal;
60
64
  var _useState = useState(propsOpen !== null && propsOpen !== void 0 ? propsOpen : false),
61
65
  _useState2 = _slicedToArray(_useState, 2),
62
66
  open = _useState2[0],
@@ -206,7 +210,8 @@ var PisellDateRangePicker = function PisellDateRangePicker(props) {
206
210
  }
207
211
  },
208
212
  popper: {
209
- className: popupClassName
213
+ className: popupClassName,
214
+ disablePortal: disablePortal
210
215
  },
211
216
  mobilePaper: {
212
217
  className: popupClassName
@@ -62,14 +62,14 @@ var ActionBar = (props) => {
62
62
  var _a, _b;
63
63
  const newValue = [...value];
64
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"))) == null ? void 0 : _a.set("minute", val == null ? void 0 : val.get("minute"))) == null ? void 0 : _b.set("second", val == null ? void 0 : val.get("second"))) || null;
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
66
  onChange(newValue, "time");
67
67
  };
68
68
  const handleEndChange = (val) => {
69
69
  var _a, _b;
70
70
  const newValue = [...value];
71
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"))) == null ? void 0 : _a.set("minute", val == null ? void 0 : val.get("minute"))) == null ? void 0 : _b.set("second", val == null ? void 0 : val.get("second"))) || null;
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
73
  onChange(newValue, "time");
74
74
  };
75
75
  const spaceStyle = (0, import_react.useMemo)(() => {
@@ -2,6 +2,9 @@ import { Dayjs } from "dayjs";
2
2
  import React from "react";
3
3
  import { ButtonProps } from "antd";
4
4
  import { PresetType } from "../Shortcuts";
5
+ import 'dayjs/locale/zh-cn';
6
+ import 'dayjs/locale/en';
7
+ import 'dayjs/locale/zh-tw';
5
8
  import "./index.less";
6
9
  export interface PisellDateRangePickerProps {
7
10
  /** 再次选择日期时是否清除结束时间 */
@@ -64,6 +67,8 @@ export interface PisellDateRangePickerProps {
64
67
  style?: React.CSSProperties;
65
68
  /** 是否展示清除按钮 */
66
69
  allowClear?: boolean;
70
+ /** true 将弹窗当前DOM层次结构下 false 追加到body */
71
+ disablePortal?: boolean;
67
72
  }
68
73
  declare const PisellDateRangePicker: (props: PisellDateRangePickerProps) => JSX.Element;
69
74
  export default PisellDateRangePicker;
@@ -41,6 +41,9 @@ var import_classnames = __toESM(require("classnames"));
41
41
  var import_utils = require("@pisell/utils");
42
42
  var import_useCssVariables = __toESM(require("./useCssVariables"));
43
43
  var import_CloseCircle = __toESM(require("./CloseCircle"));
44
+ var import_zh_cn = require("dayjs/locale/zh-cn");
45
+ var import_en = require("dayjs/locale/en");
46
+ var import_zh_tw = require("dayjs/locale/zh-tw");
44
47
  var import_index = require("./index.less");
45
48
  var transDayjsArr = (dayjsArr, defaultValue) => {
46
49
  let newArr = dayjsArr || defaultValue;
@@ -79,7 +82,8 @@ var PisellDateRangePicker = (props) => {
79
82
  onDateChange,
80
83
  desktopModeMediaQuery,
81
84
  style,
82
- allowClear
85
+ allowClear,
86
+ disablePortal
83
87
  } = props;
84
88
  const [open, setOpen] = (0, import_react.useState)(propsOpen ?? false);
85
89
  (0, import_react.useEffect)(() => {
@@ -224,7 +228,8 @@ var PisellDateRangePicker = (props) => {
224
228
  }
225
229
  },
226
230
  popper: {
227
- className: popupClassName
231
+ className: popupClassName,
232
+ disablePortal
228
233
  },
229
234
  mobilePaper: {
230
235
  className: popupClassName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/date-picker",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "sideEffects": [
5
5
  "*.less"
6
6
  ],