@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
|
@@ -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,281 @@
|
|
|
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/OldPisellDateRangePicker/index.tsx
|
|
30
|
+
var OldPisellDateRangePicker_exports = {};
|
|
31
|
+
__export(OldPisellDateRangePicker_exports, {
|
|
32
|
+
default: () => OldPisellDateRangePicker_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(OldPisellDateRangePicker_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_DateRangePicker = require("../DateRangePicker");
|
|
37
|
+
var import_OldActionBar = __toESM(require("../OldActionBar"));
|
|
38
|
+
var import_Shortcuts = __toESM(require("../Shortcuts"));
|
|
39
|
+
var import_SingleInputDateRangeField = require("../SingleInputDateRangeField");
|
|
40
|
+
var import_classnames = __toESM(require("classnames"));
|
|
41
|
+
var import_utils = require("@pisell/utils");
|
|
42
|
+
var import_useCssVariables = __toESM(require("../PisellDateRangePicker/useCssVariables"));
|
|
43
|
+
var import_CloseCircle = __toESM(require("../icon/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");
|
|
47
|
+
var import_utils2 = require("../utils");
|
|
48
|
+
var import_LocaleContext = require("../PisellDateRangePicker/LocaleContext");
|
|
49
|
+
var import_locales = require("../locales");
|
|
50
|
+
var import_index = require("./index.less");
|
|
51
|
+
var transDayjsArr = (dayjsArr, defaultValue) => {
|
|
52
|
+
let newArr = dayjsArr || defaultValue || [null, null];
|
|
53
|
+
if ((dayjsArr == null ? void 0 : dayjsArr.length) === 0) {
|
|
54
|
+
newArr = defaultValue || [null, null];
|
|
55
|
+
}
|
|
56
|
+
return newArr == null ? void 0 : newArr.map((item) => {
|
|
57
|
+
return item ? item : null;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
var PisellDateRangePicker = (props) => {
|
|
61
|
+
const {
|
|
62
|
+
onChange: propsOnChange,
|
|
63
|
+
value: propsValue,
|
|
64
|
+
presets = [],
|
|
65
|
+
className,
|
|
66
|
+
showTime,
|
|
67
|
+
placeholder,
|
|
68
|
+
disabledDate,
|
|
69
|
+
format: propsFormat,
|
|
70
|
+
defaultValue,
|
|
71
|
+
suffixIcon,
|
|
72
|
+
bordered = true,
|
|
73
|
+
open: propsOpen,
|
|
74
|
+
onClose,
|
|
75
|
+
popupWidth = 625,
|
|
76
|
+
clearEndOnSelection,
|
|
77
|
+
minDate,
|
|
78
|
+
maxDate,
|
|
79
|
+
onOpen,
|
|
80
|
+
onMonthChange,
|
|
81
|
+
popupClassName,
|
|
82
|
+
defaultCalendarMonth,
|
|
83
|
+
okButtonProps,
|
|
84
|
+
cancelButtonProps,
|
|
85
|
+
onDateChange,
|
|
86
|
+
desktopModeMediaQuery,
|
|
87
|
+
style,
|
|
88
|
+
allowClear,
|
|
89
|
+
disablePortal,
|
|
90
|
+
placement = "auto",
|
|
91
|
+
inputReadOnly
|
|
92
|
+
} = props;
|
|
93
|
+
const [open, setOpen] = (0, import_react.useState)(propsOpen ?? false);
|
|
94
|
+
const { locale } = (0, import_react.useContext)(import_LocaleContext.LocaleContext) || {};
|
|
95
|
+
(0, import_react.useEffect)(() => {
|
|
96
|
+
(0, import_utils.isBoolean)(propsOpen) && setOpen(propsOpen);
|
|
97
|
+
}, [propsOpen]);
|
|
98
|
+
const [_value, setValue] = (0, import_react.useState)(
|
|
99
|
+
() => transDayjsArr(propsValue, defaultValue)
|
|
100
|
+
);
|
|
101
|
+
(0, import_react.useEffect)(() => {
|
|
102
|
+
setValue(transDayjsArr(propsValue, defaultValue));
|
|
103
|
+
}, [propsValue]);
|
|
104
|
+
const handleOpen = () => {
|
|
105
|
+
setOpen(true);
|
|
106
|
+
onOpen == null ? void 0 : onOpen();
|
|
107
|
+
};
|
|
108
|
+
const handleClose = () => {
|
|
109
|
+
setOpen(false);
|
|
110
|
+
onClose == null ? void 0 : onClose();
|
|
111
|
+
onDateChange == null ? void 0 : onDateChange(transDayjsArr(propsValue, defaultValue));
|
|
112
|
+
setValue(transDayjsArr(propsValue, defaultValue));
|
|
113
|
+
};
|
|
114
|
+
const handleOk = () => {
|
|
115
|
+
setOpen(false);
|
|
116
|
+
onClose == null ? void 0 : onClose();
|
|
117
|
+
propsOnChange == null ? void 0 : propsOnChange(_value);
|
|
118
|
+
};
|
|
119
|
+
const _presets = (0, import_react.useMemo)(() => {
|
|
120
|
+
if ((0, import_utils2.isMobile)())
|
|
121
|
+
return [];
|
|
122
|
+
return presets.map((item) => {
|
|
123
|
+
const getValue = () => {
|
|
124
|
+
if (typeof item.getValue === "function") {
|
|
125
|
+
return item.getValue();
|
|
126
|
+
}
|
|
127
|
+
return item == null ? void 0 : item.value;
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
label: item.label,
|
|
131
|
+
getValue
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}, [presets]);
|
|
135
|
+
const handleChange = (val, type) => {
|
|
136
|
+
let newVal = val;
|
|
137
|
+
if ((0, import_utils.isArr)(showTime) && type !== "time") {
|
|
138
|
+
newVal = newVal.map((item, index) => {
|
|
139
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
140
|
+
if ((_a = showTime == null ? void 0 : showTime[index]) == null ? void 0 : _a.defaultValue) {
|
|
141
|
+
return (item == null ? void 0 : item.set("hour", (_c = (_b = showTime[index]) == null ? void 0 : _b.defaultValue) == null ? void 0 : _c.get("hour")).set("minute", (_e = (_d = showTime[index]) == null ? void 0 : _d.defaultValue) == null ? void 0 : _e.get("minute")).set("second", (_g = (_f = showTime[index]) == null ? void 0 : _f.defaultValue) == null ? void 0 : _g.get("second"))) || null;
|
|
142
|
+
}
|
|
143
|
+
return item || null;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (clearEndOnSelection && type !== "set" && _value.filter(Boolean).length === 2) {
|
|
147
|
+
newVal = [newVal[0], null];
|
|
148
|
+
}
|
|
149
|
+
onDateChange == null ? void 0 : onDateChange(newVal);
|
|
150
|
+
setValue(newVal);
|
|
151
|
+
};
|
|
152
|
+
const hasPreset = (_presets == null ? void 0 : _presets.length) > 0;
|
|
153
|
+
(0, import_useCssVariables.default)({
|
|
154
|
+
variables: {
|
|
155
|
+
"--pisell-date-range-picker-popup-width": `${hasPreset ? popupWidth + 192 : popupWidth}px`
|
|
156
|
+
},
|
|
157
|
+
dom: document.body
|
|
158
|
+
});
|
|
159
|
+
const handleClear = (e) => {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
setValue([null, null]);
|
|
162
|
+
setOpen(false);
|
|
163
|
+
onClose == null ? void 0 : onClose();
|
|
164
|
+
propsOnChange == null ? void 0 : propsOnChange([null, null]);
|
|
165
|
+
};
|
|
166
|
+
const endAdornment = (0, import_react.useMemo)(() => {
|
|
167
|
+
if (!allowClear) {
|
|
168
|
+
return suffixIcon;
|
|
169
|
+
}
|
|
170
|
+
if (_value == null ? void 0 : _value.some((item) => !!item)) {
|
|
171
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
172
|
+
import_CloseCircle.default,
|
|
173
|
+
{
|
|
174
|
+
className: "pisell-date-range-picker-clear",
|
|
175
|
+
onClick: handleClear
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}, [suffixIcon, allowClear, _value]);
|
|
180
|
+
const readOnlyProps = (0, import_react.useMemo)(() => {
|
|
181
|
+
if (inputReadOnly) {
|
|
182
|
+
return {
|
|
183
|
+
readOnly: true,
|
|
184
|
+
selectedSections: null
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return {};
|
|
188
|
+
}, [inputReadOnly]);
|
|
189
|
+
const format = (0, import_react.useMemo)(() => {
|
|
190
|
+
if (propsFormat) {
|
|
191
|
+
return propsFormat;
|
|
192
|
+
}
|
|
193
|
+
let localeValue = locale;
|
|
194
|
+
if (!localeValue) {
|
|
195
|
+
localeValue = import_locales.pLocaleMap[(0, import_utils2.getCurrentLocale)()];
|
|
196
|
+
}
|
|
197
|
+
return localeValue === "en" || localeValue === "en-US" ? "DD/MM/YYYY" : "YYYY/MM/DD";
|
|
198
|
+
}, [propsFormat, locale]);
|
|
199
|
+
console.log(_presets, presets, "_presets");
|
|
200
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
className: (0, import_classnames.default)(
|
|
204
|
+
className,
|
|
205
|
+
"pisell-date-range-picker",
|
|
206
|
+
"pisell-date-range-picker-old",
|
|
207
|
+
{
|
|
208
|
+
"pisell-date-range-picker-no-border": !bordered
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
style,
|
|
212
|
+
onClick: (e) => e.stopPropagation()
|
|
213
|
+
},
|
|
214
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
215
|
+
import_DateRangePicker.DateRangePicker,
|
|
216
|
+
{
|
|
217
|
+
desktopModeMediaQuery,
|
|
218
|
+
onMonthChange,
|
|
219
|
+
minDate,
|
|
220
|
+
maxDate,
|
|
221
|
+
format,
|
|
222
|
+
label: placeholder,
|
|
223
|
+
value: _value,
|
|
224
|
+
closeOnSelect: false,
|
|
225
|
+
onClose: handleClose,
|
|
226
|
+
onChange: handleChange,
|
|
227
|
+
onOpen: handleOpen,
|
|
228
|
+
open,
|
|
229
|
+
defaultCalendarMonth,
|
|
230
|
+
shouldDisableDate: (current, position) => disabledDate == null ? void 0 : disabledDate(current, position, _value),
|
|
231
|
+
slots: {
|
|
232
|
+
actionBar: import_OldActionBar.default,
|
|
233
|
+
shortcuts: import_Shortcuts.default,
|
|
234
|
+
field: import_SingleInputDateRangeField.SingleInputDateRangeField
|
|
235
|
+
},
|
|
236
|
+
dayOfWeekFormatter: (day) => {
|
|
237
|
+
return day;
|
|
238
|
+
},
|
|
239
|
+
slotProps: {
|
|
240
|
+
shortcuts: {
|
|
241
|
+
items: _presets,
|
|
242
|
+
changeImportance: "set",
|
|
243
|
+
onChange: handleChange
|
|
244
|
+
},
|
|
245
|
+
actionBar: {
|
|
246
|
+
onOk: handleOk,
|
|
247
|
+
onCancel: handleClose,
|
|
248
|
+
showTime,
|
|
249
|
+
onChange: handleChange,
|
|
250
|
+
value: _value,
|
|
251
|
+
okButtonProps,
|
|
252
|
+
cancelButtonProps
|
|
253
|
+
},
|
|
254
|
+
field: {
|
|
255
|
+
value: _value,
|
|
256
|
+
size: "small",
|
|
257
|
+
fullWidth: true,
|
|
258
|
+
// variant: "standard",
|
|
259
|
+
// hiddenLabel: true,
|
|
260
|
+
InputProps: {
|
|
261
|
+
endAdornment
|
|
262
|
+
},
|
|
263
|
+
...readOnlyProps
|
|
264
|
+
},
|
|
265
|
+
popper: {
|
|
266
|
+
className: (0, import_classnames.default)(popupClassName, "pisell-date-range-picker-popper-old"),
|
|
267
|
+
disablePortal,
|
|
268
|
+
placement
|
|
269
|
+
},
|
|
270
|
+
dialog: {
|
|
271
|
+
disablePortal
|
|
272
|
+
},
|
|
273
|
+
mobilePaper: {
|
|
274
|
+
className: popupClassName
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
var OldPisellDateRangePicker_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/lib/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
ConfigProvider: () => import_antd.ConfigProvider,
|
|
34
34
|
LocaleContext: () => import_LocaleContext.LocaleContext,
|
|
35
35
|
LocaleProvider: () => import_LocaleContext.LocaleProvider,
|
|
36
|
+
OldPisellDateRangePicker: () => import_OldPisellDateRangePicker.default,
|
|
36
37
|
RangePicker: () => import_PisellDateRangePicker.default,
|
|
37
38
|
formatPresets: () => import_utils.formatPresets,
|
|
38
39
|
getDatePickerValue: () => import_utils.getDatePickerValue,
|
|
@@ -43,6 +44,7 @@ __export(src_exports, {
|
|
|
43
44
|
module.exports = __toCommonJS(src_exports);
|
|
44
45
|
var import_antd = require("antd");
|
|
45
46
|
var import_PisellDateRangePicker = __toESM(require("./PisellDateRangePicker"));
|
|
47
|
+
var import_OldPisellDateRangePicker = __toESM(require("./OldPisellDateRangePicker"));
|
|
46
48
|
var import_LocaleContext = require("./PisellDateRangePicker/LocaleContext");
|
|
47
49
|
__reExport(src_exports, require("@mui/x-date-pickers"), module.exports);
|
|
48
50
|
__reExport(src_exports, require("@mui/material/styles"), module.exports);
|
|
@@ -65,6 +67,7 @@ __reExport(src_exports, require("./models"), module.exports);
|
|
|
65
67
|
ConfigProvider,
|
|
66
68
|
LocaleContext,
|
|
67
69
|
LocaleProvider,
|
|
70
|
+
OldPisellDateRangePicker,
|
|
68
71
|
RangePicker,
|
|
69
72
|
formatPresets,
|
|
70
73
|
getDatePickerValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/date-picker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.89",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.less"
|
|
6
6
|
],
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"antd": "^5.5.0",
|
|
27
27
|
"react": "^18.0.0",
|
|
28
28
|
"react-dom": "^18.0.0",
|
|
29
|
-
"@pisell/utils": "1.0.
|
|
29
|
+
"@pisell/utils": "1.0.28"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"es",
|
package/es/ActionBar/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from "antd";
|
|
2
|
-
import { Dayjs } from "dayjs";
|
|
3
|
-
import "./index.less";
|
|
4
|
-
interface ActionBarProps {
|
|
5
|
-
ownerState: any;
|
|
6
|
-
onCancel: () => void;
|
|
7
|
-
onChange: (val: any[], type?: "time") => void;
|
|
8
|
-
onOk: () => void;
|
|
9
|
-
value: any[];
|
|
10
|
-
showTime?: boolean | {
|
|
11
|
-
defaultValue: Dayjs;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}[];
|
|
14
|
-
okButtonProps?: ButtonProps;
|
|
15
|
-
cancelButtonProps?: ButtonProps;
|
|
16
|
-
}
|
|
17
|
-
declare const ActionBar: (props: ActionBarProps) => JSX.Element;
|
|
18
|
-
export default ActionBar;
|
package/es/Dialog/index.d.ts
DELETED
package/es/Drawer/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./index.less";
|
|
3
|
-
interface DrawerProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
className?: string;
|
|
6
|
-
height?: number;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
onClose: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const Drawer: (props: DrawerProps) => JSX.Element | null;
|
|
11
|
-
export default Drawer;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Dayjs } from "dayjs";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ButtonProps } from "antd";
|
|
4
|
-
import { PopperPlacementType } from "@mui/base/Popper/Popper.types";
|
|
5
|
-
import { PresetType } from "../Shortcuts";
|
|
6
|
-
import "dayjs/locale/zh-cn";
|
|
7
|
-
import "dayjs/locale/en";
|
|
8
|
-
import "dayjs/locale/zh-tw";
|
|
9
|
-
import "./index.less";
|
|
10
|
-
export interface PisellDateRangePickerProps {
|
|
11
|
-
/** 再次选择日期时是否清除结束时间 */
|
|
12
|
-
clearEndOnSelection?: boolean;
|
|
13
|
-
/** 日期选择确认回调 */
|
|
14
|
-
onChange?: (day: (Dayjs | null)[] | string) => void;
|
|
15
|
-
/** 日期改变回调 此处只为了组件外拿到当前日期项进行状态操作 通常情况下只使用onChange来拿value */
|
|
16
|
-
onDateChange?: (day: (Dayjs | null)[]) => void;
|
|
17
|
-
/** 日期选择值 */
|
|
18
|
-
value?: Dayjs[] | string;
|
|
19
|
-
/** 日期选择默认值 */
|
|
20
|
-
defaultValue?: Dayjs[];
|
|
21
|
-
/** 快捷选择项 */
|
|
22
|
-
presets?: PresetType[];
|
|
23
|
-
/** 类名 */
|
|
24
|
-
className?: string;
|
|
25
|
-
/** 是否显示时间选择 这里参数为antd TimePickerProps */
|
|
26
|
-
showTime?: boolean | {
|
|
27
|
-
defaultValue: Dayjs;
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}[];
|
|
30
|
-
/** 占位符 */
|
|
31
|
-
placeholder?: string;
|
|
32
|
-
/** 是否禁用日期 */
|
|
33
|
-
disabledDate?: (day: Dayjs, position: "start" | "end", value: Dayjs[]) => boolean;
|
|
34
|
-
/** 日期格式 */
|
|
35
|
-
format?: string;
|
|
36
|
-
/** 后缀图标 */
|
|
37
|
-
suffixIcon?: React.ReactNode;
|
|
38
|
-
/** 是否显示边框 */
|
|
39
|
-
bordered?: boolean;
|
|
40
|
-
/** 是否打开日期选择 */
|
|
41
|
-
open?: boolean;
|
|
42
|
-
/** 关闭回调 */
|
|
43
|
-
onClose?: () => void;
|
|
44
|
-
/** 打开回调 */
|
|
45
|
-
onOpen?: () => void;
|
|
46
|
-
/** 弹窗宽度 */
|
|
47
|
-
popupWidth?: number;
|
|
48
|
-
/** 最小日期 */
|
|
49
|
-
minDate?: Dayjs;
|
|
50
|
-
/** 最大日期 */
|
|
51
|
-
maxDate?: Dayjs;
|
|
52
|
-
/** 月份切换事件 */
|
|
53
|
-
onMonthChange?: (value: Dayjs) => void;
|
|
54
|
-
/** 额外的弹出日历 className */
|
|
55
|
-
popupClassName?: string;
|
|
56
|
-
/** 默认显示月份 */
|
|
57
|
-
defaultCalendarMonth?: Dayjs;
|
|
58
|
-
/** ok 按钮 props */
|
|
59
|
-
okButtonProps?: ButtonProps;
|
|
60
|
-
/** cancel 按钮 props */
|
|
61
|
-
cancelButtonProps?: ButtonProps;
|
|
62
|
-
/**
|
|
63
|
-
* CSS media query when `Mobile` mode will be changed to `Desktop`.
|
|
64
|
-
* @default '@media (pointer: fine)'
|
|
65
|
-
* @example '@media (min-width: 720px)' or theme.breakpoints.up("sm")
|
|
66
|
-
*/
|
|
67
|
-
desktopModeMediaQuery?: string;
|
|
68
|
-
style?: React.CSSProperties;
|
|
69
|
-
/** 是否展示清除按钮 */
|
|
70
|
-
allowClear?: boolean;
|
|
71
|
-
/** true 将弹窗当前DOM层次结构下 false 追加到body */
|
|
72
|
-
disablePortal?: boolean;
|
|
73
|
-
/** 弹窗放置位置 */
|
|
74
|
-
placement?: PopperPlacementType;
|
|
75
|
-
/** 输入框只读 */
|
|
76
|
-
inputReadOnly: boolean;
|
|
77
|
-
/** 使用快捷筛选时返回快捷字符串 */
|
|
78
|
-
returnShortcutString?: boolean;
|
|
79
|
-
}
|
|
80
|
-
declare const PisellDateRangePicker: (props: PisellDateRangePickerProps) => JSX.Element;
|
|
81
|
-
export default PisellDateRangePicker;
|
package/es/Shortcuts/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "./index.less";
|
|
2
|
-
import { Dayjs } from "dayjs";
|
|
3
|
-
export declare type PresetType = {
|
|
4
|
-
label?: string;
|
|
5
|
-
getValue?: () => [Dayjs, Dayjs];
|
|
6
|
-
value: [Dayjs, Dayjs] | "today" | "yesterday" | "last_3_days" | "last_7_days" | "last_30_days" | "last_90_days" | "last_180_days" | "tomorrow" | "next_3_days" | "next_7_days" | "next_30_days" | "next_90_days" | "next_180_days";
|
|
7
|
-
key?: string;
|
|
8
|
-
};
|
|
9
|
-
interface ShortcutsProps {
|
|
10
|
-
items: PresetType[];
|
|
11
|
-
onChange: (day: [Dayjs, Dayjs], changeImportance?: "accept" | "set") => void;
|
|
12
|
-
changeImportance?: "accept" | "set";
|
|
13
|
-
}
|
|
14
|
-
declare const Shortcuts: (props: ShortcutsProps) => JSX.Element | null;
|
|
15
|
-
export default Shortcuts;
|
package/es/Toolbar/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./index.less";
|
|
3
|
-
interface BrowserSelectProps extends React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement> {
|
|
4
|
-
options: any[];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* @title: 系统级别的下拉框
|
|
8
|
-
* @description:
|
|
9
|
-
* @param {BrowserSelectProps} props
|
|
10
|
-
* @return {*}
|
|
11
|
-
* @Author: zhiwei.Wang
|
|
12
|
-
* @Date: 2024-01-30 16:43
|
|
13
|
-
*/
|
|
14
|
-
declare const BrowserSelect: (props: BrowserSelectProps) => JSX.Element;
|
|
15
|
-
export default BrowserSelect;
|
package/es/constants.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import { PresetType } from './Shortcuts';
|
|
3
|
-
export declare const presetValueArr: string[];
|
|
4
|
-
export declare const presetDetailMap: {
|
|
5
|
-
today: {
|
|
6
|
-
getValue: () => dayjs.Dayjs[];
|
|
7
|
-
label: (locale?: string) => any;
|
|
8
|
-
};
|
|
9
|
-
yesterday: {
|
|
10
|
-
getValue: () => dayjs.Dayjs[];
|
|
11
|
-
label: (locale?: string) => any;
|
|
12
|
-
};
|
|
13
|
-
last_3_days: {
|
|
14
|
-
getValue: () => dayjs.Dayjs[];
|
|
15
|
-
label: (locale?: string) => any;
|
|
16
|
-
};
|
|
17
|
-
last_7_days: {
|
|
18
|
-
getValue: () => dayjs.Dayjs[];
|
|
19
|
-
label: (locale?: string) => any;
|
|
20
|
-
};
|
|
21
|
-
last_30_days: {
|
|
22
|
-
getValue: () => dayjs.Dayjs[];
|
|
23
|
-
label: (locale?: string) => any;
|
|
24
|
-
};
|
|
25
|
-
last_90_days: {
|
|
26
|
-
getValue: () => dayjs.Dayjs[];
|
|
27
|
-
label: (locale?: string) => any;
|
|
28
|
-
};
|
|
29
|
-
last_180_days: {
|
|
30
|
-
getValue: () => dayjs.Dayjs[];
|
|
31
|
-
label: (locale?: string) => any;
|
|
32
|
-
};
|
|
33
|
-
tomorrow: {
|
|
34
|
-
getValue: () => dayjs.Dayjs[];
|
|
35
|
-
label: (locale?: string) => any;
|
|
36
|
-
};
|
|
37
|
-
next_3_days: {
|
|
38
|
-
getValue: () => dayjs.Dayjs[];
|
|
39
|
-
label: (locale?: string) => any;
|
|
40
|
-
};
|
|
41
|
-
next_7_days: {
|
|
42
|
-
getValue: () => dayjs.Dayjs[];
|
|
43
|
-
label: (locale?: string) => any;
|
|
44
|
-
};
|
|
45
|
-
next_30_days: {
|
|
46
|
-
getValue: () => dayjs.Dayjs[];
|
|
47
|
-
label: (locale?: string) => any;
|
|
48
|
-
};
|
|
49
|
-
next_90_days: {
|
|
50
|
-
getValue: () => dayjs.Dayjs[];
|
|
51
|
-
label: (locale?: string) => any;
|
|
52
|
-
};
|
|
53
|
-
next_180_days: {
|
|
54
|
-
getValue: () => dayjs.Dayjs[];
|
|
55
|
-
label: (locale?: string) => any;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export declare const defaultPresets: PresetType[];
|
package/es/hooks/useNextDay.d.ts
DELETED