@atlaskit/datetime-picker 17.7.0 → 17.8.1
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 +107 -0
- package/date-picker/package.json +17 -0
- package/date-time-picker/package.json +17 -0
- package/dist/cjs/components/date-picker.js +31 -27
- package/dist/cjs/components/date-time-picker-class.js +9 -9
- package/dist/cjs/components/date-time-picker-fc.js +5 -8
- package/dist/cjs/components/time-picker.js +14 -9
- package/dist/cjs/entry-points/date-picker.js +13 -0
- package/dist/cjs/entry-points/date-time-picker.js +13 -0
- package/dist/cjs/entry-points/time-picker.js +13 -0
- package/dist/cjs/entry-points/types.js +1 -0
- package/dist/cjs/internal/default-date-format.js +7 -0
- package/dist/cjs/internal/default-times.js +7 -0
- package/dist/cjs/internal/empty-component.js +12 -0
- package/dist/cjs/internal/fixed-layer-menu-top-layer.js +113 -0
- package/dist/cjs/internal/format-date-time-zone-into-iso.js +15 -0
- package/dist/cjs/internal/format-date.js +2 -2
- package/dist/cjs/internal/get-parsed-iso.js +3 -3
- package/dist/cjs/internal/get-placeholder.js +2 -2
- package/dist/cjs/internal/menu-top-layer.js +116 -0
- package/dist/cjs/internal/pad-two.js +9 -0
- package/dist/cjs/internal/parse-date.js +2 -2
- package/dist/cjs/internal/placeholder-date-time.js +9 -0
- package/dist/es2019/components/date-picker.js +29 -25
- package/dist/es2019/components/date-time-picker-class.js +6 -6
- package/dist/es2019/components/date-time-picker-fc.js +2 -5
- package/dist/es2019/components/time-picker.js +8 -3
- package/dist/es2019/entry-points/date-picker.js +1 -0
- package/dist/es2019/entry-points/date-time-picker.js +1 -0
- package/dist/es2019/entry-points/time-picker.js +1 -0
- package/dist/es2019/entry-points/types.js +0 -0
- package/dist/es2019/internal/default-date-format.js +1 -0
- package/dist/es2019/internal/default-times.js +1 -0
- package/dist/es2019/internal/empty-component.js +4 -0
- package/dist/es2019/internal/fixed-layer-menu-top-layer.js +103 -0
- package/dist/es2019/internal/format-date-time-zone-into-iso.js +9 -0
- package/dist/es2019/internal/format-date.js +1 -1
- package/dist/es2019/internal/get-parsed-iso.js +1 -1
- package/dist/es2019/internal/get-placeholder.js +1 -1
- package/dist/es2019/internal/menu-top-layer.js +111 -0
- package/dist/es2019/internal/pad-two.js +3 -0
- package/dist/es2019/internal/parse-date.js +1 -1
- package/dist/es2019/internal/placeholder-date-time.js +3 -0
- package/dist/esm/components/date-picker.js +29 -25
- package/dist/esm/components/date-time-picker-class.js +6 -6
- package/dist/esm/components/date-time-picker-fc.js +2 -5
- package/dist/esm/components/time-picker.js +8 -3
- package/dist/esm/entry-points/date-picker.js +1 -0
- package/dist/esm/entry-points/date-time-picker.js +1 -0
- package/dist/esm/entry-points/time-picker.js +1 -0
- package/dist/esm/entry-points/types.js +0 -0
- package/dist/esm/internal/default-date-format.js +1 -0
- package/dist/esm/internal/default-times.js +1 -0
- package/dist/esm/internal/empty-component.js +6 -0
- package/dist/esm/internal/fixed-layer-menu-top-layer.js +105 -0
- package/dist/esm/internal/format-date-time-zone-into-iso.js +9 -0
- package/dist/esm/internal/format-date.js +1 -1
- package/dist/esm/internal/get-parsed-iso.js +1 -1
- package/dist/esm/internal/get-placeholder.js +1 -1
- package/dist/esm/internal/menu-top-layer.js +107 -0
- package/dist/esm/internal/pad-two.js +3 -0
- package/dist/esm/internal/parse-date.js +1 -1
- package/dist/esm/internal/placeholder-date-time.js +3 -0
- package/dist/types/components/date-time-picker-class.d.ts +0 -2
- package/dist/types/components/date-time-picker-fc.d.ts +0 -2
- package/dist/types/entry-points/date-picker.d.ts +2 -0
- package/dist/types/entry-points/date-time-picker.d.ts +1 -0
- package/dist/types/entry-points/time-picker.d.ts +1 -0
- package/dist/types/entry-points/types.d.ts +1 -0
- package/dist/types/internal/default-date-format.d.ts +1 -0
- package/dist/types/internal/default-times.d.ts +1 -0
- package/dist/types/internal/empty-component.d.ts +4 -0
- package/dist/types/internal/fixed-layer-menu-top-layer.d.ts +12 -0
- package/dist/types/internal/format-date-time-zone-into-iso.d.ts +4 -0
- package/dist/types/internal/menu-top-layer.d.ts +16 -0
- package/dist/types/internal/pad-two.d.ts +1 -0
- package/dist/types/internal/placeholder-date-time.d.ts +1 -0
- package/dist/types-ts4.5/components/date-time-picker-class.d.ts +0 -2
- package/dist/types-ts4.5/components/date-time-picker-fc.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/date-picker.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/date-time-picker.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/time-picker.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.5/internal/default-date-format.d.ts +1 -0
- package/dist/types-ts4.5/internal/default-times.d.ts +1 -0
- package/dist/types-ts4.5/internal/empty-component.d.ts +4 -0
- package/dist/types-ts4.5/internal/fixed-layer-menu-top-layer.d.ts +12 -0
- package/dist/types-ts4.5/internal/format-date-time-zone-into-iso.d.ts +4 -0
- package/dist/types-ts4.5/internal/menu-top-layer.d.ts +16 -0
- package/dist/types-ts4.5/internal/pad-two.d.ts +1 -0
- package/dist/types-ts4.5/internal/placeholder-date-time.d.ts +1 -0
- package/package.json +12 -8
- package/time-picker/package.json +17 -0
- package/types/package.json +5 -5
- package/dist/cjs/internal/index.js +0 -31
- package/dist/es2019/internal/index.js +0 -20
- package/dist/esm/internal/index.js +0 -22
- package/dist/types/internal/index.d.ts +0 -10
- package/dist/types-ts4.5/internal/index.d.ts +0 -10
- package/offerings.json +0 -98
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
20
20
|
|
|
21
|
-
import { placeholderDatetime } from './
|
|
21
|
+
import { placeholderDatetime } from './placeholder-date-time';
|
|
22
22
|
export var getPlaceholder = function getPlaceholder(di) {
|
|
23
23
|
var placeholder = di.placeholder,
|
|
24
24
|
l10n = di.l10n;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* menu-top-layer.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment, useRef } from 'react';
|
|
6
|
+
import { isValid, parseISO } from 'date-fns';
|
|
7
|
+
import Calendar from '@atlaskit/calendar';
|
|
8
|
+
import { slideAndFade } from '@atlaskit/top-layer/animations';
|
|
9
|
+
import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map';
|
|
10
|
+
import { Popup } from '@atlaskit/top-layer/popup';
|
|
11
|
+
var animation = slideAndFade();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Bottom-start placement: calendar appears below and aligned to the
|
|
15
|
+
* start edge of the trigger (the select input).
|
|
16
|
+
*/
|
|
17
|
+
var popupPlacement = fromLegacyPlacement({
|
|
18
|
+
legacy: 'bottom-start'
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param isos A series of ISO dates.
|
|
23
|
+
* @returns The last valid date within the array of ISO strings.
|
|
24
|
+
*/
|
|
25
|
+
function getValidDate(isos) {
|
|
26
|
+
return isos.reduce(function (acc, iso) {
|
|
27
|
+
var date = parseISO(iso);
|
|
28
|
+
return isValid(date) ? {
|
|
29
|
+
day: date.getDate(),
|
|
30
|
+
month: date.getMonth() + 1,
|
|
31
|
+
year: date.getFullYear()
|
|
32
|
+
} : acc;
|
|
33
|
+
}, {});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Top-layer version of the date picker menu.
|
|
38
|
+
*
|
|
39
|
+
* Uses `@atlaskit/top-layer/popup` (Popup.Content + Popup.Surface) so the
|
|
40
|
+
* calendar renders in the browser's top layer via the native Popover API
|
|
41
|
+
* and is positioned via CSS Anchor Positioning. This avoids overflow clipping,
|
|
42
|
+
* z-index wars, and portal-based layering.
|
|
43
|
+
*
|
|
44
|
+
* Gated behind the `platform-dst-top-layer` feature flag.
|
|
45
|
+
*/
|
|
46
|
+
export var MenuTopLayer = function MenuTopLayer(_ref) {
|
|
47
|
+
var _selectProps$calendar, _selectProps$calendar2;
|
|
48
|
+
var selectProps = _ref.selectProps,
|
|
49
|
+
innerProps = _ref.innerProps;
|
|
50
|
+
var calendarValue = selectProps.calendarValue,
|
|
51
|
+
calendarView = selectProps.calendarView,
|
|
52
|
+
MenuInnerWrapper = selectProps.menuInnerWrapper;
|
|
53
|
+
var _getValidDate = getValidDate([calendarValue, calendarView]),
|
|
54
|
+
day = _getValidDate.day,
|
|
55
|
+
month = _getValidDate.month,
|
|
56
|
+
year = _getValidDate.year;
|
|
57
|
+
|
|
58
|
+
// The select's container element is the anchor for the popup.
|
|
59
|
+
var triggerRef = useRef((_selectProps$calendar = selectProps.calendarContainerRef) !== null && _selectProps$calendar !== void 0 ? _selectProps$calendar : null);
|
|
60
|
+
triggerRef.current = (_selectProps$calendar2 = selectProps.calendarContainerRef) !== null && _selectProps$calendar2 !== void 0 ? _selectProps$calendar2 : null;
|
|
61
|
+
var onMenuMouseDown = function onMenuMouseDown(event) {
|
|
62
|
+
if (event.button !== 0) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
};
|
|
68
|
+
var Wrapper = typeof MenuInnerWrapper === 'function' ? MenuInnerWrapper : Fragment;
|
|
69
|
+
return /*#__PURE__*/React.createElement(Popup.Content, {
|
|
70
|
+
role: "dialog",
|
|
71
|
+
label: "calendar",
|
|
72
|
+
isOpen: true
|
|
73
|
+
// `mode="manual"` opts out of native popover light-dismiss.
|
|
74
|
+
// react-select / DateTimePicker already own outside-click and
|
|
75
|
+
// Esc handling. Without this, the same click that opens the
|
|
76
|
+
// menu (which targets the select input outside the popover)
|
|
77
|
+
// also bubbles to the browser's auto-dismiss handler and
|
|
78
|
+
// immediately closes the popover.
|
|
79
|
+
,
|
|
80
|
+
mode: "manual",
|
|
81
|
+
placement: popupPlacement,
|
|
82
|
+
triggerRef: triggerRef,
|
|
83
|
+
animate: animation,
|
|
84
|
+
testId: selectProps.testId && "".concat(selectProps.testId, "--popup")
|
|
85
|
+
}, /*#__PURE__*/React.createElement(Popup.Surface, null, /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
86
|
+
role: "presentation",
|
|
87
|
+
onMouseDown: onMenuMouseDown
|
|
88
|
+
}), /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Calendar, {
|
|
89
|
+
day: day,
|
|
90
|
+
month: month,
|
|
91
|
+
year: year,
|
|
92
|
+
disabled: selectProps.calendarDisabled,
|
|
93
|
+
disabledDateFilter: selectProps.calendarDisabledDateFilter,
|
|
94
|
+
minDate: selectProps.calendarMinDate,
|
|
95
|
+
maxDate: selectProps.calendarMaxDate,
|
|
96
|
+
nextMonthLabel: selectProps.nextMonthLabel,
|
|
97
|
+
onChange: selectProps.onCalendarChange,
|
|
98
|
+
onSelect: selectProps.onCalendarSelect,
|
|
99
|
+
previousMonthLabel: selectProps.previousMonthLabel,
|
|
100
|
+
ref: selectProps.calendarRef,
|
|
101
|
+
selected: [selectProps.calendarValue],
|
|
102
|
+
shouldSetFocusOnCurrentDay: selectProps.shouldSetFocusOnCurrentDay,
|
|
103
|
+
locale: selectProps.calendarLocale,
|
|
104
|
+
testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
|
|
105
|
+
weekStartDay: selectProps.calendarWeekStartDay
|
|
106
|
+
})))));
|
|
107
|
+
};
|
|
@@ -11,8 +11,6 @@ interface State {
|
|
|
11
11
|
value: string;
|
|
12
12
|
zoneValue: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const datePickerDefaultAriaLabel = "Date";
|
|
15
|
-
export declare const timePickerDefaultAriaLabel = "Time";
|
|
16
14
|
declare class DateTimePickerComponent extends React.Component<DateTimePickerBaseProps, State> {
|
|
17
15
|
static defaultProps: DateTimePickerBaseProps;
|
|
18
16
|
state: State;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../components/date-time-picker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../components/time-picker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Appearance, DatePickerBaseProps, DateTimePickerBaseProps, DateTimePickerSelectProps, Spacing, TimePickerBaseProps, } from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultDateFormat = "YYYY/MM/DD";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultTimes: string[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MenuProps, type OptionType } from '@atlaskit/select';
|
|
2
|
+
/**
|
|
3
|
+
* Top-layer version of the fixed layer menu used in the time picker.
|
|
4
|
+
*
|
|
5
|
+
* Uses `@atlaskit/top-layer/popup` (Popup.Content + Popup.Surface) so the
|
|
6
|
+
* time options list renders in the browser's top layer via the native Popover API
|
|
7
|
+
* and is positioned via CSS Anchor Positioning. This avoids overflow clipping,
|
|
8
|
+
* z-index wars, and portal-based layering.
|
|
9
|
+
*
|
|
10
|
+
* Gated behind the `platform-dst-top-layer` feature flag.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FixedLayerMenuTopLayer: ({ className, clearValue, cx, getStyles, getValue, hasValue, innerProps, innerRef, isLoading, isMulti, isRtl, maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, options, placement, selectOption, selectProps, setValue, children, ...rest }: MenuProps<OptionType>) => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { type MenuProps, type OptionType } from '@atlaskit/select';
|
|
6
|
+
/**
|
|
7
|
+
* Top-layer version of the date picker menu.
|
|
8
|
+
*
|
|
9
|
+
* Uses `@atlaskit/top-layer/popup` (Popup.Content + Popup.Surface) so the
|
|
10
|
+
* calendar renders in the browser's top layer via the native Popover API
|
|
11
|
+
* and is positioned via CSS Anchor Positioning. This avoids overflow clipping,
|
|
12
|
+
* z-index wars, and portal-based layering.
|
|
13
|
+
*
|
|
14
|
+
* Gated behind the `platform-dst-top-layer` feature flag.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MenuTopLayer: ({ selectProps, innerProps }: MenuProps<OptionType>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function padToTwo(number: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const placeholderDatetime: Date;
|
|
@@ -11,8 +11,6 @@ interface State {
|
|
|
11
11
|
value: string;
|
|
12
12
|
zoneValue: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const datePickerDefaultAriaLabel = "Date";
|
|
15
|
-
export declare const timePickerDefaultAriaLabel = "Time";
|
|
16
14
|
declare class DateTimePickerComponent extends React.Component<DateTimePickerBaseProps, State> {
|
|
17
15
|
static defaultProps: DateTimePickerBaseProps;
|
|
18
16
|
state: State;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../components/date-time-picker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../components/time-picker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Appearance, DatePickerBaseProps, DateTimePickerBaseProps, DateTimePickerSelectProps, Spacing, TimePickerBaseProps, } from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultDateFormat = "YYYY/MM/DD";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultTimes: string[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MenuProps, type OptionType } from '@atlaskit/select';
|
|
2
|
+
/**
|
|
3
|
+
* Top-layer version of the fixed layer menu used in the time picker.
|
|
4
|
+
*
|
|
5
|
+
* Uses `@atlaskit/top-layer/popup` (Popup.Content + Popup.Surface) so the
|
|
6
|
+
* time options list renders in the browser's top layer via the native Popover API
|
|
7
|
+
* and is positioned via CSS Anchor Positioning. This avoids overflow clipping,
|
|
8
|
+
* z-index wars, and portal-based layering.
|
|
9
|
+
*
|
|
10
|
+
* Gated behind the `platform-dst-top-layer` feature flag.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FixedLayerMenuTopLayer: ({ className, clearValue, cx, getStyles, getValue, hasValue, innerProps, innerRef, isLoading, isMulti, isRtl, maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, options, placement, selectOption, selectProps, setValue, children, ...rest }: MenuProps<OptionType>) => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { type MenuProps, type OptionType } from '@atlaskit/select';
|
|
6
|
+
/**
|
|
7
|
+
* Top-layer version of the date picker menu.
|
|
8
|
+
*
|
|
9
|
+
* Uses `@atlaskit/top-layer/popup` (Popup.Content + Popup.Surface) so the
|
|
10
|
+
* calendar renders in the browser's top layer via the native Popover API
|
|
11
|
+
* and is positioned via CSS Anchor Positioning. This avoids overflow clipping,
|
|
12
|
+
* z-index wars, and portal-based layering.
|
|
13
|
+
*
|
|
14
|
+
* Gated behind the `platform-dst-top-layer` feature flag.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MenuTopLayer: ({ selectProps, innerProps }: MenuProps<OptionType>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function padToTwo(number: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const placeholderDatetime: Date;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.8.1",
|
|
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/"
|
|
@@ -44,14 +44,15 @@
|
|
|
44
44
|
"@atlaskit/calendar": "^17.2.0",
|
|
45
45
|
"@atlaskit/css": "^0.19.0",
|
|
46
46
|
"@atlaskit/ds-lib": "^7.0.0",
|
|
47
|
-
"@atlaskit/icon": "^34.
|
|
47
|
+
"@atlaskit/icon": "^34.5.0",
|
|
48
48
|
"@atlaskit/layering": "^3.7.0",
|
|
49
49
|
"@atlaskit/locale": "^4.1.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
51
|
"@atlaskit/popper": "^7.2.0",
|
|
52
52
|
"@atlaskit/primitives": "^19.0.0",
|
|
53
|
-
"@atlaskit/select": "^21.
|
|
53
|
+
"@atlaskit/select": "^21.11.0",
|
|
54
54
|
"@atlaskit/tokens": "^13.0.0",
|
|
55
|
+
"@atlaskit/top-layer": "^0.6.0",
|
|
55
56
|
"@babel/runtime": "^7.0.0",
|
|
56
57
|
"@compiled/react": "^0.20.0",
|
|
57
58
|
"date-fns": "^2.17.0"
|
|
@@ -63,19 +64,19 @@
|
|
|
63
64
|
"@af/accessibility-testing": "workspace:^",
|
|
64
65
|
"@af/integration-testing": "workspace:^",
|
|
65
66
|
"@af/visual-regression": "workspace:^",
|
|
66
|
-
"@atlaskit/code": "^17.
|
|
67
|
+
"@atlaskit/code": "^17.5.0",
|
|
67
68
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
68
69
|
"@atlaskit/docs": "^11.8.0",
|
|
69
70
|
"@atlaskit/form": "^15.5.0",
|
|
70
71
|
"@atlaskit/heading": "^5.4.0",
|
|
71
72
|
"@atlaskit/link": "^3.4.0",
|
|
72
|
-
"@atlaskit/modal-dialog": "^
|
|
73
|
-
"@atlaskit/popup": "^4.
|
|
74
|
-
"@atlaskit/range": "^10.
|
|
73
|
+
"@atlaskit/modal-dialog": "^15.0.0",
|
|
74
|
+
"@atlaskit/popup": "^4.18.0",
|
|
75
|
+
"@atlaskit/range": "^10.1.0",
|
|
75
76
|
"@atlaskit/section-message": "^8.12.0",
|
|
76
77
|
"@atlaskit/textfield": "^8.3.0",
|
|
77
78
|
"@atlaskit/toggle": "^15.6.0",
|
|
78
|
-
"@atlassian/feature-flags-test-utils": "^1.
|
|
79
|
+
"@atlassian/feature-flags-test-utils": "^1.1.0",
|
|
79
80
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
80
81
|
"@atlassian/ssr-tests": "workspace:^",
|
|
81
82
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
@@ -118,6 +119,9 @@
|
|
|
118
119
|
"dst-date-time-picker-use-functional-component": {
|
|
119
120
|
"type": "boolean"
|
|
120
121
|
},
|
|
122
|
+
"platform-dst-top-layer": {
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
121
125
|
"platform-dst-shape-theme-default": {
|
|
122
126
|
"type": "boolean"
|
|
123
127
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/datetime-picker/time-picker",
|
|
3
|
+
"main": "../dist/cjs/entry-points/time-picker.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/time-picker.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/time-picker.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/entry-points/time-picker.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/entry-points/time-picker.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/types/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker/types",
|
|
3
|
-
"main": "../dist/cjs/types.js",
|
|
4
|
-
"module": "../dist/esm/types.js",
|
|
5
|
-
"module:es2019": "../dist/es2019/types.js",
|
|
3
|
+
"main": "../dist/cjs/entry-points/types.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/types.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/types.d.ts",
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
10
10
|
"typesVersions": {
|
|
11
11
|
">=4.5 <5.9": {
|
|
12
12
|
"*": [
|
|
13
|
-
"../dist/types-ts4.5/types.d.ts"
|
|
13
|
+
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
14
|
]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.defaultTimes = exports.defaultTimeFormat = exports.defaultDateFormat = exports.EmptyComponent = void 0;
|
|
7
|
-
exports.formatDateTimeZoneIntoIso = formatDateTimeZoneIntoIso;
|
|
8
|
-
exports.padToTwo = padToTwo;
|
|
9
|
-
exports.placeholderDatetime = void 0;
|
|
10
|
-
/**
|
|
11
|
-
* This component is used to hide portions of Select component.
|
|
12
|
-
*/
|
|
13
|
-
var EmptyComponent = exports.EmptyComponent = function EmptyComponent() {
|
|
14
|
-
return null;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// This date was chosen to clearly show date and time formats (day > 12)
|
|
18
|
-
// e.g. 18/02/1993 vs. 2/18/1993 and 1:00 PM vs 13:00
|
|
19
|
-
var placeholderDatetime = exports.placeholderDatetime = new Date(1993, 1, 18, 13);
|
|
20
|
-
var defaultTimes = exports.defaultTimes = ['09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00'];
|
|
21
|
-
var defaultTimeFormat = exports.defaultTimeFormat = 'h:mma';
|
|
22
|
-
var defaultDateFormat = exports.defaultDateFormat = 'YYYY/MM/DD';
|
|
23
|
-
function padToTwo(number) {
|
|
24
|
-
return number <= 99 ? "0".concat(number).slice(-2) : "".concat(number);
|
|
25
|
-
}
|
|
26
|
-
function formatDateTimeZoneIntoIso(date, time, zone) {
|
|
27
|
-
// 12:00 => 12:00, 1:00 => 01:00
|
|
28
|
-
var needsLeadingZero = /^\d:/;
|
|
29
|
-
var sanitizedTime = needsLeadingZero.test(time) ? "0".concat(time) : time;
|
|
30
|
-
return "".concat(date, "T").concat(sanitizedTime).concat(zone);
|
|
31
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component is used to hide portions of Select component.
|
|
3
|
-
*/
|
|
4
|
-
export const EmptyComponent = () => null;
|
|
5
|
-
|
|
6
|
-
// This date was chosen to clearly show date and time formats (day > 12)
|
|
7
|
-
// e.g. 18/02/1993 vs. 2/18/1993 and 1:00 PM vs 13:00
|
|
8
|
-
export const placeholderDatetime = new Date(1993, 1, 18, 13);
|
|
9
|
-
export const defaultTimes = ['09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00'];
|
|
10
|
-
export const defaultTimeFormat = 'h:mma';
|
|
11
|
-
export const defaultDateFormat = 'YYYY/MM/DD';
|
|
12
|
-
export function padToTwo(number) {
|
|
13
|
-
return number <= 99 ? `0${number}`.slice(-2) : `${number}`;
|
|
14
|
-
}
|
|
15
|
-
export function formatDateTimeZoneIntoIso(date, time, zone) {
|
|
16
|
-
// 12:00 => 12:00, 1:00 => 01:00
|
|
17
|
-
const needsLeadingZero = /^\d:/;
|
|
18
|
-
const sanitizedTime = needsLeadingZero.test(time) ? `0${time}` : time;
|
|
19
|
-
return `${date}T${sanitizedTime}${zone}`;
|
|
20
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component is used to hide portions of Select component.
|
|
3
|
-
*/
|
|
4
|
-
export var EmptyComponent = function EmptyComponent() {
|
|
5
|
-
return null;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// This date was chosen to clearly show date and time formats (day > 12)
|
|
9
|
-
// e.g. 18/02/1993 vs. 2/18/1993 and 1:00 PM vs 13:00
|
|
10
|
-
export var placeholderDatetime = new Date(1993, 1, 18, 13);
|
|
11
|
-
export var defaultTimes = ['09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00'];
|
|
12
|
-
export var defaultTimeFormat = 'h:mma';
|
|
13
|
-
export var defaultDateFormat = 'YYYY/MM/DD';
|
|
14
|
-
export function padToTwo(number) {
|
|
15
|
-
return number <= 99 ? "0".concat(number).slice(-2) : "".concat(number);
|
|
16
|
-
}
|
|
17
|
-
export function formatDateTimeZoneIntoIso(date, time, zone) {
|
|
18
|
-
// 12:00 => 12:00, 1:00 => 01:00
|
|
19
|
-
var needsLeadingZero = /^\d:/;
|
|
20
|
-
var sanitizedTime = needsLeadingZero.test(time) ? "0".concat(time) : time;
|
|
21
|
-
return "".concat(date, "T").concat(sanitizedTime).concat(zone);
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component is used to hide portions of Select component.
|
|
3
|
-
*/
|
|
4
|
-
export declare const EmptyComponent: () => null;
|
|
5
|
-
export declare const placeholderDatetime: Date;
|
|
6
|
-
export declare const defaultTimes: string[];
|
|
7
|
-
export declare const defaultTimeFormat = "h:mma";
|
|
8
|
-
export declare const defaultDateFormat = "YYYY/MM/DD";
|
|
9
|
-
export declare function padToTwo(number: number): string;
|
|
10
|
-
export declare function formatDateTimeZoneIntoIso(date: string, time: string, zone: string): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component is used to hide portions of Select component.
|
|
3
|
-
*/
|
|
4
|
-
export declare const EmptyComponent: () => null;
|
|
5
|
-
export declare const placeholderDatetime: Date;
|
|
6
|
-
export declare const defaultTimes: string[];
|
|
7
|
-
export declare const defaultTimeFormat = "h:mma";
|
|
8
|
-
export declare const defaultDateFormat = "YYYY/MM/DD";
|
|
9
|
-
export declare function padToTwo(number: number): string;
|
|
10
|
-
export declare function formatDateTimeZoneIntoIso(date: string, time: string, zone: string): string;
|
package/offerings.json
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "DatePicker",
|
|
4
|
-
"package": "@atlaskit/datetime-picker",
|
|
5
|
-
"import": {
|
|
6
|
-
"name": "DatePicker",
|
|
7
|
-
"package": "@atlaskit/datetime-picker",
|
|
8
|
-
"type": "named"
|
|
9
|
-
},
|
|
10
|
-
"keywords": ["date", "picker", "calendar", "selection", "form"],
|
|
11
|
-
"categories": ["form"],
|
|
12
|
-
"shortDescription": "A component for selecting date values with calendar support.",
|
|
13
|
-
"status": "general-availability",
|
|
14
|
-
"accessibilityGuidelines": [
|
|
15
|
-
"Ensure proper keyboard navigation",
|
|
16
|
-
"Use appropriate date formats",
|
|
17
|
-
"Provide clear date labels",
|
|
18
|
-
"Consider screen reader announcements"
|
|
19
|
-
],
|
|
20
|
-
"usageGuidelines": [
|
|
21
|
-
"Use for date selection only",
|
|
22
|
-
"Provide clear date formats",
|
|
23
|
-
"Handle date validation appropriately",
|
|
24
|
-
"Consider calendar button visibility"
|
|
25
|
-
],
|
|
26
|
-
"contentGuidelines": [
|
|
27
|
-
"Use clear, descriptive labels",
|
|
28
|
-
"Provide helpful placeholder text",
|
|
29
|
-
"Use appropriate date formats",
|
|
30
|
-
"Keep labels concise but descriptive"
|
|
31
|
-
],
|
|
32
|
-
"examples": ["./examples/ai/date-picker.tsx"]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "TimePicker",
|
|
36
|
-
"package": "@atlaskit/datetime-picker",
|
|
37
|
-
"import": {
|
|
38
|
-
"name": "TimePicker",
|
|
39
|
-
"package": "@atlaskit/datetime-picker",
|
|
40
|
-
"type": "named"
|
|
41
|
-
},
|
|
42
|
-
"keywords": ["time", "picker", "clock", "selection", "form"],
|
|
43
|
-
"categories": ["form"],
|
|
44
|
-
"shortDescription": "A component for selecting time values with clock interface.",
|
|
45
|
-
"status": "general-availability",
|
|
46
|
-
"accessibilityGuidelines": [
|
|
47
|
-
"Ensure proper keyboard navigation",
|
|
48
|
-
"Use appropriate time formats",
|
|
49
|
-
"Provide clear time labels",
|
|
50
|
-
"Consider screen reader announcements"
|
|
51
|
-
],
|
|
52
|
-
"usageGuidelines": [
|
|
53
|
-
"Use for time selection only",
|
|
54
|
-
"Provide clear time formats",
|
|
55
|
-
"Handle time validation appropriately",
|
|
56
|
-
"Consider editable time input"
|
|
57
|
-
],
|
|
58
|
-
"contentGuidelines": [
|
|
59
|
-
"Use clear, descriptive labels",
|
|
60
|
-
"Provide helpful placeholder text",
|
|
61
|
-
"Use appropriate time formats",
|
|
62
|
-
"Keep labels concise but descriptive"
|
|
63
|
-
],
|
|
64
|
-
"examples": ["./examples/ai/time-picker.tsx"]
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "DateTimePicker",
|
|
68
|
-
"package": "@atlaskit/datetime-picker",
|
|
69
|
-
"import": {
|
|
70
|
-
"name": "DateTimePicker",
|
|
71
|
-
"package": "@atlaskit/datetime-picker",
|
|
72
|
-
"type": "named"
|
|
73
|
-
},
|
|
74
|
-
"keywords": ["datetime", "picker", "date", "time", "calendar"],
|
|
75
|
-
"categories": ["form"],
|
|
76
|
-
"shortDescription": "A component for selecting both date and time values.",
|
|
77
|
-
"status": "general-availability",
|
|
78
|
-
"accessibilityGuidelines": [
|
|
79
|
-
"Ensure proper keyboard navigation",
|
|
80
|
-
"Use appropriate date/time formats",
|
|
81
|
-
"Provide clear date/time labels",
|
|
82
|
-
"Consider screen reader announcements"
|
|
83
|
-
],
|
|
84
|
-
"usageGuidelines": [
|
|
85
|
-
"Use for combined date and time selection",
|
|
86
|
-
"Provide clear date/time formats",
|
|
87
|
-
"Handle timezone considerations",
|
|
88
|
-
"Consider validation requirements"
|
|
89
|
-
],
|
|
90
|
-
"contentGuidelines": [
|
|
91
|
-
"Use clear, descriptive labels",
|
|
92
|
-
"Provide helpful placeholder text",
|
|
93
|
-
"Use appropriate date/time formats",
|
|
94
|
-
"Keep labels concise but descriptive"
|
|
95
|
-
],
|
|
96
|
-
"examples": ["./examples/ai/datetime-picker.tsx"]
|
|
97
|
-
}
|
|
98
|
-
]
|