@atlaskit/datetime-picker 16.2.3 → 17.0.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 +27 -0
- package/dist/cjs/components/date-picker-class.compiled.css +16 -0
- package/dist/cjs/components/date-picker-class.js +122 -146
- package/dist/cjs/components/date-picker-fc.compiled.css +16 -0
- package/dist/cjs/components/date-picker-fc.js +117 -144
- package/dist/cjs/components/date-time-picker-class.compiled.css +19 -0
- package/dist/cjs/components/date-time-picker-class.js +22 -47
- package/dist/cjs/components/date-time-picker-fc.compiled.css +6 -0
- package/dist/cjs/components/date-time-picker-fc.js +22 -27
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/internal/date-time-picker-container.compiled.css +21 -0
- package/dist/cjs/internal/date-time-picker-container.js +26 -71
- package/dist/cjs/internal/ff-component.js +0 -2
- package/dist/cjs/internal/fixed-layer-menu.js +8 -8
- package/dist/cjs/internal/fixed-layer.compiled.css +4 -0
- package/dist/cjs/internal/fixed-layer.js +14 -13
- package/dist/cjs/internal/indicators-container.compiled.css +2 -0
- package/dist/cjs/internal/indicators-container.js +14 -15
- package/dist/cjs/internal/menu.compiled.css +6 -0
- package/dist/cjs/internal/menu.js +15 -32
- package/dist/es2019/components/date-picker-class.compiled.css +16 -0
- package/dist/es2019/components/date-picker-class.js +117 -143
- package/dist/es2019/components/date-picker-fc.compiled.css +16 -0
- package/dist/es2019/components/date-picker-fc.js +114 -141
- package/dist/es2019/components/date-time-picker-class.compiled.css +19 -0
- package/dist/es2019/components/date-time-picker-class.js +21 -49
- package/dist/es2019/components/date-time-picker-fc.compiled.css +6 -0
- package/dist/es2019/components/date-time-picker-fc.js +19 -24
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/internal/date-time-picker-container.compiled.css +21 -0
- package/dist/es2019/internal/date-time-picker-container.js +18 -69
- package/dist/es2019/internal/ff-component.js +0 -2
- package/dist/es2019/internal/fixed-layer-menu.js +5 -8
- package/dist/es2019/internal/fixed-layer.compiled.css +4 -0
- package/dist/es2019/internal/fixed-layer.js +13 -12
- package/dist/es2019/internal/indicators-container.compiled.css +2 -0
- package/dist/es2019/internal/indicators-container.js +11 -16
- package/dist/es2019/internal/menu.compiled.css +6 -0
- package/dist/es2019/internal/menu.js +11 -30
- package/dist/esm/components/date-picker-class.compiled.css +16 -0
- package/dist/esm/components/date-picker-class.js +120 -147
- package/dist/esm/components/date-picker-fc.compiled.css +16 -0
- package/dist/esm/components/date-picker-fc.js +116 -144
- package/dist/esm/components/date-time-picker-class.compiled.css +19 -0
- package/dist/esm/components/date-time-picker-class.js +21 -49
- package/dist/esm/components/date-time-picker-fc.compiled.css +6 -0
- package/dist/esm/components/date-time-picker-fc.js +19 -24
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/internal/date-time-picker-container.compiled.css +21 -0
- package/dist/esm/internal/date-time-picker-container.js +22 -69
- package/dist/esm/internal/ff-component.js +0 -2
- package/dist/esm/internal/fixed-layer-menu.js +5 -8
- package/dist/esm/internal/fixed-layer.compiled.css +4 -0
- package/dist/esm/internal/fixed-layer.js +13 -13
- package/dist/esm/internal/indicators-container.compiled.css +2 -0
- package/dist/esm/internal/indicators-container.js +11 -16
- package/dist/esm/internal/menu.compiled.css +6 -0
- package/dist/esm/internal/menu.js +11 -30
- package/dist/types/components/date-picker-class.d.ts +2 -3
- package/dist/types/components/date-picker.d.ts +1 -1
- package/dist/types/components/date-time-picker-class.d.ts +4 -5
- package/dist/types/components/date-time-picker.d.ts +3 -3
- package/dist/types/internal/date-time-picker-container.d.ts +4 -0
- package/dist/types/internal/fixed-layer-menu.d.ts +2 -6
- package/dist/types/internal/fixed-layer.d.ts +5 -1
- package/dist/types/internal/indicators-container.d.ts +2 -2
- package/dist/types/internal/menu.d.ts +6 -2
- package/dist/types-ts4.5/components/date-picker-class.d.ts +2 -3
- package/dist/types-ts4.5/components/date-picker.d.ts +1 -1
- package/dist/types-ts4.5/components/date-time-picker-class.d.ts +4 -5
- package/dist/types-ts4.5/components/date-time-picker.d.ts +3 -3
- package/dist/types-ts4.5/internal/date-time-picker-container.d.ts +4 -0
- package/dist/types-ts4.5/internal/fixed-layer-menu.d.ts +2 -6
- package/dist/types-ts4.5/internal/fixed-layer.d.ts +5 -1
- package/dist/types-ts4.5/internal/indicators-container.d.ts +2 -2
- package/dist/types-ts4.5/internal/menu.d.ts +6 -2
- package/package.json +12 -12
|
@@ -1,26 +1,24 @@
|
|
|
1
|
+
/* date-picker-fc.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
6
|
var _excluded = ["appearance", "autoFocus", "clearControlLabel", "hideIcon", "openCalendarLabel", "defaultIsOpen", "defaultValue", "disabled", "disabledDateFilter", "icon", "id", "innerProps", "inputLabel", "inputLabelId", "isDisabled", "isInvalid", "isRequired", "label", "name", "onBlur", "onChange", "onFocus", "selectProps", "shouldShowCalendarButton", "spacing", "locale", "value", "isOpen", "maxDate", "minDate", "weekStartDay", "formatDisplayLabel", "testId", "aria-describedby", "placeholder", "nextMonthLabel", "previousMonthLabel"];
|
|
7
|
+
import "./date-picker-fc.compiled.css";
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
10
|
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; }
|
|
7
11
|
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) { _defineProperty(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; }
|
|
8
|
-
/**
|
|
9
|
-
* @jsxRuntime classic
|
|
10
|
-
* @jsx jsx
|
|
11
|
-
*/
|
|
12
12
|
import { forwardRef, useCallback, useEffect, useReducer, useRef, useState } from 'react';
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
-
import { css, jsx } from '@emotion/react';
|
|
16
13
|
import { isValid, parseISO } from 'date-fns';
|
|
17
14
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
18
15
|
import { IconButton } from '@atlaskit/button/new';
|
|
16
|
+
import { cx } from '@atlaskit/css';
|
|
19
17
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
20
18
|
import CalendarIcon from '@atlaskit/icon/core/migration/calendar';
|
|
21
19
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
22
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
|
-
import { Box
|
|
21
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
24
22
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
25
23
|
import { EmptyComponent } from '../internal';
|
|
26
24
|
import { formatDate, getParsedISO, getPlaceholder, isDateDisabled, parseDate } from '../internal/date-picker-migration';
|
|
@@ -29,42 +27,19 @@ import { Menu } from '../internal/menu';
|
|
|
29
27
|
import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
|
|
30
28
|
import { makeSingleValue } from '../internal/single-value';
|
|
31
29
|
var packageName = "@atlaskit/datetime-picker";
|
|
32
|
-
var packageVersion = "
|
|
30
|
+
var packageVersion = "17.0.1";
|
|
31
|
+
var styles = {
|
|
32
|
+
pickerContainerStyle: "_kqswh2mm",
|
|
33
|
+
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
34
|
+
iconContainerStyles: "_v564vrg3 _1e0c1txw _4t3i1osq _kqswstnw _4cvr1h6o _i0dl1kw7 _syaz131l _152tze3t _rjxpze3t _30l31gjq",
|
|
35
|
+
iconSpacingWithClearButtonStyles: "_12l2xy5q",
|
|
36
|
+
iconSpacingWithoutClearButtonStyles: "_12l21b66"
|
|
37
|
+
};
|
|
33
38
|
var analyticsAttributes = {
|
|
34
39
|
componentName: 'datePicker',
|
|
35
40
|
packageName: packageName,
|
|
36
41
|
packageVersion: packageVersion
|
|
37
42
|
};
|
|
38
|
-
var pickerContainerStyles = css({
|
|
39
|
-
position: 'relative'
|
|
40
|
-
});
|
|
41
|
-
var dropdownIndicatorStyles = xcss({
|
|
42
|
-
minWidth: "var(--ds-space-300, 24px)",
|
|
43
|
-
minHeight: "var(--ds-space-300, 24px)",
|
|
44
|
-
display: 'flex',
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
justifyContent: 'center'
|
|
47
|
-
});
|
|
48
|
-
var iconContainerStyles = xcss({
|
|
49
|
-
display: 'flex',
|
|
50
|
-
height: '100%',
|
|
51
|
-
position: 'absolute',
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
flexBasis: 'inherit',
|
|
54
|
-
color: 'color.text.subtlest',
|
|
55
|
-
insetBlockStart: 'space.0',
|
|
56
|
-
insetInlineEnd: 'space.0',
|
|
57
|
-
transition: "color 150ms",
|
|
58
|
-
':hover': {
|
|
59
|
-
color: 'color.text.subtle'
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
var iconSpacingWithClearButtonStyles = xcss({
|
|
63
|
-
marginInlineEnd: 'space.400'
|
|
64
|
-
});
|
|
65
|
-
var iconSpacingWithoutClearButtonStyles = xcss({
|
|
66
|
-
marginInlineEnd: 'space.050'
|
|
67
|
-
});
|
|
68
43
|
|
|
69
44
|
/**
|
|
70
45
|
* __Date picker__
|
|
@@ -455,23 +430,23 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
455
430
|
var showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
|
|
456
431
|
var clearIndicator = Icon;
|
|
457
432
|
|
|
458
|
-
// eslint-disable-next-line @atlaskit/platform/
|
|
433
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
459
434
|
if (fg('platform-visual-refresh-icons')) {
|
|
460
435
|
clearIndicator = function clearIndicator(props) {
|
|
461
|
-
return
|
|
462
|
-
xcss: dropdownIndicatorStyles
|
|
463
|
-
},
|
|
436
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
437
|
+
xcss: styles.dropdownIndicatorStyles
|
|
438
|
+
}, /*#__PURE__*/React.createElement(Icon, props));
|
|
464
439
|
};
|
|
465
440
|
}
|
|
466
441
|
var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : clearIndicator;
|
|
467
442
|
var SingleValue = makeSingleValue({
|
|
468
443
|
lang: propLocale
|
|
469
444
|
});
|
|
470
|
-
var selectComponents = _objectSpread(_objectSpread({
|
|
445
|
+
var selectComponents = _objectSpread(_objectSpread(_objectSpread({}, selectProps.components), {}, {
|
|
471
446
|
DropdownIndicator: shouldShowCalendarButton ? EmptyComponent : dropDownIcon
|
|
472
447
|
}, shouldShowCalendarButton ? {
|
|
473
448
|
IndicatorsContainer: function IndicatorsContainer(props) {
|
|
474
|
-
return
|
|
449
|
+
return /*#__PURE__*/React.createElement(_IndicatorsContainer, _extends({}, props, {
|
|
475
450
|
showClearIndicator: showClearIndicator
|
|
476
451
|
}));
|
|
477
452
|
}
|
|
@@ -533,104 +508,101 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
533
508
|
// `label` takes precedence of the `inputLabel`
|
|
534
509
|
var fullopenCalendarLabel = label || inputLabel ? "".concat(label || inputLabel, ", ").concat(openCalendarLabel) : openCalendarLabel;
|
|
535
510
|
var openCalendarLabelId = "open-calendar-label--".concat(useId());
|
|
536
|
-
return (
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
testId: testId && "".concat(testId, "--open-calendar-button")
|
|
633
|
-
})) : null)
|
|
634
|
-
);
|
|
511
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, innerProps, {
|
|
512
|
+
"data-testid": testId && "".concat(testId, "--container"),
|
|
513
|
+
onBlur: onContainerBlur,
|
|
514
|
+
onFocus: onContainerFocus,
|
|
515
|
+
onClick: onInputClick,
|
|
516
|
+
onInput: onTextInput,
|
|
517
|
+
onKeyDown: onInputKeyDown,
|
|
518
|
+
ref: getContainerRef
|
|
519
|
+
// Since the onclick, onfocus are passed down, adding role="presentation" prevents typecheck errors.
|
|
520
|
+
,
|
|
521
|
+
role: "presentation",
|
|
522
|
+
className: ax([styles.pickerContainerStyle])
|
|
523
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
524
|
+
name: name,
|
|
525
|
+
type: "hidden",
|
|
526
|
+
value: getterValue,
|
|
527
|
+
"data-testid": testId && "".concat(testId, "--input")
|
|
528
|
+
}), /*#__PURE__*/React.createElement(Select, _extends({
|
|
529
|
+
appearance: appearance,
|
|
530
|
+
"aria-describedby": ariaDescribedBy,
|
|
531
|
+
label: label || undefined
|
|
532
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
533
|
+
,
|
|
534
|
+
autoFocus: autoFocus,
|
|
535
|
+
clearControlLabel: clearControlLabel,
|
|
536
|
+
closeMenuOnSelect: true,
|
|
537
|
+
enableAnimation: false,
|
|
538
|
+
inputId: id,
|
|
539
|
+
inputValue: actualSelectInputValue,
|
|
540
|
+
isDisabled: isDisabled,
|
|
541
|
+
isRequired: isRequired,
|
|
542
|
+
menuIsOpen: menuIsOpen,
|
|
543
|
+
onBlur: onSelectBlur,
|
|
544
|
+
onChange: onSelectChange,
|
|
545
|
+
onFocus: onSelectFocus,
|
|
546
|
+
onInputChange: handleSelectInputChange,
|
|
547
|
+
placeholder: getPlaceholder({
|
|
548
|
+
placeholder: placeholder,
|
|
549
|
+
l10n: l10n
|
|
550
|
+
})
|
|
551
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
|
|
552
|
+
// @ts-ignore -- Type 'OptionType' is not assignable to type '{ label: string; value: string; }'
|
|
553
|
+
,
|
|
554
|
+
styles: mergedStyles,
|
|
555
|
+
value: initialValue
|
|
556
|
+
}, selectProps, {
|
|
557
|
+
// For some reason, this and the below `styles` type error _only_ show
|
|
558
|
+
// up when you alter some of the properties in the `selectComponents`
|
|
559
|
+
// object. These errors are still present, and I suspect have always
|
|
560
|
+
// been present, without changing the unrelated code. Ignoring as the
|
|
561
|
+
// component still works as expected despite this error. And also
|
|
562
|
+
// because the select refresh team may solve it later.
|
|
563
|
+
components: selectComponents
|
|
564
|
+
// These are below the spread because I don't know what is in
|
|
565
|
+
// selectProps or not and what wil be overwritten
|
|
566
|
+
,
|
|
567
|
+
isClearable: true,
|
|
568
|
+
isInvalid: isInvalid,
|
|
569
|
+
spacing: spacing,
|
|
570
|
+
testId: testId
|
|
571
|
+
// These aren't part of `Select`'s API, but we're using them here.
|
|
572
|
+
// @ts-ignore -- Property 'calendarContainerRef' does not exist on type 'IntrinsicAttributes & LibraryManagedAttributes<(<Option extends unknown = OptionType, IsMulti extends boolean = false>(props: AtlaskitSelectProps<Option, IsMulti> & { ...; }) => Element), AtlaskitSelectProps<...> & { ...; }>'.
|
|
573
|
+
,
|
|
574
|
+
calendarContainerRef: calendarProps.calendarContainerRef,
|
|
575
|
+
calendarDisabled: calendarProps.calendarDisabled,
|
|
576
|
+
calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
|
|
577
|
+
calendarLocale: calendarProps.calendarLocale,
|
|
578
|
+
calendarMaxDate: calendarProps.calendarMaxDate,
|
|
579
|
+
calendarMinDate: calendarProps.calendarMinDate,
|
|
580
|
+
calendarRef: calendarProps.calendarRef,
|
|
581
|
+
calendarValue: calendarProps.calendarValue,
|
|
582
|
+
calendarView: calendarProps.calendarView,
|
|
583
|
+
calendarWeekStartDay: calendarProps.calendarWeekStartDay,
|
|
584
|
+
nextMonthLabel: nextMonthLabel,
|
|
585
|
+
onCalendarChange: calendarProps.onCalendarChange,
|
|
586
|
+
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
587
|
+
previousMonthLabel: previousMonthLabel,
|
|
588
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
589
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
590
|
+
})), shouldShowCalendarButton && !isDisabled ? /*#__PURE__*/React.createElement(Box, {
|
|
591
|
+
xcss: cx(styles.iconContainerStyles, value && !hideIcon ? styles.iconSpacingWithClearButtonStyles : styles.iconSpacingWithoutClearButtonStyles)
|
|
592
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
593
|
+
appearance: "subtle",
|
|
594
|
+
label: !inputLabelId ? fullopenCalendarLabel : openCalendarLabel,
|
|
595
|
+
"aria-labelledby": inputLabelId ? "".concat(inputLabelId, " ").concat(openCalendarLabelId) : undefined,
|
|
596
|
+
id: openCalendarLabelId,
|
|
597
|
+
icon: function icon(iconProps) {
|
|
598
|
+
return /*#__PURE__*/React.createElement(CalendarIcon, _extends({}, iconProps, {
|
|
599
|
+
color: "var(--ds-icon, #44546F)"
|
|
600
|
+
}));
|
|
601
|
+
},
|
|
602
|
+
onClick: onCalendarButtonClick,
|
|
603
|
+
onKeyDown: onCalendarButtonKeyDown,
|
|
604
|
+
ref: calendarButtonRef,
|
|
605
|
+
testId: testId && "".concat(testId, "--open-calendar-button")
|
|
606
|
+
})) : null);
|
|
635
607
|
});
|
|
636
608
|
export default DatePicker;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
._19itglyw{border:none}
|
|
3
|
+
._v564vrg3{transition:color .15s}._12l2e4h9{margin-inline-end:var(--ds-border-width,1px)}
|
|
4
|
+
._16jlkb7n{flex-grow:1}
|
|
5
|
+
._1e0c1txw{display:flex}
|
|
6
|
+
._1o9zidpf{flex-shrink:0}
|
|
7
|
+
._1pfhe4h9{margin-block-start:var(--ds-border-width,1px)}
|
|
8
|
+
._1q5112x7{padding-block-start:var(--ds-space-075,6px)}
|
|
9
|
+
._4cvr1h6o{align-items:center}
|
|
10
|
+
._6rthe4h9{margin-block-end:var(--ds-border-width,1px)}
|
|
11
|
+
._85i512x7{padding-block-end:var(--ds-space-075,6px)}
|
|
12
|
+
._ahbqe4h9{margin-inline-start:var(--ds-border-width,1px)}
|
|
13
|
+
._bfhk1kw7{background-color:inherit}
|
|
14
|
+
._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
|
|
15
|
+
._i0dl1kw7{flex-basis:inherit}
|
|
16
|
+
._i0dl1ssb{flex-basis:50%}
|
|
17
|
+
._syaz131l{color:var(--ds-text-subtlest,#626f86)}
|
|
18
|
+
._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
|
|
19
|
+
._30l31gjq:hover{color:var(--ds-text-subtle,#44546f)}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
+
/* date-time-picker-class.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import "./date-time-picker-class.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
12
|
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; }
|
|
10
13
|
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) { _defineProperty(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; }
|
|
11
|
-
/**
|
|
12
|
-
* @jsxRuntime classic
|
|
13
|
-
* @jsx jsx
|
|
14
|
-
*/
|
|
15
14
|
import React from 'react';
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
-
import { css, jsx } from '@emotion/react';
|
|
19
15
|
import { format, isValid, parseISO } from 'date-fns';
|
|
20
16
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
21
17
|
import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
|
|
22
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
19
|
import { mergeStyles } from '@atlaskit/select';
|
|
24
|
-
import { N500, N70 } from '@atlaskit/theme/colors';
|
|
25
20
|
import { formatDateTimeZoneIntoIso } from '../internal';
|
|
26
21
|
import { DateTimePickerContainer } from '../internal/date-time-picker-container';
|
|
27
22
|
import { componentWithCondition } from '../internal/ff-component';
|
|
@@ -33,35 +28,12 @@ var DatePicker = componentWithCondition(function () {
|
|
|
33
28
|
return fg('dst-date-picker-use-functional-component');
|
|
34
29
|
}, DatePickerNew, DatePickerOld);
|
|
35
30
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
flexShrink: 0
|
|
43
|
-
});
|
|
44
|
-
var timePickerContainerStyles = css({
|
|
45
|
-
flexBasis: '50%',
|
|
46
|
-
flexGrow: 1
|
|
47
|
-
});
|
|
48
|
-
var iconContainerStyles = css({
|
|
49
|
-
display: 'flex',
|
|
50
|
-
margin: "var(--ds-border-width, 1px)",
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
flexBasis: 'inherit',
|
|
53
|
-
backgroundColor: 'inherit',
|
|
54
|
-
border: 'none',
|
|
55
|
-
color: "var(--ds-text-subtlest, ".concat(N70, ")"),
|
|
56
|
-
paddingBlockEnd: "var(--ds-space-075, 6px)",
|
|
57
|
-
paddingBlockStart: "var(--ds-space-075, 6px)",
|
|
58
|
-
paddingInlineEnd: "var(--ds-space-100, 8px)",
|
|
59
|
-
paddingInlineStart: "var(--ds-space-050, 4px)",
|
|
60
|
-
transition: "color 150ms",
|
|
61
|
-
'&:hover': {
|
|
62
|
-
color: "var(--ds-text-subtle, ".concat(N500, ")")
|
|
63
|
-
}
|
|
64
|
-
});
|
|
31
|
+
var packageVersion = "17.0.1";
|
|
32
|
+
var compiledStyles = {
|
|
33
|
+
datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
|
|
34
|
+
timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
|
|
35
|
+
iconContainerStyles: "_19itglyw _v564vrg3 _1e0c1txw _4cvr1h6o _i0dl1kw7 _bfhk1kw7 _syaz131l _6rthe4h9 _1pfhe4h9 _12l2e4h9 _ahbqe4h9 _85i512x7 _1q5112x7 _y4tiu2gc _bozg1b66 _30l31gjq"
|
|
36
|
+
};
|
|
65
37
|
|
|
66
38
|
// react-select overrides (via @atlaskit/select).
|
|
67
39
|
var styles = {
|
|
@@ -311,21 +283,21 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
311
283
|
// Render DateTimePicker's IconContainer when a value has been filled
|
|
312
284
|
// Don't use Date or TimePicker's because they can't be customised
|
|
313
285
|
var isClearable = Boolean(dateValue || timeValue);
|
|
314
|
-
return
|
|
286
|
+
return /*#__PURE__*/React.createElement(DateTimePickerContainer, {
|
|
315
287
|
appearance: appearance,
|
|
316
288
|
isDisabled: isDisabled,
|
|
317
289
|
isFocused: isFocused,
|
|
318
290
|
isInvalid: isInvalid,
|
|
319
291
|
testId: testId,
|
|
320
292
|
innerProps: innerProps
|
|
321
|
-
},
|
|
293
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
322
294
|
name: name,
|
|
323
295
|
type: "hidden",
|
|
324
296
|
value: value,
|
|
325
297
|
"data-testid": testId && "".concat(testId, "--input")
|
|
326
|
-
}),
|
|
327
|
-
|
|
328
|
-
},
|
|
298
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
className: ax([compiledStyles.datePickerContainerStyles])
|
|
300
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
329
301
|
appearance: appearance,
|
|
330
302
|
"aria-describedby": datePickerAriaDescribedBy,
|
|
331
303
|
autoFocus: datePickerProps.autoFocus || autoFocus,
|
|
@@ -361,9 +333,9 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
361
333
|
testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
|
|
362
334
|
value: dateValue,
|
|
363
335
|
weekStartDay: datePickerProps.weekStartDay
|
|
364
|
-
})),
|
|
365
|
-
|
|
366
|
-
},
|
|
336
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
337
|
+
className: ax([compiledStyles.timePickerContainerStyles])
|
|
338
|
+
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
367
339
|
appearance: timePickerProps.appearance || appearance,
|
|
368
340
|
"aria-describedby": timePickerAriaDescribedBy,
|
|
369
341
|
autoFocus: timePickerProps.autoFocus,
|
|
@@ -392,13 +364,13 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
392
364
|
timeIsEditable: timePickerProps.timeIsEditable,
|
|
393
365
|
times: timePickerProps.times,
|
|
394
366
|
value: timeValue
|
|
395
|
-
})), isClearable && !isDisabled ?
|
|
396
|
-
css: iconContainerStyles,
|
|
367
|
+
})), isClearable && !isDisabled ? /*#__PURE__*/React.createElement("button", {
|
|
397
368
|
onClick: this.onClear,
|
|
398
369
|
"data-testid": testId && "".concat(testId, "--icon--container"),
|
|
399
370
|
tabIndex: -1,
|
|
400
|
-
type: "button"
|
|
401
|
-
|
|
371
|
+
type: "button",
|
|
372
|
+
className: ax([compiledStyles.iconContainerStyles])
|
|
373
|
+
}, /*#__PURE__*/React.createElement(SelectClearIcon, {
|
|
402
374
|
LEGACY_size: "small",
|
|
403
375
|
color: "currentColor",
|
|
404
376
|
label: clearControlLabel
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/* date-time-picker-fc.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
6
|
var _excluded = ["selectProps"],
|
|
6
7
|
_excluded2 = ["selectProps"];
|
|
8
|
+
import "./date-time-picker-fc.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
10
|
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; }
|
|
8
11
|
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) { _defineProperty(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; }
|
|
9
12
|
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
@@ -12,7 +15,7 @@ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
|
12
15
|
import { IconButton } from '@atlaskit/button/new';
|
|
13
16
|
import SelectClearIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
|
|
14
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { Box, Inline
|
|
18
|
+
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
16
19
|
import { mergeStyles } from '@atlaskit/select';
|
|
17
20
|
import { formatDateTimeZoneIntoIso } from '../internal';
|
|
18
21
|
import { DateTimePickerContainer } from '../internal/date-time-picker-container';
|
|
@@ -27,29 +30,17 @@ function () {
|
|
|
27
30
|
return fg('dst-date-picker-use-functional-component');
|
|
28
31
|
}, DatePickerNew, DatePickerOld);
|
|
29
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
30
|
-
var packageVersion = "
|
|
33
|
+
var packageVersion = "17.0.1";
|
|
31
34
|
var analyticsAttributes = {
|
|
32
35
|
componentName: 'dateTimePicker',
|
|
33
36
|
packageName: packageName,
|
|
34
37
|
packageVersion: packageVersion
|
|
35
38
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
flexGrow: 1,
|
|
42
|
-
flexShrink: 0
|
|
43
|
-
});
|
|
44
|
-
var timePickerContainerStyles = xcss({
|
|
45
|
-
flexBasis: '50%',
|
|
46
|
-
flexGrow: 1
|
|
47
|
-
});
|
|
48
|
-
var iconContainerStyles = xcss({
|
|
49
|
-
display: 'flex',
|
|
50
|
-
alignItems: 'center',
|
|
51
|
-
flexBasis: 'inherit'
|
|
52
|
-
});
|
|
39
|
+
var compiledStyles = {
|
|
40
|
+
datePickerContainerStyles: "_i0dl1ssb _16jlkb7n _1o9zidpf",
|
|
41
|
+
timePickerContainerStyles: "_i0dl1ssb _16jlkb7n",
|
|
42
|
+
iconContainerStyles: "_1e0c1txw _4cvr1h6o _i0dl1kw7"
|
|
43
|
+
};
|
|
53
44
|
|
|
54
45
|
// react-select overrides (via @atlaskit/select).
|
|
55
46
|
var styles = {
|
|
@@ -294,10 +285,12 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
294
285
|
value: value,
|
|
295
286
|
"data-testid": testId && "".concat(testId, "--input")
|
|
296
287
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
297
|
-
xcss: datePickerContainerStyles
|
|
288
|
+
xcss: compiledStyles.datePickerContainerStyles
|
|
298
289
|
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
299
290
|
appearance: appearance,
|
|
300
|
-
"aria-describedby": datePickerAriaDescribedBy
|
|
291
|
+
"aria-describedby": datePickerAriaDescribedBy
|
|
292
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
293
|
+
,
|
|
301
294
|
autoFocus: datePickerProps.autoFocus || autoFocus,
|
|
302
295
|
dateFormat: datePickerProps.dateFormat,
|
|
303
296
|
defaultIsOpen: datePickerProps.defaultIsOpen,
|
|
@@ -335,10 +328,12 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
335
328
|
value: dateValue,
|
|
336
329
|
weekStartDay: datePickerProps.weekStartDay
|
|
337
330
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
338
|
-
xcss: timePickerContainerStyles
|
|
331
|
+
xcss: compiledStyles.timePickerContainerStyles
|
|
339
332
|
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
340
333
|
appearance: timePickerProps.appearance || appearance,
|
|
341
|
-
"aria-describedby": timePickerAriaDescribedBy
|
|
334
|
+
"aria-describedby": timePickerAriaDescribedBy
|
|
335
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
336
|
+
,
|
|
342
337
|
autoFocus: timePickerProps.autoFocus,
|
|
343
338
|
defaultIsOpen: timePickerProps.defaultIsOpen,
|
|
344
339
|
defaultValue: timePickerProps.defaultValue,
|
|
@@ -366,7 +361,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
366
361
|
times: timePickerProps.times,
|
|
367
362
|
value: timeValue
|
|
368
363
|
})), isClearable && !isDisabled ? /*#__PURE__*/React.createElement(Inline, {
|
|
369
|
-
xcss: iconContainerStyles
|
|
364
|
+
xcss: compiledStyles.iconContainerStyles
|
|
370
365
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
371
366
|
appearance: "subtle",
|
|
372
367
|
label: clearControlLabel,
|
|
@@ -17,7 +17,7 @@ import parseTime from '../internal/parse-time';
|
|
|
17
17
|
import { convertTokens } from '../internal/parse-tokens';
|
|
18
18
|
import { makeSingleValue } from '../internal/single-value';
|
|
19
19
|
var packageName = "@atlaskit/datetime-picker";
|
|
20
|
-
var packageVersion = "
|
|
20
|
+
var packageVersion = "17.0.1";
|
|
21
21
|
var menuStyles = {
|
|
22
22
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
23
23
|
position: 'static',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
._19itp69y{border:var(--_1p9iyo2)}
|
|
3
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
4
|
+
._v564r5cv{transition:background-color .2s ease-in-out,border-color .2s ease-in-out}
|
|
5
|
+
._1h6d13gt{border-color:var(--ds-border-disabled,#091e420f)}
|
|
6
|
+
._1h6d1bqt{border-color:var(--ds-border-danger,#e2483d)}
|
|
7
|
+
._1h6d1j28{border-color:transparent}
|
|
8
|
+
._1h6d1p6i{border-color:var(--ds-border-focused,#388bff)}._16qsic8z{box-shadow:var(--_1p9nqfm)}
|
|
9
|
+
._1e0c1txw{display:flex}
|
|
10
|
+
._bfhk1j28{background-color:transparent}
|
|
11
|
+
._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
|
|
12
|
+
._bfhk1y3p{background-color:var(--ds-background-input-pressed,transparent)}
|
|
13
|
+
._bfhkr01l{background-color:var(--ds-background-input-pressed,#fff)}
|
|
14
|
+
._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
|
|
15
|
+
._4cvx1bqt:hover{border-color:var(--ds-border-danger,#e2483d)}
|
|
16
|
+
._4cvx1elr:hover{border-color:var(--ds-border-input,#8590a2)}
|
|
17
|
+
._4cvx1j28:hover{border-color:transparent}
|
|
18
|
+
._d0al73ad:hover{cursor:default}
|
|
19
|
+
._d0altlke:hover{cursor:pointer}
|
|
20
|
+
._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
|
|
21
|
+
._irr31j28:hover{background-color:transparent}
|