@toptal/picasso-date-picker 3.2.2 → 3.2.3-alpha-1757603192867.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/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@toptal/picasso-date-picker",
3
- "version": "3.2.2",
3
+ "version": "3.2.3-alpha-1757603192867.0",
4
4
  "description": "Toptal UI components library - DatePicker",
5
5
  "publishConfig": {
6
- "access": "public"
6
+ "access": "public",
7
+ "provenance": true
7
8
  },
8
9
  "main": "./dist-package/src/index.js",
9
10
  "module": "./dist-package/src/index.js",
10
11
  "scripts": {
11
12
  "build:package": "tsc -b tsconfig.json",
12
- "prepublishOnly": "yarn build:package"
13
+ "prepublishOnly": "echo 0"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -22,14 +23,14 @@
22
23
  },
23
24
  "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
24
25
  "dependencies": {
25
- "@toptal/picasso-calendar": "4.1.5",
26
- "@toptal/picasso-container": "3.1.2",
27
- "@toptal/picasso-icons": "1.12.1",
28
- "@toptal/picasso-input": "4.1.2",
29
- "@toptal/picasso-input-adornment": "3.0.10",
30
- "@toptal/picasso-outlined-input": "4.1.2",
31
- "@toptal/picasso-popper": "2.0.0",
32
- "@toptal/picasso-utils": "3.1.0",
26
+ "@toptal/picasso-calendar": "4.1.6-alpha-1757603192867.0",
27
+ "@toptal/picasso-container": "3.1.3-alpha-1757603192867.0",
28
+ "@toptal/picasso-icons": "1.12.2-alpha-1757603192867.0",
29
+ "@toptal/picasso-input": "4.1.3-alpha-1757603192867.0",
30
+ "@toptal/picasso-input-adornment": "3.0.11-alpha-1757603192867.0",
31
+ "@toptal/picasso-outlined-input": "4.1.3-alpha-1757603192867.0",
32
+ "@toptal/picasso-popper": "2.0.1-alpha-1757603192867.0",
33
+ "@toptal/picasso-utils": "3.1.1-alpha-1757603192867.0",
33
34
  "date-fns": "^2.30.0",
34
35
  "date-fns-tz": "^2.0.0"
35
36
  },
@@ -38,7 +39,7 @@
38
39
  "**/styles.js"
39
40
  ],
40
41
  "peerDependencies": {
41
- "@toptal/picasso-tailwind": ">=2.7",
42
+ "@toptal/picasso-tailwind": "3.0.1-alpha-1757603192867.0",
42
43
  "react": ">=16.12.0 < 19.0.0"
43
44
  },
