@pisell/date-picker 1.0.75 → 1.0.76

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.
Files changed (75) hide show
  1. package/es/ActionBar/index.js +19 -28
  2. package/es/ActionBar/index.less +2 -1
  3. package/es/CustomCalendarHeader/index.js +53 -0
  4. package/es/Dialog/index.js +22 -0
  5. package/es/Drawer/index.js +35 -0
  6. package/es/Drawer/index.less +40 -0
  7. package/es/PisellDateRangePicker/LocaleContext.d.ts +2 -0
  8. package/es/PisellDateRangePicker/index.js +109 -39
  9. package/es/PisellDateRangePicker/index.less +56 -0
  10. package/es/Toolbar/index.js +122 -0
  11. package/es/Toolbar/index.less +32 -0
  12. package/es/browserSelect/chevron-down.png +0 -0
  13. package/es/browserSelect/index.js +36 -0
  14. package/es/browserSelect/index.less +18 -0
  15. package/es/constants.js +109 -0
  16. package/es/hooks/useDocumentVisibility.js +27 -0
  17. package/es/hooks/useNextDay.js +15 -0
  18. package/es/hooks/useUpdateEffect.js +11 -0
  19. package/es/icon/ChevronLeft.js +23 -0
  20. package/es/icon/ChevronLeftDouble.js +23 -0
  21. package/es/icon/ChevronRight.js +23 -0
  22. package/es/icon/ChevronRightDouble.js +23 -0
  23. package/es/index.js +1 -0
  24. package/es/internals/utils/date-fields-utils.d.ts +1 -1
  25. package/es/locales/en-US.js +18 -1
  26. package/es/locales/index.d.ts +2 -0
  27. package/es/locales/zh-CN.js +21 -4
  28. package/es/locales/zh-TW.js +18 -1
  29. package/es/utils/index.js +86 -3
  30. package/lib/ActionBar/index.js +30 -25
  31. package/lib/ActionBar/index.less +2 -1
  32. package/lib/CustomCalendarHeader/index.js +58 -0
  33. package/lib/Dialog/index.js +52 -0
  34. package/lib/Drawer/index.js +62 -0
  35. package/lib/Drawer/index.less +40 -0
  36. package/lib/PisellDateRangePicker/LocaleContext.d.ts +2 -0
  37. package/lib/PisellDateRangePicker/index.js +86 -32
  38. package/lib/PisellDateRangePicker/index.less +56 -0
  39. package/lib/Toolbar/index.js +139 -0
  40. package/lib/Toolbar/index.less +32 -0
  41. package/lib/browserSelect/chevron-down.png +0 -0
  42. package/lib/browserSelect/index.js +59 -0
  43. package/lib/browserSelect/index.less +18 -0
  44. package/lib/constants.js +147 -0
  45. package/lib/hooks/useDocumentVisibility.js +40 -0
  46. package/lib/hooks/useNextDay.js +49 -0
  47. package/lib/hooks/useUpdateEffect.js +35 -0
  48. package/lib/icon/ChevronLeft.js +60 -0
  49. package/lib/icon/ChevronLeftDouble.js +60 -0
  50. package/lib/icon/ChevronRight.js +60 -0
  51. package/lib/icon/ChevronRightDouble.js +60 -0
  52. package/lib/{PisellDateRangePicker → icon}/CloseCircle.js +1 -1
  53. package/lib/index.js +10 -1
  54. package/lib/internals/utils/date-fields-utils.d.ts +1 -1
  55. package/lib/locales/en-US.js +18 -1
  56. package/lib/locales/index.d.ts +2 -0
  57. package/lib/locales/zh-CN.js +18 -1
  58. package/lib/locales/zh-TW.js +18 -1
  59. package/lib/utils/index.js +58 -0
  60. package/package.json +1 -1
  61. package/es/ActionBar/index.d.ts +0 -18
  62. package/es/PisellDateRangePicker/CloseCircle.d.ts +0 -5
  63. package/es/Shortcuts/index.d.ts +0 -14
  64. package/es/locales/en-US.d.ts +0 -7
  65. package/es/locales/zh-CN.d.ts +0 -7
  66. package/es/locales/zh-TW.d.ts +0 -7
  67. package/es/utils/index.d.ts +0 -3
  68. package/lib/ActionBar/index.d.ts +0 -18
  69. package/lib/PisellDateRangePicker/CloseCircle.d.ts +0 -5
  70. package/lib/Shortcuts/index.d.ts +0 -14
  71. package/lib/locales/en-US.d.ts +0 -7
  72. package/lib/locales/zh-CN.d.ts +0 -7
  73. package/lib/locales/zh-TW.d.ts +0 -7
  74. package/lib/utils/index.d.ts +0 -3
  75. /package/es/{PisellDateRangePicker → icon}/CloseCircle.js +0 -0
