@alfalab/core-components 23.12.0-beta.1 → 23.12.0-beta.2
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/calendar/Component.js +1 -1
- package/calendar/components/days-table/Component.js +1 -1
- package/calendar/components/days-table/index.js +1 -1
- package/calendar/components/months-table/Component.js +1 -1
- package/calendar/components/months-table/index.js +1 -1
- package/calendar/components/period-slider/Component.d.ts +1 -1
- package/calendar/components/period-slider/Component.js +42 -26
- package/calendar/components/period-slider/index.css +3 -0
- package/calendar/components/period-slider/index.js +1 -1
- package/calendar/components/select-button/Component.js +1 -1
- package/calendar/components/select-button/index.js +1 -1
- package/calendar/components/years-table/Component.js +1 -1
- package/calendar/components/years-table/index.js +1 -1
- package/calendar/cssm/components/period-slider/Component.d.ts +1 -1
- package/calendar/cssm/components/period-slider/Component.js +40 -24
- package/calendar/cssm/components/period-slider/index.module.css +3 -0
- package/calendar/esm/Component.js +1 -1
- package/calendar/esm/components/days-table/Component.js +1 -1
- package/calendar/esm/components/days-table/index.js +1 -1
- package/calendar/esm/components/months-table/Component.js +1 -1
- package/calendar/esm/components/months-table/index.js +1 -1
- package/calendar/esm/components/period-slider/Component.d.ts +1 -1
- package/calendar/esm/components/period-slider/Component.js +44 -28
- package/calendar/esm/components/period-slider/index.css +3 -0
- package/calendar/esm/components/period-slider/index.js +1 -1
- package/calendar/esm/components/select-button/Component.js +1 -1
- package/calendar/esm/components/select-button/index.js +1 -1
- package/calendar/esm/components/years-table/Component.js +1 -1
- package/calendar/esm/components/years-table/index.js +1 -1
- package/calendar/esm/index.js +1 -1
- package/calendar/esm/tslib.es6-e343fc3f.d.ts +32 -0
- package/calendar/esm/tslib.es6-e343fc3f.js +40 -0
- package/calendar/index.js +1 -1
- package/calendar/modern/components/period-slider/Component.d.ts +1 -1
- package/calendar/modern/components/period-slider/Component.js +39 -24
- package/calendar/modern/components/period-slider/index.css +3 -0
- package/calendar/tslib.es6-4ab2b8f8.d.ts +32 -0
- package/calendar/tslib.es6-4ab2b8f8.js +40 -0
- package/package.json +1 -1
package/calendar/Component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./tslib.es6-
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-4ab2b8f8.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var dateFns = require('date-fns');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
3
|
+
var tslib_es6 = require('../../tslib.es6-4ab2b8f8.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var dateFns = require('date-fns');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
3
|
+
var tslib_es6 = require('../../tslib.es6-4ab2b8f8.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
require('classnames');
|
|
6
6
|
var dateFns = require('date-fns');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
require('../../tslib.es6-
|
|
3
|
+
require('../../tslib.es6-4ab2b8f8.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var dateFns = require('date-fns');
|
|
@@ -14,29 +14,37 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
15
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
16
16
|
|
|
17
|
-
var styles = {"component":"calendar__component_s40ku","month":"calendar__month_s40ku","year":"calendar__year_s40ku","buttonContent":"calendar__buttonContent_s40ku","period":"calendar__period_s40ku","upDownIcon":"calendar__upDownIcon_s40ku","arrow":"calendar__arrow_s40ku","full":"calendar__full_s40ku"};
|
|
17
|
+
var styles = {"component":"calendar__component_s40ku","month":"calendar__month_s40ku","year":"calendar__year_s40ku","buttonContent":"calendar__buttonContent_s40ku","period":"calendar__period_s40ku","empty":"calendar__empty_s40ku","upDownIcon":"calendar__upDownIcon_s40ku","arrow":"calendar__arrow_s40ku","full":"calendar__full_s40ku"};
|
|
18
18
|
require('./index.css');
|
|
19
19
|
|
|
20
20
|
var PeriodSlider = function (_a) {
|
|
21
|
-
var _b
|
|
22
|
-
var value = _a.value,
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
valueFrom = dateFns.startOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
32
|
-
valueTo = dateFns.endOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
21
|
+
var _b;
|
|
22
|
+
var value = _a.value, _c = _a.view, view = _c === void 0 ? 'month-only' : _c, _d = _a.periodType, periodType = _d === void 0 ? 'month' : _d, className = _a.className, _e = _a.periodFormatter, periodFormatter = _e === void 0 ? components_periodSlider_utils.formatPeriod : _e, _f = _a.prevArrowDisabled, prevArrowDisabled = _f === void 0 ? false : _f, _g = _a.nextArrowDisabled, nextArrowDisabled = _g === void 0 ? false : _g, _h = _a.hideDisabledArrows, hideDisabledArrows = _h === void 0 ? false : _h, _j = _a.onPrevArrowClick, onPrevArrowClick = _j === void 0 ? function () { return null; } : _j, _k = _a.onNextArrowClick, onNextArrowClick = _k === void 0 ? function () { return null; } : _k, onMonthClick = _a.onMonthClick, onYearClick = _a.onYearClick, dataTestId = _a.dataTestId;
|
|
23
|
+
var _l = React.useMemo(function () {
|
|
24
|
+
var _a;
|
|
25
|
+
var from;
|
|
26
|
+
var to;
|
|
27
|
+
if (!value)
|
|
28
|
+
return [undefined, undefined];
|
|
29
|
+
if (Array.isArray(value)) {
|
|
30
|
+
from = value[0], to = value[1];
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
else {
|
|
33
|
+
_a = [value, value], from = _a[0], to = _a[1];
|
|
34
|
+
if (periodType === 'week') {
|
|
35
|
+
from = dateFns.startOfWeek(from, { weekStartsOn: 1 });
|
|
36
|
+
to = dateFns.endOfWeek(from, { weekStartsOn: 1 });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [from, to];
|
|
40
|
+
}, [periodType, value]), valueFrom = _l[0], valueTo = _l[1];
|
|
41
|
+
var month = valueFrom ? utils.monthName(valueFrom) : undefined;
|
|
42
|
+
var year = valueFrom ? valueFrom.getFullYear().toString() : undefined;
|
|
43
|
+
var showPrevButton = !(hideDisabledArrows && (prevArrowDisabled || !valueFrom));
|
|
44
|
+
var showNextButton = !(hideDisabledArrows && (nextArrowDisabled || !valueFrom));
|
|
39
45
|
var handleNextArrowClick = function (event) {
|
|
46
|
+
if (!valueFrom || !valueTo)
|
|
47
|
+
return;
|
|
40
48
|
var newValues = components_periodSlider_utils.shiftValues(valueFrom, valueTo, periodType, 'next');
|
|
41
49
|
onNextArrowClick(event, {
|
|
42
50
|
value: newValues.valueFrom,
|
|
@@ -46,6 +54,8 @@ var PeriodSlider = function (_a) {
|
|
|
46
54
|
});
|
|
47
55
|
};
|
|
48
56
|
var handlePrevArrowClick = function (event) {
|
|
57
|
+
if (!valueFrom || !valueTo)
|
|
58
|
+
return;
|
|
49
59
|
var newValues = components_periodSlider_utils.shiftValues(valueFrom, valueTo, periodType, 'prev');
|
|
50
60
|
onPrevArrowClick(event, {
|
|
51
61
|
value: newValues.valueFrom,
|
|
@@ -54,11 +64,11 @@ var PeriodSlider = function (_a) {
|
|
|
54
64
|
periodType: periodType,
|
|
55
65
|
});
|
|
56
66
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
view === 'full' ? (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
67
|
+
var renderHeader = function () {
|
|
68
|
+
if (!valueFrom || !valueTo) {
|
|
69
|
+
return React__default['default'].createElement("span", { className: cn__default['default'](styles.period, styles.empty) }, "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434");
|
|
70
|
+
}
|
|
71
|
+
return view === 'full' ? (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
62
72
|
React__default['default'].createElement(components_selectButton_Component.SelectButton, { view: 'filled', className: styles.month, onClick: onMonthClick },
|
|
63
73
|
React__default['default'].createElement("span", { className: styles.buttonContent },
|
|
64
74
|
month,
|
|
@@ -66,8 +76,14 @@ var PeriodSlider = function (_a) {
|
|
|
66
76
|
React__default['default'].createElement(components_selectButton_Component.SelectButton, { view: 'filled', className: styles.year, onClick: onYearClick },
|
|
67
77
|
React__default['default'].createElement("span", { className: styles.buttonContent },
|
|
68
78
|
year,
|
|
69
|
-
React__default['default'].createElement("span", { className: styles.upDownIcon }))))) : (React__default['default'].createElement("span", { className: styles.period }, periodFormatter(valueFrom, valueTo, periodType)))
|
|
70
|
-
|
|
79
|
+
React__default['default'].createElement("span", { className: styles.upDownIcon }))))) : (React__default['default'].createElement("span", { className: styles.period }, periodFormatter(valueFrom, valueTo, periodType)));
|
|
80
|
+
};
|
|
81
|
+
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.component, className, (_b = {},
|
|
82
|
+
_b[styles.full] = view === 'full',
|
|
83
|
+
_b)), "aria-live": 'polite', "data-test-id": dataTestId },
|
|
84
|
+
showPrevButton && (React__default['default'].createElement(coreComponentsButton.Button, { view: 'ghost', className: styles.arrow, onClick: handlePrevArrowClick, disabled: prevArrowDisabled || !valueFrom, "aria-label": '\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' })),
|
|
85
|
+
renderHeader(),
|
|
86
|
+
showNextButton && (React__default['default'].createElement(coreComponentsButton.Button, { view: 'ghost', className: styles.arrow, onClick: handleNextArrowClick, disabled: nextArrowDisabled || !valueFrom, "aria-label": '\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' }))));
|
|
71
87
|
};
|
|
72
88
|
|
|
73
89
|
exports.PeriodSlider = PeriodSlider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
3
|
+
var tslib_es6 = require('../../tslib.es6-4ab2b8f8.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var coreComponentsButton = require('../../../button');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
3
|
+
var tslib_es6 = require('../../tslib.es6-4ab2b8f8.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
require('classnames');
|
|
6
6
|
var dateFns = require('date-fns');
|
|
@@ -18,25 +18,33 @@ var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
|
18
18
|
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
19
19
|
|
|
20
20
|
var PeriodSlider = function (_a) {
|
|
21
|
-
var _b
|
|
22
|
-
var value = _a.value,
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
valueFrom = dateFns.startOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
32
|
-
valueTo = dateFns.endOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
21
|
+
var _b;
|
|
22
|
+
var value = _a.value, _c = _a.view, view = _c === void 0 ? 'month-only' : _c, _d = _a.periodType, periodType = _d === void 0 ? 'month' : _d, className = _a.className, _e = _a.periodFormatter, periodFormatter = _e === void 0 ? components_periodSlider_utils.formatPeriod : _e, _f = _a.prevArrowDisabled, prevArrowDisabled = _f === void 0 ? false : _f, _g = _a.nextArrowDisabled, nextArrowDisabled = _g === void 0 ? false : _g, _h = _a.hideDisabledArrows, hideDisabledArrows = _h === void 0 ? false : _h, _j = _a.onPrevArrowClick, onPrevArrowClick = _j === void 0 ? function () { return null; } : _j, _k = _a.onNextArrowClick, onNextArrowClick = _k === void 0 ? function () { return null; } : _k, onMonthClick = _a.onMonthClick, onYearClick = _a.onYearClick, dataTestId = _a.dataTestId;
|
|
23
|
+
var _l = React.useMemo(function () {
|
|
24
|
+
var _a;
|
|
25
|
+
var from;
|
|
26
|
+
var to;
|
|
27
|
+
if (!value)
|
|
28
|
+
return [undefined, undefined];
|
|
29
|
+
if (Array.isArray(value)) {
|
|
30
|
+
from = value[0], to = value[1];
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
else {
|
|
33
|
+
_a = [value, value], from = _a[0], to = _a[1];
|
|
34
|
+
if (periodType === 'week') {
|
|
35
|
+
from = dateFns.startOfWeek(from, { weekStartsOn: 1 });
|
|
36
|
+
to = dateFns.endOfWeek(from, { weekStartsOn: 1 });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [from, to];
|
|
40
|
+
}, [periodType, value]), valueFrom = _l[0], valueTo = _l[1];
|
|
41
|
+
var month = valueFrom ? utils.monthName(valueFrom) : undefined;
|
|
42
|
+
var year = valueFrom ? valueFrom.getFullYear().toString() : undefined;
|
|
43
|
+
var showPrevButton = !(hideDisabledArrows && (prevArrowDisabled || !valueFrom));
|
|
44
|
+
var showNextButton = !(hideDisabledArrows && (nextArrowDisabled || !valueFrom));
|
|
39
45
|
var handleNextArrowClick = function (event) {
|
|
46
|
+
if (!valueFrom || !valueTo)
|
|
47
|
+
return;
|
|
40
48
|
var newValues = components_periodSlider_utils.shiftValues(valueFrom, valueTo, periodType, 'next');
|
|
41
49
|
onNextArrowClick(event, {
|
|
42
50
|
value: newValues.valueFrom,
|
|
@@ -46,6 +54,8 @@ var PeriodSlider = function (_a) {
|
|
|
46
54
|
});
|
|
47
55
|
};
|
|
48
56
|
var handlePrevArrowClick = function (event) {
|
|
57
|
+
if (!valueFrom || !valueTo)
|
|
58
|
+
return;
|
|
49
59
|
var newValues = components_periodSlider_utils.shiftValues(valueFrom, valueTo, periodType, 'prev');
|
|
50
60
|
onPrevArrowClick(event, {
|
|
51
61
|
value: newValues.valueFrom,
|
|
@@ -54,11 +64,11 @@ var PeriodSlider = function (_a) {
|
|
|
54
64
|
periodType: periodType,
|
|
55
65
|
});
|
|
56
66
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
view === 'full' ? (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
67
|
+
var renderHeader = function () {
|
|
68
|
+
if (!valueFrom || !valueTo) {
|
|
69
|
+
return React__default['default'].createElement("span", { className: cn__default['default'](styles__default['default'].period, styles__default['default'].empty) }, "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434");
|
|
70
|
+
}
|
|
71
|
+
return view === 'full' ? (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
62
72
|
React__default['default'].createElement(components_selectButton_Component.SelectButton, { view: 'filled', className: styles__default['default'].month, onClick: onMonthClick },
|
|
63
73
|
React__default['default'].createElement("span", { className: styles__default['default'].buttonContent },
|
|
64
74
|
month,
|
|
@@ -66,8 +76,14 @@ var PeriodSlider = function (_a) {
|
|
|
66
76
|
React__default['default'].createElement(components_selectButton_Component.SelectButton, { view: 'filled', className: styles__default['default'].year, onClick: onYearClick },
|
|
67
77
|
React__default['default'].createElement("span", { className: styles__default['default'].buttonContent },
|
|
68
78
|
year,
|
|
69
|
-
React__default['default'].createElement("span", { className: styles__default['default'].upDownIcon }))))) : (React__default['default'].createElement("span", { className: styles__default['default'].period }, periodFormatter(valueFrom, valueTo, periodType)))
|
|
70
|
-
|
|
79
|
+
React__default['default'].createElement("span", { className: styles__default['default'].upDownIcon }))))) : (React__default['default'].createElement("span", { className: styles__default['default'].period }, periodFormatter(valueFrom, valueTo, periodType)));
|
|
80
|
+
};
|
|
81
|
+
return (React__default['default'].createElement("div", { className: cn__default['default'](styles__default['default'].component, className, (_b = {},
|
|
82
|
+
_b[styles__default['default'].full] = view === 'full',
|
|
83
|
+
_b)), "aria-live": 'polite', "data-test-id": dataTestId },
|
|
84
|
+
showPrevButton && (React__default['default'].createElement(coreComponentsButton.Button, { view: 'ghost', className: styles__default['default'].arrow, onClick: handlePrevArrowClick, disabled: prevArrowDisabled || !valueFrom, "aria-label": '\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' })),
|
|
85
|
+
renderHeader(),
|
|
86
|
+
showNextButton && (React__default['default'].createElement(coreComponentsButton.Button, { view: 'ghost', className: styles__default['default'].arrow, onClick: handleNextArrowClick, disabled: nextArrowDisabled || !valueFrom, "aria-label": '\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' }))));
|
|
71
87
|
};
|
|
72
88
|
|
|
73
89
|
exports.PeriodSlider = PeriodSlider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __assign } from './tslib.es6-
|
|
1
|
+
import { _ as __assign } from './tslib.es6-e343fc3f.js';
|
|
2
2
|
import React, { forwardRef, useState, useMemo, useCallback } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { startOfMonth, startOfDay, endOfDay } from 'date-fns';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __assign } from '../../tslib.es6-
|
|
1
|
+
import { _ as __assign } from '../../tslib.es6-e343fc3f.js';
|
|
2
2
|
import React, { useRef, useCallback } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { startOfMonth, isToday, isEqual, isSameDay, isWithinInterval, isLastDayOfMonth } from 'date-fns';
|
|
@@ -1,35 +1,43 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import '../../tslib.es6-e343fc3f.js';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { startOfWeek, endOfWeek } from 'date-fns';
|
|
5
5
|
import { Button } from '../../../../button/esm';
|
|
6
6
|
import { monthName } from '../../utils.js';
|
|
7
7
|
import { SelectButton } from '../select-button/Component.js';
|
|
8
|
-
import {
|
|
8
|
+
import { shiftValues, formatPeriod } from './utils.js';
|
|
9
9
|
|
|
10
|
-
var styles = {"component":"calendar__component_s40ku","month":"calendar__month_s40ku","year":"calendar__year_s40ku","buttonContent":"calendar__buttonContent_s40ku","period":"calendar__period_s40ku","upDownIcon":"calendar__upDownIcon_s40ku","arrow":"calendar__arrow_s40ku","full":"calendar__full_s40ku"};
|
|
10
|
+
var styles = {"component":"calendar__component_s40ku","month":"calendar__month_s40ku","year":"calendar__year_s40ku","buttonContent":"calendar__buttonContent_s40ku","period":"calendar__period_s40ku","empty":"calendar__empty_s40ku","upDownIcon":"calendar__upDownIcon_s40ku","arrow":"calendar__arrow_s40ku","full":"calendar__full_s40ku"};
|
|
11
11
|
require('./index.css');
|
|
12
12
|
|
|
13
13
|
var PeriodSlider = function (_a) {
|
|
14
|
-
var _b
|
|
15
|
-
var value = _a.value,
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
valueFrom = startOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
25
|
-
valueTo = endOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
14
|
+
var _b;
|
|
15
|
+
var value = _a.value, _c = _a.view, view = _c === void 0 ? 'month-only' : _c, _d = _a.periodType, periodType = _d === void 0 ? 'month' : _d, className = _a.className, _e = _a.periodFormatter, periodFormatter = _e === void 0 ? formatPeriod : _e, _f = _a.prevArrowDisabled, prevArrowDisabled = _f === void 0 ? false : _f, _g = _a.nextArrowDisabled, nextArrowDisabled = _g === void 0 ? false : _g, _h = _a.hideDisabledArrows, hideDisabledArrows = _h === void 0 ? false : _h, _j = _a.onPrevArrowClick, onPrevArrowClick = _j === void 0 ? function () { return null; } : _j, _k = _a.onNextArrowClick, onNextArrowClick = _k === void 0 ? function () { return null; } : _k, onMonthClick = _a.onMonthClick, onYearClick = _a.onYearClick, dataTestId = _a.dataTestId;
|
|
16
|
+
var _l = useMemo(function () {
|
|
17
|
+
var _a;
|
|
18
|
+
var from;
|
|
19
|
+
var to;
|
|
20
|
+
if (!value)
|
|
21
|
+
return [undefined, undefined];
|
|
22
|
+
if (Array.isArray(value)) {
|
|
23
|
+
from = value[0], to = value[1];
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
else {
|
|
26
|
+
_a = [value, value], from = _a[0], to = _a[1];
|
|
27
|
+
if (periodType === 'week') {
|
|
28
|
+
from = startOfWeek(from, { weekStartsOn: 1 });
|
|
29
|
+
to = endOfWeek(from, { weekStartsOn: 1 });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return [from, to];
|
|
33
|
+
}, [periodType, value]), valueFrom = _l[0], valueTo = _l[1];
|
|
34
|
+
var month = valueFrom ? monthName(valueFrom) : undefined;
|
|
35
|
+
var year = valueFrom ? valueFrom.getFullYear().toString() : undefined;
|
|
36
|
+
var showPrevButton = !(hideDisabledArrows && (prevArrowDisabled || !valueFrom));
|
|
37
|
+
var showNextButton = !(hideDisabledArrows && (nextArrowDisabled || !valueFrom));
|
|
32
38
|
var handleNextArrowClick = function (event) {
|
|
39
|
+
if (!valueFrom || !valueTo)
|
|
40
|
+
return;
|
|
33
41
|
var newValues = shiftValues(valueFrom, valueTo, periodType, 'next');
|
|
34
42
|
onNextArrowClick(event, {
|
|
35
43
|
value: newValues.valueFrom,
|
|
@@ -39,6 +47,8 @@ var PeriodSlider = function (_a) {
|
|
|
39
47
|
});
|
|
40
48
|
};
|
|
41
49
|
var handlePrevArrowClick = function (event) {
|
|
50
|
+
if (!valueFrom || !valueTo)
|
|
51
|
+
return;
|
|
42
52
|
var newValues = shiftValues(valueFrom, valueTo, periodType, 'prev');
|
|
43
53
|
onPrevArrowClick(event, {
|
|
44
54
|
value: newValues.valueFrom,
|
|
@@ -47,11 +57,11 @@ var PeriodSlider = function (_a) {
|
|
|
47
57
|
periodType: periodType,
|
|
48
58
|
});
|
|
49
59
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
view === 'full' ? (React.createElement(React.Fragment, null,
|
|
60
|
+
var renderHeader = function () {
|
|
61
|
+
if (!valueFrom || !valueTo) {
|
|
62
|
+
return React.createElement("span", { className: cn(styles.period, styles.empty) }, "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434");
|
|
63
|
+
}
|
|
64
|
+
return view === 'full' ? (React.createElement(React.Fragment, null,
|
|
55
65
|
React.createElement(SelectButton, { view: 'filled', className: styles.month, onClick: onMonthClick },
|
|
56
66
|
React.createElement("span", { className: styles.buttonContent },
|
|
57
67
|
month,
|
|
@@ -59,8 +69,14 @@ var PeriodSlider = function (_a) {
|
|
|
59
69
|
React.createElement(SelectButton, { view: 'filled', className: styles.year, onClick: onYearClick },
|
|
60
70
|
React.createElement("span", { className: styles.buttonContent },
|
|
61
71
|
year,
|
|
62
|
-
React.createElement("span", { className: styles.upDownIcon }))))) : (React.createElement("span", { className: styles.period }, periodFormatter(valueFrom, valueTo, periodType)))
|
|
63
|
-
|
|
72
|
+
React.createElement("span", { className: styles.upDownIcon }))))) : (React.createElement("span", { className: styles.period }, periodFormatter(valueFrom, valueTo, periodType)));
|
|
73
|
+
};
|
|
74
|
+
return (React.createElement("div", { className: cn(styles.component, className, (_b = {},
|
|
75
|
+
_b[styles.full] = view === 'full',
|
|
76
|
+
_b)), "aria-live": 'polite', "data-test-id": dataTestId },
|
|
77
|
+
showPrevButton && (React.createElement(Button, { view: 'ghost', className: styles.arrow, onClick: handlePrevArrowClick, disabled: prevArrowDisabled || !valueFrom, "aria-label": '\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' })),
|
|
78
|
+
renderHeader(),
|
|
79
|
+
showNextButton && (React.createElement(Button, { view: 'ghost', className: styles.arrow, onClick: handleNextArrowClick, disabled: nextArrowDisabled || !valueFrom, "aria-label": '\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' }))));
|
|
64
80
|
};
|
|
65
81
|
|
|
66
82
|
export { PeriodSlider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __rest, _ as __assign } from '../../tslib.es6-
|
|
1
|
+
import { a as __rest, _ as __assign } from '../../tslib.es6-e343fc3f.js';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { Button } from '../../../../button/esm';
|
package/calendar/esm/index.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare function __extends(d: any, b: any): void;
|
|
2
|
+
declare function __rest(s: any, e: any): {};
|
|
3
|
+
declare function __decorate(decorators: any, target: any, key: any, desc: any, ...args: any[]): any;
|
|
4
|
+
declare function __param(paramIndex: any, decorator: any): (target: any, key: any) => void;
|
|
5
|
+
declare function __metadata(metadataKey: any, metadataValue: any): any;
|
|
6
|
+
declare function __awaiter(thisArg: any, _arguments: any, P: any, generator: any): any;
|
|
7
|
+
declare function __generator(thisArg: any, body: any): {
|
|
8
|
+
next: (v: any) => any;
|
|
9
|
+
throw: (v: any) => any;
|
|
10
|
+
return: (v: any) => any;
|
|
11
|
+
};
|
|
12
|
+
declare function __exportStar(m: any, o: any): void;
|
|
13
|
+
declare function __values(o: any): any;
|
|
14
|
+
declare function __read(o: any, n: any): any;
|
|
15
|
+
declare function __spread(...args: any[]): any[];
|
|
16
|
+
declare function __spreadArrays(...args: any[]): any[];
|
|
17
|
+
declare function __await(v: any): any;
|
|
18
|
+
declare class __await {
|
|
19
|
+
constructor(v: any);
|
|
20
|
+
v: any;
|
|
21
|
+
}
|
|
22
|
+
declare function __asyncGenerator(thisArg: any, _arguments: any, generator: any): {};
|
|
23
|
+
declare function __asyncDelegator(o: any): {};
|
|
24
|
+
declare function __asyncValues(o: any): any;
|
|
25
|
+
declare function __makeTemplateObject(cooked: any, raw: any): any;
|
|
26
|
+
declare function __importStar(mod: any): any;
|
|
27
|
+
declare function __importDefault(mod: any): any;
|
|
28
|
+
declare function __classPrivateFieldGet(receiver: any, privateMap: any): any;
|
|
29
|
+
declare function __classPrivateFieldSet(receiver: any, privateMap: any, value: any): any;
|
|
30
|
+
declare function __assign(...args: any[]): any;
|
|
31
|
+
declare function __createBinding(o: any, m: any, k: any, k2: any): void;
|
|
32
|
+
export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __assign, __createBinding };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
var __assign = function () {
|
|
16
|
+
__assign = Object.assign || function __assign(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s)
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
function __rest(s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s)
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
31
|
+
t[p] = s[p];
|
|
32
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
33
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
+
t[p[i]] = s[p[i]];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { __assign as _, __rest as a };
|
package/calendar/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { startOfWeek, endOfWeek } from 'date-fns';
|
|
4
4
|
import { Button } from '../../../../button/modern';
|
|
@@ -6,27 +6,34 @@ import { monthName } from '../../utils.js';
|
|
|
6
6
|
import { SelectButton } from '../select-button/Component.js';
|
|
7
7
|
import { formatPeriod, shiftValues } from './utils.js';
|
|
8
8
|
|
|
9
|
-
var styles = {"component":"calendar__component_s40ku","month":"calendar__month_s40ku","year":"calendar__year_s40ku","buttonContent":"calendar__buttonContent_s40ku","period":"calendar__period_s40ku","upDownIcon":"calendar__upDownIcon_s40ku","arrow":"calendar__arrow_s40ku","full":"calendar__full_s40ku"};
|
|
9
|
+
var styles = {"component":"calendar__component_s40ku","month":"calendar__month_s40ku","year":"calendar__year_s40ku","buttonContent":"calendar__buttonContent_s40ku","period":"calendar__period_s40ku","empty":"calendar__empty_s40ku","upDownIcon":"calendar__upDownIcon_s40ku","arrow":"calendar__arrow_s40ku","full":"calendar__full_s40ku"};
|
|
10
10
|
require('./index.css');
|
|
11
11
|
|
|
12
12
|
const PeriodSlider = ({ value, view = 'month-only', periodType = 'month', className, periodFormatter = formatPeriod, prevArrowDisabled = false, nextArrowDisabled = false, hideDisabledArrows = false, onPrevArrowClick = () => null, onNextArrowClick = () => null, onMonthClick, onYearClick, dataTestId, }) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (periodType === 'week') {
|
|
21
|
-
valueFrom = startOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
22
|
-
valueTo = endOfWeek(valueFrom, { weekStartsOn: 1 });
|
|
13
|
+
const [valueFrom, valueTo] = useMemo(() => {
|
|
14
|
+
let from;
|
|
15
|
+
let to;
|
|
16
|
+
if (!value)
|
|
17
|
+
return [undefined, undefined];
|
|
18
|
+
if (Array.isArray(value)) {
|
|
19
|
+
[from, to] = value;
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
else {
|
|
22
|
+
[from, to] = [value, value];
|
|
23
|
+
if (periodType === 'week') {
|
|
24
|
+
from = startOfWeek(from, { weekStartsOn: 1 });
|
|
25
|
+
to = endOfWeek(from, { weekStartsOn: 1 });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return [from, to];
|
|
29
|
+
}, [periodType, value]);
|
|
30
|
+
const month = valueFrom ? monthName(valueFrom) : undefined;
|
|
31
|
+
const year = valueFrom ? valueFrom.getFullYear().toString() : undefined;
|
|
32
|
+
const showPrevButton = !(hideDisabledArrows && (prevArrowDisabled || !valueFrom));
|
|
33
|
+
const showNextButton = !(hideDisabledArrows && (nextArrowDisabled || !valueFrom));
|
|
29
34
|
const handleNextArrowClick = (event) => {
|
|
35
|
+
if (!valueFrom || !valueTo)
|
|
36
|
+
return;
|
|
30
37
|
const newValues = shiftValues(valueFrom, valueTo, periodType, 'next');
|
|
31
38
|
onNextArrowClick(event, {
|
|
32
39
|
value: newValues.valueFrom,
|
|
@@ -36,6 +43,8 @@ const PeriodSlider = ({ value, view = 'month-only', periodType = 'month', classN
|
|
|
36
43
|
});
|
|
37
44
|
};
|
|
38
45
|
const handlePrevArrowClick = (event) => {
|
|
46
|
+
if (!valueFrom || !valueTo)
|
|
47
|
+
return;
|
|
39
48
|
const newValues = shiftValues(valueFrom, valueTo, periodType, 'prev');
|
|
40
49
|
onPrevArrowClick(event, {
|
|
41
50
|
value: newValues.valueFrom,
|
|
@@ -44,11 +53,11 @@ const PeriodSlider = ({ value, view = 'month-only', periodType = 'month', classN
|
|
|
44
53
|
periodType,
|
|
45
54
|
});
|
|
46
55
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
view === 'full' ? (React.createElement(React.Fragment, null,
|
|
56
|
+
const renderHeader = () => {
|
|
57
|
+
if (!valueFrom || !valueTo) {
|
|
58
|
+
return React.createElement("span", { className: cn(styles.period, styles.empty) }, "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434");
|
|
59
|
+
}
|
|
60
|
+
return view === 'full' ? (React.createElement(React.Fragment, null,
|
|
52
61
|
React.createElement(SelectButton, { view: 'filled', className: styles.month, onClick: onMonthClick },
|
|
53
62
|
React.createElement("span", { className: styles.buttonContent },
|
|
54
63
|
month,
|
|
@@ -56,8 +65,14 @@ const PeriodSlider = ({ value, view = 'month-only', periodType = 'month', classN
|
|
|
56
65
|
React.createElement(SelectButton, { view: 'filled', className: styles.year, onClick: onYearClick },
|
|
57
66
|
React.createElement("span", { className: styles.buttonContent },
|
|
58
67
|
year,
|
|
59
|
-
React.createElement("span", { className: styles.upDownIcon }))))) : (React.createElement("span", { className: styles.period }, periodFormatter(valueFrom, valueTo, periodType)))
|
|
60
|
-
|
|
68
|
+
React.createElement("span", { className: styles.upDownIcon }))))) : (React.createElement("span", { className: styles.period }, periodFormatter(valueFrom, valueTo, periodType)));
|
|
69
|
+
};
|
|
70
|
+
return (React.createElement("div", { className: cn(styles.component, className, {
|
|
71
|
+
[styles.full]: view === 'full',
|
|
72
|
+
}), "aria-live": 'polite', "data-test-id": dataTestId },
|
|
73
|
+
showPrevButton && (React.createElement(Button, { view: 'ghost', className: styles.arrow, onClick: handlePrevArrowClick, disabled: prevArrowDisabled || !valueFrom, "aria-label": '\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' })),
|
|
74
|
+
renderHeader(),
|
|
75
|
+
showNextButton && (React.createElement(Button, { view: 'ghost', className: styles.arrow, onClick: handleNextArrowClick, disabled: nextArrowDisabled || !valueFrom, "aria-label": '\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u043F\u0435\u0440\u0438\u043E\u0434' }))));
|
|
61
76
|
};
|
|
62
77
|
|
|
63
78
|
export { PeriodSlider };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare function __extends(d: any, b: any): void;
|
|
2
|
+
declare function __rest(s: any, e: any): {};
|
|
3
|
+
declare function __decorate(decorators: any, target: any, key: any, desc: any, ...args: any[]): any;
|
|
4
|
+
declare function __param(paramIndex: any, decorator: any): (target: any, key: any) => void;
|
|
5
|
+
declare function __metadata(metadataKey: any, metadataValue: any): any;
|
|
6
|
+
declare function __awaiter(thisArg: any, _arguments: any, P: any, generator: any): any;
|
|
7
|
+
declare function __generator(thisArg: any, body: any): {
|
|
8
|
+
next: (v: any) => any;
|
|
9
|
+
throw: (v: any) => any;
|
|
10
|
+
return: (v: any) => any;
|
|
11
|
+
};
|
|
12
|
+
declare function __exportStar(m: any, o: any): void;
|
|
13
|
+
declare function __values(o: any): any;
|
|
14
|
+
declare function __read(o: any, n: any): any;
|
|
15
|
+
declare function __spread(...args: any[]): any[];
|
|
16
|
+
declare function __spreadArrays(...args: any[]): any[];
|
|
17
|
+
declare function __await(v: any): any;
|
|
18
|
+
declare class __await {
|
|
19
|
+
constructor(v: any);
|
|
20
|
+
v: any;
|
|
21
|
+
}
|
|
22
|
+
declare function __asyncGenerator(thisArg: any, _arguments: any, generator: any): {};
|
|
23
|
+
declare function __asyncDelegator(o: any): {};
|
|
24
|
+
declare function __asyncValues(o: any): any;
|
|
25
|
+
declare function __makeTemplateObject(cooked: any, raw: any): any;
|
|
26
|
+
declare function __importStar(mod: any): any;
|
|
27
|
+
declare function __importDefault(mod: any): any;
|
|
28
|
+
declare function __classPrivateFieldGet(receiver: any, privateMap: any): any;
|
|
29
|
+
declare function __classPrivateFieldSet(receiver: any, privateMap: any, value: any): any;
|
|
30
|
+
declare function __assign(...args: any[]): any;
|
|
31
|
+
declare function __createBinding(o: any, m: any, k: any, k2: any): void;
|
|
32
|
+
export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __assign, __createBinding };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
exports.__assign = function () {
|
|
16
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s)
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return exports.__assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
function __rest(s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s)
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
31
|
+
t[p] = s[p];
|
|
32
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
33
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
+
t[p[i]] = s[p[i]];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
exports.__rest = __rest;
|