44
45
  "devDependencies": {
@@ -1,82 +0,0 @@
1
- import type { BaseProps } from '@toptal/picasso-shared';
2
- import type { ReactNode } from 'react';
3
- import type { CalendarDateRange, WeekStart, CalendarMonthsAmount, RenderDay } from '@toptal/picasso-calendar';
4
- import type { InputProps } from '@toptal/picasso-input';
5
- import type { Status } from '@toptal/picasso-outlined-input';
6
- import type { DatePickerValue, DatePickerInputCustomValueParser } from './types';
7
- export interface Props extends BaseProps, Omit<InputProps, 'value' | 'onSelect' | 'type' | 'multiline' | 'rows' | 'defaultValue' | 'onChange' | 'testIds'> {
8
- /** Date that will be selected in `DatePicker` */
9
- value?: DatePickerValue;
10
- /** Method that will be invoked with selected values */
11
- onChange: (value: DatePickerValue) => void;
12
- /** Invoked when user goes away from `DatePicker` input */
13
- onBlur?: () => void;
14
- /** Whether calendar supports single date selection or range */
15
- range?: boolean;
16
- /** Earliest date available for selection */
17
- minDate?: Date;
18
- /** Latest date available for selection */
19
- maxDate?: Date;
20
- /** Whether calendar should be closed after date selection. True by default */
21
- hideOnSelect?: boolean;
22
- /** Date format that user will see in the input */
23
- displayDateFormat?: string;
24
- /** Days to disable. e.g. Disable Sundays and Saturdays {dayOfWeek: [0, 6]} */
25
- disableDays?: {
26
- dayOfWeek: number[];
27
- };
28
- /** Date range where selection is not allowed */
29
- disabledIntervals?: CalendarDateRange[];
30
- /** Date format that user will see during manual input */
31
- editDateFormat?: string;
32
- /** Specify icon which should be rendered inside `DatePicker` */
33
- icon?: ReactNode;
34
- /** Specify a value if want to enable browser autofill */
35
- autoComplete?: string;
36
- /** Indicate `DatePicker` status */
37
- status?: Status;
38
- /** Function to override default markup to show Date */
39
- renderDay?: RenderDay;
40
- popperContainer?: HTMLElement;
41
- /** Index of the first day of the week (0 - Sunday). Default is 1 - Monday */
42
- weekStartsOn?: WeekStart;
43
- /** IANA timezone to display and edit date(s) */
44
- timezone?: string;
45
- /** Custom parser for `DatePicker`'s input value to process custom input value, like, human-readable dates */
46
- parseInputValue?: DatePickerInputCustomValueParser;
47
- /** Additional data-* attrs for the inner Popper */
48
- popperProps?: {
49
- [key: `data-${string}`]: unknown;
50
- };
51
- testIds?: InputProps['testIds'] & {
52
- calendar?: string;
53
- input?: string;
54
- };
55
- /** Adds a customized footer at the bottom of the calendar */
56
- footer?: ReactNode;
57
- /** Change the footer background color */
58
- footerBackgroundColor?: string;
59
- /** Shows orange dot indicator in days between a date range */
60
- indicatedIntervals?: CalendarDateRange[];
61
- highlight?: 'autofill';
62
- /** Display more than one month at the same time */
63
- numberOfMonths?: CalendarMonthsAmount;
64
- /** Display dropdown navigation between months and years (requires minDate and maxDate to be set) */
65
- dropdownNavigation?: boolean;
66
- }
67
- export declare const DatePicker: {
68
- (props: Props): JSX.Element;
69
- defaultProps: {
70
- range: boolean;
71
- hideOnSelect: boolean;
72
- onBlur: () => void;
73
- editDateFormat: string;
74
- displayDateFormat: string;
75
- autoComplete: string;
76
- status: string;
77
- numberOfMonths: number;
78
- };
79
- displayName: string;
80
- };
81
- export default DatePicker;
82
- //# sourceMappingURL=DatePicker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AASrD,OAAO,KAAK,EACV,iBAAiB,EAGjB,SAAS,EACT,oBAAoB,EACpB,SAAS,EACV,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,UAAU,E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A;IACxB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6GAA6G;IAC7G,eAAe,CAAC,EAAE,gCAAgC,CAAA;IAClD,mDAAmD;IACnD,WAAW,CAAC,EAAE;QACZ,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAA;KACjC,CAAA;IACD,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG;QAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,6DAA6D;IAC7D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACxC,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,mDAAmD;IACnD,cAAc,CAAC,EAAE,oBAAoB,CAAA;IACrC,oGAAoG;IACpG,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,eAAO,MAAM,UAAU;YAAW,KAAK;;;;;;;;;;;;CA+VtC,CAAA;AAeD,eAAe,UAAU,CAAA"}
@@ -1,221 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import formatDate from 'date-fns/format';
13
- import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
14
- import { Calendar16 } from '@toptal/picasso-icons';
15
- import { Popper } from '@toptal/picasso-popper';
16
- import { Container } from '@toptal/picasso-container';
17
- import { Input } from '@toptal/picasso-input';
18
- import { InputAdornment } from '@toptal/picasso-input-adornment';
19
- import { ClickAwayListener, noop } from '@toptal/picasso-utils';
20
- import { Calendar } from '@toptal/picasso-calendar';
21
- import { DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT, DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT, POPPER_OPTIONS, } from './constants';
22
- import { formatDateRange, datePickerParseDateString, timezoneConvert, timezoneFormat, getStartOfTheDayDate, } from './utils';
23
- const EMPTY_INPUT_VALUE = '';
24
- export const DatePicker = (props) => {
25
- const { range, hideOnSelect, displayDateFormat = DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT, editDateFormat = DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT, onBlur = noop, onChange, onResetClick, value, width, icon, minDate, maxDate, disableDays, disabledIntervals, popperContainer, renderDay, weekStartsOn, timezone, size, parseInputValue, testIds, status, popperProps, disabled, footer, indicatedIntervals, footerBackgroundColor, highlight, numberOfMonths = 1, dropdownNavigation } = props, rest = __rest(props, ["range", "hideOnSelect", "displayDateFormat", "editDateFormat", "onBlur", "onChange", "onResetClick", "value", "width", "icon", "minDate", "maxDate", "disableDays", "disabledIntervals", "popperContainer", "renderDay", "weekStartsOn", "timezone", "size", "parseInputValue", "testIds", "status", "popperProps", "disabled", "footer", "indicatedIntervals", "footerBackgroundColor", "highlight", "numberOfMonths", "dropdownNavigation"]);
26
- const inputProps = rest;
27
- const [calendarIsShown, setCalendarIsShown] = useState(false);
28
- const [isInputFocused, setIsInputFocused] = useState(false);
29
- const [inputValue, setInputValue] = useState(EMPTY_INPUT_VALUE);
30
- const [calendarValue, setCalendarValue] = useState(null);
31
- const [normalizedMinDate, normalizedMaxDate] = useMemo(() => {
32
- return [getStartOfTheDayDate(minDate), getStartOfTheDayDate(maxDate)];
33
- }, [minDate, maxDate]);
34
- const hideCalendar = () => setCalendarIsShown(false);
35
- const showCalendar = () => setCalendarIsShown(true);
36
- const inputRef = useRef(null);
37
- const popperRef = useRef(null);
38
- const calendarRef = useRef(null);
39
- const inputWrapperRef = useRef(null);
40
- // Active (visible) month of the calendar that required for manual entering of
41
- // a single date
42
- const activeMonth = calendarValue instanceof Date ? calendarValue : undefined;
43
- // Format the input based on its 'focus' state
44
- const formatInputValue = useCallback((valueToFormat) => {
45
- return Array.isArray(valueToFormat)
46
- ? formatDateRange(valueToFormat, displayDateFormat)
47
- : formatDate(valueToFormat, isInputFocused ? editDateFormat : displayDateFormat);
48
- }, [isInputFocused, editDateFormat, displayDateFormat]);
49
- const updateInputValue = useCallback(({ preventUpdateOnFocus }) => {
50
- if (preventUpdateOnFocus && isInputFocused) {
51
- return;
52
- }
53
- setInputValue(() => {
54
- if (!value) {
55
- return EMPTY_INPUT_VALUE;
56
- }
57
- return formatInputValue(timezoneConvert(value, timezone));
58
- });
59
- }, [value, isInputFocused, timezone, formatInputValue]);
60
- // Keep the input value in sync with date value update
61
- // Updating on incoming date value or timezone change
62
- // Should not update when input is focused to prevent overriding it's value
63
- useEffect(() => {
64
- updateInputValue({ preventUpdateOnFocus: true });
65
- }, [value, timezone]);
66
- // Keep the input format in sync with its 'focus' state
67
- // Updating on input focus state change
68
- useEffect(() => {
69
- updateInputValue({ preventUpdateOnFocus: false });
70
- }, [isInputFocused]);
71
- useEffect(() => {
72
- if (disabled) {
73
- setIsInputFocused(false);
74
- }
75
- }, [disabled]);
76
- // Keep the calendar in sync with the input value
77
- useEffect(() => {
78
- setCalendarValue(() => {
79
- if (!value) {
80
- return null;
81
- }
82
- return timezoneConvert(value, timezone);
83
- });
84
- }, [value, timezone]);
85
- const isInsideDatePicker = (node) => {
86
- var _a, _b;
87
- return (((_a = popperRef.current) === null || _a === void 0 ? void 0 : _a.popper.contains(node)) ||
88
- ((_b = inputWrapperRef.current) === null || _b === void 0 ? void 0 : _b.contains(node)));
89
- };
90
- const handleInputBlur = (event) => {
91
- const isFocusedInsideDatePicker = isInsideDatePicker((event.relatedTarget || document.activeElement));
92
- if (isFocusedInsideDatePicker) {
93
- return;
94
- }
95
- hideCalendar();
96
- onBlur();
97
- setIsInputFocused(false);
98
- };
99
- const handleCalendarClickOutside = (event) => {
100
- if (!isInsideDatePicker(event.target)) {
101
- hideCalendar();
102
- setIsInputFocused(false);
103
- }
104
- };
105
- const handleInputChange = (e) => {
106
- const nextValue = e.target.value;
107
- // TODO: change this if manual entering of range is needed
108
- if (range && nextValue) {
109
- return;
110
- }
111
- // TODO: add char filtering (only number , `-` or ` ` allowed) in case if `parseInputValue` is not set
112
- setInputValue(nextValue);
113
- if (!nextValue) {
114
- return onChange(null);
115
- }
116
- const parsedInputDate = datePickerParseDateString(nextValue, {
117
- customParser: parseInputValue,
118
- dateFormat: editDateFormat,
119
- timezone,
120
- minDate: normalizedMinDate,
121
- maxDate: normalizedMaxDate,
122
- });
123
- if (parsedInputDate) {
124
- onChange(parsedInputDate);
125
- }
126
- };
127
- const focus = () => {
128
- if (inputRef && inputRef.current) {
129
- inputRef.current.focus();
130
- }
131
- };
132
- const handleCalendarChange = (nextValue) => {
133
- const nextTimezoneValue = Array.isArray(nextValue)
134
- ? nextValue.map((date) => timezoneFormat(date, timezone))
135
- : timezoneFormat(nextValue, timezone);
136
- onChange(nextTimezoneValue);
137
- setInputValue(formatInputValue(nextValue));
138
- setCalendarValue(nextValue);
139
- if (hideOnSelect) {
140
- focus();
141
- hideCalendar();
142
- }
143
- };
144
- const handleInputKeydown = (event) => {
145
- var _a;
146
- const key = event.key;
147
- if (key === 'Escape') {
148
- hideCalendar();
149
- event.currentTarget.blur();
150
- return;
151
- }
152
- if (key === 'Enter') {
153
- if (!calendarIsShown) {
154
- showCalendar();
155
- }
156
- else {
157
- hideCalendar();
158
- }
159
- return;
160
- }
161
- if (key === 'Tab' && calendarIsShown) {
162
- event.preventDefault();
163
- event.stopPropagation();
164
- if (!calendarIsShown) {
165
- event.currentTarget.blur();
166
- }
167
- else {
168
- const firstButton = (_a = calendarRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('button:not([tabindex="-1"])');
169
- if (firstButton) {
170
- firstButton.focus();
171
- }
172
- }
173
- }
174
- };
175
- const handleClick = event => {
176
- var _a;
177
- if (disabled) {
178
- return;
179
- }
180
- (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onClick) === null || _a === void 0 ? void 0 : _a.call(inputProps, event);
181
- showCalendar();
182
- setIsInputFocused(true);
183
- };
184
- const handleFocus = event => {
185
- var _a;
186
- if (disabled) {
187
- return;
188
- }
189
- (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(inputProps, event);
190
- showCalendar();
191
- setIsInputFocused(true);
192
- };
193
- const handleResetClick = (event) => {
194
- setInputValue(EMPTY_INPUT_VALUE);
195
- onResetClick === null || onResetClick === void 0 ? void 0 : onResetClick(event);
196
- // prevent re-opening the calendar popper
197
- event.stopPropagation();
198
- };
199
- const startAdornment = size !== 'small' ? (React.createElement(InputAdornment, { position: 'start', disablePointerEvents: true }, icon || React.createElement(Calendar16, null))) : undefined;
200
- return (React.createElement(React.Fragment, null,
201
- React.createElement(Container, { inline: width !== 'full', ref: inputWrapperRef },
202
- React.createElement(Input, Object.assign({}, inputProps, { status: status, disabled: disabled, ref: inputRef, onKeyDown: handleInputKeydown, onClick: handleClick, onFocus: handleFocus, onBlur: handleInputBlur, onResetClick: handleResetClick, value: inputValue, onChange: handleInputChange, size: size, startAdornment: startAdornment, width: width, testIds: testIds, "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.input, highlight: highlight }))),
203
- inputWrapperRef.current && (React.createElement(Popper, Object.assign({ placement: 'bottom-start', open: calendarIsShown, anchorEl: inputWrapperRef.current, autoWidth: false, enableCompactMode: true, container: popperContainer, popperOptions: POPPER_OPTIONS, ref: popperRef }, popperProps),
204
- React.createElement(ClickAwayListener, { onClickAway: handleCalendarClickOutside },
205
- React.createElement("div", null,
206
- React.createElement(Calendar, { activeMonth: activeMonth, "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.calendar, ref: calendarRef, range: range, value: calendarValue !== null && calendarValue !== void 0 ? calendarValue : undefined, minDate: normalizedMinDate, maxDate: normalizedMaxDate, disabledIntervals: disabledIntervals, indicatedIntervals: indicatedIntervals, renderDay: renderDay, onChange: handleCalendarChange, className: 'outline-none', hasFooter: Boolean(footer), weekStartsOn: weekStartsOn, numberOfMonths: numberOfMonths, dropdownNavigation: dropdownNavigation, disableDays: disableDays }),
207
- footer && (React.createElement("div", { className: 'bg-gray-50 shadow-5 rounded-t-none rounded-b-sm py-[0.625rem] px-[1.187rem] w-[20.5rem]', style: { backgroundColor: footerBackgroundColor } }, footer))))))));
208
- };
209
- DatePicker.defaultProps = {
210
- range: false,
211
- hideOnSelect: true,
212
- onBlur: noop,
213
- editDateFormat: 'MM-dd-yyyy',
214
- displayDateFormat: 'MMM d, yyyy',
215
- autoComplete: 'off',
216
- status: 'default',
217
- numberOfMonths: 1,
218
- };
219
- DatePicker.displayName = 'DatePicker';
220
- export default DatePicker;
221
- //# sourceMappingURL=DatePicker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/DatePicker/DatePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;AAGA,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAGxC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,uBAAu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AAS,EAAC,yFAAyF,EACnG,KAAK,EAAE,EAAE,eAAe,EAAE,qBAAqB,EAAE,IAEhD,MAAM,CACH,CACP,CACG,CACY,CACb,CACV,CACA,CACJ,CAAA;AACH,CAAC,CAAA;AAED,UAAU,CAAC,YAAY,GAAG;IACxB,KAAK,EAAE,KAAK;IACZ,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,YAAY;IAC5B,iBAAiB,EAAE,aAAa;IAChC,YAAY,EAAE,KAAK;IACnB,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,CAAC;CAClB,CAAA;AAED,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,eAAe,UAAU,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { PopperOptions } from 'popper.js';
2
- export declare const DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT = "MM-dd-yyyy";
3
- export declare const DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT = "MMM d, yyyy";
4
- export declare const POPPER_OPTIONS: PopperOptions;
5
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/DatePicker/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE9C,eAAO,MAAM,oCAAoC,eAAe,CAAA;AAChE,eAAO,MAAM,uCAAuC,gBAAgB,CAAA;AACpE,eAAO,MAAM,cAAc,EAAE,aAU5B,CAAA"}
@@ -1,14 +0,0 @@
1
- export const DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT = 'MM-dd-yyyy';
2
- export const DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT = 'MMM d, yyyy';
3
- export const POPPER_OPTIONS = {
4
- modifiers: {
5
- hide: {
6
- enabled: false,
7
- },
8
- preventOverflow: {
9
- enabled: true,
10
- boundariesElement: 'viewport',
11
- },
12
- },
13
- };
14
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/DatePicker/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oCAAoC,GAAG,YAAY,CAAA;AAChE,MAAM,CAAC,MAAM,uCAAuC,GAAG,aAAa,CAAA;AACpE,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,SAAS,EAAE;QACT,IAAI,EAAE;YACJ,OAAO,EAAE,KAAK;SACf;QACD,eAAe,EAAE;YACf,OAAO,EAAE,IAAI;YACb,iBAAiB,EAAE,UAAU;SAC9B;KACF;CACF,CAAA"}
@@ -1,6 +0,0 @@
1
- export { default as DatePicker } from './DatePicker';
2
- export type { Props as DatePickerProps } from './DatePicker';
3
- export type { DatePickerValue, DatePickerInputCustomValueParser, DatePickerInputCustomValueParserParameters, } from './types';
4
- export { datePickerParseDateString } from './utils';
5
- export { DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT, DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT, } from './constants';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DatePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,YAAY,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,cAAc,CAAA;AAC5D,YAAY,EACV,eAAe,EACf,gCAAgC,EAChC,0CAA0C,GAC3C,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EACL,oCAAoC,EACpC,uCAAuC,GACxC,MAAM,aAAa,CAAA"}
@@ -1,4 +0,0 @@
1
- export { default as DatePicker } from './DatePicker';
2
- export { datePickerParseDateString } from './utils';
3
- export { DEFAULT_DATE_PICKER_EDIT_DATE_FORMAT, DEFAULT_DATE_PICKER_DISPLAY_DATE_FORMAT, } from './constants';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DatePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AAOpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EACL,oCAAoC,EACpC,uCAAuC,GACxC,MAAM,aAAa,CAAA"}
@@ -1,14 +0,0 @@
1
- import type { DateOrDateRangeType } from '@toptal/picasso-calendar';
2
- export declare type DatePickerValue = DateOrDateRangeType | null;
3
- export declare type DatePickerInputValueParserParameters = {
4
- customParser?: DatePickerInputCustomValueParser;
5
- dateFormat: string;
6
- minDate?: Date;
7
- maxDate?: Date;
8
- timezone?: string;
9
- };
10
- export declare type DatePickerInputCustomValueParserParameters = {
11
- timezone?: string;
12
- };
13
- export declare type DatePickerInputCustomValueParser = (value: string, params: DatePickerInputCustomValueParserParameters) => Date | null | undefined;
14
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/DatePicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,oBAAY,eAAe,GAAG,mBAAmB,GAAG,IAAI,CAAA;AAExD,oBAAY,oCAAoC,GAAG;IACjD,YAAY,CAAC,EAAE,gCAAgC,CAAA;IAC/C,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,oBAAY,0CAA0C,GAAG;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,oBAAY,gCAAgC,GAAG,CAC7C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,0CAA0C,KAC/C,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/DatePicker/types.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- import type { DateOrDateRangeType, DateRangeType } from '@toptal/picasso-calendar';
2
- import type { DatePickerInputValueParserParameters } from './types';
3
- export declare const timezoneConvert: (date: DateOrDateRangeType, timeZone?: string) => DateOrDateRangeType;
4
- export declare const timezoneFormat: (date: Date, timeZone?: string) => Date;
5
- export declare const formatDateRange: (dates: DateRangeType, format: string) => string;
6
- export declare const isDateValid: (date: string, pattern: string) => boolean;
7
- export declare const isDateAfter: (date: Date, dateToCompare: Date) => boolean;
8
- export declare const isDateBefore: (date: Date, dateToCompare: Date) => boolean;
9
- export declare const isDateWithinInterval: (date: Date, minDate: Date | undefined, maxDate: Date | undefined) => boolean;
10
- export declare const datePickerParseDateString: (value: string, { customParser, dateFormat, timezone, minDate, maxDate, }: DatePickerInputValueParserParameters) => Date | undefined;
11
- export declare const isValidDateValue: (dateValue: DateOrDateRangeType | string) => dateValue is DateOrDateRangeType;
12
- export declare const getStartOfTheDayDate: (date?: Date) => Date | undefined;
13
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/DatePicker/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACd,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAA;AAGnE,eAAO,MAAM,eAAe,SACpB,mBAAmB,aACd,MAAM,KAChB,mBAoBF,CAAA;AAGD,eAAO,MAAM,cAAc,SAAU,IAAI,aAAa,MAAM,SAkB3D,CAAA;AAED,eAAO,MAAM,eAAe,iCAAkC,MAAM,WACX,CAAA;AAEzD,eAAO,MAAM,WAAW,SAAU,MAAM,WAAW,MAAM,YAIxD,CAAA;AAED,eAAO,MAAM,WAAW,SAAU,IAAI,iBAAiB,IAAI,YACG,CAAA;AAE9D,eAAO,MAAM,YAAY,SAAU,IAAI,iBAAiB,IAAI,YACG,CAAA;AAG/D,eAAO,MAAM,oBAAoB,SACzB,IAAI,WACD,IAAI,GAAG,SAAS,WAChB,IAAI,GAAG,SAAS,YAsB1B,CAAA;AAED,eAAO,MAAM,yBAAyB,UAC7B,MAAM,6DAOV,oCAAoC,qBAuBxC,CAAA;AAED,eAAO,MAAM,gBAAgB,cAChB,mBAAmB,GAAG,MAAM,qCAC2B,CAAA;AAEpE,eAAO,MAAM,oBAAoB,UAAW,IAAI,KAAG,IAAI,GAAG,SAWzD,CAAA"}
@@ -1,102 +0,0 @@
1
- import parse from 'date-fns/parse';
2
- import isValid from 'date-fns/isValid';
3
- import formatDate from 'date-fns/format';
4
- import isWithinInterval from 'date-fns/isWithinInterval';
5
- import isEqual from 'date-fns/isEqual';
6
- import isBefore from 'date-fns/isBefore';
7
- import isAfter from 'date-fns/isAfter';
8
- import { utcToZonedTime, format as tzFormat, toDate } from 'date-fns-tz';
9
- // Convert date to given timezone. If timezone is undefined, return given date as is.
10
- export const timezoneConvert = (date, timeZone) => {
11
- const convert = (dateToConvert) => {
12
- if (timeZone) {
13
- /**
14
- * Prevent invalid IANA timezone error. This is likely to happen
15
- * when someone is editing properties in a Storybook examples.
16
- */
17
- try {
18
- return utcToZonedTime(dateToConvert, timeZone);
19
- }
20
- catch (_a) {
21
- return dateToConvert;
22
- }
23
- }
24
- return dateToConvert;
25
- };
26
- return Array.isArray(date)
27
- ? date.map(convert)
28
- : convert(date);
29
- };
30
- // Format date in given timezone. If timezone is undefined, return given date as is.
31
- export const timezoneFormat = (date, timeZone) => {
32
- if (timeZone) {
33
- /**
34
- * Prevent invalid IANA timezone error. This is likely to happen
35
- * when someone is editing properties in a Storybook examples.
36
- */
37
- try {
38
- /**
39
- * Maintain the same date and time, but formatted in the given timezone
40
- * so next time the user edits the date it's not recalculated.
41
- */
42
- return new Date(tzFormat(date, 'MMM dd yyyy HH:mm:ss OOOO', { timeZone }));
43
- }
44
- catch (_a) {
45
- return date;
46
- }
47
- }
48
- return date;
49
- };
50
- export const formatDateRange = (dates, format) => dates.map(date => formatDate(date, format)).join(' - ');
51
- export const isDateValid = (date, pattern) => {
52
- return (date.length === pattern.length && isValid(parse(date, pattern, new Date())));
53
- };
54
- export const isDateAfter = (date, dateToCompare) => isEqual(date, dateToCompare) || isAfter(date, dateToCompare);
55
- export const isDateBefore = (date, dateToCompare) => isEqual(date, dateToCompare) || isBefore(date, dateToCompare);
56
- // eslint-disable-next-line complexity
57
- export const isDateWithinInterval = (date, minDate, maxDate) => {
58
- if (!minDate && !maxDate) {
59
- return true;
60
- }
61
- if (minDate && maxDate) {
62
- return isWithinInterval(date, {
63
- start: minDate,
64
- end: maxDate,
65
- });
66
- }
67
- if (minDate) {
68
- return isDateAfter(date, minDate);
69
- }
70
- if (maxDate) {
71
- return isDateBefore(date, maxDate);
72
- }
73
- return false;
74
- };
75
- export const datePickerParseDateString = (value, { customParser, dateFormat, timezone, minDate, maxDate, }) => {
76
- if (!value) {
77
- return;
78
- }
79
- const isValidDateString = isDateValid(value, dateFormat);
80
- const parsedNextValue = customParser && !isValidDateString
81
- ? customParser(value, { timezone })
82
- : parse(value, dateFormat, new Date());
83
- if (!parsedNextValue || !isValid(parsedNextValue)) {
84
- return;
85
- }
86
- const nextTimezoneValue = timezoneFormat(parsedNextValue, timezone);
87
- if (!isDateWithinInterval(nextTimezoneValue, minDate, maxDate)) {
88
- return;
89
- }
90
- return nextTimezoneValue;
91
- };
92
- export const isValidDateValue = (dateValue) => typeof dateValue !== 'string';
93
- export const getStartOfTheDayDate = (date) => {
94
- if (!date) {
95
- return date;
96
- }
97
- // to prevent mutation of the original date
98
- const clonedDate = toDate(date);
99
- clonedDate.setHours(0, 0, 0, 0);
100
- return clonedDate;
101
- };
102
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/DatePicker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,OAAO,MAAM,kBAAkB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,gBAAgB,MAAM,2BAA2B,CAAA;AACxD,OAAO,OAAO,MAAM,kBAAkB,CAAA;AACtC,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,OAAO,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAQxE,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAyB,EACzB,QAAiB,EACI,EAAE;IACvB,MAAM,OAAO,GAAG,CAAC,aAAmB,EAAE,EAAE;QACtC,IAAI,QAAQ,EAAE;YACZ;;;eAGG;YACH,IAAI;gBACF,OAAO,cAAc,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;aAC/C;YAAC,WAAM;gBACN,OAAO,aAAa,CAAA;aACrB;SACF;QAED,OAAO,aAAa,CAAA;IACtB,CAAC,CAAA;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACxB,CAAC,CAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAmB;QACtC,CAAC,CAAE,OAAO,CAAC,IAAI,CAAU,CAAA;AAC7B,CAAC,CAAA;AAED,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAU,EAAE,QAAiB,EAAE,EAAE;IAC9D,IAAI,QAAQ,EAAE;QACZ;;;WAGG;QACH,IAAI;YACF;;;eAGG;YACH,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,2BAA2B,EAAE,EAAE,Q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AE/B,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAE/B,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './DatePicker';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './DatePicker';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}