@@ -5,6 +5,7 @@
5
5
  //.MuiInputBase-input {
6
6
  // padding: 10px;
7
7
  //}
8
+
8
9
  label {
9
10
  font-size: 14px;
10
11
  }
@@ -42,11 +43,13 @@
42
43
  .MuiPickersPopper-root {
43
44
  .MuiPickersLayout-root {
44
45
  width: var(--pisell-date-range-picker-popup-width, 625px);
46
+ display: block;
45
47
  .MuiDateRangeCalendar-root {
46
48
  width: 100%;
47
49
  flex: 1;
48
50
  .MuiDateRangeCalendar-monthContainer {
49
51
  width: 50%;
52
+ border: none;
50
53
  .MuiDayCalendar-header {
51
54
  padding: 0 20px;
52
55
  .MuiDayCalendar-weekDayLabel {
@@ -95,3 +98,56 @@
95
98
  grid-column: 1 !important;
96
99
  grid-row: 1/3 !important;
97
100
  }
101
+
102
+ .date-picker-paid-drawer {
103
+ .MuiPickersLayout-root {
104
+ display: block;
105
+ }
106
+ }
107
+
108
+ .date-picker-custom-drawer {
109
+ .MuiPickersCalendarHeader-root {
110
+ padding-left: 35px;
111
+ padding-right: 22px;
112
+ }
113
+ .MuiPickersLayout-root {
114
+ display: block;
115
+ }
116
+ .MuiPickersLayout-toolbar {
117
+ display: none;
118
+ }
119
+ .MuiDayCalendar-header {
120
+ padding: 0 20px;
121
+ .MuiDayCalendar-weekDayLabel {
122
+ flex: 1;
123
+ max-width: 46px;
124
+ }
125
+ }
126
+ .MuiDayCalendar-slideTransition {
127
+ height: 315px;
128
+ .MuiDayCalendar-monthContainer {
129
+ padding: 0 20px;
130
+ }
131
+ }
132
+ .MuiDateRangeCalendar-monthContainer {
133
+ width: 100%;
134
+ .MuiDateRangePickerDay-root {
135
+ flex: 1;
136
+ max-width: 50px;
137
+ max-height: 50px;
138
+ .MuiDateRangePickerDay-day {
139
+ width: 100%;
140
+ height: auto;
141
+ &::before {
142
+ content: "";
143
+ display: block;
144
+ padding-top: 100%;
145
+ }
146
+ }
147
+ }
148
+ }
149
+ .MuiDrawer-paperAnchorBottom {
150
+ border-top-left-radius: 8px;
151
+ border-top-right-radius: 8px;
152
+ }
153
+ }
@@ -0,0 +1,139 @@
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/Toolbar/index.tsx
30
+ var Toolbar_exports = {};
31
+ __export(Toolbar_exports, {
32
+ default: () => Toolbar_default
33
+ });
34
+ module.exports = __toCommonJS(Toolbar_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_dayjs = __toESM(require("dayjs"));
38
+ var import_browserSelect = __toESM(require("../browserSelect"));
39
+ var import_locales = require("../locales");
40
+ var import_index = require("./index.less");
41
+ var isValidDate = (dateString, format) => {
42
+ const date = (0, import_dayjs.default)(dateString, format, true);
43
+ return date.isValid();
44
+ };
45
+ var Toolbar = (props) => {
46
+ const {
47
+ presetItems,
48
+ value = [],
49
+ locale,
50
+ onChange,
51
+ currentShortcut,
52
+ setCurrentShortcut
53
+ } = props;
54
+ const format = locale === "en" || locale === "en-US" ? "DD/MM/YYYY" : "YYYY/MM/DD";
55
+ const [startStr, setStartStr] = (0, import_react.useState)("");
56
+ const [endStr, setEndStr] = (0, import_react.useState)("");
57
+ (0, import_react.useEffect)(() => {
58
+ if (value == null ? void 0 : value[0]) {
59
+ setStartStr(value[0].format(format));
60
+ } else {
61
+ setStartStr("");
62
+ }
63
+ if (value == null ? void 0 : value[1]) {
64
+ setEndStr(value[1].format(format));
65
+ } else {
66
+ setEndStr("");
67
+ }
68
+ }, [value]);
69
+ const handleStartChange = (e) => {
70
+ var _a, _b;
71
+ const val = e.target.value;
72
+ setStartStr(val);
73
+ if (isValidDate(val, format)) {
74
+ const valDate = (0, import_dayjs.default)(val, format);
75
+ const newValue = [...value];
76
+ const start = newValue[0] || (0, import_dayjs.default)();
77
+ newValue[0] = ((_b = (_a = start == null ? void 0 : start.set("year", (valDate == null ? void 0 : valDate.get("year")) || 0)) == null ? void 0 : _a.set("month", (valDate == null ? void 0 : valDate.get("month")) || 0)) == null ? void 0 : _b.set("date", (valDate == null ? void 0 : valDate.get("date")) || 0)) || null;
78
+ onChange(newValue);
79
+ }
80
+ };
81
+ const handleEndChange = (e) => {
82
+ var _a, _b;
83
+ const val = e.target.value;
84
+ setEndStr(val);
85
+ if (isValidDate(val, format)) {
86
+ const valDate = (0, import_dayjs.default)(val, format);
87
+ const newValue = [...value];
88
+ const end = newValue[1] || (0, import_dayjs.default)();
89
+ newValue[1] = ((_b = (_a = end == null ? void 0 : end.set("year", (valDate == null ? void 0 : valDate.get("year")) || 0)) == null ? void 0 : _a.set("month", (valDate == null ? void 0 : valDate.get("month")) || 0)) == null ? void 0 : _b.set("date", (valDate == null ? void 0 : valDate.get("date")) || 0)) || null;
90
+ onChange(newValue);
91
+ }
92
+ };
93
+ const handleSelectChange = (e) => {
94
+ const val = e.target.value;
95
+ const detail = presetItems.find((item) => item.value === val || item.label === val);
96
+ if (!detail)
97
+ return;
98
+ const dateVal = detail.getValue();
99
+ onChange(dateVal, "shortcuts", val);
100
+ };
101
+ const customPresetItems = (0, import_react.useMemo)(() => {
102
+ if (!currentShortcut) {
103
+ return presetItems.concat([
104
+ {
105
+ label: (0, import_locales.getText)("toolbar-date-range-shortcut-custom"),
106
+ value: (0, import_locales.getText)("toolbar-date-range-shortcut-custom")
107
+ }
108
+ ]);
109
+ }
110
+ return presetItems;
111
+ }, [presetItems]);
112
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-content-top" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("toolbar-date-range-shortcut-date-range")), /* @__PURE__ */ import_react.default.createElement(
113
+ import_browserSelect.default,
114
+ {
115
+ value: currentShortcut || (0, import_locales.getText)("toolbar-date-range-shortcut-custom"),
116
+ className: "date-picker-toolbar-select",
117
+ options: customPresetItems,
118
+ size: "large",
119
+ onChange: handleSelectChange
120
+ }
121
+ )), /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-content-bottom" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar-start-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("toolbar-date-range-shortcut-starting")), /* @__PURE__ */ import_react.default.createElement(
122
+ import_antd.Input,
123
+ {
124
+ size: "large",
125
+ value: startStr,
126
+ onChange: handleStartChange,
127
+ placeholder: (0, import_dayjs.default)().format(format)
128
+ }
129
+ )), /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar-end-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("toolbar-date-range-shortcut-ending")), /* @__PURE__ */ import_react.default.createElement(
130
+ import_antd.Input,
131
+ {
132
+ size: "large",
133
+ value: endStr,
134
+ onChange: handleEndChange,
135
+ placeholder: (0, import_dayjs.default)().format(format)
136
+ }
137
+ ))));
138
+ };
139
+ var Toolbar_default = Toolbar;
@@ -0,0 +1,32 @@
1
+ .date-picker-toolbar {
2
+ padding: 20px 20px 0;
3
+ color: var(--Gray-700, #344054);
4
+ font-size: 14px;
5
+ font-style: normal;
6
+ font-weight: 600;
7
+ line-height: 20px; /* 142.857% */
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 12px;
11
+ .date-picker-content-top {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: 8px;
15
+ }
16
+ .date-picker-content-bottom {
17
+ display: flex;
18
+ gap: 16px;
19
+ }
20
+ .date-picker-toolbar-start-wrap {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: 8px;
24
+ flex: 1;
25
+ }
26
+ .date-picker-toolbar-end-wrap {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 8px;
30
+ flex: 1;
31
+ }
32
+ }
@@ -0,0 +1,59 @@
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/browserSelect/index.tsx
30
+ var browserSelect_exports = {};
31
+ __export(browserSelect_exports, {
32
+ default: () => browserSelect_default
33
+ });
34
+ module.exports = __toCommonJS(browserSelect_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_index = require("./index.less");
38
+ var BrowserSelect = (props) => {
39
+ const { options, ...resetProps } = props;
40
+ const _options = (0, import_react.useMemo)(() => {
41
+ return (props.options || []).map((d) => {
42
+ return /* @__PURE__ */ import_react.default.createElement("option", { value: d.value, key: d.value }, d.label);
43
+ });
44
+ }, [props.options]);
45
+ return /* @__PURE__ */ import_react.default.createElement(
46
+ "select",
47
+ {
48
+ ...resetProps,
49
+ className: (0, import_classnames.default)("pisell-browser-select", resetProps.className),
50
+ onChange: (e) => {
51
+ var _a;
52
+ e.persist();
53
+ (_a = resetProps.onChange) == null ? void 0 : _a.call(resetProps, e);
54
+ }
55
+ },
56
+ _options
57
+ );
58
+ };
59
+ var browserSelect_default = BrowserSelect;
@@ -0,0 +1,18 @@
1
+ .pisell-browser-select {
2
+ padding: 9px 16px;
3
+ border-radius: 8px;
4
+ background-color: #fff;
5
+ background-image: url('./chevron-down.png');
6
+ color: var(--Gray-true-900, #141414);
7
+ font-size: 16px;
8
+ font-style: normal;
9
+ font-weight: 600;
10
+ border: 1px solid var(--Gray-300, #D0D5DD);
11
+ cursor: pointer;
12
+ appearance: none;
13
+ -webkit-appearance: none;
14
+ -moz-appearance: none;
15
+ background-position: right 10px center;
16
+ background-size: 12px;
17
+ background-repeat: no-repeat;
18
+ }
@@ -0,0 +1,147 @@
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/constants.ts
30
+ var constants_exports = {};
31
+ __export(constants_exports, {
32
+ presetDetailMap: () => presetDetailMap,
33
+ presetValueArr: () => presetValueArr
34
+ });
35
+ module.exports = __toCommonJS(constants_exports);
36
+ var import_dayjs = __toESM(require("dayjs"));
37
+ var import_locales = require("./locales");
38
+ var presetValueArr = [
39
+ "today",
40
+ "yesterday",
41
+ "last_3_days",
42
+ "last_7_days",
43
+ "last_30_days",
44
+ "last_90_days",
45
+ "last_180_days",
46
+ "tomorrow",
47
+ "next_3_days",
48
+ "next_7_days",
49
+ "next_30_days",
50
+ "next_90_days",
51
+ "next_180_days"
52
+ ];
53
+ var presetDetailMap = {
54
+ today: {
55
+ getValue: () => [(0, import_dayjs.default)().startOf("day"), (0, import_dayjs.default)().endOf("day")],
56
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-today")
57
+ },
58
+ yesterday: {
59
+ getValue: () => [
60
+ (0, import_dayjs.default)().add(-1, "d").startOf("day"),
61
+ (0, import_dayjs.default)().add(-1, "d").endOf("day")
62
+ ],
63
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-yesterday")
64
+ },
65
+ last_3_days: {
66
+ getValue: () => [
67
+ (0, import_dayjs.default)().add(-3, "d").startOf("day"),
68
+ (0, import_dayjs.default)().add(-1, "d").endOf("day")
69
+ ],
70
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-last-3-days")
71
+ },
72
+ last_7_days: {
73
+ getValue: () => [
74
+ (0, import_dayjs.default)().add(-7, "d").startOf("day"),
75
+ (0, import_dayjs.default)().add(-1, "d").endOf("day")
76
+ ],
77
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-last-7-days")
78
+ },
79
+ last_30_days: {
80
+ getValue: () => [
81
+ (0, import_dayjs.default)().add(-30, "d").startOf("day"),
82
+ (0, import_dayjs.default)().add(-1, "d").endOf("day")
83
+ ],
84
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-last-30-days")
85
+ },
86
+ last_90_days: {
87
+ getValue: () => [
88
+ (0, import_dayjs.default)().add(-90, "d").startOf("day"),
89
+ (0, import_dayjs.default)().add(-1, "d").endOf("day")
90
+ ],
91
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-last-90-days")
92
+ },
93
+ last_180_days: {
94
+ getValue: () => [
95
+ (0, import_dayjs.default)().add(-180, "d").startOf("day"),
96
+ (0, import_dayjs.default)().add(-1, "d").endOf("day")
97
+ ],
98
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-last-180-days")
99
+ },
100
+ tomorrow: {
101
+ getValue: () => [
102
+ (0, import_dayjs.default)().add(1, "d").startOf("day"),
103
+ (0, import_dayjs.default)().add(1, "d").endOf("day")
104
+ ],
105
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-tomorrow")
106
+ },
107
+ next_3_days: {
108
+ getValue: () => [
109
+ (0, import_dayjs.default)().add(1, "d").startOf("day"),
110
+ (0, import_dayjs.default)().add(3, "d").endOf("day")
111
+ ],
112
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-next-3-days")
113
+ },
114
+ next_7_days: {
115
+ getValue: () => [
116
+ (0, import_dayjs.default)().add(1, "d").startOf("day"),
117
+ (0, import_dayjs.default)().add(7, "d").endOf("day")
118
+ ],
119
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-next-7-days")
120
+ },
121
+ next_30_days: {
122
+ getValue: () => [
123
+ (0, import_dayjs.default)().add(1, "d").startOf("day"),
124
+ (0, import_dayjs.default)().add(30, "d").endOf("day")
125
+ ],
126
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-next-30-days")
127
+ },
128
+ next_90_days: {
129
+ getValue: () => [
130
+ (0, import_dayjs.default)().add(1, "d").startOf("day"),
131
+ (0, import_dayjs.default)().add(90, "d").endOf("day")
132
+ ],
133
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-next-90-days")
134
+ },
135
+ next_180_days: {
136
+ getValue: () => [
137
+ (0, import_dayjs.default)().add(1, "d").startOf("day"),
138
+ (0, import_dayjs.default)().add(180, "d").endOf("day")
139
+ ],
140
+ label: () => (0, import_locales.getText)("toolbar-date-range-shortcut-next-180-days")
141
+ }
142
+ };
143
+ // Annotate the CommonJS export names for ESM import in node:
144
+ 0 && (module.exports = {
145
+ presetDetailMap,
146
+ presetValueArr
147
+ });
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/hooks/useDocumentVisibility.ts
20
+ var useDocumentVisibility_exports = {};
21
+ __export(useDocumentVisibility_exports, {
22
+ default: () => useDocumentVisibility_default
23
+ });
24
+ module.exports = __toCommonJS(useDocumentVisibility_exports);
25
+ var import_react = require("react");
26
+ var getVisible = () => document.visibilityState;
27
+ var useDocumentVisibility = () => {
28
+ const [visible, setVisible] = (0, import_react.useState)(getVisible());
29
+ (0, import_react.useEffect)(() => {
30
+ const handleVisibilityChange = () => {
31
+ setVisible(getVisible());
32
+ };
33
+ document.addEventListener("visibilitychange", handleVisibilityChange);
34
+ return () => {
35
+ document.removeEventListener("visibilitychange", handleVisibilityChange);
36
+ };
37
+ }, []);
38
+ return visible;
39
+ };
40
+ var useDocumentVisibility_default = useDocumentVisibility;
@@ -0,0 +1,49 @@
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/hooks/useNextDay.ts
30
+ var useNextDay_exports = {};
31
+ __export(useNextDay_exports, {
32
+ default: () => useNextDay_default
33
+ });
34
+ module.exports = __toCommonJS(useNextDay_exports);
35
+ var import_react = require("react");
36
+ var import_useUpdateEffect = __toESM(require("./useUpdateEffect"));
37
+ var import_useDocumentVisibility = __toESM(require("./useDocumentVisibility"));
38
+ var import_dayjs = __toESM(require("dayjs"));
39
+ var useNextDay = (fn) => {
40
+ const visible = (0, import_useDocumentVisibility.default)();
41
+ const currentDay = (0, import_react.useRef)((0, import_dayjs.default)());
42
+ (0, import_useUpdateEffect.default)(() => {
43
+ if (visible && !currentDay.current.isSame((0, import_dayjs.default)(), "day")) {
44
+ currentDay.current = (0, import_dayjs.default)();
45
+ fn();
46
+ }
47
+ }, [visible]);
48
+ };
49
+ var useNextDay_default = useNextDay;
@@ -0,0 +1,35 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/hooks/useUpdateEffect.ts
20
+ var useUpdateEffect_exports = {};
21
+ __export(useUpdateEffect_exports, {
22
+ default: () => useUpdateEffect_default
23
+ });
24
+ module.exports = __toCommonJS(useUpdateEffect_exports);
25
+ var import_react = require("react");
26
+ var useUpdateEffect = (fn, deps) => {
27
+ const isMount = (0, import_react.useRef)(false);
28
+ (0, import_react.useEffect)(() => {
29
+ if (isMount.current) {
30
+ fn();
31
+ }
32
+ isMount.current = true;
33
+ }, deps);
34
+ };
35
+ var useUpdateEffect_default = useUpdateEffect;
@@ -0,0 +1,60 @@
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/icon/ChevronLeft.tsx
30
+ var ChevronLeft_exports = {};
31
+ __export(ChevronLeft_exports, {
32
+ default: () => ChevronLeft_default
33
+ });
34
+ module.exports = __toCommonJS(ChevronLeft_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var ChevronLeft = (props) => {
37
+ const { className, onClick } = props;
38
+ return /* @__PURE__ */ import_react.default.createElement("span", { className, onClick }, /* @__PURE__ */ import_react.default.createElement(
39
+ "svg",
40
+ {
41
+ className: "icon",
42
+ viewBox: "0 0 1024 1024",
43
+ version: "1.1",
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ "p-id": "35105",
46
+ width: "1em",
47
+ height: "1em"
48
+ },
49
+ /* @__PURE__ */ import_react.default.createElement(
50
+ "path",
51
+ {
52
+ "fill-rule": "evenodd",
53
+ "clip-rule": "evenodd",
54
+ d: "M15.7071 5.29289C16.0976 5.68342 16.0976 6.31658 15.7071 6.70711L10.4142 12L15.7071 17.2929C16.0976 17.6834 16.0976 18.3166 15.7071 18.7071C15.3166 19.0976 14.6834 19.0976 14.2929 18.7071L8.29289 12.7071C7.90237 12.3166 7.90237 11.6834 8.29289 11.2929L14.2929 5.29289C14.6834 4.90237 15.3166 4.90237 15.7071 5.29289Z",
55
+ fill: "currentColor"
56
+ }
57
+ )
58
+ ));
59
+ };
60
+ var ChevronLeft_default = ChevronLeft;