@zendeskgarden/react-datepickers 8.67.0 → 8.69.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/dist/index.cjs.js
CHANGED
|
@@ -38,6 +38,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
38
38
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
39
39
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
40
40
|
|
|
41
|
+
const WEEK_STARTS_ON = [0, 1, 2, 3, 4, 5, 6];
|
|
41
42
|
const SHARED_PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'];
|
|
42
43
|
const PLACEMENT = [...SHARED_PLACEMENT, 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
|
|
43
44
|
|
|
@@ -262,7 +263,7 @@ function getDate(dirtyDate) {
|
|
|
262
263
|
const COMPONENT_ID$b = 'datepickers.menu';
|
|
263
264
|
const StyledMenu = styled__default.default.div.attrs({
|
|
264
265
|
'data-garden-id': COMPONENT_ID$b,
|
|
265
|
-
'data-garden-version': '8.
|
|
266
|
+
'data-garden-version': '8.69.0'
|
|
266
267
|
}).withConfig({
|
|
267
268
|
displayName: "StyledMenu",
|
|
268
269
|
componentId: "sc-1npbkk0-0"
|
|
@@ -3262,7 +3263,7 @@ Datepicker.propTypes = {
|
|
|
3262
3263
|
onChange: PropTypes__default.default.any,
|
|
3263
3264
|
formatDate: PropTypes__default.default.func,
|
|
3264
3265
|
locale: PropTypes__default.default.any,
|
|
3265
|
-
weekStartsOn: PropTypes__default.default.
|
|
3266
|
+
weekStartsOn: PropTypes__default.default.oneOf(WEEK_STARTS_ON),
|
|
3266
3267
|
minValue: PropTypes__default.default.any,
|
|
3267
3268
|
maxValue: PropTypes__default.default.any,
|
|
3268
3269
|
isCompact: PropTypes__default.default.bool,
|
|
@@ -3993,7 +3994,7 @@ const Calendar = React.forwardRef((props, ref) => {
|
|
|
3993
3994
|
return React__namespace.default.createElement(StyledRangeCalendar, _extends({
|
|
3994
3995
|
ref: ref,
|
|
3995
3996
|
"data-garden-id": "datepickers.range",
|
|
3996
|
-
"data-garden-version": '8.
|
|
3997
|
+
"data-garden-version": '8.69.0'
|
|
3997
3998
|
}, props), React__namespace.default.createElement(Month, {
|
|
3998
3999
|
displayDate: state.previewDate,
|
|
3999
4000
|
isNextHidden: true
|
package/dist/index.esm.js
CHANGED
|
@@ -13,6 +13,7 @@ import { Manager, Reference, Popper } from 'react-popper';
|
|
|
13
13
|
import { composeEventHandlers, KEY_CODES } from '@zendeskgarden/container-utilities';
|
|
14
14
|
import { retrieveComponentStyles, DEFAULT_THEME, menuStyles, getColor } from '@zendeskgarden/react-theming';
|
|
15
15
|
|
|
16
|
+
const WEEK_STARTS_ON = [0, 1, 2, 3, 4, 5, 6];
|
|
16
17
|
const SHARED_PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'];
|
|
17
18
|
const PLACEMENT = [...SHARED_PLACEMENT, 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
|
|
18
19
|
|
|
@@ -237,7 +238,7 @@ function getDate(dirtyDate) {
|
|
|
237
238
|
const COMPONENT_ID$b = 'datepickers.menu';
|
|
238
239
|
const StyledMenu = styled.div.attrs({
|
|
239
240
|
'data-garden-id': COMPONENT_ID$b,
|
|
240
|
-
'data-garden-version': '8.
|
|
241
|
+
'data-garden-version': '8.69.0'
|
|
241
242
|
}).withConfig({
|
|
242
243
|
displayName: "StyledMenu",
|
|
243
244
|
componentId: "sc-1npbkk0-0"
|
|
@@ -3237,7 +3238,7 @@ Datepicker.propTypes = {
|
|
|
3237
3238
|
onChange: PropTypes.any,
|
|
3238
3239
|
formatDate: PropTypes.func,
|
|
3239
3240
|
locale: PropTypes.any,
|
|
3240
|
-
weekStartsOn: PropTypes.
|
|
3241
|
+
weekStartsOn: PropTypes.oneOf(WEEK_STARTS_ON),
|
|
3241
3242
|
minValue: PropTypes.any,
|
|
3242
3243
|
maxValue: PropTypes.any,
|
|
3243
3244
|
isCompact: PropTypes.bool,
|
|
@@ -3968,7 +3969,7 @@ const Calendar = forwardRef((props, ref) => {
|
|
|
3968
3969
|
return React__default.createElement(StyledRangeCalendar, _extends({
|
|
3969
3970
|
ref: ref,
|
|
3970
3971
|
"data-garden-id": "datepickers.range",
|
|
3971
|
-
"data-garden-version": '8.
|
|
3972
|
+
"data-garden-version": '8.69.0'
|
|
3972
3973
|
}, props), React__default.createElement(Month, {
|
|
3973
3974
|
displayDate: state.previewDate,
|
|
3974
3975
|
isNextHidden: true
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import { PropsWithChildren } from 'react';
|
|
7
|
+
import React, { PropsWithChildren } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { IDatepickerRangeProps } from '../../types';
|
|
10
10
|
import { Start } from './components/Start';
|
|
11
11
|
import { End } from './components/End';
|
|
12
12
|
import { Calendar } from './components/Calendar';
|
|
13
13
|
export declare const DatepickerRange: {
|
|
14
|
-
(props: PropsWithChildren<IDatepickerRangeProps>): JSX.Element;
|
|
14
|
+
(props: PropsWithChildren<IDatepickerRangeProps>): React.JSX.Element;
|
|
15
15
|
propTypes: {
|
|
16
16
|
locale: PropTypes.Requireable<string>;
|
|
17
17
|
weekStartsOn: PropTypes.Requireable<number>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLAttributes } from 'react';
|
|
8
8
|
import { Modifiers } from 'popper.js';
|
|
9
|
-
|
|
9
|
+
export declare const WEEK_STARTS_ON: readonly [0, 1, 2, 3, 4, 5, 6];
|
|
10
10
|
export declare const PLACEMENT: readonly ["auto", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "end", "end-top", "end-bottom", "start", "start-top", "start-bottom"];
|
|
11
11
|
export declare const POPPER_PLACEMENT: readonly ["auto", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"];
|
|
12
12
|
export type GardenPlacement = (typeof PLACEMENT)[number];
|
|
@@ -37,7 +37,7 @@ export interface IDatepickerProps extends Omit<HTMLAttributes<HTMLDivElement>, '
|
|
|
37
37
|
/**
|
|
38
38
|
* Overrides the locale default start day of week
|
|
39
39
|
*/
|
|
40
|
-
weekStartsOn?:
|
|
40
|
+
weekStartsOn?: (typeof WEEK_STARTS_ON)[number];
|
|
41
41
|
/**
|
|
42
42
|
* Disables dates before this value on the calendar
|
|
43
43
|
*/
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
+
import { IDatepickerProps } from '../types';
|
|
7
8
|
/**
|
|
8
9
|
* The following mappings use the Date offests:
|
|
9
10
|
* 0 - Sunday
|
|
@@ -11,8 +12,8 @@
|
|
|
11
12
|
* 6 - Saturday
|
|
12
13
|
*/
|
|
13
14
|
/** This type matches definition required by date-fns utilities */
|
|
14
|
-
export type DateFnsIndex =
|
|
15
|
+
export type DateFnsIndex = IDatepickerProps['weekStartsOn'];
|
|
15
16
|
/**
|
|
16
17
|
* Return start day of week based on locale
|
|
17
18
|
*/
|
|
18
|
-
export declare function getStartOfWeek(locale?: string):
|
|
19
|
+
export declare function getStartOfWeek(locale?: string): 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-datepickers",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.69.0",
|
|
4
4
|
"description": "Components relating to datepickers in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^8.
|
|
36
|
+
"@zendeskgarden/react-theming": "^8.69.0",
|
|
37
37
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "0af9ddcc0516d455cd359ae4229c7121edf23060"
|
|
50
50
|
}
|