@semcore/date-picker 16.2.4 → 17.0.0-prerelease.18
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 +6 -0
- package/lib/cjs/DatePicker.js +116 -139
- package/lib/cjs/DatePicker.js.map +1 -1
- package/lib/cjs/DateRangeComparator.js +144 -149
- package/lib/cjs/DateRangeComparator.js.map +1 -1
- package/lib/cjs/DateRangePicker.js +86 -101
- package/lib/cjs/DateRangePicker.js.map +1 -1
- package/lib/cjs/MonthDateRangeComparator.js +173 -180
- package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
- package/lib/cjs/MonthPicker.js +70 -87
- package/lib/cjs/MonthPicker.js.map +1 -1
- package/lib/cjs/MonthRangePicker.js +96 -111
- package/lib/cjs/MonthRangePicker.js.map +1 -1
- package/lib/cjs/components/ButtonTrigger.js +12 -11
- package/lib/cjs/components/ButtonTrigger.js.map +1 -1
- package/lib/cjs/components/Calendar.js +409 -466
- package/lib/cjs/components/Calendar.js.map +1 -1
- package/lib/cjs/components/DateRangeComparatorAbstract.js +574 -626
- package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/cjs/components/InputTrigger.js +585 -677
- package/lib/cjs/components/InputTrigger.js.map +1 -1
- package/lib/cjs/components/PickerAbstract.js +254 -273
- package/lib/cjs/components/PickerAbstract.js.map +1 -1
- package/lib/cjs/components/RangePickerAbstract.js +407 -439
- package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
- package/lib/cjs/components/index.js +92 -102
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +15 -15
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +17 -17
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/utils/cronTabScheduler.js +13 -22
- package/lib/cjs/utils/cronTabScheduler.js.map +1 -1
- package/lib/cjs/utils/datesIntersects.js +12 -19
- package/lib/cjs/utils/datesIntersects.js.map +1 -1
- package/lib/cjs/utils/formatDate.js +11 -9
- package/lib/cjs/utils/formatDate.js.map +1 -1
- package/lib/cjs/utils/includesDate.js +11 -16
- package/lib/cjs/utils/includesDate.js.map +1 -1
- package/lib/cjs/utils/isBetweenPlugin.js +6 -6
- package/lib/cjs/utils/isBetweenPlugin.js.map +1 -1
- package/lib/cjs/utils/shortDateRangeFormat.js +29 -33
- package/lib/cjs/utils/shortDateRangeFormat.js.map +1 -1
- package/lib/es6/DatePicker.js +117 -141
- package/lib/es6/DatePicker.js.map +1 -1
- package/lib/es6/DateRangeComparator.js +130 -135
- package/lib/es6/DateRangeComparator.js.map +1 -1
- package/lib/es6/DateRangePicker.js +87 -102
- package/lib/es6/DateRangePicker.js.map +1 -1
- package/lib/es6/MonthDateRangeComparator.js +159 -166
- package/lib/es6/MonthDateRangeComparator.js.map +1 -1
- package/lib/es6/MonthPicker.js +72 -89
- package/lib/es6/MonthPicker.js.map +1 -1
- package/lib/es6/MonthRangePicker.js +97 -112
- package/lib/es6/MonthRangePicker.js.map +1 -1
- package/lib/es6/components/ButtonTrigger.js +4 -3
- package/lib/es6/components/ButtonTrigger.js.map +1 -1
- package/lib/es6/components/Calendar.js +400 -457
- package/lib/es6/components/Calendar.js.map +1 -1
- package/lib/es6/components/DateRangeComparatorAbstract.js +552 -604
- package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/es6/components/InputTrigger.js +568 -660
- package/lib/es6/components/InputTrigger.js.map +1 -1
- package/lib/es6/components/PickerAbstract.js +246 -265
- package/lib/es6/components/PickerAbstract.js.map +1 -1
- package/lib/es6/components/RangePickerAbstract.js +397 -429
- package/lib/es6/components/RangePickerAbstract.js.map +1 -1
- package/lib/es6/components/index.js +74 -85
- package/lib/es6/components/index.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +16 -16
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/utils/cronTabScheduler.js +13 -21
- package/lib/es6/utils/cronTabScheduler.js.map +1 -1
- package/lib/es6/utils/datesIntersects.js +10 -18
- package/lib/es6/utils/datesIntersects.js.map +1 -1
- package/lib/es6/utils/formatDate.js +6 -6
- package/lib/es6/utils/formatDate.js.map +1 -1
- package/lib/es6/utils/includesDate.js +10 -15
- package/lib/es6/utils/includesDate.js.map +1 -1
- package/lib/es6/utils/isBetweenPlugin.js +4 -4
- package/lib/es6/utils/isBetweenPlugin.js.map +1 -1
- package/lib/es6/utils/shortDateRangeFormat.js +27 -31
- package/lib/es6/utils/shortDateRangeFormat.js.map +1 -1
- package/lib/esm/DatePicker.mjs +109 -114
- package/lib/esm/DateRangeComparator.mjs +112 -105
- package/lib/esm/DateRangePicker.mjs +76 -80
- package/lib/esm/MonthDateRangeComparator.mjs +141 -134
- package/lib/esm/MonthPicker.mjs +65 -70
- package/lib/esm/MonthRangePicker.mjs +86 -88
- package/lib/esm/components/ButtonTrigger.mjs +4 -3
- package/lib/esm/components/Calendar.mjs +397 -423
- package/lib/esm/components/DateRangeComparatorAbstract.mjs +559 -516
- package/lib/esm/components/InputTrigger.mjs +550 -557
- package/lib/esm/components/PickerAbstract.mjs +249 -244
- package/lib/esm/components/RangePickerAbstract.mjs +400 -384
- package/lib/esm/components/index.mjs +73 -69
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/utils/cronTabScheduler.mjs +13 -18
- package/lib/esm/utils/datesIntersects.mjs +10 -14
- package/lib/esm/utils/formatDate.mjs +6 -6
- package/lib/esm/utils/includesDate.mjs +10 -13
- package/lib/esm/utils/isBetweenPlugin.mjs +4 -4
- package/lib/esm/utils/shortDateRangeFormat.mjs +27 -27
- package/lib/types/index.d.ts +2 -44
- package/package.json +16 -17
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
|
-
import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
2
|
import { createComponent } from "@semcore/core";
|
|
9
3
|
import dayjs from "dayjs";
|
|
@@ -12,90 +6,92 @@ import { Period, Next, Prev, Title, Header, Popper, Trigger, InputTrigger } from
|
|
|
12
6
|
import { CalendarDays } from "./components/Calendar.mjs";
|
|
13
7
|
import RangePickerAbstract, { Reset, Apply } from "./components/RangePickerAbstract.mjs";
|
|
14
8
|
import shortDateRangeFormat from "./utils/shortDateRangeFormat.mjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
_this = _callSuper(this, DateRangePickerRoot2, [].concat(args));
|
|
23
|
-
_defineProperty(_this, "navigateStep", "month");
|
|
24
|
-
_defineProperty(_this, "keyStep", "day");
|
|
25
|
-
_defineProperty(_this, "keyDiff", {
|
|
9
|
+
class DateRangePickerRoot extends RangePickerAbstract {
|
|
10
|
+
constructor(...args) {
|
|
11
|
+
super(...args);
|
|
12
|
+
_defineProperty(this, "navigateStep", "month");
|
|
13
|
+
_defineProperty(this, "keyStep", "day");
|
|
14
|
+
_defineProperty(this, "keyDiff", {
|
|
26
15
|
ArrowLeft: -1,
|
|
27
16
|
ArrowUp: -7,
|
|
28
17
|
ArrowRight: 1,
|
|
29
18
|
ArrowDown: 7
|
|
30
19
|
});
|
|
31
|
-
return _this;
|
|
32
20
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
day: "numeric",
|
|
65
|
-
month: "short",
|
|
66
|
-
year: "numeric"
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
key: "getTriggerProps",
|
|
72
|
-
value: function getTriggerProps() {
|
|
73
|
-
var _this$asProps2 = this.asProps, visible = _this$asProps2.visible, preselectedValue = _this$asProps2.preselectedValue, onChange = _this$asProps2.onChange, onDisplayedPeriodChange = _this$asProps2.onDisplayedPeriodChange, locale = _this$asProps2.locale, disabled = _this$asProps2.disabled, disabledErrorText = _this$asProps2.disabledErrorText, getI18nText = _this$asProps2.getI18nText, animationsDisabled = _this$asProps2.animationsDisabled;
|
|
74
|
-
var value = visible ? [preselectedValue[0] || this.asProps.value[0], preselectedValue[1] || this.asProps.value[1]] : this.asProps.value;
|
|
75
|
-
return _objectSpread(_objectSpread({}, _superPropGet(DateRangePickerRoot2, "getButtonTriggerProps", this, 3)([])), {}, {
|
|
76
|
-
value,
|
|
77
|
-
onChange,
|
|
78
|
-
onDisplayedPeriodChange,
|
|
21
|
+
getDefaultPeriods() {
|
|
22
|
+
const {
|
|
23
|
+
getI18nText
|
|
24
|
+
} = this.asProps;
|
|
25
|
+
const today = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
|
|
26
|
+
return [{
|
|
27
|
+
children: getI18nText("last2Days"),
|
|
28
|
+
value: [dayjs(today).subtract(1, "day").toDate(), today]
|
|
29
|
+
}, {
|
|
30
|
+
children: getI18nText("lastWeek"),
|
|
31
|
+
value: [dayjs(today).subtract(6, "day").toDate(), today]
|
|
32
|
+
}, {
|
|
33
|
+
children: getI18nText("last2Weeks"),
|
|
34
|
+
value: [dayjs(today).subtract(13, "day").toDate(), today]
|
|
35
|
+
}, {
|
|
36
|
+
children: getI18nText("lastMonth"),
|
|
37
|
+
value: [dayjs(today).subtract(1, "month").toDate(), today]
|
|
38
|
+
}, {
|
|
39
|
+
children: getI18nText("last2Months"),
|
|
40
|
+
value: [dayjs(today).subtract(2, "month").toDate(), today]
|
|
41
|
+
}];
|
|
42
|
+
}
|
|
43
|
+
getButtonTriggerProps() {
|
|
44
|
+
const {
|
|
45
|
+
value,
|
|
46
|
+
locale
|
|
47
|
+
} = this.asProps;
|
|
48
|
+
return {
|
|
49
|
+
...super.getButtonTriggerProps(),
|
|
50
|
+
placeholder: "Select date period",
|
|
51
|
+
children: shortDateRangeFormat(value, {
|
|
79
52
|
locale,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
53
|
+
day: "numeric",
|
|
54
|
+
month: "short",
|
|
55
|
+
year: "numeric"
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
getTriggerProps() {
|
|
60
|
+
const {
|
|
61
|
+
visible,
|
|
62
|
+
preselectedValue,
|
|
63
|
+
onChange,
|
|
64
|
+
onDisplayedPeriodChange,
|
|
65
|
+
locale,
|
|
66
|
+
disabled,
|
|
67
|
+
disabledErrorText,
|
|
68
|
+
getI18nText,
|
|
69
|
+
animationsDisabled
|
|
70
|
+
} = this.asProps;
|
|
71
|
+
const value = visible ? [preselectedValue[0] || this.asProps.value[0], preselectedValue[1] || this.asProps.value[1]] : this.asProps.value;
|
|
72
|
+
return {
|
|
73
|
+
...super.getButtonTriggerProps(),
|
|
74
|
+
value,
|
|
75
|
+
onChange,
|
|
76
|
+
onDisplayedPeriodChange,
|
|
77
|
+
locale,
|
|
78
|
+
disabledDates: disabled,
|
|
79
|
+
disabledErrorText,
|
|
80
|
+
children: () => /* @__PURE__ */ React.createElement(InputTrigger.DateRange, null),
|
|
81
|
+
getI18nText,
|
|
82
|
+
animationsDisabled,
|
|
83
|
+
unit: this.keyStep
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
92
87
|
_defineProperty(DateRangePickerRoot, "displayName", "DateRangePicker");
|
|
93
|
-
_defineProperty(DateRangePickerRoot, "defaultProps",
|
|
94
|
-
return
|
|
88
|
+
_defineProperty(DateRangePickerRoot, "defaultProps", (props) => {
|
|
89
|
+
return {
|
|
90
|
+
...RangePickerAbstract.defaultProps(props),
|
|
95
91
|
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangePicker.Trigger, null), /* @__PURE__ */ React.createElement(DateRangePicker.Popper, null))
|
|
96
|
-
}
|
|
92
|
+
};
|
|
97
93
|
});
|
|
98
|
-
|
|
94
|
+
const DateRangePicker = createComponent(DateRangePickerRoot, {
|
|
99
95
|
Trigger: InputTrigger,
|
|
100
96
|
ButtonTrigger: Trigger,
|
|
101
97
|
Popper,
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
|
-
import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
8
2
|
import { createComponent, sstyled, assignProps } from "@semcore/core";
|
|
3
|
+
import { Flex, Box } from "@semcore/base-components";
|
|
9
4
|
import Divider from "@semcore/divider";
|
|
10
|
-
import { Flex, Box } from "@semcore/flex-box";
|
|
11
5
|
import dayjs from "dayjs";
|
|
12
6
|
import React from "react";
|
|
13
7
|
import { Period, Next, Prev, Title, Header as Header$1, Popper } from "./components/index.mjs";
|
|
14
8
|
import { CalendarMonths } from "./components/Calendar.mjs";
|
|
15
9
|
import DateRangeComparatorAbstract, { Footer, Body, CompareToggle, Trigger, Reset, Apply, Header } from "./components/DateRangeComparatorAbstract.mjs";
|
|
16
10
|
import InputTrigger from "./components/InputTrigger.mjs";
|
|
17
|
-
|
|
11
|
+
const dateParts = {
|
|
18
12
|
day: false,
|
|
19
13
|
month: true,
|
|
20
14
|
year: true
|
|
21
15
|
};
|
|
22
16
|
function RangeInput(props) {
|
|
23
17
|
var _ref = arguments[0], _ref2;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
const {
|
|
19
|
+
styles
|
|
20
|
+
} = props;
|
|
21
|
+
const SComparatorRangeInput = Box;
|
|
22
|
+
const SRangeIndicator = Box;
|
|
23
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SComparatorRangeInput, _ref2.cn("SComparatorRangeInput", {
|
|
24
|
+
...assignProps({
|
|
25
|
+
"data-name": "SComparatorRangeInput",
|
|
26
|
+
"tag": InputTrigger,
|
|
27
|
+
"parts": dateParts,
|
|
28
|
+
"unit": "month",
|
|
29
|
+
"__excludeProps": ["role", "aria-haspopup", "aria-expanded", "onChange", "value", "id"]
|
|
30
|
+
}, _ref)
|
|
31
|
+
}), /* @__PURE__ */ React.createElement(InputTrigger.DateRange, null, /* @__PURE__ */ React.createElement(SRangeIndicator, _ref2.cn("SRangeIndicator", {
|
|
34
32
|
"range": props.range,
|
|
35
33
|
"disabled": props.disabled,
|
|
36
34
|
"w": 12,
|
|
@@ -45,128 +43,115 @@ RangeInput.SingleDateInput = InputTrigger.SingleDateInput;
|
|
|
45
43
|
RangeInput.DateRange = InputTrigger.DateRange;
|
|
46
44
|
RangeInput.DateRangeFromInput = InputTrigger.DateRangeFromInput;
|
|
47
45
|
RangeInput.DateRangeToInput = InputTrigger.DateRangeToInput;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
_this = _callSuper(this, MonthDateRangeComparatorRoot2, [].concat(args));
|
|
56
|
-
_defineProperty(_this, "navigateStep", "year");
|
|
57
|
-
_defineProperty(_this, "keyStep", "month");
|
|
58
|
-
_defineProperty(_this, "keyDiff", {
|
|
46
|
+
class MonthDateRangeComparatorRoot extends DateRangeComparatorAbstract {
|
|
47
|
+
constructor(...args) {
|
|
48
|
+
super(...args);
|
|
49
|
+
_defineProperty(this, "navigateStep", "year");
|
|
50
|
+
_defineProperty(this, "keyStep", "month");
|
|
51
|
+
_defineProperty(this, "keyDiff", {
|
|
59
52
|
ArrowLeft: -1,
|
|
60
53
|
ArrowUp: -3,
|
|
61
54
|
ArrowRight: 1,
|
|
62
55
|
ArrowDown: 3
|
|
63
56
|
});
|
|
64
|
-
_defineProperty(
|
|
57
|
+
_defineProperty(this, "triggerFormattingProps", {
|
|
65
58
|
month: "short",
|
|
66
59
|
year: "numeric"
|
|
67
60
|
});
|
|
68
|
-
return _this;
|
|
69
61
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
}, {
|
|
152
|
-
key: "getFooterProps",
|
|
153
|
-
value: function getFooterProps(_ref11) {
|
|
154
|
-
var _ref11$unclearable = _ref11.unclearable, unclearable = _ref11$unclearable === void 0 ? false : _ref11$unclearable;
|
|
155
|
-
return {
|
|
156
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Reset, null))
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}]);
|
|
160
|
-
})(DateRangeComparatorAbstract);
|
|
62
|
+
getTitleProps(props, index) {
|
|
63
|
+
const {
|
|
64
|
+
displayedPeriod,
|
|
65
|
+
locale
|
|
66
|
+
} = this.asProps;
|
|
67
|
+
return {
|
|
68
|
+
...super.getTitleProps(props, index),
|
|
69
|
+
children: new Intl.DateTimeFormat(locale, {
|
|
70
|
+
year: "numeric"
|
|
71
|
+
}).format(dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate())
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
getRangeInput() {
|
|
75
|
+
return /* @__PURE__ */ React.createElement(MonthDateRangeComparator.RangeInput.DateRange, null);
|
|
76
|
+
}
|
|
77
|
+
getRangeCalendarProps() {
|
|
78
|
+
return {
|
|
79
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Flex, {
|
|
80
|
+
direction: "column"
|
|
81
|
+
}, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.CalendarHeader, {
|
|
82
|
+
tag: Flex
|
|
83
|
+
}, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Prev, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Title, null)), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Calendar, null)), /* @__PURE__ */ React.createElement(Flex, {
|
|
84
|
+
direction: "column"
|
|
85
|
+
}, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.CalendarHeader, {
|
|
86
|
+
tag: Flex
|
|
87
|
+
}, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Title, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Next, null)), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Calendar, null)))
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
getValueDateRangeProps() {
|
|
91
|
+
const props = super.getValueDateRangeProps();
|
|
92
|
+
return {
|
|
93
|
+
...props,
|
|
94
|
+
w: props.w - 60
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
getCompareDateRangeProps() {
|
|
98
|
+
const props = super.getCompareDateRangeProps();
|
|
99
|
+
return {
|
|
100
|
+
...props,
|
|
101
|
+
w: props.w - 60
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
getPopperProps() {
|
|
105
|
+
return {
|
|
106
|
+
...super.getPopperProps(),
|
|
107
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Header, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Body, {
|
|
108
|
+
showButtons: true
|
|
109
|
+
}))
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
getHeaderProps() {
|
|
113
|
+
return {
|
|
114
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.ValueDateRange, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.CompareToggle, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.CompareDateRange, null))
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
getBodyProps({
|
|
118
|
+
showButtons
|
|
119
|
+
}) {
|
|
120
|
+
return {
|
|
121
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.RangeCalendar, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Periods, {
|
|
122
|
+
showButtons
|
|
123
|
+
}))
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
getPeriodsProps({
|
|
127
|
+
showButtons,
|
|
128
|
+
unclearable = false
|
|
129
|
+
}) {
|
|
130
|
+
return {
|
|
131
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Periods.Divider, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Periods.Column, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Periods.Options, null), showButtons && /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Periods.Controls, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Reset, null))))
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
getFooterProps({
|
|
135
|
+
unclearable = false
|
|
136
|
+
}) {
|
|
137
|
+
return {
|
|
138
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Reset, null))
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
161
142
|
_defineProperty(MonthDateRangeComparatorRoot, "displayName", "MonthDateRangeComparator");
|
|
162
|
-
_defineProperty(MonthDateRangeComparatorRoot, "defaultProps",
|
|
163
|
-
return
|
|
143
|
+
_defineProperty(MonthDateRangeComparatorRoot, "defaultProps", (props) => {
|
|
144
|
+
return {
|
|
145
|
+
...DateRangeComparatorAbstract.defaultProps(props),
|
|
164
146
|
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Trigger, null), /* @__PURE__ */ React.createElement(MonthDateRangeComparator.Popper, null))
|
|
165
|
-
}
|
|
147
|
+
};
|
|
166
148
|
});
|
|
167
149
|
function ValueDateRange(props) {
|
|
168
150
|
var _ref3;
|
|
169
|
-
|
|
151
|
+
const {
|
|
152
|
+
Root: SValueDateRange,
|
|
153
|
+
styles
|
|
154
|
+
} = props;
|
|
170
155
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SValueDateRange, _ref3.cn("SValueDateRange", {
|
|
171
156
|
"render": MonthDateRangeComparator.RangeInput,
|
|
172
157
|
"range": "value"
|
|
@@ -174,7 +159,10 @@ function ValueDateRange(props) {
|
|
|
174
159
|
}
|
|
175
160
|
function CompareDateRange(props) {
|
|
176
161
|
var _ref4;
|
|
177
|
-
|
|
162
|
+
const {
|
|
163
|
+
Root: SCompareDateRange,
|
|
164
|
+
styles
|
|
165
|
+
} = props;
|
|
178
166
|
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SCompareDateRange, _ref4.cn("SCompareDateRange", {
|
|
179
167
|
"render": MonthDateRangeComparator.RangeInput,
|
|
180
168
|
"range": "compare"
|
|
@@ -182,7 +170,11 @@ function CompareDateRange(props) {
|
|
|
182
170
|
}
|
|
183
171
|
function RangeCalendar(props) {
|
|
184
172
|
var _ref5;
|
|
185
|
-
|
|
173
|
+
const {
|
|
174
|
+
Root: SRangeCalendar,
|
|
175
|
+
Children,
|
|
176
|
+
styles
|
|
177
|
+
} = props;
|
|
186
178
|
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SRangeCalendar, _ref5.cn("SRangeCalendar", {
|
|
187
179
|
"render": Flex,
|
|
188
180
|
"gap": 8
|
|
@@ -190,14 +182,20 @@ function RangeCalendar(props) {
|
|
|
190
182
|
}
|
|
191
183
|
function Periods(props) {
|
|
192
184
|
var _ref6;
|
|
193
|
-
|
|
185
|
+
const {
|
|
186
|
+
Root: SPeriods,
|
|
187
|
+
styles
|
|
188
|
+
} = props;
|
|
194
189
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriods, _ref6.cn("SPeriods", {
|
|
195
190
|
"render": Flex
|
|
196
191
|
}));
|
|
197
192
|
}
|
|
198
193
|
function PeriodsDivider(props) {
|
|
199
194
|
var _ref7;
|
|
200
|
-
|
|
195
|
+
const {
|
|
196
|
+
Root: SPeriodsDivider,
|
|
197
|
+
styles
|
|
198
|
+
} = props;
|
|
201
199
|
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsDivider, _ref7.cn("SPeriodsDivider", {
|
|
202
200
|
"orientation": "vertical",
|
|
203
201
|
"h": "auto",
|
|
@@ -206,7 +204,10 @@ function PeriodsDivider(props) {
|
|
|
206
204
|
}
|
|
207
205
|
function PeriodsColumn(props) {
|
|
208
206
|
var _ref8;
|
|
209
|
-
|
|
207
|
+
const {
|
|
208
|
+
Root: SPeriodsColumn,
|
|
209
|
+
styles
|
|
210
|
+
} = props;
|
|
210
211
|
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsColumn, _ref8.cn("SPeriodsColumn", {
|
|
211
212
|
"render": Flex,
|
|
212
213
|
"direction": "column",
|
|
@@ -216,21 +217,27 @@ function PeriodsColumn(props) {
|
|
|
216
217
|
}
|
|
217
218
|
function PeriodsOptions(props) {
|
|
218
219
|
var _ref9;
|
|
219
|
-
|
|
220
|
+
const {
|
|
221
|
+
styles,
|
|
222
|
+
Root: SPeriodsList
|
|
223
|
+
} = props;
|
|
220
224
|
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsList, _ref9.cn("SPeriodsList", {
|
|
221
225
|
"render": MonthDateRangeComparator.Period
|
|
222
226
|
}));
|
|
223
227
|
}
|
|
224
228
|
function PeriodsControls(props) {
|
|
225
229
|
var _ref0;
|
|
226
|
-
|
|
230
|
+
const {
|
|
231
|
+
styles,
|
|
232
|
+
Root: SPeriodsControls
|
|
233
|
+
} = props;
|
|
227
234
|
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsControls, _ref0.cn("SPeriodsControls", {
|
|
228
235
|
"render": Flex,
|
|
229
236
|
"p": 4,
|
|
230
237
|
"gap": 2
|
|
231
238
|
}));
|
|
232
239
|
}
|
|
233
|
-
|
|
240
|
+
const MonthDateRangeComparator = createComponent(MonthDateRangeComparatorRoot, {
|
|
234
241
|
Popper,
|
|
235
242
|
CalendarHeader: Header$1,
|
|
236
243
|
Title,
|