@salutejs/plasma-new-hope 0.340.0-canary.2316.19097749672.0 → 0.340.0-canary.2316.19129435456.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/cjs/components/DateTimePicker/DateTimePicker.js +17 -120
- package/cjs/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/cjs/components/DateTimePicker/hooks/useDateTimePicker.js +125 -11
- package/cjs/components/DateTimePicker/hooks/useDateTimePicker.js.map +1 -1
- package/cjs/components/DateTimePicker/hooks/useKeyboardNavigation.js +0 -9
- package/cjs/components/DateTimePicker/hooks/useKeyboardNavigation.js.map +1 -1
- package/emotion/cjs/components/DateTimePicker/DateTimePicker.js +9 -125
- package/emotion/cjs/components/DateTimePicker/hooks/useDateTimePicker.js +163 -3
- package/emotion/cjs/components/DateTimePicker/hooks/useKeyboardNavigation.js +1 -6
- package/emotion/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/emotion/es/components/DateTimePicker/DateTimePicker.js +10 -126
- package/emotion/es/components/DateTimePicker/hooks/useDateTimePicker.js +163 -3
- package/emotion/es/components/DateTimePicker/hooks/useKeyboardNavigation.js +1 -6
- package/es/components/DateTimePicker/DateTimePicker.js +18 -121
- package/es/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/es/components/DateTimePicker/hooks/useDateTimePicker.js +126 -12
- package/es/components/DateTimePicker/hooks/useDateTimePicker.js.map +1 -1
- package/es/components/DateTimePicker/hooks/useKeyboardNavigation.js +0 -9
- package/es/components/DateTimePicker/hooks/useKeyboardNavigation.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/DateTimePicker/DateTimePicker.js +9 -125
- package/styled-components/cjs/components/DateTimePicker/hooks/useDateTimePicker.js +163 -3
- package/styled-components/cjs/components/DateTimePicker/hooks/useKeyboardNavigation.js +1 -6
- package/styled-components/es/components/DateTimePicker/DateTimePicker.js +10 -126
- package/styled-components/es/components/DateTimePicker/hooks/useDateTimePicker.js +163 -3
- package/styled-components/es/components/DateTimePicker/hooks/useKeyboardNavigation.js +1 -6
- package/styled-components/es/examples/components/Combobox/Combobox.js +0 -7
- package/types/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/types/components/DateTimePicker/DateTimePicker.types.d.ts +7 -8
- package/types/components/DateTimePicker/DateTimePicker.types.d.ts.map +1 -1
- package/types/components/DateTimePicker/hooks/useDateTimePicker.d.ts +11 -3
- package/types/components/DateTimePicker/hooks/useDateTimePicker.d.ts.map +1 -1
- package/types/components/DateTimePicker/hooks/useKeyboardNavigation.d.ts +2 -2
- package/types/components/DateTimePicker/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/types/examples/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
1
9
|
function _define_property(obj, key, value) {
|
|
2
10
|
if (key in obj) {
|
|
3
11
|
Object.defineProperty(obj, key, {
|
|
@@ -11,6 +19,33 @@ function _define_property(obj, key, value) {
|
|
|
11
19
|
}
|
|
12
20
|
return obj;
|
|
13
21
|
}
|
|
22
|
+
function _iterable_to_array_limit(arr, i) {
|
|
23
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
24
|
+
if (_i == null) return;
|
|
25
|
+
var _arr = [];
|
|
26
|
+
var _n = true;
|
|
27
|
+
var _d = false;
|
|
28
|
+
var _s, _e;
|
|
29
|
+
try {
|
|
30
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
31
|
+
_arr.push(_s.value);
|
|
32
|
+
if (i && _arr.length === i) break;
|
|
33
|
+
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
_d = true;
|
|
36
|
+
_e = err;
|
|
37
|
+
} finally{
|
|
38
|
+
try {
|
|
39
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
40
|
+
} finally{
|
|
41
|
+
if (_d) throw _e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return _arr;
|
|
45
|
+
}
|
|
46
|
+
function _non_iterable_rest() {
|
|
47
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
48
|
+
}
|
|
14
49
|
function _object_spread(target) {
|
|
15
50
|
for(var i = 1; i < arguments.length; i++){
|
|
16
51
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -50,15 +85,67 @@ function _object_spread_props(target, source) {
|
|
|
50
85
|
}
|
|
51
86
|
return target;
|
|
52
87
|
}
|
|
88
|
+
function _sliced_to_array(arr, i) {
|
|
89
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
90
|
+
}
|
|
91
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
92
|
+
if (!o) return;
|
|
93
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
94
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
95
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
96
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
97
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
98
|
+
}
|
|
99
|
+
import { useMemo, useState } from "react";
|
|
53
100
|
import { customDayjs } from "../../../utils/datejs";
|
|
54
101
|
import { QUARTER_NAMES } from "../../Calendar/utils";
|
|
102
|
+
import { getDateFormatDelimiter } from "../../DatePicker/utils/dateHelper";
|
|
55
103
|
import { classes } from "../DateTimePicker.tokens";
|
|
56
104
|
import { getMaskedValue } from "../utils/getMaskedValue";
|
|
57
105
|
import { getFormattedDateTime, normalizeDateTime } from "../utils";
|
|
58
106
|
export var useDateTimePicker = function(param) {
|
|
59
|
-
var valueError = param.valueError, valueSuccess = param.valueSuccess, type = param.type, _param_lang = param.lang, lang = _param_lang === void 0 ? 'ru' : _param_lang, disabled = param.disabled, readOnly = param.readOnly, maskWithFormat = param.maskWithFormat,
|
|
107
|
+
var valueError = param.valueError, valueSuccess = param.valueSuccess, type = param.type, _param_lang = param.lang, lang = _param_lang === void 0 ? 'ru' : _param_lang, disabled = param.disabled, readOnly = param.readOnly, outerValue = param.outerValue, defaultDate = param.defaultDate, maskWithFormat = param.maskWithFormat, _param_dateFormat = param.dateFormat, dateFormat = _param_dateFormat === void 0 ? 'DD.MM.YYYY' : _param_dateFormat, _param_timeFormat = param.timeFormat, timeFormat = _param_timeFormat === void 0 ? 'HH:mm:ss' : _param_timeFormat, _param_dateTimeSeparator = param.dateTimeSeparator, dateTimeSeparator = _param_dateTimeSeparator === void 0 ? ' ' : _param_dateTimeSeparator, inputRef = param.inputRef, min = param.min, max = param.max, includeEdgeDates = param.includeEdgeDates, dateOnTimeSelectOnly = param.dateOnTimeSelectOnly, preserveInvalidOnBlur = param.preserveInvalidOnBlur, onChangeValue = param.onChangeValue, onCommitDate = param.onCommitDate, onBlur = param.onBlur;
|
|
60
108
|
var errorClass = valueError ? classes.error : undefined;
|
|
61
109
|
var successClass = valueSuccess ? classes.success : undefined;
|
|
110
|
+
var dateFormatDelimiter = useMemo(function() {
|
|
111
|
+
return getDateFormatDelimiter(dateFormat);
|
|
112
|
+
}, [
|
|
113
|
+
dateFormat
|
|
114
|
+
]);
|
|
115
|
+
var timeFormatDelimiter = useMemo(function() {
|
|
116
|
+
return getDateFormatDelimiter(timeFormat);
|
|
117
|
+
}, [
|
|
118
|
+
timeFormat
|
|
119
|
+
]);
|
|
120
|
+
var delimiters = [
|
|
121
|
+
dateFormatDelimiter,
|
|
122
|
+
timeFormatDelimiter,
|
|
123
|
+
dateTimeSeparator
|
|
124
|
+
];
|
|
125
|
+
var format = dateFormat + dateTimeSeparator + timeFormat;
|
|
126
|
+
var timeColumnsCount = (timeFormat === null || timeFormat === void 0 ? void 0 : timeFormat.split(timeFormatDelimiter).length) || 2;
|
|
127
|
+
var _useState = _sliced_to_array(useState(defaultDate || ''), 2), innerDate = _useState[0], setInnerDate = _useState[1];
|
|
128
|
+
var dateVisibleValue = outerValue !== null && outerValue !== void 0 ? outerValue : innerDate;
|
|
129
|
+
var initialValues = getFormattedDateTime({
|
|
130
|
+
value: dateVisibleValue,
|
|
131
|
+
lang: lang,
|
|
132
|
+
format: format,
|
|
133
|
+
includeEdgeDates: includeEdgeDates,
|
|
134
|
+
min: min,
|
|
135
|
+
max: max,
|
|
136
|
+
dateFormat: dateFormat,
|
|
137
|
+
timeFormat: timeFormat
|
|
138
|
+
});
|
|
139
|
+
var _useState1 = _sliced_to_array(useState({
|
|
140
|
+
input: initialValues.formattedDate,
|
|
141
|
+
calendar: initialValues.dateValue,
|
|
142
|
+
time: initialValues.timeValue
|
|
143
|
+
}), 2), correctDates = _useState1[0], setCorrectDates = _useState1[1];
|
|
144
|
+
var calendarGridValue = initialValues.dateValue;
|
|
145
|
+
var timeGridValue = initialValues.timeValue;
|
|
146
|
+
customDayjs.locale(lang);
|
|
147
|
+
var timeVisibleValue = timeGridValue ? customDayjs(timeGridValue).format(timeFormat) : '';
|
|
148
|
+
var inputValue = initialValues.formattedDate;
|
|
62
149
|
var getQuarterInfo = function(originalDate) {
|
|
63
150
|
if (type !== 'Quarters' || !originalDate) {
|
|
64
151
|
return;
|
|
@@ -76,6 +163,23 @@ export var useDateTimePicker = function(param) {
|
|
|
76
163
|
]
|
|
77
164
|
};
|
|
78
165
|
};
|
|
166
|
+
var isDateEqualEdge = function(dateEdge) {
|
|
167
|
+
if (!dateEdge) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
var normalizedEdgeDate = customDayjs(dateEdge);
|
|
171
|
+
normalizedEdgeDate.set('hours', 0);
|
|
172
|
+
normalizedEdgeDate.set('minutes', 0);
|
|
173
|
+
normalizedEdgeDate.set('seconds', 0);
|
|
174
|
+
var normalizedCurrentDate = customDayjs(correctDates.calendar);
|
|
175
|
+
normalizedCurrentDate.set('hours', 0);
|
|
176
|
+
normalizedCurrentDate.set('minutes', 0);
|
|
177
|
+
normalizedCurrentDate.set('seconds', 0);
|
|
178
|
+
if (normalizedCurrentDate.isSame(normalizedEdgeDate)) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
};
|
|
79
183
|
var getFormattedCorrectInput = function(param) {
|
|
80
184
|
var originalDate = param.originalDate, formattedDate = param.formattedDate, dateValue = param.dateValue, timeValue = param.timeValue;
|
|
81
185
|
if (originalDate || formattedDate === '') {
|
|
@@ -106,7 +210,7 @@ export var useDateTimePicker = function(param) {
|
|
|
106
210
|
value: value,
|
|
107
211
|
format: format,
|
|
108
212
|
delimiters: delimiters,
|
|
109
|
-
prevValue:
|
|
213
|
+
prevValue: inputValue,
|
|
110
214
|
selectionStart: selectionStart
|
|
111
215
|
}) : {
|
|
112
216
|
formattedValue: value,
|
|
@@ -316,14 +420,70 @@ export var useDateTimePicker = function(param) {
|
|
|
316
420
|
});
|
|
317
421
|
setInnerDate(formattedDate);
|
|
318
422
|
};
|
|
423
|
+
var handleBlur = function(event) {
|
|
424
|
+
if (!preserveInvalidOnBlur) {
|
|
425
|
+
customDayjs.locale(lang);
|
|
426
|
+
var originalDate = correctDates.calendar;
|
|
427
|
+
if (!originalDate) {
|
|
428
|
+
if (onChangeValue) {
|
|
429
|
+
onChangeValue(event, correctDates.input, {
|
|
430
|
+
originalDate: undefined,
|
|
431
|
+
isoDate: ''
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
if (onCommitDate) {
|
|
435
|
+
onCommitDate(correctDates.input, {
|
|
436
|
+
quarterInfo: undefined,
|
|
437
|
+
originalDate: undefined,
|
|
438
|
+
isoDate: ''
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
if (correctDates.time) {
|
|
444
|
+
originalDate.setHours(correctDates.time.getHours(), correctDates.time.getMinutes(), correctDates.time.getSeconds());
|
|
445
|
+
}
|
|
446
|
+
setInnerDate(originalDate);
|
|
447
|
+
if (!timeGridValue) {
|
|
448
|
+
if (correctDates.calendar) {
|
|
449
|
+
setInnerDate(correctDates.calendar);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
if (onChangeValue) {
|
|
453
|
+
onChangeValue(event, correctDates.input, {
|
|
454
|
+
originalDate: originalDate,
|
|
455
|
+
isoDate: originalDate.toISOString()
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
if (onCommitDate) {
|
|
459
|
+
var quarterInfo = getQuarterInfo(originalDate);
|
|
460
|
+
onCommitDate(correctDates.input, {
|
|
461
|
+
quarterInfo: quarterInfo,
|
|
462
|
+
originalDate: originalDate,
|
|
463
|
+
isoDate: originalDate.toISOString()
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if (onBlur) {
|
|
468
|
+
onBlur(event);
|
|
469
|
+
}
|
|
470
|
+
};
|
|
319
471
|
return {
|
|
472
|
+
format: format,
|
|
473
|
+
dateVisibleValue: dateVisibleValue,
|
|
474
|
+
calendarGridValue: calendarGridValue,
|
|
475
|
+
inputValue: inputValue,
|
|
476
|
+
timeVisibleValue: timeVisibleValue,
|
|
477
|
+
timeColumnsCount: timeColumnsCount,
|
|
320
478
|
errorClass: errorClass,
|
|
321
479
|
successClass: successClass,
|
|
322
480
|
handleChangeValue: handleChangeValue,
|
|
323
481
|
handleSearch: handleSearch,
|
|
324
482
|
handleCalendarPick: handleCalendarPick,
|
|
325
483
|
handleTimePick: handleTimePick,
|
|
484
|
+
handleBlur: handleBlur,
|
|
326
485
|
updateExternalDate: updateExternalDate,
|
|
327
|
-
getQuarterInfo: getQuarterInfo
|
|
486
|
+
getQuarterInfo: getQuarterInfo,
|
|
487
|
+
isDateEqualEdge: isDateEqualEdge
|
|
328
488
|
};
|
|
329
489
|
};
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { needFullMonth } from "../../DatePicker/utils/dateHelper";
|
|
2
1
|
export var keys = {
|
|
3
2
|
Space: 'Space',
|
|
4
3
|
Escape: 'Escape'
|
|
5
4
|
};
|
|
6
5
|
export var useKeyNavigation = function(param) {
|
|
7
|
-
var opened = param.opened, closeOnEsc = param.closeOnEsc,
|
|
6
|
+
var opened = param.opened, closeOnEsc = param.closeOnEsc, onToggle = param.onToggle;
|
|
8
7
|
var onKeyDown = function(event) {
|
|
9
|
-
if ((delimiters === null || delimiters === void 0 ? void 0 : delimiters.includes(event.key)) && maskWithFormat && format && !needFullMonth(format)) {
|
|
10
|
-
event.preventDefault();
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
8
|
switch(event.code){
|
|
14
9
|
case keys.Space:
|
|
15
10
|
{
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { component, mergeConfig } from "../../../engines";
|
|
2
|
-
import { comboboxNewConfig } from "../../..";
|
|
3
|
-
import { config } from "./Combobox.config";
|
|
4
|
-
var mergedConfig = mergeConfig(comboboxNewConfig, config);
|
|
5
|
-
var ComboboxComponent = component(mergedConfig);
|
|
6
|
-
var Combobox = ComboboxComponent;
|
|
7
|
-
export { Combobox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker/DateTimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker/DateTimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AACxF,OAAO,KAAK,EAAc,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAuB,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAY3F,eAAO,MAAM,kBAAkB,SAAU,SAAS,CAAC,cAAc,EAAE,uBAAuB,CAAC;;;;;;;;;;;;;;;;;0EAoC3E,CAAT,yBACS,CAAD;qBASC,CAAF,wCACQ,CAAC;yTA4PlB,CAAC;AAEN,eAAO,MAAM,oBAAoB;;;mBA7SQ,SAAS,CAAC,cAAc,EAAE,uBAAuB,CAAC;;;;;;;;;;;;;;;;;8EAoC3E,CAAT,yBACS,CAAD;yBASC,CAAF,wCACQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CA0RtB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InputHTMLAttributes, SyntheticEvent, KeyboardEvent,
|
|
2
|
-
import type { DateInfo
|
|
1
|
+
import type { InputHTMLAttributes, SyntheticEvent, KeyboardEvent, MutableRefObject, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import type { DateInfo } from '../Calendar/Calendar.types';
|
|
3
3
|
import type { DatePickerPopoverProps, DatePickerTextFieldProps } from '../DatePicker/SingleDate/SingleDate.types';
|
|
4
4
|
import type { LabelProps } from '../TextField/TextField.types';
|
|
5
5
|
import type { DatePickerCalendarProps } from '../DatePicker/DatePickerBase.types';
|
|
@@ -134,9 +134,10 @@ export type CorrectDates = {
|
|
|
134
134
|
time: Date | undefined;
|
|
135
135
|
};
|
|
136
136
|
export type UseDateTimePickerArgs = {
|
|
137
|
-
currentValue: string;
|
|
138
137
|
inputRef: MutableRefObject<HTMLInputElement | null>;
|
|
139
|
-
|
|
138
|
+
outerValue?: Date | string;
|
|
139
|
+
defaultDate?: Date;
|
|
140
|
+
preserveInvalidOnBlur?: boolean;
|
|
140
141
|
valueError?: boolean;
|
|
141
142
|
valueSuccess?: boolean;
|
|
142
143
|
type?: CalendarStateType;
|
|
@@ -144,18 +145,16 @@ export type UseDateTimePickerArgs = {
|
|
|
144
145
|
disabled?: boolean;
|
|
145
146
|
readOnly?: boolean;
|
|
146
147
|
maskWithFormat?: boolean;
|
|
147
|
-
format?: string;
|
|
148
148
|
dateFormat?: string;
|
|
149
149
|
timeFormat?: string;
|
|
150
|
+
dateTimeSeparator?: string;
|
|
150
151
|
min?: Date;
|
|
151
152
|
max?: Date;
|
|
152
153
|
includeEdgeDates?: boolean;
|
|
153
154
|
dateOnTimeSelectOnly?: Date;
|
|
154
|
-
correctDates: CorrectDates;
|
|
155
|
-
setInnerDate: Dispatch<SetStateAction<string | DateType>>;
|
|
156
|
-
setCorrectDates: Dispatch<SetStateAction<CorrectDates>>;
|
|
157
155
|
onChangeValue?: InputProps['onChangeValue'];
|
|
158
156
|
onCommitDate?: InputProps['onCommitDate'];
|
|
157
|
+
onBlur?: InputProps['onBlur'];
|
|
159
158
|
};
|
|
160
159
|
export {};
|
|
161
160
|
//# sourceMappingURL=DateTimePicker.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.types.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker/DateTimePicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"DateTimePicker.types.d.ts","sourceRoot":"","sources":["../../../src/components/DateTimePicker/DateTimePicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,aAAa,EAChB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAClH,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ChangeEvent } from 'react';
|
|
1
|
+
import type { ChangeEvent, FocusEvent } from 'react';
|
|
2
2
|
import type { TimePickerGridChangeEvent } from '../../../components/TimePickerGrid/TimePickerGrid.types';
|
|
3
|
-
import type { CalendarValueType, DateInfo } from '../../Calendar/Calendar.types';
|
|
3
|
+
import type { CalendarValueType, DateInfo, DateType } from '../../Calendar/Calendar.types';
|
|
4
4
|
import type { UseDateTimePickerArgs } from '../DateTimePicker.types';
|
|
5
|
-
export declare const useDateTimePicker: ({ valueError, valueSuccess, type, lang, disabled, readOnly,
|
|
5
|
+
export declare const useDateTimePicker: ({ valueError, valueSuccess, type, lang, disabled, readOnly, outerValue, defaultDate, maskWithFormat, dateFormat, timeFormat, dateTimeSeparator, inputRef, min, max, includeEdgeDates, dateOnTimeSelectOnly, preserveInvalidOnBlur, onChangeValue, onCommitDate, onBlur, }: UseDateTimePickerArgs) => {
|
|
6
|
+
format: string;
|
|
7
|
+
dateVisibleValue: string | DateType;
|
|
8
|
+
calendarGridValue: Date | undefined;
|
|
9
|
+
inputValue: string;
|
|
10
|
+
timeVisibleValue: string;
|
|
11
|
+
timeColumnsCount: number;
|
|
6
12
|
errorClass: string | undefined;
|
|
7
13
|
successClass: string | undefined;
|
|
8
14
|
handleChangeValue: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
9
15
|
handleSearch: (date?: string) => void;
|
|
10
16
|
handleCalendarPick: (date?: Date | null, quarterInfo?: DateInfo) => void;
|
|
11
17
|
handleTimePick: (time?: TimePickerGridChangeEvent) => void;
|
|
18
|
+
handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
|
12
19
|
updateExternalDate: (externalDate: Date | string | undefined) => void;
|
|
13
20
|
getQuarterInfo: (originalDate?: Date) => {
|
|
14
21
|
name: string;
|
|
15
22
|
fullValue: CalendarValueType;
|
|
16
23
|
} | undefined;
|
|
24
|
+
isDateEqualEdge: (dateEdge?: Date) => boolean;
|
|
17
25
|
};
|
|
18
26
|
//# sourceMappingURL=useDateTimePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDateTimePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTimePicker/hooks/useDateTimePicker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDateTimePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTimePicker/hooks/useDateTimePicker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAGpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAWrE,eAAO,MAAM,iBAAiB,8QAsB3B,qBAAqB;;;;;;;;;+BA6Gc,WAAW,CAAC,gBAAgB,CAAC;0BAuDlC,MAAM;gCA+BA,IAAI,GAAG,IAAI,gBAAgB,QAAQ;4BAiDvC,yBAAyB;wBAsF7B,UAAU,CAAC,gBAAgB,CAAC;uCA3Bb,IAAI,GAAG,MAAM,GAAG,SAAS;oCAxQ5B,IAAI;;mBAeM,iBAAiB;;iCAI9B,IAAI;CAkW3C,CAAC"}
|
|
@@ -2,16 +2,16 @@ import type { ChangeEvent, KeyboardEvent, SyntheticEvent } from 'react';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
opened: boolean;
|
|
4
4
|
closeOnEsc: boolean;
|
|
5
|
+
onToggle: (isOpen: boolean, event: SyntheticEvent | Event) => void;
|
|
5
6
|
delimiters?: string[];
|
|
6
7
|
format?: string;
|
|
7
8
|
maskWithFormat?: boolean;
|
|
8
|
-
onToggle: (isOpen: boolean, event: SyntheticEvent | Event) => void;
|
|
9
9
|
};
|
|
10
10
|
export declare const keys: {
|
|
11
11
|
Space: string;
|
|
12
12
|
Escape: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const useKeyNavigation: ({ opened, closeOnEsc,
|
|
14
|
+
export declare const useKeyNavigation: ({ opened, closeOnEsc, onToggle }: Props) => {
|
|
15
15
|
onKeyDown: (event: ChangeEvent<HTMLInputElement> & KeyboardEvent<HTMLInputElement>) => void;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTimePicker/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTimePicker/hooks/useKeyboardNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAExE,KAAK,KAAK,GAAG;IACT,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,GAAG,KAAK,KAAK,IAAI,CAAC;IAEnE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,IAAI;;;CAGhB,CAAC;AAEF,eAAO,MAAM,gBAAgB,qCAAsC,KAAK;uBAC1C,WAAW,CAAC,gBAAgB,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC;CAwB5F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../../src/examples/components/DateTimePicker/DateTimePicker.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../../../src/examples/components/DateTimePicker/DateTimePicker.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0FAC6zD,CAAC,yBAAiC,CAAC;qBAAwP,CAAC,wDAAwC,CAAC;+WADxmE,CAAC"}
|