@dextinity/admin-date-time 2.0.0-canary-20260729062014

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 (71) hide show
  1. package/LICENSE +24 -0
  2. package/lib/DatePickerNavigation.d.ts +35 -0
  3. package/lib/DatePickerNavigation.d.ts.map +1 -0
  4. package/lib/DatePickerNavigation.js +167 -0
  5. package/lib/datePicker/DateField.d.ts +8 -0
  6. package/lib/datePicker/DateField.d.ts.map +1 -0
  7. package/lib/datePicker/DateField.js +20 -0
  8. package/lib/datePicker/DatePicker.d.ts +36 -0
  9. package/lib/datePicker/DatePicker.d.ts.map +1 -0
  10. package/lib/datePicker/DatePicker.js +93 -0
  11. package/lib/datePicker/DatePicker.slots.d.ts +28 -0
  12. package/lib/datePicker/DatePicker.slots.d.ts.map +1 -0
  13. package/lib/datePicker/DatePicker.slots.js +92 -0
  14. package/lib/datePicker/FinalFormDatePicker.d.ts +14 -0
  15. package/lib/datePicker/FinalFormDatePicker.d.ts.map +1 -0
  16. package/lib/datePicker/FinalFormDatePicker.js +24 -0
  17. package/lib/dateRangePicker/DateRangeField.d.ts +9 -0
  18. package/lib/dateRangePicker/DateRangeField.d.ts.map +1 -0
  19. package/lib/dateRangePicker/DateRangeField.js +20 -0
  20. package/lib/dateRangePicker/DateRangePicker.d.ts +44 -0
  21. package/lib/dateRangePicker/DateRangePicker.d.ts.map +1 -0
  22. package/lib/dateRangePicker/DateRangePicker.js +145 -0
  23. package/lib/dateRangePicker/DateRangePicker.slots.d.ts +28 -0
  24. package/lib/dateRangePicker/DateRangePicker.slots.d.ts.map +1 -0
  25. package/lib/dateRangePicker/DateRangePicker.slots.js +116 -0
  26. package/lib/dateRangePicker/FinalFormDateRangePicker.d.ts +14 -0
  27. package/lib/dateRangePicker/FinalFormDateRangePicker.d.ts.map +1 -0
  28. package/lib/dateRangePicker/FinalFormDateRangePicker.js +24 -0
  29. package/lib/dateTimePicker/DateTimeField.d.ts +8 -0
  30. package/lib/dateTimePicker/DateTimeField.d.ts.map +1 -0
  31. package/lib/dateTimePicker/DateTimeField.js +20 -0
  32. package/lib/dateTimePicker/DateTimePicker.d.ts +39 -0
  33. package/lib/dateTimePicker/DateTimePicker.d.ts.map +1 -0
  34. package/lib/dateTimePicker/DateTimePicker.js +149 -0
  35. package/lib/dateTimePicker/FinalFormDateTimePicker.d.ts +14 -0
  36. package/lib/dateTimePicker/FinalFormDateTimePicker.d.ts.map +1 -0
  37. package/lib/dateTimePicker/FinalFormDateTimePicker.js +24 -0
  38. package/lib/index.d.ts +22 -0
  39. package/lib/index.d.ts.map +1 -0
  40. package/lib/index.js +16 -0
  41. package/lib/timePicker/FinalFormTimePicker.d.ts +14 -0
  42. package/lib/timePicker/FinalFormTimePicker.d.ts.map +1 -0
  43. package/lib/timePicker/FinalFormTimePicker.js +24 -0
  44. package/lib/timePicker/TimeField.d.ts +8 -0
  45. package/lib/timePicker/TimeField.d.ts.map +1 -0
  46. package/lib/timePicker/TimeField.js +20 -0
  47. package/lib/timePicker/TimePicker.d.ts +41 -0
  48. package/lib/timePicker/TimePicker.d.ts.map +1 -0
  49. package/lib/timePicker/TimePicker.js +141 -0
  50. package/lib/timeRangePicker/FinalFormTimeRangePicker.d.ts +14 -0
  51. package/lib/timeRangePicker/FinalFormTimeRangePicker.d.ts.map +1 -0
  52. package/lib/timeRangePicker/FinalFormTimeRangePicker.js +24 -0
  53. package/lib/timeRangePicker/TimeRangeField.d.ts +9 -0
  54. package/lib/timeRangePicker/TimeRangeField.d.ts.map +1 -0
  55. package/lib/timeRangePicker/TimeRangeField.js +20 -0
  56. package/lib/timeRangePicker/TimeRangePicker.d.ts +49 -0
  57. package/lib/timeRangePicker/TimeRangePicker.d.ts.map +1 -0
  58. package/lib/timeRangePicker/TimeRangePicker.js +184 -0
  59. package/lib/utils/DateFnsLocaleProvider.d.ts +13 -0
  60. package/lib/utils/DateFnsLocaleProvider.d.ts.map +1 -0
  61. package/lib/utils/DateFnsLocaleProvider.js +18 -0
  62. package/lib/utils/datePickerHelpers.d.ts +4 -0
  63. package/lib/utils/datePickerHelpers.d.ts.map +1 -0
  64. package/lib/utils/datePickerHelpers.js +8 -0
  65. package/lib/utils/getReactDateRangeStyles.d.ts +4 -0
  66. package/lib/utils/getReactDateRangeStyles.d.ts.map +1 -0
  67. package/lib/utils/getReactDateRangeStyles.js +78 -0
  68. package/lib/utils/timePickerHelpers.d.ts +6 -0
  69. package/lib/utils/timePickerHelpers.d.ts.map +1 -0
  70. package/lib/utils/timePickerHelpers.js +74 -0
  71. package/package.json +83 -0
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2023, Vivid Planet Software GmbH
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,35 @@
1
+ import { Button, type ThemedComponentBaseProps } from "@dextinity/admin";
2
+ import { type ComponentsOverrides, Menu } from "@mui/material";
3
+ import { type Theme } from "@mui/material/styles";
4
+ export interface DatePickerNavigationProps extends ThemedComponentBaseProps<{
5
+ root: "div";
6
+ selectMonthButton: typeof Button;
7
+ selectYearButton: typeof Button;
8
+ selectMonthMenu: typeof Menu;
9
+ selectYearMenu: typeof Menu;
10
+ }> {
11
+ focusedDate: Date;
12
+ changeShownDate: (value: number, mode: "setYear" | "setMonth" | "monthOffset") => void;
13
+ minDate: Date;
14
+ maxDate: Date;
15
+ }
16
+ /**
17
+ * @deprecated The `@dextinity/admin-date-time` package is deprecated. Use the date/time components from `@dextinity/admin` instead.
18
+ */
19
+ export declare const DatePickerNavigation: (inProps: DatePickerNavigationProps) => import("react/jsx-runtime").JSX.Element;
20
+ export type DatePickerNavigationClassKey = "root" | "selectButton" | "selectMonthButton" | "selectYearButton" | "selectMenu" | "selectMonthMenu" | "selectYearMenu";
21
+ declare module "@mui/material/styles" {
22
+ interface ComponentNameToClassKey {
23
+ CometAdminDatePickerNavigation: DatePickerNavigationClassKey;
24
+ }
25
+ interface ComponentsPropsList {
26
+ CometAdminDatePickerNavigation: DatePickerNavigationProps;
27
+ }
28
+ interface Components {
29
+ CometAdminDatePickerNavigation?: {
30
+ defaultProps?: Partial<ComponentsPropsList["CometAdminDatePickerNavigation"]>;
31
+ styleOverrides?: ComponentsOverrides<Theme>["CometAdminDatePickerNavigation"];
32
+ };
33
+ }
34
+ }
35
+ //# sourceMappingURL=DatePickerNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerNavigation.d.ts","sourceRoot":"","sources":["../src/DatePickerNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAuB,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE9F,OAAO,EAAsB,KAAK,mBAAmB,EAAc,IAAI,EAAyB,MAAM,eAAe,CAAC;AACtH,OAAO,EAAO,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AAItE,MAAM,WAAW,yBACb,SAAQ,wBAAwB,CAAC;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,iBAAiB,EAAE,OAAO,MAAM,CAAC;IACjC,gBAAgB,EAAE,OAAO,MAAM,CAAC;IAChC,eAAe,EAAE,OAAO,IAAI,CAAC;IAC7B,cAAc,EAAE,OAAO,IAAI,CAAC;CAC/B,CAAC;IACF,WAAW,EAAE,IAAI,CAAC;IAClB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;IACvF,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,4CAwFtE,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAClC,MAAM,GACN,cAAc,GACd,mBAAmB,GACnB,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,CAAC;AAyFvB,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,8BAA8B,EAAE,4BAA4B,CAAC;KAChE;IAED,UAAU,mBAAmB;QACzB,8BAA8B,EAAE,yBAAyB,CAAC;KAC7D;IAED,UAAU,UAAU;QAChB,8BAA8B,CAAC,EAAE;YAC7B,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,gCAAgC,CAAC,CAAC,CAAC;YAC9E,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,gCAAgC,CAAC,CAAC;SACjF,CAAC;KACL;CACJ"}
@@ -0,0 +1,167 @@
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); }
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
3
+ var _excluded = ["focusedDate", "changeShownDate", "minDate", "maxDate", "slotProps"];
4
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
5
+ 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; }
6
+ 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; }
7
+ 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; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
+ 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); }
10
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
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; }
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; }
18
+ import { Button, createComponentSlot } from "@dextinity/admin";
19
+ import { ArrowLeft, ArrowRight, ChevronDown } from "@dextinity/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
+ /**
26
+ * @deprecated The `@dextinity/admin-date-time` package is deprecated. Use the date/time components from `@dextinity/admin` instead.
27
+ */
28
+ export var DatePickerNavigation = function DatePickerNavigation(inProps) {
29
+ var _useThemeProps = useThemeProps({
30
+ props: inProps,
31
+ name: "CometAdminDatePickerNavigation"
32
+ }),
33
+ focusedDate = _useThemeProps.focusedDate,
34
+ changeShownDate = _useThemeProps.changeShownDate,
35
+ minDate = _useThemeProps.minDate,
36
+ maxDate = _useThemeProps.maxDate,
37
+ slotProps = _useThemeProps.slotProps,
38
+ restProps = _objectWithoutProperties(_useThemeProps, _excluded);
39
+ var intl = useIntl();
40
+ var _useState = useState(false),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ showMonthSelect = _useState2[0],
43
+ setShowMonthSelect = _useState2[1];
44
+ var _useState3 = useState(false),
45
+ _useState4 = _slicedToArray(_useState3, 2),
46
+ showYearSelect = _useState4[0],
47
+ setShowYearSelect = _useState4[1];
48
+ var monthSelectRef = useRef(null);
49
+ var yearSelectRef = useRef(null);
50
+ return /*#__PURE__*/_jsxs(Root, _objectSpread(_objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), restProps), {}, {
51
+ children: [/*#__PURE__*/_jsx(IconButton, {
52
+ onClick: function onClick() {
53
+ return changeShownDate(-1, "monthOffset");
54
+ },
55
+ children: /*#__PURE__*/_jsx(ArrowLeft, {})
56
+ }), /*#__PURE__*/_jsxs(Box, {
57
+ children: [/*#__PURE__*/_jsx(SelectMonthButton, _objectSpread(_objectSpread({
58
+ size: "small",
59
+ onClick: function onClick() {
60
+ return setShowMonthSelect(true);
61
+ },
62
+ ref: monthSelectRef,
63
+ endIcon: /*#__PURE__*/_jsx(ChevronDown, {}),
64
+ variant: "textDark"
65
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectMonthButton), {}, {
66
+ children: intl.formatDate(focusedDate, {
67
+ month: "long"
68
+ })
69
+ })), /*#__PURE__*/_jsx(SelectMonthMenu, _objectSpread(_objectSpread({
70
+ open: showMonthSelect,
71
+ onClose: function onClose() {
72
+ return setShowMonthSelect(false);
73
+ },
74
+ anchorEl: monthSelectRef.current
75
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectMonthMenu), {}, {
76
+ children: new Array(12).fill(null).map(function (_, month) {
77
+ return /*#__PURE__*/_jsx(MenuItem, {
78
+ selected: month === focusedDate.getMonth(),
79
+ value: month,
80
+ onClick: function onClick() {
81
+ setShowMonthSelect(false);
82
+ changeShownDate(month, "setMonth");
83
+ },
84
+ children: intl.formatDate(new Date(focusedDate.getFullYear(), month), {
85
+ month: "long"
86
+ })
87
+ }, month);
88
+ })
89
+ })), /*#__PURE__*/_jsx(SelectYearButton, _objectSpread(_objectSpread({
90
+ size: "small",
91
+ ref: yearSelectRef,
92
+ onClick: function onClick() {
93
+ return setShowYearSelect(true);
94
+ },
95
+ endIcon: /*#__PURE__*/_jsx(ChevronDown, {}),
96
+ variant: "textDark"
97
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectYearButton), {}, {
98
+ children: focusedDate.getFullYear()
99
+ })), /*#__PURE__*/_jsx(SelectYearMenu, _objectSpread(_objectSpread({
100
+ open: showYearSelect,
101
+ onClose: function onClose() {
102
+ return setShowYearSelect(false);
103
+ },
104
+ anchorEl: yearSelectRef.current
105
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.selectYearMenu), {}, {
106
+ children: new Array(maxDate.getFullYear() - minDate.getFullYear() + 1).fill(maxDate.getFullYear()).map(function (val, i) {
107
+ var year = val - i;
108
+ return /*#__PURE__*/_jsx(MenuItem, {
109
+ selected: year === focusedDate.getFullYear(),
110
+ value: year,
111
+ onClick: function onClick() {
112
+ setShowYearSelect(false);
113
+ changeShownDate(year, "setYear");
114
+ },
115
+ children: year
116
+ }, year);
117
+ })
118
+ }))]
119
+ }), /*#__PURE__*/_jsx(IconButton, {
120
+ onClick: function onClick() {
121
+ return changeShownDate(+1, "monthOffset");
122
+ },
123
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
124
+ })]
125
+ }));
126
+ };
127
+ var Root = createComponentSlot("div")({
128
+ componentName: "DatePickerNavigation",
129
+ slotName: "root"
130
+ })(function (_ref) {
131
+ var theme = _ref.theme;
132
+ 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]);
133
+ });
134
+ var SelectMonthButton = createComponentSlot(Button)({
135
+ componentName: "DatePickerNavigation",
136
+ slotName: "selectMonthButton",
137
+ classesResolver: function classesResolver() {
138
+ return ["selectButton"];
139
+ }
140
+ })(function (_ref2) {
141
+ var theme = _ref2.theme;
142
+ 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);
143
+ });
144
+ var SelectYearButton = createComponentSlot(Button)({
145
+ componentName: "DatePickerNavigation",
146
+ slotName: "selectYearButton",
147
+ classesResolver: function classesResolver() {
148
+ return ["selectButton"];
149
+ }
150
+ })(function (_ref3) {
151
+ var theme = _ref3.theme;
152
+ 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);
153
+ });
154
+ var SelectMonthMenu = createComponentSlot(Menu)({
155
+ componentName: "DatePickerNavigation",
156
+ slotName: "selectMonthMenu",
157
+ classesResolver: function classesResolver() {
158
+ return ["selectMenu"];
159
+ }
160
+ })(css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n & .", " {\n min-width: 110px;\n max-height: 400px;\n }\n"])), menuClasses.paper));
161
+ var SelectYearMenu = createComponentSlot(Menu)({
162
+ componentName: "DatePickerNavigation",
163
+ slotName: "selectYearMenu",
164
+ classesResolver: function classesResolver() {
165
+ return ["selectMenu"];
166
+ }
167
+ })(css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & .", " {\n min-width: 110px;\n max-height: 400px;\n }\n"])), menuClasses.paper));
@@ -0,0 +1,8 @@
1
+ import { type FieldProps } from "@dextinity/admin";
2
+ import { type FinalFormDatePickerProps } from "./FinalFormDatePicker";
3
+ export type DateFieldProps = FieldProps<Date, HTMLInputElement> & FinalFormDatePickerProps;
4
+ /**
5
+ * @deprecated Use `DatePickerField` from `@dextinity/admin` instead.
6
+ */
7
+ export declare const DateField: ({ ...restProps }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=DateField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../src/datePicker/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,GAAG,wBAAwB,CAAC;AAE3F;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,kBAAkB,cAAc,4CAEzD,CAAC"}
@@ -0,0 +1,20 @@
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); }
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; }
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; }
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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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); }
7
+ function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
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 "@dextinity/admin";
10
+ import { FinalFormDatePicker } from "./FinalFormDatePicker";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ /**
13
+ * @deprecated Use `DatePickerField` from `@dextinity/admin` instead.
14
+ */
15
+ export var DateField = function DateField(_ref) {
16
+ var restProps = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
17
+ return /*#__PURE__*/_jsx(Field, _objectSpread({
18
+ component: FinalFormDatePicker
19
+ }, restProps));
20
+ };
@@ -0,0 +1,36 @@
1
+ import "react-date-range/dist/styles.css";
2
+ import "react-date-range/dist/theme/default.css";
3
+ import { type InputWithPopperProps } from "@dextinity/admin";
4
+ import type { ComponentsOverrides } from "@mui/material";
5
+ import { type Theme } from "@mui/material/styles";
6
+ import { type FormatDateOptions } from "react-intl";
7
+ import { type DatePickerClassKey, type SlotProps } from "./DatePicker.slots";
8
+ export interface DatePickerProps extends Omit<InputWithPopperProps, "children" | "value" | "onChange" | "slotProps"> {
9
+ onChange?: (date?: string) => void;
10
+ value?: string;
11
+ formatDateOptions?: FormatDateOptions;
12
+ required?: boolean;
13
+ monthsToShow?: number;
14
+ maxDate?: Date;
15
+ minDate?: Date;
16
+ slotProps?: SlotProps;
17
+ }
18
+ /**
19
+ * @deprecated Use `DatePicker` from `@dextinity/admin` instead.
20
+ */
21
+ export declare const DatePicker: (inProps: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
22
+ declare module "@mui/material/styles" {
23
+ interface ComponentNameToClassKey {
24
+ CometAdminLegacyDatePicker: DatePickerClassKey;
25
+ }
26
+ interface ComponentsPropsList {
27
+ CometAdminLegacyDatePicker: DatePickerProps;
28
+ }
29
+ interface Components {
30
+ CometAdminLegacyDatePicker?: {
31
+ defaultProps?: Partial<ComponentsPropsList["CometAdminLegacyDatePicker"]>;
32
+ styleOverrides?: ComponentsOverrides<Theme>["CometAdminLegacyDatePicker"];
33
+ };
34
+ }
35
+ }
36
+ //# sourceMappingURL=DatePicker.d.ts.map
@@ -0,0 +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,kBAAkB,CAAC;AAElF,OAAO,KAAK,EAAE,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"}
@@ -0,0 +1,93 @@
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); }
2
+ var _excluded = ["onChange", "value", "formatDateOptions", "required", "placeholder", "monthsToShow", "minDate", "maxDate", "slotProps", "endAdornment"];
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; }
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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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); }
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; }
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 "@dextinity/admin";
13
+ import { Calendar as CalendarIcon } from "@dextinity/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";
21
+ /**
22
+ * @deprecated Use `DatePicker` from `@dextinity/admin` instead.
23
+ */
24
+ export var DatePicker = function DatePicker(inProps) {
25
+ var _useThemeProps = useThemeProps({
26
+ props: inProps,
27
+ name: "CometAdminLegacyDatePicker"
28
+ }),
29
+ _onChange = _useThemeProps.onChange,
30
+ value = _useThemeProps.value,
31
+ formatDateOptions = _useThemeProps.formatDateOptions,
32
+ required = _useThemeProps.required,
33
+ placeholder = _useThemeProps.placeholder,
34
+ monthsToShow = _useThemeProps.monthsToShow,
35
+ _useThemeProps$minDat = _useThemeProps.minDate,
36
+ minDate = _useThemeProps$minDat === void 0 ? defaultMinDate : _useThemeProps$minDat,
37
+ _useThemeProps$maxDat = _useThemeProps.maxDate,
38
+ maxDate = _useThemeProps$maxDat === void 0 ? defaultMaxDate : _useThemeProps$maxDat,
39
+ slotProps = _useThemeProps.slotProps,
40
+ endAdornment = _useThemeProps.endAdornment,
41
+ inputWithPopperProps = _objectWithoutProperties(_useThemeProps, _excluded);
42
+ var intl = useIntl();
43
+ var dateFnsLocale = useDateFnsLocale();
44
+ var dateValue = value ? new Date(value) : undefined;
45
+ return /*#__PURE__*/_jsx(Root, _objectSpread(_objectSpread(_objectSpread({
46
+ value: value ? intl.formatDate(value, formatDateOptions) : "",
47
+ startAdornment: /*#__PURE__*/_jsx(StartAdornment, _objectSpread(_objectSpread({
48
+ position: "start",
49
+ disablePointerEvents: true
50
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.startAdornment), {}, {
51
+ children: /*#__PURE__*/_jsx(CalendarIcon, {})
52
+ })),
53
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : intl.formatMessage({
54
+ id: "comet.datePicker.selectDate",
55
+ defaultMessage: "Select date"
56
+ })
57
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), inputWithPopperProps), {}, {
58
+ readOnly: true,
59
+ required: required,
60
+ endAdornment: !required && !inputWithPopperProps.disabled && value ? /*#__PURE__*/_jsxs(_Fragment, {
61
+ children: [/*#__PURE__*/_jsx(ClearInputAdornment, {
62
+ position: "end",
63
+ onClick: function onClick() {
64
+ return _onChange && _onChange(undefined);
65
+ }
66
+ }), endAdornment]
67
+ }) : endAdornment,
68
+ children: function children(closePopper) {
69
+ return /*#__PURE__*/_jsx(Calendar, _objectSpread({
70
+ locale: dateFnsLocale,
71
+ minDate: minDate,
72
+ maxDate: maxDate,
73
+ weekStartsOn: 1,
74
+ direction: "horizontal",
75
+ monthDisplayFormat: "MMMM yyyy",
76
+ months: monthsToShow,
77
+ navigatorRenderer: function navigatorRenderer(focusedDate, changeShownDate) {
78
+ return /*#__PURE__*/_jsx(DatePickerNavigation, {
79
+ focusedDate: focusedDate,
80
+ changeShownDate: changeShownDate,
81
+ minDate: minDate,
82
+ maxDate: maxDate
83
+ });
84
+ },
85
+ date: dateValue,
86
+ onChange: function onChange(date) {
87
+ closePopper(true);
88
+ _onChange === null || _onChange === void 0 || _onChange(getIsoDateString(date));
89
+ }
90
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.calendar));
91
+ }
92
+ }));
93
+ };
@@ -0,0 +1,28 @@
1
+ import { InputWithPopper, type InputWithPopperClassKey, type ThemedComponentBaseProps } from "@dextinity/admin";
2
+ import { InputAdornment } from "@mui/material";
3
+ import { Calendar as CalendarBase } from "react-date-range";
4
+ export type DatePickerClassKey = InputWithPopperClassKey | "calendar" | "startAdornment";
5
+ export type SlotProps = ThemedComponentBaseProps<{
6
+ root: typeof InputWithPopper;
7
+ startAdornment: typeof InputAdornment;
8
+ calendar: typeof CalendarBase;
9
+ }>["slotProps"];
10
+ export declare const Root: import("react").ForwardRefExoticComponent<Omit<Pick<import("@dextinity/admin").InputWithPopperProps, keyof import("@dextinity/admin").InputWithPopperProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
+ ownerState?: undefined;
12
+ } & {
13
+ className?: string;
14
+ ownerState?: object;
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<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> & {
17
+ ownerState?: undefined;
18
+ } & {
19
+ className?: string;
20
+ ownerState?: object;
21
+ }, "ref"> & import("react").RefAttributes<unknown>>;
22
+ export declare const Calendar: import("react").ForwardRefExoticComponent<Pick<import("react-date-range").CalendarProps, keyof import("react-date-range").CalendarProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
23
+ ownerState?: undefined;
24
+ } & {
25
+ className?: string;
26
+ ownerState?: object;
27
+ } & import("react").RefAttributes<unknown>>;
28
+ //# sourceMappingURL=DatePicker.slots.d.ts.map
@@ -0,0 +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,kBAAkB,CAAC;AACrI,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"}
@@ -0,0 +1,92 @@
1
+ import { createComponentSlot, InputWithPopper } from "@dextinity/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",
8
+ slotName: "root"
9
+ })();
10
+ export var StartAdornment = createComponentSlot(InputAdornment)({
11
+ componentName: "LegacyDatePicker",
12
+ slotName: "startAdornment"
13
+ })();
14
+ export var Calendar = createComponentSlot(CalendarBase)({
15
+ componentName: "LegacyDatePicker",
16
+ slotName: "calendar"
17
+ })(function (_ref) {
18
+ var theme = _ref.theme;
19
+ return deepmerge(getReactDateRangeStyles(theme), {
20
+ "& .rdrMonth:first-child:last-child .rdrMonthName": {
21
+ display: "none"
22
+ },
23
+ "& .rdrDayStartPreview": {
24
+ borderTopLeftRadius: 4,
25
+ borderBottomLeftRadius: 4,
26
+ left: 4
27
+ },
28
+ "& .rdrDayEndPreview": {
29
+ borderTopRightRadius: 4,
30
+ borderBottomRightRadius: 4,
31
+ right: 4
32
+ },
33
+ "& .rdrDay": {
34
+ "& .rdrSelected": {
35
+ top: 0,
36
+ bottom: 0,
37
+ left: 4,
38
+ right: 4,
39
+ borderRadius: 4,
40
+ backgroundColor: theme.palette.primary.main,
41
+ "& ~ .rdrDayNumber span": {
42
+ fontWeight: theme.typography.fontWeightBold,
43
+ color: "white"
44
+ },
45
+ "& ~ .rdrDayStartPreview, & ~ .rdrDayEndPreview": {
46
+ display: "none",
47
+ "& ~ .rdrDayNumber span": {
48
+ color: "white"
49
+ }
50
+ }
51
+ },
52
+ "& .rdrSelected ~ .rdrDayNumber span": {
53
+ fontWeight: theme.typography.fontWeightBold
54
+ },
55
+ "&.rdrDayPassive .rdrSelected ~ .rdrDayNumber span": {
56
+ color: theme.palette.grey[100],
57
+ fontWeight: theme.typography.fontWeightRegular
58
+ },
59
+ "&.rdrDayToday": {
60
+ "&.rdrDayPassive": {
61
+ "& .rdrSelected, & .rdrDayStartPreview, & .rdrDayEndPreview": {
62
+ "& ~ .rdrDayNumber span": {
63
+ color: theme.palette.grey[100]
64
+ }
65
+ },
66
+ "& .rdrSelected": {
67
+ backgroundColor: theme.palette.grey[50],
68
+ display: "block",
69
+ "& ~ .rdrDayNumber span": {
70
+ color: theme.palette.grey[100]
71
+ }
72
+ }
73
+ },
74
+ "& .rdrSelected ~ .rdrDayNumber span": {
75
+ fontWeight: theme.typography.fontWeightBold
76
+ }
77
+ }
78
+ },
79
+ "& .rdrDayStartOfMonth .rdrDayInPreview, & .rdrDayStartOfMonth .rdrDayEndPreview, & .rdrDayStartOfWeek .rdrDayInPreview, & .rdrDayStartOfWeek .rdrDayEndPreview": {
80
+ borderTopLeftRadius: 4,
81
+ borderBottomLeftRadius: 4
82
+ },
83
+ "& .rdrDayEndOfMonth .rdrDayInPreview, & .rdrDayEndOfMonth .rdrDayStartPreview, & .rdrDayEndOfWeek .rdrDayInPreview, & .rdrDayEndOfWeek .rdrDayStartPreview": {
84
+ borderTopRightRadius: 4,
85
+ borderBottomRightRadius: 4
86
+ },
87
+ "& .rdrDayStartPreview.rdrDayEndPreview": {
88
+ right: 4,
89
+ left: 4
90
+ }
91
+ });
92
+ });
@@ -0,0 +1,14 @@
1
+ import type { FieldRenderProps } from "react-final-form";
2
+ import { type DatePickerProps as DatePickerProps } from "./DatePicker";
3
+ export type FinalFormDatePickerProps = DatePickerProps;
4
+ type FinalFormDatePickerInternalProps = FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
5
+ /**
6
+ * @deprecated Use `DatePickerField` from `@dextinity/admin` instead.
7
+ *
8
+ * Final Form-compatible DatePicker component.
9
+ *
10
+ * @see {@link DateField} – preferred for typical form use. Use this only if no Field wrapper is needed.
11
+ */
12
+ export declare const FinalFormDatePicker: ({ meta, input, ...restProps }: FinalFormDatePickerProps & FinalFormDatePickerInternalProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=FinalFormDatePicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FinalFormDatePicker.d.ts","sourceRoot":"","sources":["../../src/datePicker/FinalFormDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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"}
@@ -0,0 +1,24 @@
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); }
2
+ var _excluded = ["meta", "input"];
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; }
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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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); }
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; }
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";
12
+ /**
13
+ * @deprecated Use `DatePickerField` from `@dextinity/admin` instead.
14
+ *
15
+ * Final Form-compatible DatePicker component.
16
+ *
17
+ * @see {@link DateField} – preferred for typical form use. Use this only if no Field wrapper is needed.
18
+ */
19
+ export var FinalFormDatePicker = function FinalFormDatePicker(_ref) {
20
+ var meta = _ref.meta,
21
+ input = _ref.input,
22
+ restProps = _objectWithoutProperties(_ref, _excluded);
23
+ return /*#__PURE__*/_jsx(DatePicker, _objectSpread(_objectSpread({}, input), restProps));
24
+ };
@@ -0,0 +1,9 @@
1
+ import { type FieldProps } from "@dextinity/admin";
2
+ import type { DateRange } from "./DateRangePicker";
3
+ import { type FinalFormDateRangePickerProps } from "./FinalFormDateRangePicker";
4
+ export type DateRangeFieldProps = FieldProps<DateRange, HTMLInputElement> & FinalFormDateRangePickerProps;
5
+ /**
6
+ * @deprecated Use `DateRangePickerField` from `@dextinity/admin` instead.
7
+ */
8
+ export declare const DateRangeField: ({ ...restProps }: DateRangeFieldProps) => import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=DateRangeField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateRangeField.d.ts","sourceRoot":"","sources":["../../src/dateRangePicker/DateRangeField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAA4B,KAAK,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE1G,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,EAAE,gBAAgB,CAAC,GAAG,6BAA6B,CAAC;AAE1G;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,kBAAkB,mBAAmB,4CAEnE,CAAC"}