@comet/admin-date-time 8.17.1 → 9.0.0-beta.0
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/lib/DatePickerNavigation.js +38 -44
- package/lib/datePicker/DateField.d.ts +1 -1
- package/lib/datePicker/DateField.js +7 -13
- package/lib/datePicker/DatePicker.d.ts +6 -6
- package/lib/datePicker/DatePicker.d.ts.map +1 -1
- package/lib/datePicker/DatePicker.js +27 -33
- package/lib/datePicker/DatePicker.slots.d.ts +1 -3
- package/lib/datePicker/DatePicker.slots.d.ts.map +1 -1
- package/lib/datePicker/DatePicker.slots.js +12 -18
- package/lib/datePicker/FinalFormDatePicker.d.ts +2 -2
- package/lib/datePicker/FinalFormDatePicker.d.ts.map +1 -1
- package/lib/datePicker/FinalFormDatePicker.js +5 -11
- package/lib/dateRangePicker/DateRangeField.d.ts +1 -1
- package/lib/dateRangePicker/DateRangeField.js +7 -13
- package/lib/dateRangePicker/DateRangePicker.d.ts +7 -7
- package/lib/dateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/lib/dateRangePicker/DateRangePicker.js +33 -38
- package/lib/dateRangePicker/DateRangePicker.slots.d.ts +1 -3
- package/lib/dateRangePicker/DateRangePicker.slots.d.ts.map +1 -1
- package/lib/dateRangePicker/DateRangePicker.slots.js +12 -18
- package/lib/dateRangePicker/FinalFormDateRangePicker.d.ts +1 -1
- package/lib/dateRangePicker/FinalFormDateRangePicker.js +5 -11
- package/lib/dateTimePicker/DateTimeField.d.ts +1 -1
- package/lib/dateTimePicker/DateTimeField.js +7 -13
- package/lib/dateTimePicker/DateTimePicker.d.ts +6 -6
- package/lib/dateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/lib/dateTimePicker/DateTimePicker.js +42 -48
- package/lib/dateTimePicker/FinalFormDateTimePicker.d.ts +1 -1
- package/lib/dateTimePicker/FinalFormDateTimePicker.js +5 -11
- package/lib/index.js +16 -129
- package/lib/timePicker/FinalFormTimePicker.d.ts +1 -1
- package/lib/timePicker/FinalFormTimePicker.js +5 -11
- package/lib/timePicker/TimeField.d.ts +1 -1
- package/lib/timePicker/TimeField.js +7 -13
- package/lib/timePicker/TimePicker.d.ts +6 -6
- package/lib/timePicker/TimePicker.d.ts.map +1 -1
- package/lib/timePicker/TimePicker.js +39 -45
- package/lib/timeRangePicker/FinalFormTimeRangePicker.js +4 -10
- package/lib/timeRangePicker/TimeRangeField.js +6 -12
- package/lib/timeRangePicker/TimeRangePicker.js +35 -41
- package/lib/utils/DateFnsLocaleProvider.js +5 -12
- package/lib/utils/datePickerHelpers.js +5 -11
- package/lib/utils/getReactDateRangeStyles.js +1 -7
- package/lib/utils/timePickerHelpers.js +8 -14
- package/package.json +18 -14
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DatePickerNavigation = void 0;
|
|
8
|
-
var _admin = require("@comet/admin");
|
|
9
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
10
|
-
var _material = require("@mui/material");
|
|
11
|
-
var _styles = require("@mui/material/styles");
|
|
12
|
-
var _react = require("react");
|
|
13
|
-
var _reactIntl = require("react-intl");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
16
3
|
var _excluded = ["focusedDate", "changeShownDate", "minDate", "maxDate", "slotProps"];
|
|
17
4
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
@@ -28,8 +15,15 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
28
15
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
29
16
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
30
17
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
import { Button, createComponentSlot } from "@comet/admin";
|
|
19
|
+
import { ArrowLeft, ArrowRight, ChevronDown } from "@comet/admin-icons";
|
|
20
|
+
import { Box, buttonClasses, IconButton, Menu, menuClasses, MenuItem } from "@mui/material";
|
|
21
|
+
import { css, useThemeProps } from "@mui/material/styles";
|
|
22
|
+
import { useRef, useState } from "react";
|
|
23
|
+
import { useIntl } from "react-intl";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
export var DatePickerNavigation = function DatePickerNavigation(inProps) {
|
|
26
|
+
var _useThemeProps = useThemeProps({
|
|
33
27
|
props: inProps,
|
|
34
28
|
name: "CometAdminDatePickerNavigation"
|
|
35
29
|
}),
|
|
@@ -39,37 +33,37 @@ var DatePickerNavigation = exports.DatePickerNavigation = function DatePickerNav
|
|
|
39
33
|
maxDate = _useThemeProps.maxDate,
|
|
40
34
|
slotProps = _useThemeProps.slotProps,
|
|
41
35
|
restProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
42
|
-
var intl =
|
|
43
|
-
var _useState =
|
|
36
|
+
var intl = useIntl();
|
|
37
|
+
var _useState = useState(false),
|
|
44
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
39
|
showMonthSelect = _useState2[0],
|
|
46
40
|
setShowMonthSelect = _useState2[1];
|
|
47
|
-
var _useState3 =
|
|
41
|
+
var _useState3 = useState(false),
|
|
48
42
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
43
|
showYearSelect = _useState4[0],
|
|
50
44
|
setShowYearSelect = _useState4[1];
|
|
51
|
-
var monthSelectRef =
|
|
52
|
-
var yearSelectRef =
|
|
53
|
-
return /*#__PURE__*/(
|
|
54
|
-
children: [/*#__PURE__*/(
|
|
45
|
+
var monthSelectRef = useRef(null);
|
|
46
|
+
var yearSelectRef = useRef(null);
|
|
47
|
+
return /*#__PURE__*/_jsxs(Root, _objectSpread(_objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), restProps), {}, {
|
|
48
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
55
49
|
onClick: function onClick() {
|
|
56
50
|
return changeShownDate(-1, "monthOffset");
|
|
57
51
|
},
|
|
58
|
-
children: /*#__PURE__*/(
|
|
59
|
-
}), /*#__PURE__*/(
|
|
60
|
-
children: [/*#__PURE__*/(
|
|
52
|
+
children: /*#__PURE__*/_jsx(ArrowLeft, {})
|
|
53
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
54
|
+
children: [/*#__PURE__*/_jsx(SelectMonthButton, _objectSpread(_objectSpread({
|
|
61
55
|
size: "small",
|
|
62
56
|
onClick: function onClick() {
|
|
63
57
|
return setShowMonthSelect(true);
|
|
64
58
|
},
|
|
65
59
|
ref: monthSelectRef,
|
|
66
|
-
endIcon: /*#__PURE__*/(
|
|
60
|
+
endIcon: /*#__PURE__*/_jsx(ChevronDown, {}),
|
|
67
61
|
variant: "textDark"
|
|
68
62
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectMonthButton), {}, {
|
|
69
63
|
children: intl.formatDate(focusedDate, {
|
|
70
64
|
month: "long"
|
|
71
65
|
})
|
|
72
|
-
})), /*#__PURE__*/(
|
|
66
|
+
})), /*#__PURE__*/_jsx(SelectMonthMenu, _objectSpread(_objectSpread({
|
|
73
67
|
open: showMonthSelect,
|
|
74
68
|
onClose: function onClose() {
|
|
75
69
|
return setShowMonthSelect(false);
|
|
@@ -77,7 +71,7 @@ var DatePickerNavigation = exports.DatePickerNavigation = function DatePickerNav
|
|
|
77
71
|
anchorEl: monthSelectRef.current
|
|
78
72
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectMonthMenu), {}, {
|
|
79
73
|
children: new Array(12).fill(null).map(function (_, month) {
|
|
80
|
-
return /*#__PURE__*/(
|
|
74
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
81
75
|
selected: month === focusedDate.getMonth(),
|
|
82
76
|
value: month,
|
|
83
77
|
onClick: function onClick() {
|
|
@@ -89,17 +83,17 @@ var DatePickerNavigation = exports.DatePickerNavigation = function DatePickerNav
|
|
|
89
83
|
})
|
|
90
84
|
}, month);
|
|
91
85
|
})
|
|
92
|
-
})), /*#__PURE__*/(
|
|
86
|
+
})), /*#__PURE__*/_jsx(SelectYearButton, _objectSpread(_objectSpread({
|
|
93
87
|
size: "small",
|
|
94
88
|
ref: yearSelectRef,
|
|
95
89
|
onClick: function onClick() {
|
|
96
90
|
return setShowYearSelect(true);
|
|
97
91
|
},
|
|
98
|
-
endIcon: /*#__PURE__*/(
|
|
92
|
+
endIcon: /*#__PURE__*/_jsx(ChevronDown, {}),
|
|
99
93
|
variant: "textDark"
|
|
100
94
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectYearButton), {}, {
|
|
101
95
|
children: focusedDate.getFullYear()
|
|
102
|
-
})), /*#__PURE__*/(
|
|
96
|
+
})), /*#__PURE__*/_jsx(SelectYearMenu, _objectSpread(_objectSpread({
|
|
103
97
|
open: showYearSelect,
|
|
104
98
|
onClose: function onClose() {
|
|
105
99
|
return setShowYearSelect(false);
|
|
@@ -108,7 +102,7 @@ var DatePickerNavigation = exports.DatePickerNavigation = function DatePickerNav
|
|
|
108
102
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectYearMenu), {}, {
|
|
109
103
|
children: new Array(maxDate.getFullYear() - minDate.getFullYear() + 1).fill(maxDate.getFullYear()).map(function (val, i) {
|
|
110
104
|
var year = val - i;
|
|
111
|
-
return /*#__PURE__*/(
|
|
105
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
|
112
106
|
selected: year === focusedDate.getFullYear(),
|
|
113
107
|
value: year,
|
|
114
108
|
onClick: function onClick() {
|
|
@@ -119,22 +113,22 @@ var DatePickerNavigation = exports.DatePickerNavigation = function DatePickerNav
|
|
|
119
113
|
}, year);
|
|
120
114
|
})
|
|
121
115
|
}))]
|
|
122
|
-
}), /*#__PURE__*/(
|
|
116
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
123
117
|
onClick: function onClick() {
|
|
124
118
|
return changeShownDate(+1, "monthOffset");
|
|
125
119
|
},
|
|
126
|
-
children: /*#__PURE__*/(
|
|
120
|
+
children: /*#__PURE__*/_jsx(ArrowRight, {})
|
|
127
121
|
})]
|
|
128
122
|
}));
|
|
129
123
|
};
|
|
130
|
-
var Root =
|
|
124
|
+
var Root = createComponentSlot("div")({
|
|
131
125
|
componentName: "DatePickerNavigation",
|
|
132
126
|
slotName: "root"
|
|
133
127
|
})(function (_ref) {
|
|
134
128
|
var theme = _ref.theme;
|
|
135
|
-
return
|
|
129
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding-left: ", ";\n padding-right: ", ";\n border-bottom: 1px solid ", ";\n height: 50px;\n "])), theme.spacing(2), theme.spacing(2), theme.palette.grey[50]);
|
|
136
130
|
});
|
|
137
|
-
var SelectMonthButton =
|
|
131
|
+
var SelectMonthButton = createComponentSlot(Button)({
|
|
138
132
|
componentName: "DatePickerNavigation",
|
|
139
133
|
slotName: "selectMonthButton",
|
|
140
134
|
classesResolver: function classesResolver() {
|
|
@@ -142,9 +136,9 @@ var SelectMonthButton = (0, _admin.createComponentSlot)(_admin.Button)({
|
|
|
142
136
|
}
|
|
143
137
|
})(function (_ref2) {
|
|
144
138
|
var theme = _ref2.theme;
|
|
145
|
-
return
|
|
139
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 10px;\n border-radius: 4;\n font-weight: ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n }\n\n & .", " {\n margin-left: 2px;\n }\n "])), theme.typography.fontWeightBold, theme.palette.primary.main, theme.palette.grey[50], buttonClasses.endIcon);
|
|
146
140
|
});
|
|
147
|
-
var SelectYearButton =
|
|
141
|
+
var SelectYearButton = createComponentSlot(Button)({
|
|
148
142
|
componentName: "DatePickerNavigation",
|
|
149
143
|
slotName: "selectYearButton",
|
|
150
144
|
classesResolver: function classesResolver() {
|
|
@@ -152,19 +146,19 @@ var SelectYearButton = (0, _admin.createComponentSlot)(_admin.Button)({
|
|
|
152
146
|
}
|
|
153
147
|
})(function (_ref3) {
|
|
154
148
|
var theme = _ref3.theme;
|
|
155
|
-
return
|
|
149
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 10px;\n border-radius: 4;\n font-weight: ", ";\n color: ", ";\n\n :hover {\n background-color: ", ";\n }\n\n & .", " {\n margin-left: 2px;\n }\n "])), theme.typography.fontWeightBold, theme.palette.primary.main, theme.palette.grey[50], buttonClasses.endIcon);
|
|
156
150
|
});
|
|
157
|
-
var SelectMonthMenu =
|
|
151
|
+
var SelectMonthMenu = createComponentSlot(Menu)({
|
|
158
152
|
componentName: "DatePickerNavigation",
|
|
159
153
|
slotName: "selectMonthMenu",
|
|
160
154
|
classesResolver: function classesResolver() {
|
|
161
155
|
return ["selectMenu"];
|
|
162
156
|
}
|
|
163
|
-
})(
|
|
164
|
-
var SelectYearMenu =
|
|
157
|
+
})(css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n & .", " {\n min-width: 110px;\n max-height: 400px;\n }\n"])), menuClasses.paper));
|
|
158
|
+
var SelectYearMenu = createComponentSlot(Menu)({
|
|
165
159
|
componentName: "DatePickerNavigation",
|
|
166
160
|
slotName: "selectYearMenu",
|
|
167
161
|
classesResolver: function classesResolver() {
|
|
168
162
|
return ["selectMenu"];
|
|
169
163
|
}
|
|
170
|
-
})(
|
|
164
|
+
})(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & .", " {\n min-width: 110px;\n max-height: 400px;\n }\n"])), menuClasses.paper));
|
|
@@ -2,7 +2,7 @@ import { type FieldProps } from "@comet/admin";
|
|
|
2
2
|
import { type FinalFormDatePickerProps } from "./FinalFormDatePicker";
|
|
3
3
|
export type DateFieldProps = FieldProps<Date, HTMLInputElement> & FinalFormDatePickerProps;
|
|
4
4
|
/**
|
|
5
|
-
* @deprecated
|
|
5
|
+
* @deprecated Use `DatePickerField` from `@comet/admin` instead.
|
|
6
6
|
*/
|
|
7
7
|
export declare const DateField: ({ ...restProps }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=DateField.d.ts.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DateField = void 0;
|
|
8
|
-
var _admin = require("@comet/admin");
|
|
9
|
-
var _FinalFormDatePicker = require("./FinalFormDatePicker");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -15,12 +6,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
15
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
7
|
function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
|
|
17
8
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
9
|
+
import { Field } from "@comet/admin";
|
|
10
|
+
import { FinalFormDatePicker } from "./FinalFormDatePicker";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
12
|
/**
|
|
19
|
-
* @deprecated
|
|
13
|
+
* @deprecated Use `DatePickerField` from `@comet/admin` instead.
|
|
20
14
|
*/
|
|
21
|
-
var DateField =
|
|
15
|
+
export var DateField = function DateField(_ref) {
|
|
22
16
|
var restProps = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
23
|
-
return /*#__PURE__*/(
|
|
24
|
-
component:
|
|
17
|
+
return /*#__PURE__*/_jsx(Field, _objectSpread({
|
|
18
|
+
component: FinalFormDatePicker
|
|
25
19
|
}, restProps));
|
|
26
20
|
};
|
|
@@ -16,20 +16,20 @@ export interface DatePickerProps extends Omit<InputWithPopperProps, "children" |
|
|
|
16
16
|
slotProps?: SlotProps;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* @deprecated
|
|
19
|
+
* @deprecated Use `DatePicker` from `@comet/admin` instead.
|
|
20
20
|
*/
|
|
21
21
|
export declare const DatePicker: (inProps: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
declare module "@mui/material/styles" {
|
|
23
23
|
interface ComponentNameToClassKey {
|
|
24
|
-
|
|
24
|
+
CometAdminLegacyDatePicker: DatePickerClassKey;
|
|
25
25
|
}
|
|
26
26
|
interface ComponentsPropsList {
|
|
27
|
-
|
|
27
|
+
CometAdminLegacyDatePicker: DatePickerProps;
|
|
28
28
|
}
|
|
29
29
|
interface Components {
|
|
30
|
-
|
|
31
|
-
defaultProps?: Partial<ComponentsPropsList["
|
|
32
|
-
styleOverrides?: ComponentsOverrides<Theme>["
|
|
30
|
+
CometAdminLegacyDatePicker?: {
|
|
31
|
+
defaultProps?: Partial<ComponentsPropsList["CometAdminLegacyDatePicker"]>;
|
|
32
|
+
styleOverrides?: ComponentsOverrides<Theme>["CometAdminLegacyDatePicker"];
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/datePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAK7D,OAAO,EAAY,KAAK,kBAAkB,EAAQ,KAAK,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAE7G,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;IAChH,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,eAAe,4CAgElD,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/datePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAK7D,OAAO,EAAY,KAAK,kBAAkB,EAAQ,KAAK,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAE7G,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;IAChH,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,eAAe,4CAgElD,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,0BAA0B,EAAE,kBAAkB,CAAC;KAClD;IAED,UAAU,mBAAmB;QACzB,0BAA0B,EAAE,eAAe,CAAC;KAC/C;IAED,UAAU,UAAU;QAChB,0BAA0B,CAAC,EAAE;YACzB,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC,CAAC;YAC1E,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,4BAA4B,CAAC,CAAC;SAC7E,CAAC;KACL;CACJ"}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DatePicker = void 0;
|
|
8
|
-
require("react-date-range/dist/styles.css");
|
|
9
|
-
require("react-date-range/dist/theme/default.css");
|
|
10
|
-
var _admin = require("@comet/admin");
|
|
11
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
12
|
-
var _styles2 = require("@mui/material/styles");
|
|
13
|
-
var _reactIntl = require("react-intl");
|
|
14
|
-
var _DatePickerNavigation = require("../DatePickerNavigation");
|
|
15
|
-
var _DateFnsLocaleProvider = require("../utils/DateFnsLocaleProvider");
|
|
16
|
-
var _datePickerHelpers = require("../utils/datePickerHelpers");
|
|
17
|
-
var _DatePicker = require("./DatePicker.slots");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
2
|
var _excluded = ["onChange", "value", "formatDateOptions", "required", "placeholder", "monthsToShow", "minDate", "maxDate", "slotProps", "endAdornment"];
|
|
20
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -24,13 +7,24 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
24
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import "react-date-range/dist/styles.css";
|
|
11
|
+
import "react-date-range/dist/theme/default.css";
|
|
12
|
+
import { ClearInputAdornment } from "@comet/admin";
|
|
13
|
+
import { Calendar as CalendarIcon } from "@comet/admin-icons";
|
|
14
|
+
import { useThemeProps } from "@mui/material/styles";
|
|
15
|
+
import { useIntl } from "react-intl";
|
|
16
|
+
import { DatePickerNavigation } from "../DatePickerNavigation";
|
|
17
|
+
import { useDateFnsLocale } from "../utils/DateFnsLocaleProvider";
|
|
18
|
+
import { defaultMaxDate, defaultMinDate, getIsoDateString } from "../utils/datePickerHelpers";
|
|
19
|
+
import { Calendar, Root, StartAdornment } from "./DatePicker.slots";
|
|
20
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
21
|
/**
|
|
28
|
-
* @deprecated
|
|
22
|
+
* @deprecated Use `DatePicker` from `@comet/admin` instead.
|
|
29
23
|
*/
|
|
30
|
-
var DatePicker =
|
|
31
|
-
var _useThemeProps =
|
|
24
|
+
export var DatePicker = function DatePicker(inProps) {
|
|
25
|
+
var _useThemeProps = useThemeProps({
|
|
32
26
|
props: inProps,
|
|
33
|
-
name: "
|
|
27
|
+
name: "CometAdminLegacyDatePicker"
|
|
34
28
|
}),
|
|
35
29
|
_onChange = _useThemeProps.onChange,
|
|
36
30
|
value = _useThemeProps.value,
|
|
@@ -39,22 +33,22 @@ var DatePicker = exports.DatePicker = function DatePicker(inProps) {
|
|
|
39
33
|
placeholder = _useThemeProps.placeholder,
|
|
40
34
|
monthsToShow = _useThemeProps.monthsToShow,
|
|
41
35
|
_useThemeProps$minDat = _useThemeProps.minDate,
|
|
42
|
-
minDate = _useThemeProps$minDat === void 0 ?
|
|
36
|
+
minDate = _useThemeProps$minDat === void 0 ? defaultMinDate : _useThemeProps$minDat,
|
|
43
37
|
_useThemeProps$maxDat = _useThemeProps.maxDate,
|
|
44
|
-
maxDate = _useThemeProps$maxDat === void 0 ?
|
|
38
|
+
maxDate = _useThemeProps$maxDat === void 0 ? defaultMaxDate : _useThemeProps$maxDat,
|
|
45
39
|
slotProps = _useThemeProps.slotProps,
|
|
46
40
|
endAdornment = _useThemeProps.endAdornment,
|
|
47
41
|
inputWithPopperProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
48
|
-
var intl =
|
|
49
|
-
var dateFnsLocale =
|
|
42
|
+
var intl = useIntl();
|
|
43
|
+
var dateFnsLocale = useDateFnsLocale();
|
|
50
44
|
var dateValue = value ? new Date(value) : undefined;
|
|
51
|
-
return /*#__PURE__*/(
|
|
45
|
+
return /*#__PURE__*/_jsx(Root, _objectSpread(_objectSpread(_objectSpread({
|
|
52
46
|
value: value ? intl.formatDate(value, formatDateOptions) : "",
|
|
53
|
-
startAdornment: /*#__PURE__*/(
|
|
47
|
+
startAdornment: /*#__PURE__*/_jsx(StartAdornment, _objectSpread(_objectSpread({
|
|
54
48
|
position: "start",
|
|
55
49
|
disablePointerEvents: true
|
|
56
50
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.startAdornment), {}, {
|
|
57
|
-
children: /*#__PURE__*/(
|
|
51
|
+
children: /*#__PURE__*/_jsx(CalendarIcon, {})
|
|
58
52
|
})),
|
|
59
53
|
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : intl.formatMessage({
|
|
60
54
|
id: "comet.datePicker.selectDate",
|
|
@@ -63,8 +57,8 @@ var DatePicker = exports.DatePicker = function DatePicker(inProps) {
|
|
|
63
57
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), inputWithPopperProps), {}, {
|
|
64
58
|
readOnly: true,
|
|
65
59
|
required: required,
|
|
66
|
-
endAdornment: !required && !inputWithPopperProps.disabled ? /*#__PURE__*/(
|
|
67
|
-
children: [/*#__PURE__*/(
|
|
60
|
+
endAdornment: !required && !inputWithPopperProps.disabled ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
61
|
+
children: [/*#__PURE__*/_jsx(ClearInputAdornment, {
|
|
68
62
|
position: "end",
|
|
69
63
|
hasClearableContent: Boolean(value),
|
|
70
64
|
onClick: function onClick() {
|
|
@@ -73,7 +67,7 @@ var DatePicker = exports.DatePicker = function DatePicker(inProps) {
|
|
|
73
67
|
}), endAdornment]
|
|
74
68
|
}) : endAdornment,
|
|
75
69
|
children: function children(closePopper) {
|
|
76
|
-
return /*#__PURE__*/(
|
|
70
|
+
return /*#__PURE__*/_jsx(Calendar, _objectSpread({
|
|
77
71
|
locale: dateFnsLocale,
|
|
78
72
|
minDate: minDate,
|
|
79
73
|
maxDate: maxDate,
|
|
@@ -82,7 +76,7 @@ var DatePicker = exports.DatePicker = function DatePicker(inProps) {
|
|
|
82
76
|
monthDisplayFormat: "MMMM yyyy",
|
|
83
77
|
months: monthsToShow,
|
|
84
78
|
navigatorRenderer: function navigatorRenderer(focusedDate, changeShownDate) {
|
|
85
|
-
return /*#__PURE__*/(
|
|
79
|
+
return /*#__PURE__*/_jsx(DatePickerNavigation, {
|
|
86
80
|
focusedDate: focusedDate,
|
|
87
81
|
changeShownDate: changeShownDate,
|
|
88
82
|
minDate: minDate,
|
|
@@ -92,7 +86,7 @@ var DatePicker = exports.DatePicker = function DatePicker(inProps) {
|
|
|
92
86
|
date: dateValue,
|
|
93
87
|
onChange: function onChange(date) {
|
|
94
88
|
closePopper(true);
|
|
95
|
-
_onChange === null || _onChange === void 0 || _onChange(
|
|
89
|
+
_onChange === null || _onChange === void 0 || _onChange(getIsoDateString(date));
|
|
96
90
|
}
|
|
97
91
|
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.calendar));
|
|
98
92
|
}
|
|
@@ -13,9 +13,7 @@ export declare const Root: import("react").ForwardRefExoticComponent<Omit<Pick<i
|
|
|
13
13
|
className?: string;
|
|
14
14
|
ownerState?: object;
|
|
15
15
|
}, "ref"> & import("react").RefAttributes<unknown>>;
|
|
16
|
-
export declare const StartAdornment: import("react").ForwardRefExoticComponent<Omit<Pick<import("@mui/material").InputAdornmentOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
17
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
|
-
}, "style" | "className" | "classes" | "children" | "sx" | "position" | "variant" | "disablePointerEvents" | "disableTypography">, "slot" | "style" | "title" | "className" | "classes" | "children" | "sx" | "tabIndex" | "color" | "content" | "position" | "translate" | "variant" | "ref" | "suppressHydrationWarning" | "id" | "lang" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "disablePointerEvents" | "disableTypography"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
16
|
+
export declare const StartAdornment: import("react").ForwardRefExoticComponent<Omit<Pick<import("@mui/material").InputAdornmentOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style" | "className" | "classes" | "children" | "sx" | "position" | "variant" | "disablePointerEvents" | "disableTypography">, "slot" | "style" | "title" | "className" | "classes" | "children" | "sx" | "tabIndex" | "color" | "content" | "position" | "translate" | "variant" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "disablePointerEvents" | "disableTypography"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
19
17
|
ownerState?: undefined;
|
|
20
18
|
} & {
|
|
21
19
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.slots.d.ts","sourceRoot":"","sources":["../../src/datePicker/DatePicker.slots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,eAAe,EAAE,KAAK,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACjI,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAI5D,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEzF,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC;IAC7C,IAAI,EAAE,OAAO,eAAe,CAAC;IAC7B,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,QAAQ,EAAE,OAAO,YAAY,CAAC;CACjC,CAAC,CAAC,WAAW,CAAC,CAAC;AAEhB,eAAO,MAAM,IAAI;;;;;mDAGb,CAAC;AAEL,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"DatePicker.slots.d.ts","sourceRoot":"","sources":["../../src/datePicker/DatePicker.slots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,eAAe,EAAE,KAAK,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACjI,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAI5D,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEzF,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC;IAC7C,IAAI,EAAE,OAAO,eAAe,CAAC;IAC7B,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,QAAQ,EAAE,OAAO,YAAY,CAAC;CACjC,CAAC,CAAC,WAAW,CAAC,CAAC;AAEhB,eAAO,MAAM,IAAI;;;;;mDAGb,CAAC;AAEL,eAAO,MAAM,cAAc;;;;;mDAGvB,CAAC;AAEL,eAAO,MAAM,QAAQ;;;;;2CAoFpB,CAAC"}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _material = require("@mui/material");
|
|
9
|
-
var _utils = require("@mui/utils");
|
|
10
|
-
var _reactDateRange = require("react-date-range");
|
|
11
|
-
var _getReactDateRangeStyles = require("../utils/getReactDateRangeStyles");
|
|
12
|
-
var Root = exports.Root = (0, _admin.createComponentSlot)(_admin.InputWithPopper)({
|
|
13
|
-
componentName: "DatePicker",
|
|
1
|
+
import { createComponentSlot, InputWithPopper } from "@comet/admin";
|
|
2
|
+
import { InputAdornment } from "@mui/material";
|
|
3
|
+
import { deepmerge } from "@mui/utils";
|
|
4
|
+
import { Calendar as CalendarBase } from "react-date-range";
|
|
5
|
+
import { getReactDateRangeStyles } from "../utils/getReactDateRangeStyles";
|
|
6
|
+
export var Root = createComponentSlot(InputWithPopper)({
|
|
7
|
+
componentName: "LegacyDatePicker",
|
|
14
8
|
slotName: "root"
|
|
15
9
|
})();
|
|
16
|
-
var StartAdornment =
|
|
17
|
-
componentName: "
|
|
10
|
+
export var StartAdornment = createComponentSlot(InputAdornment)({
|
|
11
|
+
componentName: "LegacyDatePicker",
|
|
18
12
|
slotName: "startAdornment"
|
|
19
13
|
})();
|
|
20
|
-
var Calendar =
|
|
21
|
-
componentName: "
|
|
14
|
+
export var Calendar = createComponentSlot(CalendarBase)({
|
|
15
|
+
componentName: "LegacyDatePicker",
|
|
22
16
|
slotName: "calendar"
|
|
23
17
|
})(function (_ref) {
|
|
24
18
|
var theme = _ref.theme;
|
|
25
|
-
return
|
|
19
|
+
return deepmerge(getReactDateRangeStyles(theme), {
|
|
26
20
|
"& .rdrMonth:first-child:last-child .rdrMonthName": {
|
|
27
21
|
display: "none"
|
|
28
22
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type FieldRenderProps } from "react-final-form";
|
|
2
|
-
import { type DatePickerProps } from "./DatePicker";
|
|
2
|
+
import { type DatePickerProps as DatePickerProps } from "./DatePicker";
|
|
3
3
|
export type FinalFormDatePickerProps = DatePickerProps;
|
|
4
4
|
type FinalFormDatePickerInternalProps = FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated
|
|
6
|
+
* @deprecated Use `DatePickerField` from `@comet/admin` instead.
|
|
7
7
|
*
|
|
8
8
|
* Final Form-compatible DatePicker component.
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinalFormDatePicker.d.ts","sourceRoot":"","sources":["../../src/datePicker/FinalFormDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,
|
|
1
|
+
{"version":3,"file":"FinalFormDatePicker.d.ts","sourceRoot":"","sources":["../../src/datePicker/FinalFormDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAA4B,KAAK,eAAe,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjG,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAEvD,KAAK,gCAAgC,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEzG;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,+BAA+B,wBAAwB,GAAG,gCAAgC,4CAE7H,CAAC"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.FinalFormDatePicker = void 0;
|
|
8
|
-
var _DatePicker = require("./DatePicker");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
2
|
var _excluded = ["meta", "input"];
|
|
11
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -15,16 +7,18 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
15
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import { DatePicker } from "./DatePicker";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
12
|
/**
|
|
19
|
-
* @deprecated
|
|
13
|
+
* @deprecated Use `DatePickerField` from `@comet/admin` instead.
|
|
20
14
|
*
|
|
21
15
|
* Final Form-compatible DatePicker component.
|
|
22
16
|
*
|
|
23
17
|
* @see {@link DateField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
24
18
|
*/
|
|
25
|
-
var FinalFormDatePicker =
|
|
19
|
+
export var FinalFormDatePicker = function FinalFormDatePicker(_ref) {
|
|
26
20
|
var meta = _ref.meta,
|
|
27
21
|
input = _ref.input,
|
|
28
22
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
-
return /*#__PURE__*/(
|
|
23
|
+
return /*#__PURE__*/_jsx(DatePicker, _objectSpread(_objectSpread({}, input), restProps));
|
|
30
24
|
};
|
|
@@ -3,7 +3,7 @@ import { type DateRange } from "./DateRangePicker";
|
|
|
3
3
|
import { type FinalFormDateRangePickerProps } from "./FinalFormDateRangePicker";
|
|
4
4
|
export type DateRangeFieldProps = FieldProps<DateRange, HTMLInputElement> & FinalFormDateRangePickerProps;
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated
|
|
6
|
+
* @deprecated Use `DateRangePickerField` from `@comet/admin` instead.
|
|
7
7
|
*/
|
|
8
8
|
export declare const DateRangeField: ({ ...restProps }: DateRangeFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=DateRangeField.d.ts.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DateRangeField = void 0;
|
|
8
|
-
var _admin = require("@comet/admin");
|
|
9
|
-
var _FinalFormDateRangePicker = require("./FinalFormDateRangePicker");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -15,12 +6,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
15
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
7
|
function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
|
|
17
8
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
9
|
+
import { Field } from "@comet/admin";
|
|
10
|
+
import { FinalFormDateRangePicker } from "./FinalFormDateRangePicker";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
12
|
/**
|
|
19
|
-
* @deprecated
|
|
13
|
+
* @deprecated Use `DateRangePickerField` from `@comet/admin` instead.
|
|
20
14
|
*/
|
|
21
|
-
var DateRangeField =
|
|
15
|
+
export var DateRangeField = function DateRangeField(_ref) {
|
|
22
16
|
var restProps = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
23
|
-
return /*#__PURE__*/(
|
|
24
|
-
component:
|
|
17
|
+
return /*#__PURE__*/_jsx(Field, _objectSpread({
|
|
18
|
+
component: FinalFormDateRangePicker
|
|
25
19
|
}, restProps));
|
|
26
20
|
};
|