@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
package/lib/esm/DatePicker.mjs
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
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
|
-
import { createComponent, sstyled, assignProps
|
|
2
|
+
import { createComponent, Component, sstyled, assignProps } from "@semcore/core";
|
|
3
|
+
import { Box } from "@semcore/base-components";
|
|
9
4
|
import Button from "@semcore/button";
|
|
10
5
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
11
6
|
import Divider from "@semcore/divider";
|
|
12
|
-
import { Box } from "@semcore/flex-box";
|
|
13
7
|
import dayjs from "dayjs";
|
|
14
8
|
import React from "react";
|
|
15
9
|
import { InputTrigger, Next, Prev, Title, Header, Popper, Trigger } from "./components/index.mjs";
|
|
@@ -18,122 +12,123 @@ import PickerAbstract from "./components/PickerAbstract.mjs";
|
|
|
18
12
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
19
13
|
import { formatDDMMYY } from "./utils/formatDate.mjs";
|
|
20
14
|
import { includesDate } from "./utils/includesDate.mjs";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
_this = _callSuper(this, DatePickerRoot2, [].concat(args));
|
|
29
|
-
_defineProperty(_this, "navigateStep", "month");
|
|
30
|
-
_defineProperty(_this, "keyStep", "day");
|
|
31
|
-
_defineProperty(_this, "keyDiff", {
|
|
15
|
+
class DatePickerRoot extends PickerAbstract {
|
|
16
|
+
constructor(...args) {
|
|
17
|
+
super(...args);
|
|
18
|
+
_defineProperty(this, "navigateStep", "month");
|
|
19
|
+
_defineProperty(this, "keyStep", "day");
|
|
20
|
+
_defineProperty(this, "keyDiff", {
|
|
32
21
|
ArrowLeft: -1,
|
|
33
22
|
ArrowUp: -7,
|
|
34
23
|
ArrowRight: 1,
|
|
35
24
|
ArrowDown: 7
|
|
36
25
|
});
|
|
37
|
-
_defineProperty(
|
|
38
|
-
|
|
26
|
+
_defineProperty(this, "handlerToday", () => {
|
|
27
|
+
this.handlers.value(new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)));
|
|
39
28
|
});
|
|
40
|
-
return _this;
|
|
41
29
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
children: new Intl.DateTimeFormat(locale, {
|
|
88
|
-
month: "long",
|
|
89
|
-
year: "numeric"
|
|
90
|
-
}).format(dayjs(displayedPeriod).startOf("month").toDate())
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
key: "getTodayProps",
|
|
95
|
-
value: function getTodayProps() {
|
|
96
|
-
var _this$asProps4 = this.asProps, i18n = _this$asProps4.i18n, locale = _this$asProps4.locale, disabled = _this$asProps4.disabled;
|
|
97
|
-
return {
|
|
98
|
-
i18n,
|
|
99
|
-
locale,
|
|
100
|
-
onClick: this.handlerToday,
|
|
101
|
-
disabled: disabled.some(includesDate(dayjs(), "day"))
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}]);
|
|
105
|
-
})(PickerAbstract);
|
|
106
|
-
_defineProperty(DatePickerRoot, "displayName", "DatePicker");
|
|
107
|
-
_defineProperty(DatePickerRoot, "defaultProps", function(props) {
|
|
108
|
-
return _objectSpread(_objectSpread({}, PickerAbstract.defaultProps(props)), {}, {
|
|
109
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DatePicker.Trigger, null), /* @__PURE__ */ React.createElement(DatePicker.Popper, null))
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
var Today = /* @__PURE__ */ (function(_Component) {
|
|
113
|
-
function Today2() {
|
|
114
|
-
_classCallCheck(this, Today2);
|
|
115
|
-
return _callSuper(this, Today2, arguments);
|
|
30
|
+
getButtonTriggerProps() {
|
|
31
|
+
const {
|
|
32
|
+
value,
|
|
33
|
+
locale
|
|
34
|
+
} = this.asProps;
|
|
35
|
+
return {
|
|
36
|
+
...super.getButtonTriggerProps(),
|
|
37
|
+
placeholder: "Select date",
|
|
38
|
+
children: value ? formatDDMMYY(value, locale) : null
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
getTriggerProps() {
|
|
42
|
+
const {
|
|
43
|
+
value,
|
|
44
|
+
onChange,
|
|
45
|
+
onDisplayedPeriodChange,
|
|
46
|
+
locale,
|
|
47
|
+
disabled,
|
|
48
|
+
disabledErrorText,
|
|
49
|
+
getI18nText,
|
|
50
|
+
animationsDisabled
|
|
51
|
+
} = this.asProps;
|
|
52
|
+
return {
|
|
53
|
+
...super.getButtonTriggerProps(),
|
|
54
|
+
value,
|
|
55
|
+
onChange,
|
|
56
|
+
onDisplayedPeriodChange,
|
|
57
|
+
locale,
|
|
58
|
+
disabledDates: disabled,
|
|
59
|
+
disabledErrorText,
|
|
60
|
+
children: () => /* @__PURE__ */ React.createElement(InputTrigger.SingleDateInput, null),
|
|
61
|
+
getI18nText,
|
|
62
|
+
animationsDisabled,
|
|
63
|
+
unit: this.keyStep
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
getPopperProps() {
|
|
67
|
+
return {
|
|
68
|
+
...super.getPopperProps(),
|
|
69
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DatePicker.Header, null), /* @__PURE__ */ React.createElement(DatePicker.Calendar, null), /* @__PURE__ */ React.createElement(Divider, {
|
|
70
|
+
ml: -4,
|
|
71
|
+
mt: 4,
|
|
72
|
+
w: "calc(100% + 32px)"
|
|
73
|
+
}), /* @__PURE__ */ React.createElement(DatePicker.Today, null))
|
|
74
|
+
};
|
|
116
75
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
76
|
+
getTitleProps() {
|
|
77
|
+
const {
|
|
78
|
+
displayedPeriod,
|
|
79
|
+
locale
|
|
80
|
+
} = this.asProps;
|
|
81
|
+
return {
|
|
82
|
+
...super.getTitleProps(),
|
|
83
|
+
children: new Intl.DateTimeFormat(locale, {
|
|
84
|
+
month: "long",
|
|
85
|
+
year: "numeric"
|
|
86
|
+
}).format(dayjs(displayedPeriod).startOf("month").toDate())
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
getTodayProps() {
|
|
90
|
+
const {
|
|
91
|
+
i18n,
|
|
92
|
+
locale,
|
|
93
|
+
disabled
|
|
94
|
+
} = this.asProps;
|
|
95
|
+
return {
|
|
96
|
+
i18n,
|
|
97
|
+
locale,
|
|
98
|
+
onClick: this.handlerToday,
|
|
99
|
+
disabled: disabled.some(includesDate(dayjs(), "day"))
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
_defineProperty(DatePickerRoot, "displayName", "DatePicker");
|
|
104
|
+
_defineProperty(DatePickerRoot, "defaultProps", (props) => ({
|
|
105
|
+
...PickerAbstract.defaultProps(props),
|
|
106
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DatePicker.Trigger, null), /* @__PURE__ */ React.createElement(DatePicker.Popper, null))
|
|
107
|
+
}));
|
|
108
|
+
class Today extends Component {
|
|
109
|
+
render() {
|
|
110
|
+
var _ref = this.asProps, _ref2;
|
|
111
|
+
const SToday = Box;
|
|
112
|
+
const {
|
|
113
|
+
styles,
|
|
114
|
+
getI18nText,
|
|
115
|
+
disabled,
|
|
116
|
+
onClick
|
|
117
|
+
} = this.asProps;
|
|
118
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SToday, _ref2.cn("SToday", {
|
|
119
|
+
...assignProps({
|
|
125
120
|
"__excludeProps": ["onClick"]
|
|
126
|
-
}, _ref)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
121
|
+
}, _ref)
|
|
122
|
+
}), /* @__PURE__ */ React.createElement(Button, _ref2.cn("Button", {
|
|
123
|
+
"use": "tertiary",
|
|
124
|
+
"children": getI18nText("today"),
|
|
125
|
+
"disabled": disabled,
|
|
126
|
+
"onClick": onClick
|
|
127
|
+
})));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
135
130
|
_defineProperty(Today, "enhance", [i18nEnhance(localizedMessages)]);
|
|
136
|
-
|
|
131
|
+
const DatePicker = createComponent(DatePickerRoot, {
|
|
137
132
|
Trigger: InputTrigger,
|
|
138
133
|
ButtonTrigger: Trigger,
|
|
139
134
|
Popper,
|
|
@@ -1,13 +1,7 @@
|
|
|
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 React from "react";
|
|
12
6
|
import { Period, Next, Prev, Title, Header as Header$1, Popper } from "./components/index.mjs";
|
|
13
7
|
import { CalendarDays } from "./components/Calendar.mjs";
|
|
@@ -15,15 +9,19 @@ import DateRangeComparatorAbstract, { Footer, Body, CompareToggle, Trigger, Rese
|
|
|
15
9
|
import InputTrigger from "./components/InputTrigger.mjs";
|
|
16
10
|
function RangeInput(props) {
|
|
17
11
|
var _ref = arguments[0], _ref2;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const {
|
|
13
|
+
styles
|
|
14
|
+
} = props;
|
|
15
|
+
const SComparatorRangeInput = Box;
|
|
16
|
+
const SRangeIndicator = Box;
|
|
17
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SComparatorRangeInput, _ref2.cn("SComparatorRangeInput", {
|
|
18
|
+
...assignProps({
|
|
19
|
+
"data-name": "SComparatorRangeInput",
|
|
20
|
+
"tag": InputTrigger,
|
|
21
|
+
"unit": "date",
|
|
22
|
+
"__excludeProps": ["role", "aria-haspopup", "aria-expanded", "onChange", "value", "id"]
|
|
23
|
+
}, _ref)
|
|
24
|
+
}), /* @__PURE__ */ React.createElement(InputTrigger.DateRange, null, /* @__PURE__ */ React.createElement(SRangeIndicator, _ref2.cn("SRangeIndicator", {
|
|
27
25
|
"range": props.range,
|
|
28
26
|
"disabled": props.disabled,
|
|
29
27
|
"w": 12,
|
|
@@ -38,98 +36,85 @@ RangeInput.SingleDateInput = InputTrigger.SingleDateInput;
|
|
|
38
36
|
RangeInput.DateRange = InputTrigger.DateRange;
|
|
39
37
|
RangeInput.DateRangeFromInput = InputTrigger.DateRangeFromInput;
|
|
40
38
|
RangeInput.DateRangeToInput = InputTrigger.DateRangeToInput;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
_this = _callSuper(this, DateRangeComparatorRoot2, [].concat(args));
|
|
49
|
-
_defineProperty(_this, "navigateStep", "month");
|
|
50
|
-
_defineProperty(_this, "keyStep", "day");
|
|
51
|
-
_defineProperty(_this, "keyDiff", {
|
|
39
|
+
class DateRangeComparatorRoot extends DateRangeComparatorAbstract {
|
|
40
|
+
constructor(...args) {
|
|
41
|
+
super(...args);
|
|
42
|
+
_defineProperty(this, "navigateStep", "month");
|
|
43
|
+
_defineProperty(this, "keyStep", "day");
|
|
44
|
+
_defineProperty(this, "keyDiff", {
|
|
52
45
|
ArrowLeft: -1,
|
|
53
46
|
ArrowUp: -7,
|
|
54
47
|
ArrowRight: 1,
|
|
55
48
|
ArrowDown: 7
|
|
56
49
|
});
|
|
57
|
-
return _this;
|
|
58
50
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
key: "getFooterProps",
|
|
116
|
-
value: function getFooterProps(_ref11) {
|
|
117
|
-
var _ref11$unclearable = _ref11.unclearable, unclearable = _ref11$unclearable === void 0 ? false : _ref11$unclearable;
|
|
118
|
-
return {
|
|
119
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(DateRangeComparator.Reset, null))
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}]);
|
|
123
|
-
})(DateRangeComparatorAbstract);
|
|
51
|
+
getRangeInput() {
|
|
52
|
+
return /* @__PURE__ */ React.createElement(DateRangeComparator.RangeInput.DateRange, null);
|
|
53
|
+
}
|
|
54
|
+
getRangeCalendarProps() {
|
|
55
|
+
return {
|
|
56
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Flex, {
|
|
57
|
+
direction: "column"
|
|
58
|
+
}, /* @__PURE__ */ React.createElement(DateRangeComparator.CalendarHeader, {
|
|
59
|
+
tag: Flex
|
|
60
|
+
}, /* @__PURE__ */ React.createElement(DateRangeComparator.Prev, null), /* @__PURE__ */ React.createElement(DateRangeComparator.Title, null)), /* @__PURE__ */ React.createElement(DateRangeComparator.Calendar, null)), /* @__PURE__ */ React.createElement(Flex, {
|
|
61
|
+
direction: "column"
|
|
62
|
+
}, /* @__PURE__ */ React.createElement(DateRangeComparator.CalendarHeader, {
|
|
63
|
+
tag: Flex
|
|
64
|
+
}, /* @__PURE__ */ React.createElement(DateRangeComparator.Title, null), /* @__PURE__ */ React.createElement(DateRangeComparator.Next, null)), /* @__PURE__ */ React.createElement(DateRangeComparator.Calendar, null)))
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
getPopperProps() {
|
|
68
|
+
return {
|
|
69
|
+
...super.getPopperProps(),
|
|
70
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Header, null), /* @__PURE__ */ React.createElement(DateRangeComparator.Body, {
|
|
71
|
+
showButtons: true
|
|
72
|
+
}))
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
getHeaderProps() {
|
|
76
|
+
return {
|
|
77
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangeComparator.ValueDateRange, null), /* @__PURE__ */ React.createElement(DateRangeComparator.CompareToggle, null), /* @__PURE__ */ React.createElement(DateRangeComparator.CompareDateRange, null))
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
getBodyProps({
|
|
81
|
+
showButtons
|
|
82
|
+
}) {
|
|
83
|
+
return {
|
|
84
|
+
children: /* @__PURE__ */ React.createElement(Flex, null, /* @__PURE__ */ React.createElement(DateRangeComparator.RangeCalendar, null), /* @__PURE__ */ React.createElement(DateRangeComparator.Periods, {
|
|
85
|
+
showButtons
|
|
86
|
+
}))
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
getPeriodsProps({
|
|
90
|
+
showButtons,
|
|
91
|
+
unclearable = false
|
|
92
|
+
}) {
|
|
93
|
+
return {
|
|
94
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Periods.Divider, null), /* @__PURE__ */ React.createElement(DateRangeComparator.Periods.Column, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Periods.Options, null), showButtons && /* @__PURE__ */ React.createElement(DateRangeComparator.Periods.Controls, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(DateRangeComparator.Reset, null))))
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
getFooterProps({
|
|
98
|
+
unclearable = false
|
|
99
|
+
}) {
|
|
100
|
+
return {
|
|
101
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Apply, null), !unclearable && /* @__PURE__ */ React.createElement(DateRangeComparator.Reset, null))
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
124
105
|
_defineProperty(DateRangeComparatorRoot, "displayName", "DateRangeComparator");
|
|
125
|
-
_defineProperty(DateRangeComparatorRoot, "defaultProps",
|
|
126
|
-
return
|
|
106
|
+
_defineProperty(DateRangeComparatorRoot, "defaultProps", (props) => {
|
|
107
|
+
return {
|
|
108
|
+
...DateRangeComparatorAbstract.defaultProps(props),
|
|
127
109
|
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DateRangeComparator.Trigger, null), /* @__PURE__ */ React.createElement(DateRangeComparator.Popper, null))
|
|
128
|
-
}
|
|
110
|
+
};
|
|
129
111
|
});
|
|
130
112
|
function ValueDateRange(props) {
|
|
131
113
|
var _ref3;
|
|
132
|
-
|
|
114
|
+
const {
|
|
115
|
+
Root: SValueDateRange,
|
|
116
|
+
styles
|
|
117
|
+
} = props;
|
|
133
118
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SValueDateRange, _ref3.cn("SValueDateRange", {
|
|
134
119
|
"render": DateRangeComparator.RangeInput,
|
|
135
120
|
"range": "value"
|
|
@@ -137,7 +122,10 @@ function ValueDateRange(props) {
|
|
|
137
122
|
}
|
|
138
123
|
function CompareDateRange(props) {
|
|
139
124
|
var _ref4;
|
|
140
|
-
|
|
125
|
+
const {
|
|
126
|
+
Root: SSecondaryDateRange,
|
|
127
|
+
styles
|
|
128
|
+
} = props;
|
|
141
129
|
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SSecondaryDateRange, _ref4.cn("SSecondaryDateRange", {
|
|
142
130
|
"render": DateRangeComparator.RangeInput,
|
|
143
131
|
"range": "compare"
|
|
@@ -145,7 +133,11 @@ function CompareDateRange(props) {
|
|
|
145
133
|
}
|
|
146
134
|
function RangeCalendar(props) {
|
|
147
135
|
var _ref5;
|
|
148
|
-
|
|
136
|
+
const {
|
|
137
|
+
Root: SRangeCalendar,
|
|
138
|
+
Children,
|
|
139
|
+
styles
|
|
140
|
+
} = props;
|
|
149
141
|
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SRangeCalendar, _ref5.cn("SRangeCalendar", {
|
|
150
142
|
"render": Flex,
|
|
151
143
|
"gap": 8
|
|
@@ -153,14 +145,20 @@ function RangeCalendar(props) {
|
|
|
153
145
|
}
|
|
154
146
|
function Periods(props) {
|
|
155
147
|
var _ref6;
|
|
156
|
-
|
|
148
|
+
const {
|
|
149
|
+
Root: SPeriods,
|
|
150
|
+
styles
|
|
151
|
+
} = props;
|
|
157
152
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriods, _ref6.cn("SPeriods", {
|
|
158
153
|
"render": Flex
|
|
159
154
|
}));
|
|
160
155
|
}
|
|
161
156
|
function PeriodsDivider(props) {
|
|
162
157
|
var _ref7;
|
|
163
|
-
|
|
158
|
+
const {
|
|
159
|
+
Root: SPeriodsDivider,
|
|
160
|
+
styles
|
|
161
|
+
} = props;
|
|
164
162
|
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsDivider, _ref7.cn("SPeriodsDivider", {
|
|
165
163
|
"orientation": "vertical",
|
|
166
164
|
"h": "auto",
|
|
@@ -169,7 +167,10 @@ function PeriodsDivider(props) {
|
|
|
169
167
|
}
|
|
170
168
|
function PeriodsColumn(props) {
|
|
171
169
|
var _ref8;
|
|
172
|
-
|
|
170
|
+
const {
|
|
171
|
+
Root: SPeriodsColumn,
|
|
172
|
+
styles
|
|
173
|
+
} = props;
|
|
173
174
|
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsColumn, _ref8.cn("SPeriodsColumn", {
|
|
174
175
|
"render": Flex,
|
|
175
176
|
"direction": "column",
|
|
@@ -178,7 +179,10 @@ function PeriodsColumn(props) {
|
|
|
178
179
|
}
|
|
179
180
|
function PeriodsOptions(props) {
|
|
180
181
|
var _ref9;
|
|
181
|
-
|
|
182
|
+
const {
|
|
183
|
+
styles,
|
|
184
|
+
Root: SPeriodsOptions
|
|
185
|
+
} = props;
|
|
182
186
|
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsOptions, _ref9.cn("SPeriodsOptions", {
|
|
183
187
|
"render": DateRangeComparator.Period,
|
|
184
188
|
"p": 2
|
|
@@ -186,14 +190,17 @@ function PeriodsOptions(props) {
|
|
|
186
190
|
}
|
|
187
191
|
function PeriodsControls(props) {
|
|
188
192
|
var _ref0;
|
|
189
|
-
|
|
193
|
+
const {
|
|
194
|
+
styles,
|
|
195
|
+
Root: SPeriodsControls
|
|
196
|
+
} = props;
|
|
190
197
|
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SPeriodsControls, _ref0.cn("SPeriodsControls", {
|
|
191
198
|
"render": Flex,
|
|
192
199
|
"p": 4,
|
|
193
200
|
"gap": 2
|
|
194
201
|
}));
|
|
195
202
|
}
|
|
196
|
-
|
|
203
|
+
const DateRangeComparator = createComponent(DateRangeComparatorRoot, {
|
|
197
204
|
Popper,
|
|
198
205
|
CalendarHeader: Header$1,
|
|
199
206
|
Title,
|