@atlaskit/datetime-picker 14.0.1 → 14.0.3
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/CHANGELOG.md +17 -0
- package/dist/cjs/components/date-picker.js +1 -7
- package/dist/cjs/components/date-time-picker.js +1 -1
- package/dist/cjs/components/time-picker.js +284 -312
- package/dist/cjs/internal/menu.js +0 -1
- package/dist/es2019/components/date-picker.js +1 -7
- package/dist/es2019/components/date-time-picker.js +1 -1
- package/dist/es2019/components/time-picker.js +246 -297
- package/dist/es2019/internal/menu.js +0 -1
- package/dist/esm/components/date-picker.js +1 -7
- package/dist/esm/components/date-time-picker.js +1 -1
- package/dist/esm/components/time-picker.js +283 -313
- package/dist/esm/internal/menu.js +0 -1
- package/dist/types/components/date-picker.d.ts +0 -3
- package/dist/types/components/time-picker.d.ts +2 -104
- package/dist/types/types.d.ts +4 -0
- package/dist/types-ts4.5/components/date-picker.d.ts +0 -3
- package/dist/types-ts4.5/components/time-picker.d.ts +2 -104
- package/dist/types-ts4.5/types.d.ts +4 -0
- package/package.json +3 -8
|
@@ -1,86 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import { type Appearance, type Spacing, type TimePickerBaseProps } from '../types';
|
|
4
|
-
type TimePickerProps = typeof timePickerDefaultProps & TimePickerBaseProps;
|
|
5
|
-
interface State {
|
|
6
|
-
isOpen: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* When being cleared from the icon the TimePicker is blurred.
|
|
9
|
-
* This variable defines whether the default onMenuOpen or onMenuClose
|
|
10
|
-
* events should behave as normal
|
|
11
|
-
*/
|
|
12
|
-
clearingFromIcon: boolean;
|
|
13
|
-
value: string;
|
|
14
|
-
isFocused: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const timePickerDefaultProps: {
|
|
17
|
-
appearance: Appearance;
|
|
18
|
-
autoFocus: boolean;
|
|
19
|
-
defaultIsOpen: boolean;
|
|
20
|
-
defaultValue: string;
|
|
21
|
-
hideIcon: boolean;
|
|
22
|
-
id: string;
|
|
23
|
-
innerProps: {};
|
|
24
|
-
isDisabled: boolean;
|
|
25
|
-
isInvalid: boolean;
|
|
26
|
-
label: string;
|
|
27
|
-
name: string;
|
|
28
|
-
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
29
|
-
onChange: (_value: string) => void;
|
|
30
|
-
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
31
|
-
parseInputValue: (time: string, _timeFormat: string) => string | Date;
|
|
32
|
-
selectProps: {};
|
|
33
|
-
spacing: Spacing;
|
|
34
|
-
times: string[];
|
|
35
|
-
timeIsEditable: boolean;
|
|
36
|
-
locale: string;
|
|
37
|
-
};
|
|
38
|
-
declare class TimePickerComponent extends React.Component<TimePickerProps, State> {
|
|
39
|
-
containerRef: HTMLElement | null;
|
|
40
|
-
static defaultProps: {
|
|
41
|
-
appearance: Appearance;
|
|
42
|
-
autoFocus: boolean;
|
|
43
|
-
defaultIsOpen: boolean;
|
|
44
|
-
defaultValue: string;
|
|
45
|
-
hideIcon: boolean;
|
|
46
|
-
id: string;
|
|
47
|
-
innerProps: {};
|
|
48
|
-
isDisabled: boolean;
|
|
49
|
-
isInvalid: boolean;
|
|
50
|
-
label: string;
|
|
51
|
-
name: string;
|
|
52
|
-
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
-
onChange: (_value: string) => void;
|
|
54
|
-
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
55
|
-
parseInputValue: (time: string, _timeFormat: string) => string | Date;
|
|
56
|
-
selectProps: {};
|
|
57
|
-
spacing: Spacing;
|
|
58
|
-
times: string[];
|
|
59
|
-
timeIsEditable: boolean;
|
|
60
|
-
locale: string;
|
|
61
|
-
};
|
|
62
|
-
state: {
|
|
63
|
-
isOpen: boolean;
|
|
64
|
-
clearingFromIcon: boolean;
|
|
65
|
-
value: string;
|
|
66
|
-
isFocused: boolean;
|
|
67
|
-
};
|
|
68
|
-
getValue: () => string;
|
|
69
|
-
getIsOpen: () => boolean;
|
|
70
|
-
onChange: (newValue: ValueType<OptionType> | string, action?: ActionMeta<OptionType>) => void;
|
|
71
|
-
/**
|
|
72
|
-
* Only allow custom times if timeIsEditable prop is true
|
|
73
|
-
*/
|
|
74
|
-
onCreateOption: (inputValue: string) => void;
|
|
75
|
-
onMenuOpen: () => void;
|
|
76
|
-
onMenuClose: () => void;
|
|
77
|
-
setContainerRef: (ref: HTMLElement | null) => void;
|
|
78
|
-
onBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
79
|
-
onFocus: (event: React.FocusEvent<HTMLElement>) => void;
|
|
80
|
-
onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
81
|
-
render(): JSX.Element;
|
|
82
|
-
}
|
|
83
|
-
export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
2
|
+
import { type TimePickerBaseProps } from '../types';
|
|
84
3
|
/**
|
|
85
4
|
* __Time picker__
|
|
86
5
|
*
|
|
@@ -90,26 +9,5 @@ export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
|
90
9
|
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
91
10
|
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
92
11
|
*/
|
|
93
|
-
declare const TimePicker: React.ForwardRefExoticComponent<Pick<
|
|
94
|
-
appearance: Appearance;
|
|
95
|
-
autoFocus: boolean;
|
|
96
|
-
defaultIsOpen: boolean;
|
|
97
|
-
defaultValue: string;
|
|
98
|
-
hideIcon: boolean;
|
|
99
|
-
id: string;
|
|
100
|
-
innerProps: {};
|
|
101
|
-
isDisabled: boolean;
|
|
102
|
-
isInvalid: boolean;
|
|
103
|
-
label: string;
|
|
104
|
-
name: string;
|
|
105
|
-
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
106
|
-
onChange: (_value: string) => void;
|
|
107
|
-
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
108
|
-
parseInputValue: (time: string, _timeFormat: string) => string | Date;
|
|
109
|
-
selectProps: {};
|
|
110
|
-
spacing: Spacing;
|
|
111
|
-
times: string[];
|
|
112
|
-
timeIsEditable: boolean;
|
|
113
|
-
locale: string;
|
|
114
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
12
|
+
declare const TimePicker: React.ForwardRefExoticComponent<Pick<TimePickerBaseProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<unknown>>;
|
|
115
13
|
export default TimePicker;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -206,6 +206,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
|
|
|
206
206
|
weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
207
207
|
}
|
|
208
208
|
export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
|
|
209
|
+
/**
|
|
210
|
+
* Additional information to be included in the `context` of analytics events
|
|
211
|
+
*/
|
|
212
|
+
analyticsContext?: Record<string, any>;
|
|
209
213
|
/**
|
|
210
214
|
* Set the appearance of the picker.
|
|
211
215
|
* `subtle` will remove the borders, background, and icon.
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Component } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import { type CalendarRef } from '@atlaskit/calendar';
|
|
8
7
|
import { type LocalizationProvider } from '@atlaskit/locale';
|
|
9
8
|
import { type ActionMeta, type DropdownIndicatorProps, type GroupType, type InputActionMeta, type OptionType } from '@atlaskit/select';
|
|
10
9
|
import { type Appearance, type DatePickerBaseProps, type Spacing } from '../types';
|
|
@@ -70,7 +69,6 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
|
|
|
70
69
|
spacing: Spacing;
|
|
71
70
|
locale: string;
|
|
72
71
|
};
|
|
73
|
-
calendarRef: CalendarRef | null;
|
|
74
72
|
containerRef: HTMLElement | null;
|
|
75
73
|
constructor(props: any);
|
|
76
74
|
static getDerivedStateFromProps(nextProps: Readonly<DatePickerProps>, prevState: State): {
|
|
@@ -95,7 +93,6 @@ declare class DatePickerComponent extends Component<DatePickerProps, State> {
|
|
|
95
93
|
onInputKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
96
94
|
onClear: () => void;
|
|
97
95
|
onSelectChange: (_value: unknown, action: ActionMeta) => void;
|
|
98
|
-
refCalendar: (ref: CalendarRef | null) => void;
|
|
99
96
|
handleSelectInputChange: (selectInputValue: string, actionMeta: InputActionMeta) => void;
|
|
100
97
|
getContainerRef: (ref: HTMLElement | null) => void;
|
|
101
98
|
/**
|
|
@@ -1,86 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import { type Appearance, type Spacing, type TimePickerBaseProps } from '../types';
|
|
4
|
-
type TimePickerProps = typeof timePickerDefaultProps & TimePickerBaseProps;
|
|
5
|
-
interface State {
|
|
6
|
-
isOpen: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* When being cleared from the icon the TimePicker is blurred.
|
|
9
|
-
* This variable defines whether the default onMenuOpen or onMenuClose
|
|
10
|
-
* events should behave as normal
|
|
11
|
-
*/
|
|
12
|
-
clearingFromIcon: boolean;
|
|
13
|
-
value: string;
|
|
14
|
-
isFocused: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const timePickerDefaultProps: {
|
|
17
|
-
appearance: Appearance;
|
|
18
|
-
autoFocus: boolean;
|
|
19
|
-
defaultIsOpen: boolean;
|
|
20
|
-
defaultValue: string;
|
|
21
|
-
hideIcon: boolean;
|
|
22
|
-
id: string;
|
|
23
|
-
innerProps: {};
|
|
24
|
-
isDisabled: boolean;
|
|
25
|
-
isInvalid: boolean;
|
|
26
|
-
label: string;
|
|
27
|
-
name: string;
|
|
28
|
-
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
29
|
-
onChange: (_value: string) => void;
|
|
30
|
-
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
31
|
-
parseInputValue: (time: string, _timeFormat: string) => string | Date;
|
|
32
|
-
selectProps: {};
|
|
33
|
-
spacing: Spacing;
|
|
34
|
-
times: string[];
|
|
35
|
-
timeIsEditable: boolean;
|
|
36
|
-
locale: string;
|
|
37
|
-
};
|
|
38
|
-
declare class TimePickerComponent extends React.Component<TimePickerProps, State> {
|
|
39
|
-
containerRef: HTMLElement | null;
|
|
40
|
-
static defaultProps: {
|
|
41
|
-
appearance: Appearance;
|
|
42
|
-
autoFocus: boolean;
|
|
43
|
-
defaultIsOpen: boolean;
|
|
44
|
-
defaultValue: string;
|
|
45
|
-
hideIcon: boolean;
|
|
46
|
-
id: string;
|
|
47
|
-
innerProps: {};
|
|
48
|
-
isDisabled: boolean;
|
|
49
|
-
isInvalid: boolean;
|
|
50
|
-
label: string;
|
|
51
|
-
name: string;
|
|
52
|
-
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
-
onChange: (_value: string) => void;
|
|
54
|
-
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
55
|
-
parseInputValue: (time: string, _timeFormat: string) => string | Date;
|
|
56
|
-
selectProps: {};
|
|
57
|
-
spacing: Spacing;
|
|
58
|
-
times: string[];
|
|
59
|
-
timeIsEditable: boolean;
|
|
60
|
-
locale: string;
|
|
61
|
-
};
|
|
62
|
-
state: {
|
|
63
|
-
isOpen: boolean;
|
|
64
|
-
clearingFromIcon: boolean;
|
|
65
|
-
value: string;
|
|
66
|
-
isFocused: boolean;
|
|
67
|
-
};
|
|
68
|
-
getValue: () => string;
|
|
69
|
-
getIsOpen: () => boolean;
|
|
70
|
-
onChange: (newValue: ValueType<OptionType> | string, action?: ActionMeta<OptionType>) => void;
|
|
71
|
-
/**
|
|
72
|
-
* Only allow custom times if timeIsEditable prop is true
|
|
73
|
-
*/
|
|
74
|
-
onCreateOption: (inputValue: string) => void;
|
|
75
|
-
onMenuOpen: () => void;
|
|
76
|
-
onMenuClose: () => void;
|
|
77
|
-
setContainerRef: (ref: HTMLElement | null) => void;
|
|
78
|
-
onBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
79
|
-
onFocus: (event: React.FocusEvent<HTMLElement>) => void;
|
|
80
|
-
onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
81
|
-
render(): JSX.Element;
|
|
82
|
-
}
|
|
83
|
-
export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
2
|
+
import { type TimePickerBaseProps } from '../types';
|
|
84
3
|
/**
|
|
85
4
|
* __Time picker__
|
|
86
5
|
*
|
|
@@ -90,26 +9,5 @@ export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
|
90
9
|
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
91
10
|
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
92
11
|
*/
|
|
93
|
-
declare const TimePicker: React.ForwardRefExoticComponent<Pick<
|
|
94
|
-
appearance: Appearance;
|
|
95
|
-
autoFocus: boolean;
|
|
96
|
-
defaultIsOpen: boolean;
|
|
97
|
-
defaultValue: string;
|
|
98
|
-
hideIcon: boolean;
|
|
99
|
-
id: string;
|
|
100
|
-
innerProps: {};
|
|
101
|
-
isDisabled: boolean;
|
|
102
|
-
isInvalid: boolean;
|
|
103
|
-
label: string;
|
|
104
|
-
name: string;
|
|
105
|
-
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
106
|
-
onChange: (_value: string) => void;
|
|
107
|
-
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
108
|
-
parseInputValue: (time: string, _timeFormat: string) => string | Date;
|
|
109
|
-
selectProps: {};
|
|
110
|
-
spacing: Spacing;
|
|
111
|
-
times: string[];
|
|
112
|
-
timeIsEditable: boolean;
|
|
113
|
-
locale: string;
|
|
114
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
12
|
+
declare const TimePicker: React.ForwardRefExoticComponent<Pick<TimePickerBaseProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "defaultIsOpen" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<unknown>>;
|
|
115
13
|
export default TimePicker;
|
|
@@ -206,6 +206,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
|
|
|
206
206
|
weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
207
207
|
}
|
|
208
208
|
export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
|
|
209
|
+
/**
|
|
210
|
+
* Additional information to be included in the `context` of analytics events
|
|
211
|
+
*/
|
|
212
|
+
analyticsContext?: Record<string, any>;
|
|
209
213
|
/**
|
|
210
214
|
* Set the appearance of the picker.
|
|
211
215
|
* `subtle` will remove the borders, background, and icon.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.3",
|
|
4
4
|
"description": "A date time picker allows the user to select an associated date and time.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,10 +28,6 @@
|
|
|
28
28
|
},
|
|
29
29
|
"atlassian": {
|
|
30
30
|
"team": "Design System Team",
|
|
31
|
-
"releaseModel": "continuous",
|
|
32
|
-
"productPushConsumption": [
|
|
33
|
-
"jira"
|
|
34
|
-
],
|
|
35
31
|
"website": {
|
|
36
32
|
"name": "Date time picker",
|
|
37
33
|
"category": "Components"
|
|
@@ -40,7 +36,7 @@
|
|
|
40
36
|
},
|
|
41
37
|
"dependencies": {
|
|
42
38
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
43
|
-
"@atlaskit/calendar": "^
|
|
39
|
+
"@atlaskit/calendar": "^15.0.0",
|
|
44
40
|
"@atlaskit/ds-lib": "^2.5.0",
|
|
45
41
|
"@atlaskit/icon": "^22.15.0",
|
|
46
42
|
"@atlaskit/layering": "^0.4.0",
|
|
@@ -65,7 +61,7 @@
|
|
|
65
61
|
"@atlaskit/docs": "*",
|
|
66
62
|
"@atlaskit/form": "^10.5.0",
|
|
67
63
|
"@atlaskit/modal-dialog": "^12.15.0",
|
|
68
|
-
"@atlaskit/popup": "^1.
|
|
64
|
+
"@atlaskit/popup": "^1.24.0",
|
|
69
65
|
"@atlaskit/range": "^7.4.0",
|
|
70
66
|
"@atlaskit/section-message": "^6.6.0",
|
|
71
67
|
"@atlaskit/ssr": "*",
|
|
@@ -81,7 +77,6 @@
|
|
|
81
77
|
"moment": "^2.29.2",
|
|
82
78
|
"react-dom": "^16.8.0",
|
|
83
79
|
"react-lorem-component": "^0.13.0",
|
|
84
|
-
"react-test-renderer": "^16.8.0",
|
|
85
80
|
"typescript": "~5.4.2"
|
|
86
81
|
},
|
|
87
82
|
"techstack": {
|