@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.
- package/LICENSE +24 -0
- package/lib/DatePickerNavigation.d.ts +35 -0
- package/lib/DatePickerNavigation.d.ts.map +1 -0
- package/lib/DatePickerNavigation.js +167 -0
- package/lib/datePicker/DateField.d.ts +8 -0
- package/lib/datePicker/DateField.d.ts.map +1 -0
- package/lib/datePicker/DateField.js +20 -0
- package/lib/datePicker/DatePicker.d.ts +36 -0
- package/lib/datePicker/DatePicker.d.ts.map +1 -0
- package/lib/datePicker/DatePicker.js +93 -0
- package/lib/datePicker/DatePicker.slots.d.ts +28 -0
- package/lib/datePicker/DatePicker.slots.d.ts.map +1 -0
- package/lib/datePicker/DatePicker.slots.js +92 -0
- package/lib/datePicker/FinalFormDatePicker.d.ts +14 -0
- package/lib/datePicker/FinalFormDatePicker.d.ts.map +1 -0
- package/lib/datePicker/FinalFormDatePicker.js +24 -0
- package/lib/dateRangePicker/DateRangeField.d.ts +9 -0
- package/lib/dateRangePicker/DateRangeField.d.ts.map +1 -0
- package/lib/dateRangePicker/DateRangeField.js +20 -0
- package/lib/dateRangePicker/DateRangePicker.d.ts +44 -0
- package/lib/dateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/lib/dateRangePicker/DateRangePicker.js +145 -0
- package/lib/dateRangePicker/DateRangePicker.slots.d.ts +28 -0
- package/lib/dateRangePicker/DateRangePicker.slots.d.ts.map +1 -0
- package/lib/dateRangePicker/DateRangePicker.slots.js +116 -0
- package/lib/dateRangePicker/FinalFormDateRangePicker.d.ts +14 -0
- package/lib/dateRangePicker/FinalFormDateRangePicker.d.ts.map +1 -0
- package/lib/dateRangePicker/FinalFormDateRangePicker.js +24 -0
- package/lib/dateTimePicker/DateTimeField.d.ts +8 -0
- package/lib/dateTimePicker/DateTimeField.d.ts.map +1 -0
- package/lib/dateTimePicker/DateTimeField.js +20 -0
- package/lib/dateTimePicker/DateTimePicker.d.ts +39 -0
- package/lib/dateTimePicker/DateTimePicker.d.ts.map +1 -0
- package/lib/dateTimePicker/DateTimePicker.js +149 -0
- package/lib/dateTimePicker/FinalFormDateTimePicker.d.ts +14 -0
- package/lib/dateTimePicker/FinalFormDateTimePicker.d.ts.map +1 -0
- package/lib/dateTimePicker/FinalFormDateTimePicker.js +24 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +16 -0
- package/lib/timePicker/FinalFormTimePicker.d.ts +14 -0
- package/lib/timePicker/FinalFormTimePicker.d.ts.map +1 -0
- package/lib/timePicker/FinalFormTimePicker.js +24 -0
- package/lib/timePicker/TimeField.d.ts +8 -0
- package/lib/timePicker/TimeField.d.ts.map +1 -0
- package/lib/timePicker/TimeField.js +20 -0
- package/lib/timePicker/TimePicker.d.ts +41 -0
- package/lib/timePicker/TimePicker.d.ts.map +1 -0
- package/lib/timePicker/TimePicker.js +141 -0
- package/lib/timeRangePicker/FinalFormTimeRangePicker.d.ts +14 -0
- package/lib/timeRangePicker/FinalFormTimeRangePicker.d.ts.map +1 -0
- package/lib/timeRangePicker/FinalFormTimeRangePicker.js +24 -0
- package/lib/timeRangePicker/TimeRangeField.d.ts +9 -0
- package/lib/timeRangePicker/TimeRangeField.d.ts.map +1 -0
- package/lib/timeRangePicker/TimeRangeField.js +20 -0
- package/lib/timeRangePicker/TimeRangePicker.d.ts +49 -0
- package/lib/timeRangePicker/TimeRangePicker.d.ts.map +1 -0
- package/lib/timeRangePicker/TimeRangePicker.js +184 -0
- package/lib/utils/DateFnsLocaleProvider.d.ts +13 -0
- package/lib/utils/DateFnsLocaleProvider.d.ts.map +1 -0
- package/lib/utils/DateFnsLocaleProvider.js +18 -0
- package/lib/utils/datePickerHelpers.d.ts +4 -0
- package/lib/utils/datePickerHelpers.d.ts.map +1 -0
- package/lib/utils/datePickerHelpers.js +8 -0
- package/lib/utils/getReactDateRangeStyles.d.ts +4 -0
- package/lib/utils/getReactDateRangeStyles.d.ts.map +1 -0
- package/lib/utils/getReactDateRangeStyles.js +78 -0
- package/lib/utils/timePickerHelpers.d.ts +6 -0
- package/lib/utils/timePickerHelpers.d.ts.map +1 -0
- package/lib/utils/timePickerHelpers.js +74 -0
- package/package.json +83 -0
|
@@ -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 { FinalFormDateRangePicker } from "./FinalFormDateRangePicker";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `DateRangePickerField` from `@dextinity/admin` instead.
|
|
14
|
+
*/
|
|
15
|
+
export var DateRangeField = function DateRangeField(_ref) {
|
|
16
|
+
var restProps = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
17
|
+
return /*#__PURE__*/_jsx(Field, _objectSpread({
|
|
18
|
+
component: FinalFormDateRangePicker
|
|
19
|
+
}, restProps));
|
|
20
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
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 DateRangePickerClassKey, type SlotProps } from "./DateRangePicker.slots";
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `DateRange` from `@dextinity/admin` instead.
|
|
10
|
+
*/
|
|
11
|
+
export type DateRange = {
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
};
|
|
15
|
+
export interface DateRangePickerProps extends Omit<InputWithPopperProps, "children" | "value" | "onChange" | "slotProps"> {
|
|
16
|
+
onChange?: (range?: DateRange) => void;
|
|
17
|
+
value?: DateRange;
|
|
18
|
+
formatDateOptions?: FormatDateOptions;
|
|
19
|
+
rangeStringSeparator?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
monthsToShow?: number;
|
|
22
|
+
maxDate?: Date;
|
|
23
|
+
minDate?: Date;
|
|
24
|
+
slotProps?: SlotProps;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use `DateRangePicker` from `@dextinity/admin` instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DateRangePicker: (inProps: DateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare module "@mui/material/styles" {
|
|
31
|
+
interface ComponentNameToClassKey {
|
|
32
|
+
CometAdminLegacyDateRangePicker: DateRangePickerClassKey;
|
|
33
|
+
}
|
|
34
|
+
interface ComponentsPropsList {
|
|
35
|
+
CometAdminLegacyDateRangePicker: DateRangePickerProps;
|
|
36
|
+
}
|
|
37
|
+
interface Components {
|
|
38
|
+
CometAdminLegacyDateRangePicker?: {
|
|
39
|
+
defaultProps?: Partial<ComponentsPropsList["CometAdminLegacyDateRangePicker"]>;
|
|
40
|
+
styleOverrides?: ComponentsOverrides<Theme>["CometAdminLegacyDateRangePicker"];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=DateRangePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../src/dateRangePicker/DateRangePicker.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;AAEjE,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAK7D,OAAO,EAAa,KAAK,uBAAuB,EAAQ,KAAK,SAAS,EAAkB,MAAM,yBAAyB,CAAC;AAExH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;IACrH,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,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;AAyCD;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,oBAAoB,4CA6E5D,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,+BAA+B,EAAE,uBAAuB,CAAC;KAC5D;IAED,UAAU,mBAAmB;QACzB,+BAA+B,EAAE,oBAAoB,CAAC;KACzD;IAED,UAAU,UAAU;QAChB,+BAA+B,CAAC,EAAE;YAC9B,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,iCAAiC,CAAC,CAAC,CAAC;YAC/E,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,iCAAiC,CAAC,CAAC;SAClF,CAAC;KACL;CACJ"}
|
|
@@ -0,0 +1,145 @@
|
|
|
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", "rangeStringSeparator", "endAdornment", "required", "placeholder", "monthsToShow", "minDate", "maxDate", "slotProps"];
|
|
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 } 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 { DateRange, Root, StartAdornment } from "./DateRangePicker.slots";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use `DateRange` from `@dextinity/admin` instead.
|
|
23
|
+
*/
|
|
24
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
var useDateRangeTextValue = function useDateRangeTextValue(range, rangeStringSeparator, formatDateOptions) {
|
|
26
|
+
var intl = useIntl();
|
|
27
|
+
if (range) {
|
|
28
|
+
var startDateString = intl.formatDate(range.start, formatDateOptions);
|
|
29
|
+
var endDateString = intl.formatDate(range.end, formatDateOptions);
|
|
30
|
+
if (startDateString === endDateString) {
|
|
31
|
+
return startDateString;
|
|
32
|
+
}
|
|
33
|
+
return "".concat(startDateString).concat(rangeStringSeparator).concat(endDateString);
|
|
34
|
+
}
|
|
35
|
+
return "";
|
|
36
|
+
};
|
|
37
|
+
var rangeKey = "pickedDateRange";
|
|
38
|
+
var getRangeFromValue = function getRangeFromValue(value) {
|
|
39
|
+
if (value !== null && value !== void 0 && value.start) {
|
|
40
|
+
var startDate = new Date(value.start);
|
|
41
|
+
return {
|
|
42
|
+
key: rangeKey,
|
|
43
|
+
startDate: startDate,
|
|
44
|
+
endDate: value.end ? new Date(value.end) : startDate
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The range-picker from react-date-range always requires at least one valid date range to prevent every date from being highlighted as selected.
|
|
49
|
+
// If no `value` is defined, this returns the current date as the selected range.
|
|
50
|
+
// This range is only for visual purposes and will never be passed to a change event.
|
|
51
|
+
return {
|
|
52
|
+
key: rangeKey,
|
|
53
|
+
startDate: new Date(),
|
|
54
|
+
endDate: new Date()
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `DateRangePicker` from `@dextinity/admin` instead.
|
|
60
|
+
*/
|
|
61
|
+
export var DateRangePicker = function DateRangePicker(inProps) {
|
|
62
|
+
var _useThemeProps = useThemeProps({
|
|
63
|
+
props: inProps,
|
|
64
|
+
name: "CometAdminLegacyDateRangePicker"
|
|
65
|
+
}),
|
|
66
|
+
_onChange = _useThemeProps.onChange,
|
|
67
|
+
value = _useThemeProps.value,
|
|
68
|
+
formatDateOptions = _useThemeProps.formatDateOptions,
|
|
69
|
+
_useThemeProps$rangeS = _useThemeProps.rangeStringSeparator,
|
|
70
|
+
rangeStringSeparator = _useThemeProps$rangeS === void 0 ? " — " : _useThemeProps$rangeS,
|
|
71
|
+
endAdornment = _useThemeProps.endAdornment,
|
|
72
|
+
required = _useThemeProps.required,
|
|
73
|
+
placeholder = _useThemeProps.placeholder,
|
|
74
|
+
_useThemeProps$months = _useThemeProps.monthsToShow,
|
|
75
|
+
monthsToShow = _useThemeProps$months === void 0 ? 2 : _useThemeProps$months,
|
|
76
|
+
_useThemeProps$minDat = _useThemeProps.minDate,
|
|
77
|
+
minDate = _useThemeProps$minDat === void 0 ? defaultMinDate : _useThemeProps$minDat,
|
|
78
|
+
_useThemeProps$maxDat = _useThemeProps.maxDate,
|
|
79
|
+
maxDate = _useThemeProps$maxDat === void 0 ? defaultMaxDate : _useThemeProps$maxDat,
|
|
80
|
+
slotProps = _useThemeProps.slotProps,
|
|
81
|
+
inputWithPopperProps = _objectWithoutProperties(_useThemeProps, _excluded);
|
|
82
|
+
var intl = useIntl();
|
|
83
|
+
var textValue = useDateRangeTextValue(value, rangeStringSeparator, formatDateOptions);
|
|
84
|
+
var dateFnsLocale = useDateFnsLocale();
|
|
85
|
+
return /*#__PURE__*/_jsx(Root, _objectSpread(_objectSpread(_objectSpread({
|
|
86
|
+
value: textValue,
|
|
87
|
+
startAdornment: /*#__PURE__*/_jsx(StartAdornment, _objectSpread(_objectSpread({
|
|
88
|
+
position: "start",
|
|
89
|
+
disablePointerEvents: true
|
|
90
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.startAdornment), {}, {
|
|
91
|
+
children: /*#__PURE__*/_jsx(Calendar, {})
|
|
92
|
+
})),
|
|
93
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : intl.formatMessage({
|
|
94
|
+
id: "comet.dateRangePicker.selectDateRange",
|
|
95
|
+
defaultMessage: "Select date range"
|
|
96
|
+
})
|
|
97
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), inputWithPopperProps), {}, {
|
|
98
|
+
readOnly: true,
|
|
99
|
+
required: required,
|
|
100
|
+
endAdornment: !required && value ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
101
|
+
children: [/*#__PURE__*/_jsx(ClearInputAdornment, {
|
|
102
|
+
position: "end",
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
return _onChange && _onChange(undefined);
|
|
105
|
+
}
|
|
106
|
+
}), endAdornment]
|
|
107
|
+
}) : endAdornment,
|
|
108
|
+
children: function children(closePopper) {
|
|
109
|
+
return /*#__PURE__*/_jsx(DateRange, _objectSpread({
|
|
110
|
+
locale: dateFnsLocale,
|
|
111
|
+
minDate: minDate,
|
|
112
|
+
maxDate: maxDate,
|
|
113
|
+
weekStartsOn: 1,
|
|
114
|
+
direction: "horizontal",
|
|
115
|
+
monthDisplayFormat: "MMMM yyyy",
|
|
116
|
+
months: monthsToShow,
|
|
117
|
+
navigatorRenderer: function navigatorRenderer(focusedDate, changeShownDate) {
|
|
118
|
+
return /*#__PURE__*/_jsx(DatePickerNavigation, {
|
|
119
|
+
focusedDate: focusedDate,
|
|
120
|
+
changeShownDate: changeShownDate,
|
|
121
|
+
minDate: minDate,
|
|
122
|
+
maxDate: maxDate
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
onRangeFocusChange: function onRangeFocusChange(newFocusedRange) {
|
|
126
|
+
var rangeSelectionHasCompleted = newFocusedRange[0] === 0 && newFocusedRange[1] === 0;
|
|
127
|
+
if (rangeSelectionHasCompleted) {
|
|
128
|
+
closePopper(true);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
ranges: [getRangeFromValue(value)],
|
|
132
|
+
onChange: function onChange(ranges) {
|
|
133
|
+
var pickedRange = ranges[rangeKey];
|
|
134
|
+
if (pickedRange.startDate && pickedRange.endDate) {
|
|
135
|
+
_onChange === null || _onChange === void 0 || _onChange({
|
|
136
|
+
start: getIsoDateString(pickedRange.startDate),
|
|
137
|
+
end: getIsoDateString(pickedRange.endDate)
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
showDateDisplay: false
|
|
142
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.dateRange));
|
|
143
|
+
}
|
|
144
|
+
}));
|
|
145
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InputWithPopper, type InputWithPopperClassKey, type ThemedComponentBaseProps } from "@dextinity/admin";
|
|
2
|
+
import { InputAdornment } from "@mui/material";
|
|
3
|
+
import { DateRange as ReactDateRange } from "react-date-range";
|
|
4
|
+
export type DateRangePickerClassKey = InputWithPopperClassKey | "dateRange" | "startAdornment";
|
|
5
|
+
export type SlotProps = ThemedComponentBaseProps<{
|
|
6
|
+
root: typeof InputWithPopper;
|
|
7
|
+
startAdornment: typeof InputAdornment;
|
|
8
|
+
dateRange: typeof ReactDateRange;
|
|
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 DateRange: import("react").ForwardRefExoticComponent<Pick<import("react-date-range").DateRangeProps, keyof import("react-date-range").DateRangeProps> & 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=DateRangePicker.slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.slots.d.ts","sourceRoot":"","sources":["../../src/dateRangePicker/DateRangePicker.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,SAAS,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAI/D,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAE/F,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC;IAC7C,IAAI,EAAE,OAAO,eAAe,CAAC;IAC7B,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,SAAS,EAAE,OAAO,cAAc,CAAC;CACpC,CAAC,CAAC,WAAW,CAAC,CAAC;AAEhB,eAAO,MAAM,IAAI;;;;;mDAGb,CAAC;AAEL,eAAO,MAAM,cAAc;;;;;mDAGvB,CAAC;AAEL,eAAO,MAAM,SAAS;;;;;2CA4GrB,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { createComponentSlot, InputWithPopper } from "@dextinity/admin";
|
|
2
|
+
import { InputAdornment } from "@mui/material";
|
|
3
|
+
import { deepmerge } from "@mui/utils";
|
|
4
|
+
import { DateRange as ReactDateRange } from "react-date-range";
|
|
5
|
+
import { getReactDateRangeStyles } from "../utils/getReactDateRangeStyles";
|
|
6
|
+
export var Root = createComponentSlot(InputWithPopper)({
|
|
7
|
+
componentName: "LegacyDateRangePicker",
|
|
8
|
+
slotName: "root"
|
|
9
|
+
})();
|
|
10
|
+
export var StartAdornment = createComponentSlot(InputAdornment)({
|
|
11
|
+
componentName: "LegacyDateRangePicker",
|
|
12
|
+
slotName: "startAdornment"
|
|
13
|
+
})();
|
|
14
|
+
export var DateRange = createComponentSlot(ReactDateRange)({
|
|
15
|
+
componentName: "LegacyDateRangePicker",
|
|
16
|
+
slotName: "dateRange"
|
|
17
|
+
})(function (_ref) {
|
|
18
|
+
var theme = _ref.theme;
|
|
19
|
+
return deepmerge(getReactDateRangeStyles(theme), {
|
|
20
|
+
"& .rdrDay": {
|
|
21
|
+
"& .rdrStartEdge, & .rdrEndEdge, & .rdrInRange": {
|
|
22
|
+
backgroundColor: theme.palette.primary.main,
|
|
23
|
+
borderRadius: 0,
|
|
24
|
+
top: 0,
|
|
25
|
+
bottom: 0,
|
|
26
|
+
"& ~ .rdrDayNumber span:nth-child(n)": {
|
|
27
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
28
|
+
color: "white"
|
|
29
|
+
},
|
|
30
|
+
"& ~ .rdrDayEndPreview.rdrDayStartPreview": {
|
|
31
|
+
backgroundColor: "transparent",
|
|
32
|
+
borderRadius: 0,
|
|
33
|
+
"& ~ .rdrDayNumber span:nth-child(n)": {
|
|
34
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
35
|
+
color: "white"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"& .rdrStartEdge": {
|
|
40
|
+
right: 0,
|
|
41
|
+
borderTopLeftRadius: 4,
|
|
42
|
+
borderBottomLeftRadius: 4
|
|
43
|
+
},
|
|
44
|
+
"& .rdrEndEdge": {
|
|
45
|
+
left: 0,
|
|
46
|
+
borderTopRightRadius: 4,
|
|
47
|
+
borderBottomRightRadius: 4
|
|
48
|
+
},
|
|
49
|
+
"& .rdrInRange": {
|
|
50
|
+
borderRadius: 0,
|
|
51
|
+
opacity: 0.7,
|
|
52
|
+
right: 0,
|
|
53
|
+
left: 0
|
|
54
|
+
},
|
|
55
|
+
"& .rdrDayEndPreview, & .rdrDayStartPreview, & .rdrDayInPreview": {
|
|
56
|
+
backgroundColor: theme.palette.primary.main,
|
|
57
|
+
borderRadius: 0,
|
|
58
|
+
"& ~ .rdrDayNumber span:nth-child(n)": {
|
|
59
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
60
|
+
color: "white",
|
|
61
|
+
"&:after": {
|
|
62
|
+
backgroundColor: "currentColor"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"& .rdrDayStartPreview": {
|
|
67
|
+
borderTopLeftRadius: 4,
|
|
68
|
+
borderBottomLeftRadius: 4
|
|
69
|
+
},
|
|
70
|
+
"& .rdrDayEndPreview": {
|
|
71
|
+
borderTopRightRadius: 4,
|
|
72
|
+
borderBottomRightRadius: 4
|
|
73
|
+
},
|
|
74
|
+
"& .rdrDayEndPreview.rdrDayStartPreview": {
|
|
75
|
+
backgroundColor: theme.palette.grey[50],
|
|
76
|
+
borderRadius: 4,
|
|
77
|
+
"& ~ .rdrDayNumber span:nth-child(n)": {
|
|
78
|
+
color: theme.palette.text.primary,
|
|
79
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
80
|
+
"&:after": {
|
|
81
|
+
backgroundColor: theme.palette.primary.main
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"& .rdrDayInPreview": {
|
|
86
|
+
opacity: 0.7,
|
|
87
|
+
border: "none",
|
|
88
|
+
top: 0,
|
|
89
|
+
bottom: 0
|
|
90
|
+
},
|
|
91
|
+
"&.rdrDayToday": {
|
|
92
|
+
"& .rdrInRange ~ .rdrDayNumber span": {
|
|
93
|
+
fontWeight: theme.typography.fontWeightBold
|
|
94
|
+
},
|
|
95
|
+
"& .rdrStartEdge, & .rdrEndEdge, & .rdrInRange": {
|
|
96
|
+
"& ~ .rdrDayNumber span:nth-child(n)": {
|
|
97
|
+
"&:after": {
|
|
98
|
+
backgroundColor: "white"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"&.rdrDayPassive": {
|
|
104
|
+
"& .rdrDayEndPreview, & .rdrDayStartPreview, & .rdrDayInPreview, & .rdrStartEdge, & .rdrEndEdge, & .rdrInRange": {
|
|
105
|
+
"& ~ .rdrDayNumber span:nth-child(n)": {
|
|
106
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
107
|
+
color: theme.palette.grey[100]
|
|
108
|
+
},
|
|
109
|
+
"&:after": {
|
|
110
|
+
backgroundColor: "currentColor"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FieldRenderProps } from "react-final-form";
|
|
2
|
+
import { type DateRange, type DateRangePickerProps } from "./DateRangePicker";
|
|
3
|
+
export type FinalFormDateRangePickerProps = DateRangePickerProps;
|
|
4
|
+
type FinalFormDateRangePickerInternalProps = FieldRenderProps<DateRange, HTMLInputElement | HTMLTextAreaElement>;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `DateRangePickerField` from `@dextinity/admin` instead.
|
|
7
|
+
*
|
|
8
|
+
* Final Form-compatible DateRangerPicker component.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link DateRangeField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FinalFormDateRangePicker: ({ meta, input, ...restProps }: FinalFormDateRangePickerProps & FinalFormDateRangePickerInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=FinalFormDateRangePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinalFormDateRangePicker.d.ts","sourceRoot":"","sources":["../../src/dateRangePicker/FinalFormDateRangePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,KAAK,SAAS,EAAmB,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE/F,MAAM,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AACjE,KAAK,qCAAqC,GAAG,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEjH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,+BAA+B,6BAA6B,GAAG,qCAAqC,4CAE5I,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 { DateRangePicker } from "./DateRangePicker";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `DateRangePickerField` from `@dextinity/admin` instead.
|
|
14
|
+
*
|
|
15
|
+
* Final Form-compatible DateRangerPicker component.
|
|
16
|
+
*
|
|
17
|
+
* @see {@link DateRangeField} – preferred for typical form use. Use this only if no Field wrapper is needed.
|
|
18
|
+
*/
|
|
19
|
+
export var FinalFormDateRangePicker = function FinalFormDateRangePicker(_ref) {
|
|
20
|
+
var meta = _ref.meta,
|
|
21
|
+
input = _ref.input,
|
|
22
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
return /*#__PURE__*/_jsx(DateRangePicker, _objectSpread(_objectSpread({}, input), restProps));
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FieldProps } from "@dextinity/admin";
|
|
2
|
+
import { type FinalFormDateTimePickerProps } from "./FinalFormDateTimePicker";
|
|
3
|
+
export type DateTimeFieldProps = FieldProps<Date, HTMLInputElement> & FinalFormDateTimePickerProps;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `DateTimePickerField` from `@dextinity/admin` instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DateTimeField: ({ ...restProps }: DateTimeFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DateTimeField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeField.d.ts","sourceRoot":"","sources":["../../src/dateTimePicker/DateTimeField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAA2B,KAAK,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAEvG,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,GAAG,4BAA4B,CAAC;AAEnG;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,kBAAkB,kBAAkB,4CAEjE,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 { FinalFormDateTimePicker } from "./FinalFormDateTimePicker";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `DateTimePickerField` from `@dextinity/admin` instead.
|
|
14
|
+
*/
|
|
15
|
+
export var DateTimeField = function DateTimeField(_ref) {
|
|
16
|
+
var restProps = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
17
|
+
return /*#__PURE__*/_jsx(Field, _objectSpread({
|
|
18
|
+
component: FinalFormDateTimePicker
|
|
19
|
+
}, restProps));
|
|
20
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ThemedComponentBaseProps } from "@dextinity/admin";
|
|
2
|
+
import { type ComponentsOverrides, FormControl, type InputBaseProps } from "@mui/material";
|
|
3
|
+
import { type Theme } from "@mui/material/styles";
|
|
4
|
+
import { DatePicker as DatePickerBase } from "../datePicker/DatePicker";
|
|
5
|
+
import { TimePicker as TimePickerBase } from "../timePicker/TimePicker";
|
|
6
|
+
export type DateTimePickerClassKey = "root" | "dateFormControl" | "timeFormControl" | "datePicker" | "timePicker";
|
|
7
|
+
export interface DateTimePickerProps extends ThemedComponentBaseProps<{
|
|
8
|
+
root: "div";
|
|
9
|
+
dateFormControl: typeof FormControl;
|
|
10
|
+
timeFormControl: typeof FormControl;
|
|
11
|
+
datePicker: typeof DatePickerBase;
|
|
12
|
+
timePicker: typeof TimePickerBase;
|
|
13
|
+
}> {
|
|
14
|
+
onChange?: (value?: Date) => void;
|
|
15
|
+
value?: Date;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
onBlur?: InputBaseProps["onBlur"];
|
|
19
|
+
onFocus?: InputBaseProps["onFocus"];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use `DateTimePicker` from `@dextinity/admin` instead.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DateTimePicker: (inProps: DateTimePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare module "@mui/material/styles" {
|
|
26
|
+
interface ComponentNameToClassKey {
|
|
27
|
+
CometAdminLegacyDateTimePicker: DateTimePickerClassKey;
|
|
28
|
+
}
|
|
29
|
+
interface ComponentsPropsList {
|
|
30
|
+
CometAdminLegacyDateTimePicker: DateTimePickerProps;
|
|
31
|
+
}
|
|
32
|
+
interface Components {
|
|
33
|
+
CometAdminLegacyDateTimePicker?: {
|
|
34
|
+
defaultProps?: Partial<ComponentsPropsList["CometAdminLegacyDateTimePicker"]>;
|
|
35
|
+
styleOverrides?: ComponentsOverrides<Theme>["CometAdminLegacyDateTimePicker"];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=DateTimePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../src/dateTimePicker/DateTimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,KAAK,mBAAmB,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAO,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAIxE,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,YAAY,GAAG,YAAY,CAAC;AAmElH,MAAM,WAAW,mBACb,SAAQ,wBAAwB,CAAC;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,eAAe,EAAE,OAAO,WAAW,CAAC;IACpC,eAAe,EAAE,OAAO,WAAW,CAAC;IACpC,UAAU,EAAE,OAAO,cAAc,CAAC;IAClC,UAAU,EAAE,OAAO,cAAc,CAAC;CACrC,CAAC;IACF,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,mBAAmB,4CAkF1D,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,8BAA8B,EAAE,sBAAsB,CAAC;KAC1D;IAED,UAAU,mBAAmB;QACzB,8BAA8B,EAAE,mBAAmB,CAAC;KACvD;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"}
|