@jetbrains/ring-ui-built 6.0.3 → 6.0.4
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/components/_helpers/_rollupPluginBabelHelpers.js +8 -11
- package/components/collapse/collapse-content.d.ts +11 -0
- package/components/collapse/collapse-content.js +121 -0
- package/components/collapse/collapse-context.d.ts +10 -0
- package/components/collapse/collapse-context.js +12 -0
- package/components/collapse/collapse-control.d.ts +11 -0
- package/components/collapse/collapse-control.js +38 -0
- package/components/collapse/collapse.d.ts +12 -0
- package/components/collapse/collapse.js +41 -0
- package/components/collapse/consts.d.ts +4 -0
- package/components/collapse/consts.js +6 -0
- package/components/collapse/utils.d.ts +1 -0
- package/components/collapse/utils.js +5 -0
- package/components/date-picker/consts.js +1 -1
- package/components/date-picker/date-picker.js +7 -7
- package/components/date-picker/date-popup.js +4 -4
- package/components/date-picker/day.js +9 -9
- package/components/date-picker/month-names.js +6 -6
- package/components/date-picker/month-slider.js +3 -3
- package/components/date-picker/month.js +5 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +4 -4
- package/components/date-picker/years.js +11 -11
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/style.css +1 -1
- package/package.json +4 -4
@@ -1,3 +1,11 @@
|
|
1
|
+
function _isNativeReflectConstruct() {
|
2
|
+
try {
|
3
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
4
|
+
} catch (t) {}
|
5
|
+
return (_isNativeReflectConstruct = function () {
|
6
|
+
return !!t;
|
7
|
+
})();
|
8
|
+
}
|
1
9
|
function _iterableToArrayLimit(r, l) {
|
2
10
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
3
11
|
if (null != t) {
|
@@ -470,17 +478,6 @@ function _setPrototypeOf(o, p) {
|
|
470
478
|
};
|
471
479
|
return _setPrototypeOf(o, p);
|
472
480
|
}
|
473
|
-
function _isNativeReflectConstruct() {
|
474
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
475
|
-
if (Reflect.construct.sham) return false;
|
476
|
-
if (typeof Proxy === "function") return true;
|
477
|
-
try {
|
478
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
479
|
-
return true;
|
480
|
-
} catch (e) {
|
481
|
-
return false;
|
482
|
-
}
|
483
|
-
}
|
484
481
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
485
482
|
if (source == null) return {};
|
486
483
|
var target = {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
2
|
+
type Props = {
|
3
|
+
minHeight?: number;
|
4
|
+
className?: string;
|
5
|
+
'data-test'?: string | null | undefined;
|
6
|
+
};
|
7
|
+
/**
|
8
|
+
* @name CollapseContent
|
9
|
+
*/
|
10
|
+
export declare const CollapseContent: React.FC<PropsWithChildren<Props>>;
|
11
|
+
export default CollapseContent;
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import { k as _slicedToArray } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { useContext, useRef, useState, useEffect, useMemo } from 'react';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import joinDataTestAttributes from '../global/data-tests.js';
|
5
|
+
import { getRect } from '../global/dom.js';
|
6
|
+
import { toPx } from './utils.js';
|
7
|
+
import { CollapseContext } from './collapse-context.js';
|
8
|
+
import { COLLAPSE_CONTENT_CONTAINER_TEST_ID, COLLAPSE_CONTENT_TEST_ID } from './consts.js';
|
9
|
+
import 'core-js/modules/es.array.reduce.js';
|
10
|
+
import 'core-js/modules/es.object.to-string.js';
|
11
|
+
import 'core-js/modules/es.object.entries.js';
|
12
|
+
import 'core-js/modules/es.array.concat.js';
|
13
|
+
import 'core-js/modules/es.object.assign.js';
|
14
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
15
|
+
import 'core-js/modules/es.array.filter.js';
|
16
|
+
import 'core-js/modules/es.regexp.exec.js';
|
17
|
+
import 'core-js/modules/es.string.split.js';
|
18
|
+
import 'core-js/modules/es.array.iterator.js';
|
19
|
+
import 'core-js/modules/es.set.js';
|
20
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
21
|
+
|
22
|
+
var modules_9c8b5b00 = {"container":"container_rui_88de","transition":"transition_rui_88de","summary":"summary_rui_88de","trigger":"trigger_rui_88de","fade":"fade_rui_88de"};
|
23
|
+
|
24
|
+
var DURATION_FACTOR = 0.5;
|
25
|
+
var DEFAULT_HEIGHT = 0;
|
26
|
+
var VISIBLE = 1;
|
27
|
+
var HIDDEN = 0;
|
28
|
+
/**
|
29
|
+
* @name CollapseContent
|
30
|
+
*/
|
31
|
+
var CollapseContent = function CollapseContent(_ref) {
|
32
|
+
var children = _ref.children,
|
33
|
+
_ref$minHeight = _ref.minHeight,
|
34
|
+
minHeight = _ref$minHeight === void 0 ? DEFAULT_HEIGHT : _ref$minHeight,
|
35
|
+
dataTest = _ref['data-test'];
|
36
|
+
var _useContext = useContext(CollapseContext),
|
37
|
+
collapsed = _useContext.collapsed,
|
38
|
+
duration = _useContext.duration,
|
39
|
+
id = _useContext.id,
|
40
|
+
disableAnimation = _useContext.disableAnimation;
|
41
|
+
var containerRef = useRef(null);
|
42
|
+
var contentRef = useRef(null);
|
43
|
+
var initialContentHeight = useRef(minHeight);
|
44
|
+
var contentHeight = useRef(DEFAULT_HEIGHT);
|
45
|
+
var _useState = useState({
|
46
|
+
width: 0,
|
47
|
+
height: 0
|
48
|
+
}),
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
50
|
+
dimensions = _useState2[0],
|
51
|
+
setDimensions = _useState2[1];
|
52
|
+
var _useState3 = useState(toPx(minHeight)),
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
54
|
+
height = _useState4[0],
|
55
|
+
setHeight = _useState4[1];
|
56
|
+
var _useState5 = useState(true),
|
57
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
58
|
+
showFade = _useState6[0],
|
59
|
+
setShowFade = _useState6[1];
|
60
|
+
useEffect(function () {
|
61
|
+
if (!collapsed) {
|
62
|
+
setShowFade(false);
|
63
|
+
} else {
|
64
|
+
setShowFade(true);
|
65
|
+
}
|
66
|
+
}, [collapsed]);
|
67
|
+
useEffect(function () {
|
68
|
+
if (contentRef.current) {
|
69
|
+
contentHeight.current = getRect(contentRef.current).height;
|
70
|
+
}
|
71
|
+
}, [minHeight, dimensions.height]);
|
72
|
+
useEffect(function () {
|
73
|
+
var nextHeight = collapsed ? initialContentHeight.current : contentHeight.current;
|
74
|
+
setHeight(toPx(nextHeight));
|
75
|
+
}, [collapsed, dimensions.height]);
|
76
|
+
useEffect(function () {
|
77
|
+
if (contentRef.current) {
|
78
|
+
var observer = new ResizeObserver(function (_ref2) {
|
79
|
+
var _ref3 = _slicedToArray(_ref2, 1),
|
80
|
+
entry = _ref3[0];
|
81
|
+
if (entry && entry.borderBoxSize) {
|
82
|
+
var _entry$borderBoxSize$ = entry.borderBoxSize[0],
|
83
|
+
inlineSize = _entry$borderBoxSize$.inlineSize,
|
84
|
+
blockSize = _entry$borderBoxSize$.blockSize;
|
85
|
+
setDimensions({
|
86
|
+
width: inlineSize,
|
87
|
+
height: blockSize
|
88
|
+
});
|
89
|
+
}
|
90
|
+
});
|
91
|
+
observer.observe(contentRef.current);
|
92
|
+
}
|
93
|
+
}, []);
|
94
|
+
var style = useMemo(function () {
|
95
|
+
var calculatedDuration = duration + contentHeight.current * DURATION_FACTOR;
|
96
|
+
return {
|
97
|
+
'--duration': "".concat(calculatedDuration, "ms"),
|
98
|
+
height,
|
99
|
+
opacity: collapsed && !minHeight ? HIDDEN : VISIBLE
|
100
|
+
};
|
101
|
+
}, [duration, height, collapsed, minHeight]);
|
102
|
+
var fadeShouldBeVisible = useMemo(function () {
|
103
|
+
return Boolean(minHeight && showFade);
|
104
|
+
}, [minHeight, showFade]);
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
106
|
+
ref: containerRef,
|
107
|
+
id: "collapse-content-".concat(id),
|
108
|
+
"data-test": joinDataTestAttributes(COLLAPSE_CONTENT_CONTAINER_TEST_ID),
|
109
|
+
className: classNames(modules_9c8b5b00.container, {
|
110
|
+
[modules_9c8b5b00.transition]: !disableAnimation
|
111
|
+
}),
|
112
|
+
style: style
|
113
|
+
}, /*#__PURE__*/React.createElement("div", {
|
114
|
+
ref: contentRef,
|
115
|
+
"data-test": joinDataTestAttributes(COLLAPSE_CONTENT_TEST_ID, dataTest)
|
116
|
+
}, children), fadeShouldBeVisible && /*#__PURE__*/React.createElement("div", {
|
117
|
+
className: modules_9c8b5b00.fade
|
118
|
+
}));
|
119
|
+
};
|
120
|
+
|
121
|
+
export { CollapseContent, CollapseContent as default };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface CollapseContextInterface {
|
3
|
+
collapsed: boolean;
|
4
|
+
duration: number;
|
5
|
+
disableAnimation: boolean;
|
6
|
+
setCollapsed: () => void;
|
7
|
+
id: string;
|
8
|
+
}
|
9
|
+
export declare const CollapseContext: import("react").Context<CollapseContextInterface>;
|
10
|
+
export default CollapseContext;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { createContext } from 'react';
|
2
|
+
import { BASE_ANIMATION_DURATION } from './consts.js';
|
3
|
+
|
4
|
+
var CollapseContext = /*#__PURE__*/createContext({
|
5
|
+
collapsed: true,
|
6
|
+
duration: BASE_ANIMATION_DURATION,
|
7
|
+
disableAnimation: false,
|
8
|
+
setCollapsed: function setCollapsed() {},
|
9
|
+
id: ''
|
10
|
+
});
|
11
|
+
|
12
|
+
export { CollapseContext, CollapseContext as default };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
type ChildrenFunction = (collapsed: boolean) => React.ReactNode;
|
3
|
+
type Props = {
|
4
|
+
children: ChildrenFunction | React.ReactNode;
|
5
|
+
'data-test'?: string | null | undefined;
|
6
|
+
};
|
7
|
+
/**
|
8
|
+
* @name CollapseControl
|
9
|
+
*/
|
10
|
+
export declare const CollapseControl: React.FC<Props>;
|
11
|
+
export default CollapseControl;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React, { useContext, useMemo, cloneElement } from 'react';
|
2
|
+
import joinDataTestAttributes from '../global/data-tests.js';
|
3
|
+
import { CollapseContext } from './collapse-context.js';
|
4
|
+
import { COLLAPSE_CONTROL_TEST_ID } from './consts.js';
|
5
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
6
|
+
import 'core-js/modules/es.array.reduce.js';
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/es.object.entries.js';
|
9
|
+
import 'core-js/modules/es.array.concat.js';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @name CollapseControl
|
13
|
+
*/
|
14
|
+
var CollapseControl = function CollapseControl(_ref) {
|
15
|
+
var children = _ref.children,
|
16
|
+
dataTest = _ref['data-test'];
|
17
|
+
var _useContext = useContext(CollapseContext),
|
18
|
+
setCollapsed = _useContext.setCollapsed,
|
19
|
+
collapsed = _useContext.collapsed,
|
20
|
+
id = _useContext.id;
|
21
|
+
var child = useMemo(function () {
|
22
|
+
if (typeof children === 'function') {
|
23
|
+
return /*#__PURE__*/React.createElement("p", {
|
24
|
+
"data-test": joinDataTestAttributes(COLLAPSE_CONTROL_TEST_ID, dataTest)
|
25
|
+
}, children(collapsed));
|
26
|
+
}
|
27
|
+
return /*#__PURE__*/React.createElement("p", {
|
28
|
+
"data-test": joinDataTestAttributes(COLLAPSE_CONTROL_TEST_ID, dataTest)
|
29
|
+
}, children);
|
30
|
+
}, [children, collapsed, dataTest]);
|
31
|
+
return /*#__PURE__*/cloneElement(child, {
|
32
|
+
onClick: setCollapsed,
|
33
|
+
'aria-controls': "collapse-content-".concat(id),
|
34
|
+
'aria-expanded': String(!collapsed)
|
35
|
+
});
|
36
|
+
};
|
37
|
+
|
38
|
+
export { CollapseControl, CollapseControl as default };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
2
|
+
type Props = {
|
3
|
+
onChange?: (collapsed: boolean) => void;
|
4
|
+
duration?: number;
|
5
|
+
disableAnimation?: boolean;
|
6
|
+
className?: string;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* @name Collapse
|
10
|
+
*/
|
11
|
+
export declare const Collapse: React.FC<PropsWithChildren<Props>>;
|
12
|
+
export default Collapse;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { k as _slicedToArray } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { useState, useId, useCallback } from 'react';
|
3
|
+
import { CollapseContext } from './collapse-context.js';
|
4
|
+
import { BASE_ANIMATION_DURATION } from './consts.js';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @name Collapse
|
8
|
+
*/
|
9
|
+
var Collapse = function Collapse(_ref) {
|
10
|
+
var children = _ref.children,
|
11
|
+
_ref$duration = _ref.duration,
|
12
|
+
duration = _ref$duration === void 0 ? BASE_ANIMATION_DURATION : _ref$duration,
|
13
|
+
_ref$disableAnimation = _ref.disableAnimation,
|
14
|
+
disableAnimation = _ref$disableAnimation === void 0 ? false : _ref$disableAnimation,
|
15
|
+
_ref$className = _ref.className,
|
16
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
17
|
+
_ref$onChange = _ref.onChange,
|
18
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
19
|
+
var _useState = useState(true),
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
21
|
+
collapsed = _useState2[0],
|
22
|
+
toggle = _useState2[1];
|
23
|
+
var id = useId();
|
24
|
+
var setCollapsed = useCallback(function () {
|
25
|
+
toggle(!collapsed);
|
26
|
+
onChange(!collapsed);
|
27
|
+
}, [toggle, onChange, collapsed]);
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
29
|
+
className: className
|
30
|
+
}, /*#__PURE__*/React.createElement(CollapseContext.Provider, {
|
31
|
+
value: {
|
32
|
+
collapsed,
|
33
|
+
setCollapsed,
|
34
|
+
duration,
|
35
|
+
disableAnimation,
|
36
|
+
id
|
37
|
+
}
|
38
|
+
}, children));
|
39
|
+
};
|
40
|
+
|
41
|
+
export { Collapse, Collapse as default };
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export declare const COLLAPSE_CONTROL_TEST_ID = "ring-collapse-control";
|
2
|
+
export declare const COLLAPSE_CONTENT_CONTAINER_TEST_ID = "ring-collapse-content-container";
|
3
|
+
export declare const COLLAPSE_CONTENT_TEST_ID = "ring-collapse-content";
|
4
|
+
export declare const BASE_ANIMATION_DURATION = 200;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
var COLLAPSE_CONTROL_TEST_ID = 'ring-collapse-control';
|
2
|
+
var COLLAPSE_CONTENT_CONTAINER_TEST_ID = 'ring-collapse-content-container';
|
3
|
+
var COLLAPSE_CONTENT_TEST_ID = 'ring-collapse-content';
|
4
|
+
var BASE_ANIMATION_DURATION = 200;
|
5
|
+
|
6
|
+
export { BASE_ANIMATION_DURATION, COLLAPSE_CONTENT_CONTAINER_TEST_ID, COLLAPSE_CONTENT_TEST_ID, COLLAPSE_CONTROL_TEST_ID };
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const toPx: (value: number) => string;
|
@@ -5,13 +5,13 @@ import 'core-js/modules/es.array.map.js';
|
|
5
5
|
import React, { PureComponent } from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import classNames from 'classnames';
|
8
|
-
import format from 'date-fns/format';
|
9
|
-
import isSameDay from 'date-fns/isSameDay';
|
10
|
-
import isSameMonth from 'date-fns/isSameMonth';
|
11
|
-
import isSameYear from 'date-fns/isSameYear';
|
12
|
-
import isValid from 'date-fns/isValid';
|
13
|
-
import parse from 'date-fns/parse';
|
14
|
-
import set from 'date-fns/set';
|
8
|
+
import { format } from 'date-fns/format';
|
9
|
+
import { isSameDay } from 'date-fns/isSameDay';
|
10
|
+
import { isSameMonth } from 'date-fns/isSameMonth';
|
11
|
+
import { isSameYear } from 'date-fns/isSameYear';
|
12
|
+
import { isValid } from 'date-fns/isValid';
|
13
|
+
import { parse } from 'date-fns/parse';
|
14
|
+
import { set } from 'date-fns/set';
|
15
15
|
import calendarIcon from '@jetbrains/icons/calendar';
|
16
16
|
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
17
17
|
import memoize from '../global/memoize.js';
|
@@ -4,10 +4,10 @@ import 'core-js/modules/es.object.to-string.js';
|
|
4
4
|
import 'core-js/modules/es.array.map.js';
|
5
5
|
import React, { Component } from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
|
-
import isAfter from 'date-fns/isAfter';
|
8
|
-
import isBefore from 'date-fns/isBefore';
|
9
|
-
import isSameDay from 'date-fns/isSameDay';
|
10
|
-
import startOfDay from 'date-fns/startOfDay';
|
7
|
+
import { isAfter } from 'date-fns/isAfter';
|
8
|
+
import { isBefore } from 'date-fns/isBefore';
|
9
|
+
import { isSameDay } from 'date-fns/isSameDay';
|
10
|
+
import { startOfDay } from 'date-fns/startOfDay';
|
11
11
|
import { set } from 'date-fns';
|
12
12
|
import memoize from '../global/memoize.js';
|
13
13
|
import DateInput from './date-input.js';
|
@@ -6,15 +6,15 @@ import 'core-js/modules/es.string.includes.js';
|
|
6
6
|
import React, { Component } from 'react';
|
7
7
|
import PropTypes from 'prop-types';
|
8
8
|
import classNames from 'classnames';
|
9
|
-
import addDays from 'date-fns/addDays';
|
10
|
-
import format from 'date-fns/format';
|
11
|
-
import getDay from 'date-fns/getDay';
|
12
|
-
import getDate from 'date-fns/getDate';
|
13
|
-
import isAfter from 'date-fns/isAfter';
|
14
|
-
import isBefore from 'date-fns/isBefore';
|
15
|
-
import isSameDay from 'date-fns/isSameDay';
|
16
|
-
import isToday from 'date-fns/isToday';
|
17
|
-
import startOfDay from 'date-fns/startOfDay';
|
9
|
+
import { addDays } from 'date-fns/addDays';
|
10
|
+
import { format } from 'date-fns/format';
|
11
|
+
import { getDay } from 'date-fns/getDay';
|
12
|
+
import { getDate } from 'date-fns/getDate';
|
13
|
+
import { isAfter } from 'date-fns/isAfter';
|
14
|
+
import { isBefore } from 'date-fns/isBefore';
|
15
|
+
import { isSameDay } from 'date-fns/isSameDay';
|
16
|
+
import { isToday } from 'date-fns/isToday';
|
17
|
+
import { startOfDay } from 'date-fns/startOfDay';
|
18
18
|
import { dateType, weekdays } from './consts.js';
|
19
19
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
20
20
|
import 'core-js/modules/es.regexp.exec.js';
|
@@ -4,12 +4,12 @@ import 'core-js/modules/es.array.map.js';
|
|
4
4
|
import React, { PureComponent } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
7
|
-
import endOfMonth from 'date-fns/endOfMonth';
|
8
|
-
import format from 'date-fns/format';
|
9
|
-
import isThisMonth from 'date-fns/isThisMonth';
|
10
|
-
import set from 'date-fns/set';
|
11
|
-
import startOfDay from 'date-fns/startOfDay';
|
12
|
-
import startOfYear from 'date-fns/startOfYear';
|
7
|
+
import { endOfMonth } from 'date-fns/endOfMonth';
|
8
|
+
import { format } from 'date-fns/format';
|
9
|
+
import { isThisMonth } from 'date-fns/isThisMonth';
|
10
|
+
import { set } from 'date-fns/set';
|
11
|
+
import { startOfDay } from 'date-fns/startOfDay';
|
12
|
+
import { startOfYear } from 'date-fns/startOfYear';
|
13
13
|
import linearFunction from '../global/linear-function.js';
|
14
14
|
import MonthSlider from './month-slider.js';
|
15
15
|
import { dateType, YEAR, MIDDLE_DAY, yearScrollSpeed } from './consts.js';
|
@@ -4,9 +4,9 @@ import 'core-js/modules/es.array.map.js';
|
|
4
4
|
import React, { PureComponent } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
7
|
-
import addYears from 'date-fns/addYears';
|
8
|
-
import startOfDay from 'date-fns/startOfDay';
|
9
|
-
import subYears from 'date-fns/subYears';
|
7
|
+
import { addYears } from 'date-fns/addYears';
|
8
|
+
import { startOfDay } from 'date-fns/startOfDay';
|
9
|
+
import { subYears } from 'date-fns/subYears';
|
10
10
|
import linearFunction from '../global/linear-function.js';
|
11
11
|
import units, { dateType, yearScrollSpeed } from './consts.js';
|
12
12
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { i as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.map.js';
|
3
3
|
import React from 'react';
|
4
|
-
import addDays from 'date-fns/addDays';
|
5
|
-
import endOfMonth from 'date-fns/endOfMonth';
|
6
|
-
import format from 'date-fns/format';
|
7
|
-
import getDay from 'date-fns/getDay';
|
8
|
-
import setDay from 'date-fns/setDay';
|
4
|
+
import { addDays } from 'date-fns/addDays';
|
5
|
+
import { endOfMonth } from 'date-fns/endOfMonth';
|
6
|
+
import { format } from 'date-fns/format';
|
7
|
+
import { getDay } from 'date-fns/getDay';
|
8
|
+
import { setDay } from 'date-fns/setDay';
|
9
9
|
import PropTypes from 'prop-types';
|
10
10
|
import Day from './day.js';
|
11
11
|
import { dateType, weekdays, WEEK } from './consts.js';
|
@@ -2,12 +2,12 @@ import { i as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import 'core-js/modules/es.array.map.js';
|
3
3
|
import React, { useMemo, useRef, useEffect } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
|
-
import addMonths from 'date-fns/addMonths';
|
6
|
-
import getDay from 'date-fns/getDay';
|
7
|
-
import getDaysInMonth from 'date-fns/getDaysInMonth';
|
8
|
-
import startOfMonth from 'date-fns/startOfMonth';
|
9
|
-
import subMonths from 'date-fns/subMonths';
|
10
|
-
import endOfMonth from 'date-fns/endOfMonth';
|
5
|
+
import { addMonths } from 'date-fns/addMonths';
|
6
|
+
import { getDay } from 'date-fns/getDay';
|
7
|
+
import { getDaysInMonth } from 'date-fns/getDaysInMonth';
|
8
|
+
import { startOfMonth } from 'date-fns/startOfMonth';
|
9
|
+
import { subMonths } from 'date-fns/subMonths';
|
10
|
+
import { endOfMonth } from 'date-fns/endOfMonth';
|
11
11
|
import scheduleRAF from '../global/schedule-raf.js';
|
12
12
|
import linearFunction from '../global/linear-function.js';
|
13
13
|
import useEventCallback from '../global/use-event-callback.js';
|
@@ -4,10 +4,10 @@ import 'core-js/modules/es.array.includes.js';
|
|
4
4
|
import 'core-js/modules/es.string.includes.js';
|
5
5
|
import React from 'react';
|
6
6
|
import classNames from 'classnames';
|
7
|
-
import getDay from 'date-fns/getDay';
|
8
|
-
import format from 'date-fns/format';
|
9
|
-
import setDay from 'date-fns/setDay';
|
10
|
-
import startOfDay from 'date-fns/startOfDay';
|
7
|
+
import { getDay } from 'date-fns/getDay';
|
8
|
+
import { format } from 'date-fns/format';
|
9
|
+
import { setDay } from 'date-fns/setDay';
|
10
|
+
import { startOfDay } from 'date-fns/startOfDay';
|
11
11
|
import PropTypes from 'prop-types';
|
12
12
|
import { weekdays } from './consts.js';
|
13
13
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
@@ -4,14 +4,14 @@ import 'core-js/modules/es.array.map.js';
|
|
4
4
|
import React, { createRef, PureComponent } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
7
|
-
import addYears from 'date-fns/addYears';
|
8
|
-
import getYear from 'date-fns/getYear';
|
9
|
-
import format from 'date-fns/format';
|
10
|
-
import isSameYear from 'date-fns/isSameYear';
|
11
|
-
import isThisYear from 'date-fns/isThisYear';
|
12
|
-
import
|
13
|
-
import startOfYear from 'date-fns/startOfYear';
|
14
|
-
import subYears from 'date-fns/subYears';
|
7
|
+
import { addYears } from 'date-fns/addYears';
|
8
|
+
import { getYear } from 'date-fns/getYear';
|
9
|
+
import { format } from 'date-fns/format';
|
10
|
+
import { isSameYear } from 'date-fns/isSameYear';
|
11
|
+
import { isThisYear } from 'date-fns/isThisYear';
|
12
|
+
import { setYear } from 'date-fns/setYear';
|
13
|
+
import { startOfYear } from 'date-fns/startOfYear';
|
14
|
+
import { subYears } from 'date-fns/subYears';
|
15
15
|
import linearFunction from '../global/linear-function.js';
|
16
16
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
17
17
|
import units, { dateType, yearDuration, DOUBLE, HALF } from './consts.js';
|
@@ -76,7 +76,7 @@ var Years = /*#__PURE__*/function (_PureComponent) {
|
|
76
76
|
}
|
77
77
|
}, {
|
78
78
|
key: "setYear",
|
79
|
-
value: function setYear(date) {
|
79
|
+
value: function setYear$1(date) {
|
80
80
|
if (scrollTO) {
|
81
81
|
window.clearTimeout(scrollTO);
|
82
82
|
scrollTO = null;
|
@@ -84,7 +84,7 @@ var Years = /*#__PURE__*/function (_PureComponent) {
|
|
84
84
|
this.setState({
|
85
85
|
scrollDate: null
|
86
86
|
});
|
87
|
-
this.props.onScroll(Number(
|
87
|
+
this.props.onScroll(Number(setYear(this.props.scrollDate, getYear(date))));
|
88
88
|
}
|
89
89
|
}, {
|
90
90
|
key: "render",
|
@@ -117,7 +117,7 @@ var Years = /*#__PURE__*/function (_PureComponent) {
|
|
117
117
|
[modules_0c7b7d96.today]: isThisYear(item)
|
118
118
|
}),
|
119
119
|
onClick: function handleClick() {
|
120
|
-
onScrollChange(Number(
|
120
|
+
onScrollChange(Number(setYear(scrollDate, getYear(item))));
|
121
121
|
}
|
122
122
|
}, format(item, 'yyyy'));
|
123
123
|
}));
|
@@ -11,11 +11,11 @@ var MAJOR_VERSION_INDEX = 0;
|
|
11
11
|
/**
|
12
12
|
* SUPPORTED_BROWSERS are defined by Babel plugin, see babel config
|
13
13
|
*/
|
14
|
-
if (!["and_chr
|
14
|
+
if (!["and_chr 121", "chrome 121", "chrome 120", "chrome 119", "chrome 109", "edge 120", "firefox 121", "ios_saf 17.2", "ios_saf 17.1", "ios_saf 16.6-16.7", "op_mob 73", "samsung 23"]) {
|
15
15
|
// eslint-disable-next-line no-console
|
16
16
|
console.warn('Ring UI: no SUPPORTED_BROWSERS passed. Please check babel config.');
|
17
17
|
}
|
18
|
-
var SUPPORTED = ["and_chr
|
18
|
+
var SUPPORTED = ["and_chr 121", "chrome 121", "chrome 120", "chrome 119", "chrome 109", "edge 120", "firefox 121", "ios_saf 17.2", "ios_saf 17.1", "ios_saf 16.6-16.7", "op_mob 73", "samsung 23"] || [];
|
19
19
|
var WHITE_LISTED_BROWSERS = ['chrome', 'firefox', 'safari', 'edge'];
|
20
20
|
var WHITE_LIST = SUPPORTED.reduce(function (acc, item) {
|
21
21
|
var _item$match;
|