@atlaskit/datetime-picker 18.6.0 → 18.7.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 18.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a7ec100f7d560`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a7ec100f7d560) -
8
+ The top-layer code path now uses `@atlaskit/top-layer`'s `useAnchoredPopover`, so these popovers
9
+ are capped to the viewport and one too wide for the space beside its trigger moves to a roomier
10
+ side rather than wrapping into it. No public API change. Behind the `platform-dst-top-layer` gate
11
+ (`platform-dst-top-layer-tooltip` for `@atlaskit/tooltip`, `platform-dst-top-layer-spotlight` for
12
+ `@atlaskit/spotlight`); legacy (flag-off) behaviour is unchanged.
13
+ - Updated dependencies
14
+
15
+ ## 18.7.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`22469cd6605a3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22469cd6605a3) -
20
+ When platform-dst-locale-week-start-day is enabled, Calendar and DatePicker default the first day
21
+ of the week from the locale via Intl.Locale.getWeekInfo(). @atlaskit/locale adds
22
+ getFirstDayOfWeek() for that lookup. Pass weekStartDay to keep Sunday or any other start day.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 18.6.0
4
29
 
5
30
  ### Minor Changes
@@ -45,7 +45,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
45
45
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
46
46
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
47
47
  var packageName = "@atlaskit/datetime-picker";
