@ornikar/kitt-universal 9.43.0 → 9.44.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/definitions/forms/DatePicker/components/KeyboardDatePicker.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/reducers/keyboardDatePickerReducer.d.ts +3 -6
- package/dist/definitions/forms/DatePicker/reducers/keyboardDatePickerReducer.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +94 -119
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +94 -119
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +95 -119
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +101 -120
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +109 -135
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.js +115 -136
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardDatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/forms/DatePicker/components/KeyboardDatePicker.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAI7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"KeyboardDatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/forms/DatePicker/components/KeyboardDatePicker.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAI7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AASrD,UAAU,uBAAwB,SAAQ,eAAe;IACvD,eAAe,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,kBAAkB,iHA8I9B,CAAC"}
|
|
@@ -10,21 +10,18 @@ export interface State {
|
|
|
10
10
|
displayedYear?: string;
|
|
11
11
|
minDate: DatePickerProps['minDate'];
|
|
12
12
|
maxDate: DatePickerProps['maxDate'];
|
|
13
|
-
onChange: DatePickerProps['onChange'];
|
|
14
|
-
onBlur: DatePickerProps['onBlur'];
|
|
15
|
-
onFocus: DatePickerProps['onFocus'];
|
|
16
13
|
}
|
|
17
14
|
interface DayChangeAction {
|
|
18
15
|
type: 'day-change';
|
|
19
|
-
nextDay?:
|
|
16
|
+
nextDay?: number;
|
|
20
17
|
}
|
|
21
18
|
interface MonthChangeAction {
|
|
22
19
|
type: 'month-change';
|
|
23
|
-
nextMonth?:
|
|
20
|
+
nextMonth?: number;
|
|
24
21
|
}
|
|
25
22
|
interface YearChangeAction {
|
|
26
23
|
type: 'year-change';
|
|
27
|
-
nextYear?:
|
|
24
|
+
nextYear?: number;
|
|
28
25
|
}
|
|
29
26
|
interface DayBlurAction {
|
|
30
27
|
type: 'day-blur';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboardDatePickerReducer.d.ts","sourceRoot":"","sources":["../../../../../src/forms/DatePicker/reducers/keyboardDatePickerReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"keyboardDatePickerReducer.d.ts","sourceRoot":"","sources":["../../../../../src/forms/DatePicker/reducers/keyboardDatePickerReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACrC;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,KAAK,OAAO,GACR,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAoE7D,CAAC"}
|
|
@@ -3871,6 +3871,64 @@ function getYearInInterval(value, minDate, maxDate) {
|
|
|
3871
3871
|
return value !== undefined ? Math.max(minValue, Math.min(maxValue, value)) : value;
|
|
3872
3872
|
}
|
|
3873
3873
|
|
|
3874
|
+
var keyboardDatePickerReducer = function (state, action) {
|
|
3875
|
+
switch (action.type) {
|
|
3876
|
+
case 'day-change':
|
|
3877
|
+
{
|
|
3878
|
+
var nextDay = action.nextDay;
|
|
3879
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3880
|
+
currentDay: nextDay,
|
|
3881
|
+
displayedDay: nextDay ? nextDay.toString() : ''
|
|
3882
|
+
});
|
|
3883
|
+
}
|
|
3884
|
+
case 'month-change':
|
|
3885
|
+
{
|
|
3886
|
+
var nextMonth = action.nextMonth;
|
|
3887
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3888
|
+
currentMonth: nextMonth,
|
|
3889
|
+
displayedMonth: nextMonth ? nextMonth.toString() : ''
|
|
3890
|
+
});
|
|
3891
|
+
}
|
|
3892
|
+
case 'year-change':
|
|
3893
|
+
{
|
|
3894
|
+
var nextYear = action.nextYear;
|
|
3895
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3896
|
+
currentYear: nextYear,
|
|
3897
|
+
displayedYear: nextYear ? nextYear.toString() : ''
|
|
3898
|
+
});
|
|
3899
|
+
}
|
|
3900
|
+
case 'day-blur':
|
|
3901
|
+
{
|
|
3902
|
+
var nextCurrentDay = getDayInInterval(state.currentDay);
|
|
3903
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3904
|
+
displayedDay: nextCurrentDay ? dayFormatter(nextCurrentDay) : state.displayedDay
|
|
3905
|
+
});
|
|
3906
|
+
}
|
|
3907
|
+
case 'month-blur':
|
|
3908
|
+
{
|
|
3909
|
+
var minDate = state.minDate,
|
|
3910
|
+
maxDate = state.maxDate;
|
|
3911
|
+
var nextCurrentMonth = getMonthInInterval(state.currentMonth, minDate, maxDate);
|
|
3912
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3913
|
+
currentMonth: nextCurrentMonth,
|
|
3914
|
+
displayedMonth: nextCurrentMonth !== undefined ? monthFormatter(nextCurrentMonth) : state.displayedMonth
|
|
3915
|
+
});
|
|
3916
|
+
}
|
|
3917
|
+
case 'year-blur':
|
|
3918
|
+
{
|
|
3919
|
+
var _minDate = state.minDate,
|
|
3920
|
+
_maxDate = state.maxDate;
|
|
3921
|
+
var nextCurrentYear = getYearInInterval(state.currentYear, _minDate, _maxDate);
|
|
3922
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3923
|
+
currentYear: nextCurrentYear,
|
|
3924
|
+
displayedYear: nextCurrentYear !== undefined ? yearFormatter(nextCurrentYear) : state.displayedYear
|
|
3925
|
+
});
|
|
3926
|
+
}
|
|
3927
|
+
default:
|
|
3928
|
+
return state;
|
|
3929
|
+
}
|
|
3930
|
+
};
|
|
3931
|
+
|
|
3874
3932
|
function isNumber(input) {
|
|
3875
3933
|
// Number.isNaN and isNaN are not consistent
|
|
3876
3934
|
// eslint-disable-next-line no-restricted-globals
|
|
@@ -3954,111 +4012,6 @@ function stringToNumber(text) {
|
|
|
3954
4012
|
return parseInt(text, 10);
|
|
3955
4013
|
}
|
|
3956
4014
|
|
|
3957
|
-
var keyboardDatePickerReducer = function (state, action) {
|
|
3958
|
-
var handleChange = function (dateParts) {
|
|
3959
|
-
var onFocus = state.onFocus,
|
|
3960
|
-
onBlur = state.onBlur,
|
|
3961
|
-
onChange = state.onChange,
|
|
3962
|
-
minDate = state.minDate,
|
|
3963
|
-
maxDate = state.maxDate;
|
|
3964
|
-
onDatePartChange(_objectSpread(_objectSpread({}, dateParts), {}, {
|
|
3965
|
-
onFocus: onFocus,
|
|
3966
|
-
onBlur: onBlur,
|
|
3967
|
-
onChange: onChange,
|
|
3968
|
-
minDate: minDate,
|
|
3969
|
-
maxDate: maxDate
|
|
3970
|
-
}));
|
|
3971
|
-
};
|
|
3972
|
-
switch (action.type) {
|
|
3973
|
-
case 'day-change':
|
|
3974
|
-
{
|
|
3975
|
-
var nextDay = stringToNumber(action.nextDay || '');
|
|
3976
|
-
if (nextDay === undefined || !isNumber(action.nextDay)) {
|
|
3977
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3978
|
-
currentDay: undefined,
|
|
3979
|
-
displayedDay: ''
|
|
3980
|
-
});
|
|
3981
|
-
}
|
|
3982
|
-
handleChange({
|
|
3983
|
-
day: nextDay,
|
|
3984
|
-
month: state.currentMonth,
|
|
3985
|
-
year: state.currentYear
|
|
3986
|
-
});
|
|
3987
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3988
|
-
currentDay: nextDay,
|
|
3989
|
-
displayedDay: nextDay.toString()
|
|
3990
|
-
});
|
|
3991
|
-
}
|
|
3992
|
-
case 'month-change':
|
|
3993
|
-
{
|
|
3994
|
-
var nextMonth = stringToNumber(action.nextMonth || '');
|
|
3995
|
-
if (nextMonth === undefined || !isNumber(action.nextMonth)) {
|
|
3996
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
3997
|
-
currentMonth: undefined,
|
|
3998
|
-
displayedMonth: ''
|
|
3999
|
-
});
|
|
4000
|
-
}
|
|
4001
|
-
handleChange({
|
|
4002
|
-
day: state.currentDay,
|
|
4003
|
-
month: nextMonth,
|
|
4004
|
-
year: state.currentYear
|
|
4005
|
-
});
|
|
4006
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4007
|
-
currentMonth: nextMonth,
|
|
4008
|
-
displayedMonth: nextMonth.toString()
|
|
4009
|
-
});
|
|
4010
|
-
}
|
|
4011
|
-
case 'year-change':
|
|
4012
|
-
{
|
|
4013
|
-
var nextYear = stringToNumber(action.nextYear || '');
|
|
4014
|
-
if (nextYear === undefined || !isNumber(action.nextYear)) {
|
|
4015
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4016
|
-
currentYear: undefined,
|
|
4017
|
-
displayedYear: ''
|
|
4018
|
-
});
|
|
4019
|
-
}
|
|
4020
|
-
handleChange({
|
|
4021
|
-
day: state.currentDay,
|
|
4022
|
-
month: state.currentMonth,
|
|
4023
|
-
year: nextYear
|
|
4024
|
-
});
|
|
4025
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4026
|
-
currentYear: nextYear,
|
|
4027
|
-
displayedYear: nextYear.toString()
|
|
4028
|
-
});
|
|
4029
|
-
}
|
|
4030
|
-
case 'day-blur':
|
|
4031
|
-
{
|
|
4032
|
-
var nextCurrentDay = getDayInInterval(state.currentDay);
|
|
4033
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4034
|
-
displayedDay: nextCurrentDay ? dayFormatter(nextCurrentDay) : state.displayedDay
|
|
4035
|
-
});
|
|
4036
|
-
}
|
|
4037
|
-
case 'month-blur':
|
|
4038
|
-
{
|
|
4039
|
-
var minDate = state.minDate,
|
|
4040
|
-
maxDate = state.maxDate;
|
|
4041
|
-
var nextCurrentMonth = getMonthInInterval(state.currentMonth, minDate, maxDate);
|
|
4042
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4043
|
-
currentMonth: nextCurrentMonth,
|
|
4044
|
-
displayedMonth: nextCurrentMonth !== undefined ? monthFormatter(nextCurrentMonth) : state.displayedMonth
|
|
4045
|
-
});
|
|
4046
|
-
}
|
|
4047
|
-
case 'year-blur':
|
|
4048
|
-
{
|
|
4049
|
-
var _minDate = state.minDate,
|
|
4050
|
-
_maxDate = state.maxDate;
|
|
4051
|
-
var nextCurrentYear = getYearInInterval(state.currentYear, _minDate, _maxDate);
|
|
4052
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4053
|
-
currentYear: nextCurrentYear,
|
|
4054
|
-
displayedYear: nextCurrentYear !== undefined ? yearFormatter(nextCurrentYear) : state.displayedYear
|
|
4055
|
-
});
|
|
4056
|
-
}
|
|
4057
|
-
default:
|
|
4058
|
-
return state;
|
|
4059
|
-
}
|
|
4060
|
-
};
|
|
4061
|
-
|
|
4062
4015
|
var InputTextContainer = /*#__PURE__*/styled.View.withConfig({
|
|
4063
4016
|
displayName: "InputTextContainer"
|
|
4064
4017
|
})(["position:relative;"]);
|
|
@@ -4215,10 +4168,7 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4215
4168
|
displayedMonth: defaultMonth ? monthFormatter(defaultMonth) : '',
|
|
4216
4169
|
displayedYear: defaultYear ? yearFormatter(defaultYear) : '',
|
|
4217
4170
|
minDate: minDate,
|
|
4218
|
-
maxDate: maxDate
|
|
4219
|
-
onChange: onChange,
|
|
4220
|
-
onBlur: onBlur,
|
|
4221
|
-
onFocus: onFocus
|
|
4171
|
+
maxDate: maxDate
|
|
4222
4172
|
}),
|
|
4223
4173
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
4224
4174
|
state = _useReducer2[0],
|
|
@@ -4229,6 +4179,23 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4229
4179
|
isPressedInternal: isPressedInternal,
|
|
4230
4180
|
disabled: disabled
|
|
4231
4181
|
};
|
|
4182
|
+
var handleDatePartChange = function (day, month, year) {
|
|
4183
|
+
onDatePartChange({
|
|
4184
|
+
day: day,
|
|
4185
|
+
month: month,
|
|
4186
|
+
year: year,
|
|
4187
|
+
minDate: state.minDate,
|
|
4188
|
+
maxDate: state.maxDate,
|
|
4189
|
+
onFocus: onFocus,
|
|
4190
|
+
onBlur: onBlur,
|
|
4191
|
+
onChange: onChange
|
|
4192
|
+
});
|
|
4193
|
+
};
|
|
4194
|
+
var handleAutoFocusNextField = function (currentFieldValue, nextFieldRef) {
|
|
4195
|
+
if (currentFieldValue.length === 2 && nextFieldRef.current) {
|
|
4196
|
+
nextFieldRef.current.focus();
|
|
4197
|
+
}
|
|
4198
|
+
};
|
|
4232
4199
|
return /*#__PURE__*/jsx(View, {
|
|
4233
4200
|
testID: testID,
|
|
4234
4201
|
nativeID: id,
|
|
@@ -4244,14 +4211,15 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4244
4211
|
value: state.displayedDay,
|
|
4245
4212
|
returnKeyType: getReturnKeyTypeForNumericInput('next'),
|
|
4246
4213
|
onChange: function (e) {
|
|
4247
|
-
var nextDay = e.nativeEvent.text;
|
|
4214
|
+
var nextDay = stringToNumber(e.nativeEvent.text);
|
|
4248
4215
|
dispatch({
|
|
4249
4216
|
type: 'day-change',
|
|
4250
4217
|
nextDay: nextDay
|
|
4251
4218
|
});
|
|
4252
|
-
if (nextDay
|
|
4253
|
-
|
|
4219
|
+
if (nextDay && isNumber(nextDay)) {
|
|
4220
|
+
handleDatePartChange(nextDay, state.currentMonth, state.currentYear);
|
|
4254
4221
|
}
|
|
4222
|
+
handleAutoFocusNextField(e.nativeEvent.text, monthRef);
|
|
4255
4223
|
},
|
|
4256
4224
|
onBlur: function () {
|
|
4257
4225
|
return dispatch({
|
|
@@ -4259,7 +4227,8 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4259
4227
|
});
|
|
4260
4228
|
},
|
|
4261
4229
|
onSubmitEditing: function () {
|
|
4262
|
-
|
|
4230
|
+
var _monthRef$current;
|
|
4231
|
+
(_monthRef$current = monthRef.current) === null || _monthRef$current === void 0 ? void 0 : _monthRef$current.focus();
|
|
4263
4232
|
}
|
|
4264
4233
|
}))
|
|
4265
4234
|
}), /*#__PURE__*/jsx(PartContainer, {
|
|
@@ -4272,14 +4241,15 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4272
4241
|
value: state.displayedMonth,
|
|
4273
4242
|
returnKeyType: getReturnKeyTypeForNumericInput('next'),
|
|
4274
4243
|
onChange: function (e) {
|
|
4275
|
-
var nextMonth = e.nativeEvent.text;
|
|
4244
|
+
var nextMonth = stringToNumber(e.nativeEvent.text);
|
|
4276
4245
|
dispatch({
|
|
4277
4246
|
type: 'month-change',
|
|
4278
|
-
nextMonth:
|
|
4247
|
+
nextMonth: nextMonth
|
|
4279
4248
|
});
|
|
4280
|
-
if (nextMonth
|
|
4281
|
-
|
|
4249
|
+
if (nextMonth && isNumber(nextMonth)) {
|
|
4250
|
+
handleDatePartChange(state.currentDay, nextMonth, state.currentYear);
|
|
4282
4251
|
}
|
|
4252
|
+
handleAutoFocusNextField(e.nativeEvent.text, yearRef);
|
|
4283
4253
|
},
|
|
4284
4254
|
onBlur: function () {
|
|
4285
4255
|
return dispatch({
|
|
@@ -4287,7 +4257,8 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4287
4257
|
});
|
|
4288
4258
|
},
|
|
4289
4259
|
onSubmitEditing: function () {
|
|
4290
|
-
|
|
4260
|
+
var _yearRef$current;
|
|
4261
|
+
(_yearRef$current = yearRef.current) === null || _yearRef$current === void 0 ? void 0 : _yearRef$current.focus();
|
|
4291
4262
|
}
|
|
4292
4263
|
}))
|
|
4293
4264
|
}), /*#__PURE__*/jsx(PartContainer, {
|
|
@@ -4300,10 +4271,14 @@ var KeyboardDatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4300
4271
|
value: state.displayedYear,
|
|
4301
4272
|
returnKeyType: returnKeyType ? getReturnKeyTypeForNumericInput(returnKeyType) : undefined,
|
|
4302
4273
|
onChange: function (e) {
|
|
4274
|
+
var nextYear = stringToNumber(e.nativeEvent.text);
|
|
4303
4275
|
dispatch({
|
|
4304
4276
|
type: 'year-change',
|
|
4305
|
-
nextYear:
|
|
4277
|
+
nextYear: nextYear
|
|
4306
4278
|
});
|
|
4279
|
+
if (nextYear && isNumber(nextYear)) {
|
|
4280
|
+
handleDatePartChange(state.currentDay, state.currentMonth, nextYear);
|
|
4281
|
+
}
|
|
4307
4282
|
},
|
|
4308
4283
|
onBlur: function () {
|
|
4309
4284
|
return dispatch({
|