@zendeskgarden/react-datepickers 8.47.2 → 8.48.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 +65 -18
- package/dist/index.esm.js +66 -19
- package/dist/typings/elements/Datepicker/Datepicker.d.ts +6 -3
- package/dist/typings/elements/Datepicker/components/Calendar.d.ts +4 -4
- package/dist/typings/elements/Datepicker/components/MonthSelector.d.ts +2 -2
- package/dist/typings/elements/DatepickerRange/DatepickerRange.d.ts +8 -4
- package/dist/typings/elements/DatepickerRange/components/Calendar.d.ts +5 -3
- package/dist/typings/elements/DatepickerRange/components/End.d.ts +1 -2
- package/dist/typings/elements/DatepickerRange/components/Month.d.ts +5 -4
- package/dist/typings/elements/DatepickerRange/components/Start.d.ts +1 -2
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -100,6 +100,42 @@ function _extends$2() {
|
|
|
100
100
|
return _extends$2.apply(this, arguments);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
104
|
+
if (source == null) return {};
|
|
105
|
+
var target = {};
|
|
106
|
+
var sourceKeys = Object.keys(source);
|
|
107
|
+
var key, i;
|
|
108
|
+
|
|
109
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
110
|
+
key = sourceKeys[i];
|
|
111
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
112
|
+
target[key] = source[key];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return target;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function _objectWithoutProperties(source, excluded) {
|
|
119
|
+
if (source == null) return {};
|
|
120
|
+
|
|
121
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
122
|
+
|
|
123
|
+
var key, i;
|
|
124
|
+
|
|
125
|
+
if (Object.getOwnPropertySymbols) {
|
|
126
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
127
|
+
|
|
128
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
129
|
+
key = sourceSymbolKeys[i];
|
|
130
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
131
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
132
|
+
target[key] = source[key];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return target;
|
|
137
|
+
}
|
|
138
|
+
|
|
103
139
|
function _slicedToArray(arr, i) {
|
|
104
140
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
105
141
|
}
|
|
@@ -380,7 +416,7 @@ function getDate(dirtyDate) {
|
|
|
380
416
|
var COMPONENT_ID$b = 'datepickers.menu';
|
|
381
417
|
var StyledMenu = styled__default["default"].div.attrs({
|
|
382
418
|
'data-garden-id': COMPONENT_ID$b,
|
|
383
|
-
'data-garden-version': '8.
|
|
419
|
+
'data-garden-version': '8.48.0'
|
|
384
420
|
}).withConfig({
|
|
385
421
|
displayName: "StyledMenu",
|
|
386
422
|
componentId: "sc-1npbkk0-0"
|
|
@@ -819,7 +855,7 @@ var MonthSelector = function MonthSelector(_ref) {
|
|
|
819
855
|
}, React__default["default"].createElement(SvgChevronRightStroke, null)));
|
|
820
856
|
};
|
|
821
857
|
|
|
822
|
-
var Calendar$1 = function
|
|
858
|
+
var Calendar$1 = React.forwardRef(function (_ref, ref) {
|
|
823
859
|
var value = _ref.value,
|
|
824
860
|
minValue = _ref.minValue,
|
|
825
861
|
maxValue = _ref.maxValue,
|
|
@@ -890,6 +926,7 @@ var Calendar$1 = function Calendar(_ref) {
|
|
|
890
926
|
}, formattedDayLabel));
|
|
891
927
|
});
|
|
892
928
|
return React__default["default"].createElement(StyledDatepicker, {
|
|
929
|
+
ref: ref,
|
|
893
930
|
isCompact: isCompact,
|
|
894
931
|
onMouseDown: function onMouseDown(e) {
|
|
895
932
|
e.preventDefault();
|
|
@@ -900,7 +937,8 @@ var Calendar$1 = function Calendar(_ref) {
|
|
|
900
937
|
}), React__default["default"].createElement(StyledCalendar, {
|
|
901
938
|
isCompact: isCompact
|
|
902
939
|
}, dayLabels, items));
|
|
903
|
-
};
|
|
940
|
+
});
|
|
941
|
+
Calendar$1.displayName = 'Calendar';
|
|
904
942
|
|
|
905
943
|
function addMonths(dirtyDate, dirtyAmount) {
|
|
906
944
|
requiredArgs(2, arguments);
|
|
@@ -3242,7 +3280,8 @@ function retrieveInitialState$1(initialProps) {
|
|
|
3242
3280
|
};
|
|
3243
3281
|
}
|
|
3244
3282
|
|
|
3245
|
-
var
|
|
3283
|
+
var _excluded = ["children", "placement", "popperModifiers", "eventsEnabled", "zIndex", "isAnimated", "refKey", "value", "isCompact", "onChange", "formatDate", "minValue", "maxValue", "locale", "customParseDate"];
|
|
3284
|
+
var Datepicker = React.forwardRef(function (props, calendarRef) {
|
|
3246
3285
|
var children = props.children,
|
|
3247
3286
|
placement = props.placement,
|
|
3248
3287
|
popperModifiers = props.popperModifiers,
|
|
@@ -3257,7 +3296,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
3257
3296
|
minValue = props.minValue,
|
|
3258
3297
|
maxValue = props.maxValue,
|
|
3259
3298
|
locale = props.locale,
|
|
3260
|
-
customParseDate = props.customParseDate
|
|
3299
|
+
customParseDate = props.customParseDate,
|
|
3300
|
+
menuProps = _objectWithoutProperties(props, _excluded);
|
|
3261
3301
|
var theme = React.useContext(styled.ThemeContext);
|
|
3262
3302
|
var memoizedReducer = React.useCallback(datepickerReducer({
|
|
3263
3303
|
value: value,
|
|
@@ -3380,7 +3420,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
3380
3420
|
isAnimated: isAnimated && (state.isOpen || isVisible),
|
|
3381
3421
|
placement: currentPlacement,
|
|
3382
3422
|
zIndex: zIndex
|
|
3383
|
-
}, (state.isOpen || isVisible) && React__default["default"].createElement(StyledMenu,
|
|
3423
|
+
}, (state.isOpen || isVisible) && React__default["default"].createElement(StyledMenu, menuProps, React__default["default"].createElement(Calendar$1, {
|
|
3424
|
+
ref: calendarRef,
|
|
3384
3425
|
isCompact: isCompact,
|
|
3385
3426
|
value: value,
|
|
3386
3427
|
minValue: minValue,
|
|
@@ -3388,7 +3429,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
3388
3429
|
locale: locale
|
|
3389
3430
|
})));
|
|
3390
3431
|
})));
|
|
3391
|
-
};
|
|
3432
|
+
});
|
|
3433
|
+
Datepicker.displayName = 'Datepicker';
|
|
3392
3434
|
Datepicker.propTypes = {
|
|
3393
3435
|
value: PropTypes__default["default"].any,
|
|
3394
3436
|
onChange: PropTypes__default["default"].any,
|
|
@@ -3817,7 +3859,7 @@ function subDays(dirtyDate, dirtyAmount) {
|
|
|
3817
3859
|
return addDays(dirtyDate, -amount);
|
|
3818
3860
|
}
|
|
3819
3861
|
|
|
3820
|
-
var Month = function
|
|
3862
|
+
var Month = React.forwardRef(function (_ref, ref) {
|
|
3821
3863
|
var locale = _ref.locale,
|
|
3822
3864
|
displayDate = _ref.displayDate,
|
|
3823
3865
|
isCompact = _ref.isCompact,
|
|
@@ -3957,6 +3999,7 @@ var Month = function Month(_ref) {
|
|
|
3957
3999
|
}, formattedDayLabel));
|
|
3958
4000
|
});
|
|
3959
4001
|
return React__default["default"].createElement(StyledDatepicker, {
|
|
4002
|
+
ref: ref,
|
|
3960
4003
|
isCompact: isCompact,
|
|
3961
4004
|
onMouseDown: function onMouseDown(e) {
|
|
3962
4005
|
e.preventDefault();
|
|
@@ -3990,9 +4033,10 @@ var Month = function Month(_ref) {
|
|
|
3990
4033
|
});
|
|
3991
4034
|
}
|
|
3992
4035
|
}, dayLabels, items));
|
|
3993
|
-
};
|
|
4036
|
+
});
|
|
4037
|
+
Month.displayName = 'Month';
|
|
3994
4038
|
|
|
3995
|
-
var Calendar = function
|
|
4039
|
+
var Calendar = React.forwardRef(function (props, ref) {
|
|
3996
4040
|
var _useDatepickerRangeCo = useDatepickerContext(),
|
|
3997
4041
|
state = _useDatepickerRangeCo.state,
|
|
3998
4042
|
dispatch = _useDatepickerRangeCo.dispatch,
|
|
@@ -4004,8 +4048,9 @@ var Calendar = function Calendar(props) {
|
|
|
4004
4048
|
endValue = _useDatepickerRangeCo.endValue,
|
|
4005
4049
|
onChange = _useDatepickerRangeCo.onChange;
|
|
4006
4050
|
return React__default["default"].createElement(StyledRangeCalendar, _extends$2({
|
|
4051
|
+
ref: ref,
|
|
4007
4052
|
"data-garden-id": "datepickers.range",
|
|
4008
|
-
"data-garden-version": '8.
|
|
4053
|
+
"data-garden-version": '8.48.0'
|
|
4009
4054
|
}, props), React__default["default"].createElement(Month, {
|
|
4010
4055
|
locale: locale,
|
|
4011
4056
|
displayDate: state.previewDate,
|
|
@@ -4031,9 +4076,10 @@ var Calendar = function Calendar(props) {
|
|
|
4031
4076
|
onChange: onChange,
|
|
4032
4077
|
hoverDate: state.hoverDate
|
|
4033
4078
|
}));
|
|
4034
|
-
};
|
|
4079
|
+
});
|
|
4080
|
+
Calendar.displayName = 'Calendar';
|
|
4035
4081
|
|
|
4036
|
-
var
|
|
4082
|
+
var DatepickerRangeComponent = function DatepickerRangeComponent(props) {
|
|
4037
4083
|
var startValue = props.startValue,
|
|
4038
4084
|
locale = props.locale,
|
|
4039
4085
|
formatDate = props.formatDate,
|
|
@@ -4099,10 +4145,7 @@ var DatepickerRange = function DatepickerRange(props) {
|
|
|
4099
4145
|
value: value
|
|
4100
4146
|
}, children);
|
|
4101
4147
|
};
|
|
4102
|
-
|
|
4103
|
-
DatepickerRange.End = End;
|
|
4104
|
-
DatepickerRange.Calendar = Calendar;
|
|
4105
|
-
DatepickerRange.propTypes = {
|
|
4148
|
+
DatepickerRangeComponent.propTypes = {
|
|
4106
4149
|
locale: PropTypes__default["default"].string,
|
|
4107
4150
|
startValue: PropTypes__default["default"].instanceOf(Date),
|
|
4108
4151
|
endValue: PropTypes__default["default"].instanceOf(Date),
|
|
@@ -4113,10 +4156,14 @@ DatepickerRange.propTypes = {
|
|
|
4113
4156
|
customParseDate: PropTypes__default["default"].func,
|
|
4114
4157
|
isCompact: PropTypes__default["default"].bool
|
|
4115
4158
|
};
|
|
4116
|
-
|
|
4159
|
+
DatepickerRangeComponent.defaultProps = {
|
|
4117
4160
|
locale: 'en-US',
|
|
4118
4161
|
isCompact: false
|
|
4119
4162
|
};
|
|
4163
|
+
var DatepickerRange = DatepickerRangeComponent;
|
|
4164
|
+
DatepickerRange.Calendar = Calendar;
|
|
4165
|
+
DatepickerRange.End = End;
|
|
4166
|
+
DatepickerRange.Start = Start;
|
|
4120
4167
|
|
|
4121
4168
|
exports.Datepicker = Datepicker;
|
|
4122
4169
|
exports.DatepickerRange = DatepickerRange;
|
package/dist/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { createContext, useContext, useCallback, useReducer, useRef, useEffect, useState, useMemo } from 'react';
|
|
9
|
+
import React__default, { createContext, useContext, useCallback, forwardRef, useReducer, useRef, useEffect, useState, useMemo } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import styled, { css, ThemeContext } from 'styled-components';
|
|
12
12
|
import { Manager, Reference, Popper } from 'react-popper';
|
|
@@ -72,6 +72,42 @@ function _extends$2() {
|
|
|
72
72
|
return _extends$2.apply(this, arguments);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
76
|
+
if (source == null) return {};
|
|
77
|
+
var target = {};
|
|
78
|
+
var sourceKeys = Object.keys(source);
|
|
79
|
+
var key, i;
|
|
80
|
+
|
|
81
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
82
|
+
key = sourceKeys[i];
|
|
83
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
target[key] = source[key];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function _objectWithoutProperties(source, excluded) {
|
|
91
|
+
if (source == null) return {};
|
|
92
|
+
|
|
93
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
94
|
+
|
|
95
|
+
var key, i;
|
|
96
|
+
|
|
97
|
+
if (Object.getOwnPropertySymbols) {
|
|
98
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
99
|
+
|
|
100
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
101
|
+
key = sourceSymbolKeys[i];
|
|
102
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
103
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
104
|
+
target[key] = source[key];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return target;
|
|
109
|
+
}
|
|
110
|
+
|
|
75
111
|
function _slicedToArray(arr, i) {
|
|
76
112
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
77
113
|
}
|
|
@@ -352,7 +388,7 @@ function getDate(dirtyDate) {
|
|
|
352
388
|
var COMPONENT_ID$b = 'datepickers.menu';
|
|
353
389
|
var StyledMenu = styled.div.attrs({
|
|
354
390
|
'data-garden-id': COMPONENT_ID$b,
|
|
355
|
-
'data-garden-version': '8.
|
|
391
|
+
'data-garden-version': '8.48.0'
|
|
356
392
|
}).withConfig({
|
|
357
393
|
displayName: "StyledMenu",
|
|
358
394
|
componentId: "sc-1npbkk0-0"
|
|
@@ -791,7 +827,7 @@ var MonthSelector = function MonthSelector(_ref) {
|
|
|
791
827
|
}, React__default.createElement(SvgChevronRightStroke, null)));
|
|
792
828
|
};
|
|
793
829
|
|
|
794
|
-
var Calendar$1 = function
|
|
830
|
+
var Calendar$1 = forwardRef(function (_ref, ref) {
|
|
795
831
|
var value = _ref.value,
|
|
796
832
|
minValue = _ref.minValue,
|
|
797
833
|
maxValue = _ref.maxValue,
|
|
@@ -862,6 +898,7 @@ var Calendar$1 = function Calendar(_ref) {
|
|
|
862
898
|
}, formattedDayLabel));
|
|
863
899
|
});
|
|
864
900
|
return React__default.createElement(StyledDatepicker, {
|
|
901
|
+
ref: ref,
|
|
865
902
|
isCompact: isCompact,
|
|
866
903
|
onMouseDown: function onMouseDown(e) {
|
|
867
904
|
e.preventDefault();
|
|
@@ -872,7 +909,8 @@ var Calendar$1 = function Calendar(_ref) {
|
|
|
872
909
|
}), React__default.createElement(StyledCalendar, {
|
|
873
910
|
isCompact: isCompact
|
|
874
911
|
}, dayLabels, items));
|
|
875
|
-
};
|
|
912
|
+
});
|
|
913
|
+
Calendar$1.displayName = 'Calendar';
|
|
876
914
|
|
|
877
915
|
function addMonths(dirtyDate, dirtyAmount) {
|
|
878
916
|
requiredArgs(2, arguments);
|
|
@@ -3214,7 +3252,8 @@ function retrieveInitialState$1(initialProps) {
|
|
|
3214
3252
|
};
|
|
3215
3253
|
}
|
|
3216
3254
|
|
|
3217
|
-
var
|
|
3255
|
+
var _excluded = ["children", "placement", "popperModifiers", "eventsEnabled", "zIndex", "isAnimated", "refKey", "value", "isCompact", "onChange", "formatDate", "minValue", "maxValue", "locale", "customParseDate"];
|
|
3256
|
+
var Datepicker = forwardRef(function (props, calendarRef) {
|
|
3218
3257
|
var children = props.children,
|
|
3219
3258
|
placement = props.placement,
|
|
3220
3259
|
popperModifiers = props.popperModifiers,
|
|
@@ -3229,7 +3268,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
3229
3268
|
minValue = props.minValue,
|
|
3230
3269
|
maxValue = props.maxValue,
|
|
3231
3270
|
locale = props.locale,
|
|
3232
|
-
customParseDate = props.customParseDate
|
|
3271
|
+
customParseDate = props.customParseDate,
|
|
3272
|
+
menuProps = _objectWithoutProperties(props, _excluded);
|
|
3233
3273
|
var theme = useContext(ThemeContext);
|
|
3234
3274
|
var memoizedReducer = useCallback(datepickerReducer({
|
|
3235
3275
|
value: value,
|
|
@@ -3352,7 +3392,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
3352
3392
|
isAnimated: isAnimated && (state.isOpen || isVisible),
|
|
3353
3393
|
placement: currentPlacement,
|
|
3354
3394
|
zIndex: zIndex
|
|
3355
|
-
}, (state.isOpen || isVisible) && React__default.createElement(StyledMenu,
|
|
3395
|
+
}, (state.isOpen || isVisible) && React__default.createElement(StyledMenu, menuProps, React__default.createElement(Calendar$1, {
|
|
3396
|
+
ref: calendarRef,
|
|
3356
3397
|
isCompact: isCompact,
|
|
3357
3398
|
value: value,
|
|
3358
3399
|
minValue: minValue,
|
|
@@ -3360,7 +3401,8 @@ var Datepicker = function Datepicker(props) {
|
|
|
3360
3401
|
locale: locale
|
|
3361
3402
|
})));
|
|
3362
3403
|
})));
|
|
3363
|
-
};
|
|
3404
|
+
});
|
|
3405
|
+
Datepicker.displayName = 'Datepicker';
|
|
3364
3406
|
Datepicker.propTypes = {
|
|
3365
3407
|
value: PropTypes.any,
|
|
3366
3408
|
onChange: PropTypes.any,
|
|
@@ -3789,7 +3831,7 @@ function subDays(dirtyDate, dirtyAmount) {
|
|
|
3789
3831
|
return addDays(dirtyDate, -amount);
|
|
3790
3832
|
}
|
|
3791
3833
|
|
|
3792
|
-
var Month = function
|
|
3834
|
+
var Month = forwardRef(function (_ref, ref) {
|
|
3793
3835
|
var locale = _ref.locale,
|
|
3794
3836
|
displayDate = _ref.displayDate,
|
|
3795
3837
|
isCompact = _ref.isCompact,
|
|
@@ -3929,6 +3971,7 @@ var Month = function Month(_ref) {
|
|
|
3929
3971
|
}, formattedDayLabel));
|
|
3930
3972
|
});
|
|
3931
3973
|
return React__default.createElement(StyledDatepicker, {
|
|
3974
|
+
ref: ref,
|
|
3932
3975
|
isCompact: isCompact,
|
|
3933
3976
|
onMouseDown: function onMouseDown(e) {
|
|
3934
3977
|
e.preventDefault();
|
|
@@ -3962,9 +4005,10 @@ var Month = function Month(_ref) {
|
|
|
3962
4005
|
});
|
|
3963
4006
|
}
|
|
3964
4007
|
}, dayLabels, items));
|
|
3965
|
-
};
|
|
4008
|
+
});
|
|
4009
|
+
Month.displayName = 'Month';
|
|
3966
4010
|
|
|
3967
|
-
var Calendar = function
|
|
4011
|
+
var Calendar = forwardRef(function (props, ref) {
|
|
3968
4012
|
var _useDatepickerRangeCo = useDatepickerContext(),
|
|
3969
4013
|
state = _useDatepickerRangeCo.state,
|
|
3970
4014
|
dispatch = _useDatepickerRangeCo.dispatch,
|
|
@@ -3976,8 +4020,9 @@ var Calendar = function Calendar(props) {
|
|
|
3976
4020
|
endValue = _useDatepickerRangeCo.endValue,
|
|
3977
4021
|
onChange = _useDatepickerRangeCo.onChange;
|
|
3978
4022
|
return React__default.createElement(StyledRangeCalendar, _extends$2({
|
|
4023
|
+
ref: ref,
|
|
3979
4024
|
"data-garden-id": "datepickers.range",
|
|
3980
|
-
"data-garden-version": '8.
|
|
4025
|
+
"data-garden-version": '8.48.0'
|
|
3981
4026
|
}, props), React__default.createElement(Month, {
|
|
3982
4027
|
locale: locale,
|
|
3983
4028
|
displayDate: state.previewDate,
|
|
@@ -4003,9 +4048,10 @@ var Calendar = function Calendar(props) {
|
|
|
4003
4048
|
onChange: onChange,
|
|
4004
4049
|
hoverDate: state.hoverDate
|
|
4005
4050
|
}));
|
|
4006
|
-
};
|
|
4051
|
+
});
|
|
4052
|
+
Calendar.displayName = 'Calendar';
|
|
4007
4053
|
|
|
4008
|
-
var
|
|
4054
|
+
var DatepickerRangeComponent = function DatepickerRangeComponent(props) {
|
|
4009
4055
|
var startValue = props.startValue,
|
|
4010
4056
|
locale = props.locale,
|
|
4011
4057
|
formatDate = props.formatDate,
|
|
@@ -4071,10 +4117,7 @@ var DatepickerRange = function DatepickerRange(props) {
|
|
|
4071
4117
|
value: value
|
|
4072
4118
|
}, children);
|
|
4073
4119
|
};
|
|
4074
|
-
|
|
4075
|
-
DatepickerRange.End = End;
|
|
4076
|
-
DatepickerRange.Calendar = Calendar;
|
|
4077
|
-
DatepickerRange.propTypes = {
|
|
4120
|
+
DatepickerRangeComponent.propTypes = {
|
|
4078
4121
|
locale: PropTypes.string,
|
|
4079
4122
|
startValue: PropTypes.instanceOf(Date),
|
|
4080
4123
|
endValue: PropTypes.instanceOf(Date),
|
|
@@ -4085,9 +4128,13 @@ DatepickerRange.propTypes = {
|
|
|
4085
4128
|
customParseDate: PropTypes.func,
|
|
4086
4129
|
isCompact: PropTypes.bool
|
|
4087
4130
|
};
|
|
4088
|
-
|
|
4131
|
+
DatepickerRangeComponent.defaultProps = {
|
|
4089
4132
|
locale: 'en-US',
|
|
4090
4133
|
isCompact: false
|
|
4091
4134
|
};
|
|
4135
|
+
var DatepickerRange = DatepickerRangeComponent;
|
|
4136
|
+
DatepickerRange.Calendar = Calendar;
|
|
4137
|
+
DatepickerRange.End = End;
|
|
4138
|
+
DatepickerRange.Start = Start;
|
|
4092
4139
|
|
|
4093
4140
|
export { Datepicker, DatepickerRange };
|
|
@@ -4,10 +4,13 @@
|
|
|
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 React from 'react';
|
|
7
|
+
import React, { HTMLAttributes } from 'react';
|
|
8
8
|
import { Modifiers } from 'popper.js';
|
|
9
9
|
import { GARDEN_PLACEMENT } from './utils/garden-placements';
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @extends HTMLAttributes<HTMLDivElement>
|
|
12
|
+
*/
|
|
13
|
+
export interface IDatepickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
11
14
|
/**
|
|
12
15
|
* Sets the selected date
|
|
13
16
|
*/
|
|
@@ -74,4 +77,4 @@ export interface IDatepickerProps {
|
|
|
74
77
|
*/
|
|
75
78
|
zIndex?: number;
|
|
76
79
|
}
|
|
77
|
-
export declare const Datepicker: React.
|
|
80
|
+
export declare const Datepicker: React.ForwardRefExoticComponent<IDatepickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -4,13 +4,13 @@
|
|
|
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 React from 'react';
|
|
8
|
-
interface ICalendarProps {
|
|
7
|
+
import React, { HTMLAttributes } from 'react';
|
|
8
|
+
interface ICalendarProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
9
|
value?: Date;
|
|
10
10
|
minValue?: Date;
|
|
11
11
|
maxValue?: Date;
|
|
12
12
|
isCompact?: boolean;
|
|
13
13
|
locale?: string;
|
|
14
14
|
}
|
|
15
|
-
declare const Calendar: React.
|
|
16
|
-
export
|
|
15
|
+
export declare const Calendar: React.ForwardRefExoticComponent<ICalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export {};
|
|
@@ -9,5 +9,5 @@ interface IMonthSelectorProps {
|
|
|
9
9
|
locale?: string;
|
|
10
10
|
isCompact: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare const MonthSelector: React.FunctionComponent<IMonthSelectorProps>;
|
|
13
|
-
export
|
|
12
|
+
export declare const MonthSelector: React.FunctionComponent<IMonthSelectorProps>;
|
|
13
|
+
export {};
|
|
@@ -4,8 +4,11 @@
|
|
|
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
|
|
7
|
+
import { PropsWithChildren } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
+
import { Start } from './components/Start';
|
|
10
|
+
import { End } from './components/End';
|
|
11
|
+
import { Calendar } from './components/Calendar';
|
|
9
12
|
export interface IDatepickerRangeProps {
|
|
10
13
|
/**
|
|
11
14
|
* Applies locale-based formatting.
|
|
@@ -60,9 +63,6 @@ export interface IDatepickerRangeProps {
|
|
|
60
63
|
}
|
|
61
64
|
export declare const DatepickerRange: {
|
|
62
65
|
(props: PropsWithChildren<IDatepickerRangeProps>): JSX.Element;
|
|
63
|
-
Start: (props: React.PropsWithChildren<React.HTMLAttributes<HTMLInputElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
64
|
-
End: (props: React.PropsWithChildren<React.HTMLAttributes<HTMLInputElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
65
|
-
Calendar: React.FunctionComponent<React.HTMLAttributes<HTMLDivElement>>;
|
|
66
66
|
propTypes: {
|
|
67
67
|
locale: PropTypes.Requireable<string>;
|
|
68
68
|
startValue: PropTypes.Requireable<Date>;
|
|
@@ -78,4 +78,8 @@ export declare const DatepickerRange: {
|
|
|
78
78
|
locale: string;
|
|
79
79
|
isCompact: boolean;
|
|
80
80
|
};
|
|
81
|
+
} & {
|
|
82
|
+
Calendar: typeof Calendar;
|
|
83
|
+
End: typeof End;
|
|
84
|
+
Start: typeof Start;
|
|
81
85
|
};
|
|
@@ -4,6 +4,8 @@
|
|
|
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 React
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* @extends HTMLAttributes<HTMLDivElement>
|
|
10
|
+
*/
|
|
11
|
+
export declare const Calendar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import React, { PropsWithChildren, HTMLAttributes } from 'react';
|
|
8
|
-
declare const End: (props: PropsWithChildren<HTMLAttributes<HTMLInputElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
9
|
-
export default End;
|
|
8
|
+
export declare const End: (props: PropsWithChildren<HTMLAttributes<HTMLInputElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -4,9 +4,9 @@
|
|
|
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 React from 'react';
|
|
7
|
+
import React, { HTMLAttributes } from 'react';
|
|
8
8
|
import { DatepickerRangeAction } from '../utils/datepicker-range-reducer';
|
|
9
|
-
|
|
9
|
+
interface IMonthProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
10
10
|
locale?: string;
|
|
11
11
|
displayDate: Date;
|
|
12
12
|
isCompact?: boolean;
|
|
@@ -22,5 +22,6 @@ declare const Month: React.FunctionComponent<{
|
|
|
22
22
|
endValue?: Date;
|
|
23
23
|
}) => void;
|
|
24
24
|
hoverDate?: Date;
|
|
25
|
-
}
|
|
26
|
-
export
|
|
25
|
+
}
|
|
26
|
+
export declare const Month: React.ForwardRefExoticComponent<IMonthProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export {};
|
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import React, { PropsWithChildren, HTMLAttributes } from 'react';
|
|
8
|
-
declare const Start: (props: PropsWithChildren<HTMLAttributes<HTMLInputElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
9
|
-
export default Start;
|
|
8
|
+
export declare const Start: (props: PropsWithChildren<HTMLAttributes<HTMLInputElement>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-datepickers",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.48.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.48.0",
|
|
37
37
|
"@zendeskgarden/svg-icons": "6.30.2"
|
|
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": "75f36aee62043004650c3eb2e1583b98a87d71f8"
|
|
50
50
|
}
|