48
- var packageVersion = "18.5.2";
48
+ var packageVersion = "18.7.0";
49
49
  var styles = {
50
50
  pickerContainerStyle: "_kqswh2mm",
51
51
  dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
@@ -503,7 +503,7 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, _forwarded
503
503
  onCalendarChange: onCalendarChange,
504
504
  onCalendarSelect: onCalendarSelect,
505
505
  calendarLocale: locale,
506
- calendarWeekStartDay: weekStartDay,
506
+ calendarWeekStartDay: weekStartDay !== null && weekStartDay !== void 0 ? weekStartDay : (0, _fg.fg)('platform-dst-locale-week-start-day') ? l10n.getFirstDayOfWeek() : undefined,
507
507
  shouldSetFocusOnCurrentDay: shouldSetFocusOnCurrentDay,
508
508
  /**
509
509
  * This overrides the inner wrapper the Calendar.
@@ -33,7 +33,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
33
33
  // for typing `process`
34
34
  // oxlint-disable-next-line @atlassian/no-restricted-imports
35
35
  var packageName = "@atlaskit/datetime-picker";
36
- var packageVersion = "18.5.2";
36
+ var packageVersion = "18.7.0";
37
37
  var analyticsAttributes = {
38
38
  componentName: 'dateTimePicker',
39
39
  packageName: packageName,
@@ -32,7 +32,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
32
32
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
33
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // oxlint-disable-next-line @atlassian/no-restricted-imports
34
34
  var packageName = "@atlaskit/datetime-picker";
35
- var packageVersion = "18.5.2";
35
+ var packageVersion = "18.7.0";
36
36
  var defaultTimeFormat = 'h:mma';
37
37
  var menuStyles = {
38
38
  /* Need to remove default absolute positioning as that causes issues with position fixed */
@@ -16,7 +16,7 @@ var _components = require("@atlaskit/react-select/components");
16
16
  var _index = require("@atlaskit/top-layer/placement-map/index");
17
17
  var _popover = require("@atlaskit/top-layer/popover/popover");
18
18
  var _popoverSurface = require("@atlaskit/top-layer/popover-surface");
19
- var _useAnchorPosition = require("@atlaskit/top-layer/use-anchor-position");
19
+ var _useAnchoredPopover = require("@atlaskit/top-layer/use-anchored-popover");
20
20
  var _excluded = ["className", "clearValue", "cx", "getStyles", "getValue", "hasValue", "innerProps", "innerRef", "isLoading", "isMulti", "isRtl", "maxMenuHeight", "menuPlacement", "menuPosition", "menuShouldScrollIntoView", "minMenuHeight", "options", "placement", "selectOption", "selectProps", "setValue", "children"];
21
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
22
  /**
@@ -30,7 +30,7 @@ var popupPlacement = (0, _index.fromLegacyPlacement)({
30
30
  /**
31
31
  * Top-layer version of the fixed layer menu used in the time picker.
32
32
  *
33
- * Uses `Popover` + `useAnchorPosition` so the time options list renders
33
+ * Uses `Popover` + `useAnchoredPopover` so the time options list renders
34
34
  * in the browser's top layer via the native Popover API and is positioned
35
35
  * via CSS Anchor Positioning. This avoids overflow clipping, z-index wars,
36
36
  * and portal-based layering.
@@ -66,7 +66,7 @@ var FixedLayerMenuTopLayer = exports.FixedLayerMenuTopLayer = function FixedLaye
66
66
  var triggerRef = (0, _react.useRef)((_selectProps$fixedLay = selectProps.fixedLayerRef) !== null && _selectProps$fixedLay !== void 0 ? _selectProps$fixedLay : null);
67
67
  triggerRef.current = (_selectProps$fixedLay2 = selectProps.fixedLayerRef) !== null && _selectProps$fixedLay2 !== void 0 ? _selectProps$fixedLay2 : null;
68
68
  var popoverRef = (0, _react.useRef)(null);
69
- (0, _useAnchorPosition.useAnchorPosition)({
69
+ (0, _useAnchoredPopover.useAnchoredPopover)({
70
70
  anchorRef: triggerRef,
71
71
  popoverRef: popoverRef,
72
72
  placement: popupPlacement,
@@ -32,7 +32,7 @@ import { MenuTopLayer } from '../internal/menu-top-layer';
32
32
  import { parseDate } from '../internal/parse-date';
33
33
  import { makeSingleValue } from '../internal/single-value';
34
34
  const packageName = "@atlaskit/datetime-picker";
35
- const packageVersion = "18.5.2";
35
+ const packageVersion = "18.7.0";
36
36
  const styles = {
37
37
  pickerContainerStyle: "_kqswh2mm",
38
38
  dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
@@ -431,7 +431,7 @@ const DatePicker = /*#__PURE__*/forwardRef((props, _forwardedRef) => {
431
431
  onCalendarChange,
432
432
  onCalendarSelect,
433
433
  calendarLocale: locale,
434
- calendarWeekStartDay: weekStartDay,
434
+ calendarWeekStartDay: weekStartDay !== null && weekStartDay !== void 0 ? weekStartDay : fg('platform-dst-locale-week-start-day') ? l10n.getFirstDayOfWeek() : undefined,
435
435
  shouldSetFocusOnCurrentDay,
436
436
  /**
437
437
  * This overrides the inner wrapper the Calendar.
@@ -20,7 +20,7 @@ import { convertTokens } from '../internal/parse-tokens';
20
20
  import DatePicker from './date-picker';
21
21
  import TimePicker from './time-picker';
22
22
  const packageName = "@atlaskit/datetime-picker";
23
- const packageVersion = "18.5.2";
23
+ const packageVersion = "18.7.0";
24
24
  const analyticsAttributes = {
25
25
  componentName: 'dateTimePicker',
26
26
  packageName,
@@ -19,7 +19,7 @@ import { convertTokens } from '../internal/parse-tokens';
19
19
  import { placeholderDatetime } from '../internal/placeholder-date-time';
20
20
  import { makeSingleValue } from '../internal/single-value';
21
21
  const packageName = "@atlaskit/datetime-picker";
22
- const packageVersion = "18.5.2";
22
+ const packageVersion = "18.7.0";
23
23
  const defaultTimeFormat = 'h:mma';
24
24
  const menuStyles = {
25
25
  /* Need to remove default absolute positioning as that causes issues with position fixed */
@@ -7,7 +7,7 @@ import { components } from '@atlaskit/react-select/components';
7
7
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map/index';
8
8
  import { Popover } from '@atlaskit/top-layer/popover/popover';
9
9
  import { PopoverSurface } from '@atlaskit/top-layer/popover-surface';
10
- import { useAnchorPosition } from '@atlaskit/top-layer/use-anchor-position';
10
+ import { useAnchoredPopover } from '@atlaskit/top-layer/use-anchored-popover';
11
11
 
12
12
  /**
13
13
  * Bottom-start placement: time options menu appears below and aligned to the
@@ -20,7 +20,7 @@ const popupPlacement = fromLegacyPlacement({
20
20
  /**
21
21
  * Top-layer version of the fixed layer menu used in the time picker.
22
22
  *
23
- * Uses `Popover` + `useAnchorPosition` so the time options list renders
23
+ * Uses `Popover` + `useAnchoredPopover` so the time options list renders
24
24
  * in the browser's top layer via the native Popover API and is positioned
25
25
  * via CSS Anchor Positioning. This avoids overflow clipping, z-index wars,
26
26
  * and portal-based layering.
@@ -57,7 +57,7 @@ export const FixedLayerMenuTopLayer = ({
57
57
  const triggerRef = useRef((_selectProps$fixedLay = selectProps.fixedLayerRef) !== null && _selectProps$fixedLay !== void 0 ? _selectProps$fixedLay : null);
58
58
  triggerRef.current = (_selectProps$fixedLay2 = selectProps.fixedLayerRef) !== null && _selectProps$fixedLay2 !== void 0 ? _selectProps$fixedLay2 : null;
59
59
  const popoverRef = useRef(null);
60
- useAnchorPosition({
60
+ useAnchoredPopover({
61
61
  anchorRef: triggerRef,
62
62
  popoverRef,
63
63
  placement: popupPlacement,
@@ -38,7 +38,7 @@ import { MenuTopLayer } from '../internal/menu-top-layer';
38
38
  import { parseDate } from '../internal/parse-date';
39
39
  import { makeSingleValue } from '../internal/single-value';
40
40
  var packageName = "@atlaskit/datetime-picker";
41
- var packageVersion = "18.5.2";
41
+ var packageVersion = "18.7.0";
42
42
  var styles = {
43
43
  pickerContainerStyle: "_kqswh2mm",
44
44
  dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
@@ -496,7 +496,7 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, _forwardedRef) {
496
496
  onCalendarChange: onCalendarChange,
497
497
  onCalendarSelect: onCalendarSelect,
498
498
  calendarLocale: locale,
499
- calendarWeekStartDay: weekStartDay,
499
+ calendarWeekStartDay: weekStartDay !== null && weekStartDay !== void 0 ? weekStartDay : fg('platform-dst-locale-week-start-day') ? l10n.getFirstDayOfWeek() : undefined,
500
500
  shouldSetFocusOnCurrentDay: shouldSetFocusOnCurrentDay,
501
501
  /**
502
502
  * This overrides the inner wrapper the Calendar.
@@ -27,7 +27,7 @@ import { convertTokens } from '../internal/parse-tokens';
27
27
  import DatePicker from './date-picker';
28
28
  import TimePicker from './time-picker';
29
29
  var packageName = "@atlaskit/datetime-picker";
30
- var packageVersion = "18.5.2";
30
+ var packageVersion = "18.7.0";
31
31
  var analyticsAttributes = {
32
32
  componentName: 'dateTimePicker',
33
33
  packageName: packageName,
@@ -25,7 +25,7 @@ import { convertTokens } from '../internal/parse-tokens';
25
25
  import { placeholderDatetime } from '../internal/placeholder-date-time';
26
26
  import { makeSingleValue } from '../internal/single-value';
27
27
  var packageName = "@atlaskit/datetime-picker";
28
- var packageVersion = "18.5.2";
28
+ var packageVersion = "18.7.0";
29
29
  var defaultTimeFormat = 'h:mma';
30
30
  var menuStyles = {
31
31
  /* Need to remove default absolute positioning as that causes issues with position fixed */
@@ -9,7 +9,7 @@ import { components } from '@atlaskit/react-select/components';
9
9
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map/index';
10
10
  import { Popover } from '@atlaskit/top-layer/popover/popover';
11
11
  import { PopoverSurface } from '@atlaskit/top-layer/popover-surface';
12
- import { useAnchorPosition } from '@atlaskit/top-layer/use-anchor-position';
12
+ import { useAnchoredPopover } from '@atlaskit/top-layer/use-anchored-popover';
13
13
 
14
14
  /**
15
15
  * Bottom-start placement: time options menu appears below and aligned to the
@@ -22,7 +22,7 @@ var popupPlacement = fromLegacyPlacement({
22
22
  /**
23
23
  * Top-layer version of the fixed layer menu used in the time picker.
24
24
  *
25
- * Uses `Popover` + `useAnchorPosition` so the time options list renders
25
+ * Uses `Popover` + `useAnchoredPopover` so the time options list renders
26
26
  * in the browser's top layer via the native Popover API and is positioned
27
27
  * via CSS Anchor Positioning. This avoids overflow clipping, z-index wars,
28
28
  * and portal-based layering.
@@ -58,7 +58,7 @@ var FixedLayerMenuTopLayer = function FixedLayerMenuTopLayer(_ref) {
58
58
  var triggerRef = useRef((_selectProps$fixedLay = selectProps.fixedLayerRef) !== null && _selectProps$fixedLay !== void 0 ? _selectProps$fixedLay : null);
59
59
  triggerRef.current = (_selectProps$fixedLay2 = selectProps.fixedLayerRef) !== null && _selectProps$fixedLay2 !== void 0 ? _selectProps$fixedLay2 : null;
60
60
  var popoverRef = useRef(null);
61
- useAnchorPosition({
61
+ useAnchoredPopover({
62
62
  anchorRef: triggerRef,
63
63
  popoverRef: popoverRef,
64
64
  placement: popupPlacement,
@@ -2,7 +2,7 @@ import type { MenuProps, OptionType } from '@atlaskit/select/types';
2
2
  /**
3
3
  * Top-layer version of the fixed layer menu used in the time picker.
4
4
  *
5
- * Uses `Popover` + `useAnchorPosition` so the time options list renders
5
+ * Uses `Popover` + `useAnchoredPopover` so the time options list renders
6
6
  * in the browser's top layer via the native Popover API and is positioned
7
7
  * via CSS Anchor Positioning. This avoids overflow clipping, z-index wars,
8
8
  * and portal-based layering.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "18.6.0",
3
+ "version": "18.7.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/"
@@ -33,20 +33,20 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/analytics-next": "^12.5.0",
35
35
  "@atlaskit/button": "^25.3.0",
36
- "@atlaskit/calendar": "^19.2.0",
36
+ "@atlaskit/calendar": "^19.3.0",
37
37
  "@atlaskit/css": "^1.1.0",
38
38
  "@atlaskit/ds-lib": "^8.0.0",
39
- "@atlaskit/icon": "^37.6.0",
39
+ "@atlaskit/icon": "^37.7.0",
40
40
  "@atlaskit/layering": "^5.2.0",
41
- "@atlaskit/locale": "^5.2.0",
41
+ "@atlaskit/locale": "^5.3.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.2.0",
43
43
  "@atlaskit/popper": "^9.4.0",
44
44
  "@atlaskit/primitives": "^22.5.0",
45
45
  "@atlaskit/react-compiler-gating": "^0.2.0",
46
46
  "@atlaskit/react-select": "^4.9.0",
47
47
  "@atlaskit/select": "^22.11.0",
48
- "@atlaskit/tokens": "^16.11.0",
49
- "@atlaskit/top-layer": "^4.4.0",
48
+ "@atlaskit/tokens": "^16.12.0",
49
+ "@atlaskit/top-layer": "^5.0.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@compiled/react": "^1.0.2",
52
52
  "date-fns": "^2.17.0"
@@ -90,6 +90,9 @@
90
90
  },
91
91
  "platform-dst-dp-parse-date-format": {
92
92
  "type": "boolean"
93
+ },
94
+ "platform-dst-locale-week-start-day": {
95
+ "type": "boolean"
93
96
  }
94
97
  },
95
98
  "homepage": "https://atlassian.design/components/datetime-picker/"