@semcore/date-picker 4.16.0 → 4.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/lib/cjs/components/Calendar.js +16 -16
- package/lib/cjs/components/InputTrigger.js +18 -18
- package/lib/cjs/components/PickerAbstract.js +18 -18
- package/lib/cjs/components/RangePickerAbstract.js +18 -18
- package/lib/cjs/components/index.js +2 -2
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/es6/components/Calendar.js +16 -16
- package/lib/es6/components/InputTrigger.js +18 -18
- package/lib/es6/components/PickerAbstract.js +18 -18
- package/lib/es6/components/RangePickerAbstract.js +18 -18
- package/lib/es6/components/index.js +2 -2
- package/lib/es6/components/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [4.16.
|
|
5
|
+
## [4.16.1-prerelease.1] - 2023-11-14
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version prepatch update due to children dependencies update (`@semcore/dropdown` [4.10.1 ~> 4.10.2]).
|
|
10
|
+
|
|
11
|
+
## [4.16.0] - 2023-11-13
|
|
6
12
|
|
|
7
13
|
### Changed
|
|
8
14
|
|
|
@@ -28,22 +28,22 @@ var _includesDate = _interopRequireDefault(require("../utils/includesDate"));
|
|
|
28
28
|
var _formatDate = require("../utils/formatDate");
|
|
29
29
|
var _excluded = ["date"];
|
|
30
30
|
/*__reshadow-styles__:"../style/calendar.shadow.css"*/
|
|
31
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
32
|
-
"__SCalendar": "
|
|
33
|
-
"__SGridDays": "
|
|
34
|
-
"__SGridMonths": "
|
|
35
|
-
"__SWeekDays": "
|
|
36
|
-
"__SWeekDay": "
|
|
37
|
-
"__SCalendarUnit": "
|
|
38
|
-
"_startHighlighted": "
|
|
39
|
-
"_selected": "
|
|
40
|
-
"_endHighlighted": "
|
|
41
|
-
"_startSelected": "
|
|
42
|
-
"_endSelected": "
|
|
43
|
-
"_outdated": "
|
|
44
|
-
"_disabled": "
|
|
45
|
-
"_highlighted": "
|
|
46
|
-
"_today": "
|
|
31
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SCalendar_1dmi3_gg_{display:flex;flex-direction:column}.___SGridDays_1dmi3_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto));grid-template-rows:repeat(auto-fit,minmax(32px,auto))}.___SGridMonths_1dmi3_gg_{display:grid;grid-row-gap:var(--intergalactic-spacing-2x, 8px);grid-template-columns:repeat(3,minmax(60px,auto));grid-template-rows:repeat(4,minmax(32px,auto))}.___SWeekDays_1dmi3_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto))}.___SCalendarUnit_1dmi3_gg_,.___SWeekDay_1dmi3_gg_{align-items:center;display:flex;font-size:var(--intergalactic-fs-200, 14px);justify-content:center;min-height:32px;min-width:32px}.___SWeekDay_1dmi3_gg_{color:var(--intergalactic-text-secondary, #6c6e79);font-weight:var(--intergalactic-regular, 400);overflow:hidden}.___SCalendarUnit_1dmi3_gg_{font-family:inherit;font-weight:400;line-height:normal;-webkit-text-decoration:none;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:var(--intergalactic-text-primary, #191b23);box-shadow:none;overflow:visible;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:var(--intergalactic-date-picker-cell, #ffffff);border-radius:var(--intergalactic-control-rounded, 6px);box-sizing:border-box;cursor:pointer;position:relative;transition:color .15s,background .15s,border-radius .15s .15s;outline:0;margin:0}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_:hover{color:var(--intergalactic-text-primary, #191b23);background:var(--intergalactic-date-picker-cell-hover, #e0e1e9)}}.___SCalendarUnit_1dmi3_gg_:focus-visible{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SCalendarUnit_1dmi3_gg_.__today_1dmi3_gg_:before{content:\"\";position:absolute;display:block;top:1px;left:1px;border-radius:var(--intergalactic-control-rounded, 6px);width:calc(100% - 2px);height:calc(100% - 2px);box-sizing:border-box;border:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SCalendarUnit_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__today_1dmi3_gg_.__endSelected_1dmi3_gg_:before,.___SCalendarUnit_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__today_1dmi3_gg_.__startSelected_1dmi3_gg_:before{border-color:var(--intergalactic-border-secondary, #e0e1e9)}.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_{border-radius:0;transition:color .15s,background .15s,border-radius 0s 0s;color:var(--intergalactic-text-primary, #191b23)}.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_{background:var(--intergalactic-date-picker-cell-range, #c4e5fe)}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_:hover{background:var(--intergalactic-date-picker-cell-range-hover, #8ecdff)}}.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_{background:var(--intergalactic-date-picker-cell-range-hover, #8ecdff)}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_:hover{background:var(--intergalactic-date-picker-cell-range-hover, #8ecdff)}}.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_:not(.__highlighted_1dmi3_gg_){border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-bottom-right-radius:0;border-top-left-radius:var(--intergalactic-control-rounded, 6px);border-top-right-radius:0}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_:hover{color:var(--intergalactic-text-primary-invert, #ffffff);background:var(--intergalactic-date-picker-cell-active-hover, #008ff8)}}.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_{background:var(--intergalactic-date-picker-cell-active, #2bb3ff);color:var(--intergalactic-text-primary-invert, #ffffff)}.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_:not(.__highlighted_1dmi3_gg_){border-bottom-left-radius:0;border-bottom-right-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:0;border-top-right-radius:var(--intergalactic-control-rounded, 6px)}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_:hover{color:var(--intergalactic-text-primary-invert, #ffffff);background:var(--intergalactic-date-picker-cell-active-hover, #008ff8)}}.___SCalendarUnit_1dmi3_gg_.__startHighlighted_1dmi3_gg_:not(.__selected_1dmi3_gg_){border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-bottom-right-radius:0;border-top-left-radius:var(--intergalactic-control-rounded, 6px);border-top-right-radius:0}.___SCalendarUnit_1dmi3_gg_.__endHighlighted_1dmi3_gg_:not(.__selected_1dmi3_gg_){border-bottom-left-radius:0;border-bottom-right-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:0;border-top-right-radius:var(--intergalactic-control-rounded, 6px)}.___SCalendarUnit_1dmi3_gg_.__startHighlighted_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__endHighlighted_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_{border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-bottom-right-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px);border-top-right-radius:var(--intergalactic-control-rounded, 6px)}.___SCalendarUnit_1dmi3_gg_.__outdated_1dmi3_gg_{opacity:.2}.___SCalendarUnit_1dmi3_gg_.__disabled_1dmi3_gg_{opacity:.4;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SCalendarUnit_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_{transition:none}}" /*__inner_css_end__*/, "1dmi3_gg_") /*__reshadow_css_end__*/, {
|
|
32
|
+
"__SCalendar": "___SCalendar_1dmi3_gg_",
|
|
33
|
+
"__SGridDays": "___SGridDays_1dmi3_gg_",
|
|
34
|
+
"__SGridMonths": "___SGridMonths_1dmi3_gg_",
|
|
35
|
+
"__SWeekDays": "___SWeekDays_1dmi3_gg_",
|
|
36
|
+
"__SWeekDay": "___SWeekDay_1dmi3_gg_",
|
|
37
|
+
"__SCalendarUnit": "___SCalendarUnit_1dmi3_gg_",
|
|
38
|
+
"_startHighlighted": "__startHighlighted_1dmi3_gg_",
|
|
39
|
+
"_selected": "__selected_1dmi3_gg_",
|
|
40
|
+
"_endHighlighted": "__endHighlighted_1dmi3_gg_",
|
|
41
|
+
"_startSelected": "__startSelected_1dmi3_gg_",
|
|
42
|
+
"_endSelected": "__endSelected_1dmi3_gg_",
|
|
43
|
+
"_outdated": "__outdated_1dmi3_gg_",
|
|
44
|
+
"_disabled": "__disabled_1dmi3_gg_",
|
|
45
|
+
"_highlighted": "__highlighted_1dmi3_gg_",
|
|
46
|
+
"_today": "__today_1dmi3_gg_"
|
|
47
47
|
});
|
|
48
48
|
_dayjs["default"].extend(_isBetween["default"]);
|
|
49
49
|
var range = function range(N, cb) {
|
|
@@ -34,24 +34,24 @@ var _excluded = ["children", "id", "role", "aria-haspopup", "aria-label", "style
|
|
|
34
34
|
_excluded5 = ["value", "locale", "onDisplayedPeriodChange"],
|
|
35
35
|
_excluded6 = ["date", "onDateChange", "onDisplayedPeriodChange", "locale", "styles", "parts", "disabledDates", "forwardRef", "placeholders", "labelPrefix", "__excludeProps", "Root"];
|
|
36
36
|
/*__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
37
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
38
|
-
"__SHeader": "
|
|
39
|
-
"__STitle": "
|
|
40
|
-
"__SToday": "
|
|
41
|
-
"__SPeriod": "
|
|
42
|
-
"__SButton": "
|
|
43
|
-
"__SInner": "
|
|
44
|
-
"__SInputMask": "
|
|
45
|
-
"__SIndicator": "
|
|
46
|
-
"__SHumanizedDate": "
|
|
47
|
-
"__SSingleDateInput": "
|
|
48
|
-
"__SValue": "
|
|
49
|
-
"__SDateRange": "
|
|
50
|
-
"__SMask": "
|
|
51
|
-
"_noHumanizedDate": "
|
|
52
|
-
"__SRangeSep": "
|
|
53
|
-
"_fulfilled": "
|
|
54
|
-
"__SPopper": "
|
|
37
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPopper_7qpwt_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_7qpwt_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_7qpwt_gg_:active,.___SPopper_7qpwt_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_7qpwt_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_7qpwt_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_7qpwt_gg_,.___STitle_7qpwt_gg_{display:flex;align-items:center}.___STitle_7qpwt_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_7qpwt_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_7qpwt_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_7qpwt_gg_ .___SInner_7qpwt_gg_{justify-content:flex-start}.___SInputMask_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal}.___SIndicator_7qpwt_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SHumanizedDate_7qpwt_gg_{position:absolute;pointer-events:none}.___SDateRange_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_ .___SValue_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:0}.___SSingleDateInput_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_ .___SInputMask_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_7qpwt_gg_:focus-within .___SRangeSep_7qpwt_gg_,.___SRangeSep_7qpwt_gg_.__fulfilled_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23)}" /*__inner_css_end__*/, "7qpwt_gg_") /*__reshadow_css_end__*/, {
|
|
38
|
+
"__SHeader": "___SHeader_7qpwt_gg_",
|
|
39
|
+
"__STitle": "___STitle_7qpwt_gg_",
|
|
40
|
+
"__SToday": "___SToday_7qpwt_gg_",
|
|
41
|
+
"__SPeriod": "___SPeriod_7qpwt_gg_",
|
|
42
|
+
"__SButton": "___SButton_7qpwt_gg_",
|
|
43
|
+
"__SInner": "___SInner_7qpwt_gg_",
|
|
44
|
+
"__SInputMask": "___SInputMask_7qpwt_gg_",
|
|
45
|
+
"__SIndicator": "___SIndicator_7qpwt_gg_",
|
|
46
|
+
"__SHumanizedDate": "___SHumanizedDate_7qpwt_gg_",
|
|
47
|
+
"__SSingleDateInput": "___SSingleDateInput_7qpwt_gg_",
|
|
48
|
+
"__SValue": "___SValue_7qpwt_gg_",
|
|
49
|
+
"__SDateRange": "___SDateRange_7qpwt_gg_",
|
|
50
|
+
"__SMask": "___SMask_7qpwt_gg_",
|
|
51
|
+
"_noHumanizedDate": "__noHumanizedDate_7qpwt_gg_",
|
|
52
|
+
"__SRangeSep": "___SRangeSep_7qpwt_gg_",
|
|
53
|
+
"_fulfilled": "__fulfilled_7qpwt_gg_",
|
|
54
|
+
"__SPopper": "___SPopper_7qpwt_gg_"
|
|
55
55
|
});
|
|
56
56
|
var defaultAllowedParts = {
|
|
57
57
|
year: true,
|
|
@@ -19,24 +19,24 @@ var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i
|
|
|
19
19
|
var _intergalacticDynamicLocales = require("../translations/__intergalactic-dynamic-locales");
|
|
20
20
|
var _includesDate = _interopRequireDefault(require("../utils/includesDate"));
|
|
21
21
|
/*__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SHeader": "
|
|
24
|
-
"__STitle": "
|
|
25
|
-
"__SToday": "
|
|
26
|
-
"__SPeriod": "
|
|
27
|
-
"__SButton": "
|
|
28
|
-
"__SInner": "
|
|
29
|
-
"__SInputMask": "
|
|
30
|
-
"__SIndicator": "
|
|
31
|
-
"__SHumanizedDate": "
|
|
32
|
-
"__SSingleDateInput": "
|
|
33
|
-
"__SValue": "
|
|
34
|
-
"__SDateRange": "
|
|
35
|
-
"__SMask": "
|
|
36
|
-
"_noHumanizedDate": "
|
|
37
|
-
"__SRangeSep": "
|
|
38
|
-
"_fulfilled": "
|
|
39
|
-
"__SPopper": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPopper_7qpwt_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_7qpwt_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_7qpwt_gg_:active,.___SPopper_7qpwt_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_7qpwt_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_7qpwt_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_7qpwt_gg_,.___STitle_7qpwt_gg_{display:flex;align-items:center}.___STitle_7qpwt_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_7qpwt_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_7qpwt_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_7qpwt_gg_ .___SInner_7qpwt_gg_{justify-content:flex-start}.___SInputMask_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal}.___SIndicator_7qpwt_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SHumanizedDate_7qpwt_gg_{position:absolute;pointer-events:none}.___SDateRange_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_ .___SValue_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:0}.___SSingleDateInput_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_ .___SInputMask_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_7qpwt_gg_:focus-within .___SRangeSep_7qpwt_gg_,.___SRangeSep_7qpwt_gg_.__fulfilled_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23)}" /*__inner_css_end__*/, "7qpwt_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SHeader": "___SHeader_7qpwt_gg_",
|
|
24
|
+
"__STitle": "___STitle_7qpwt_gg_",
|
|
25
|
+
"__SToday": "___SToday_7qpwt_gg_",
|
|
26
|
+
"__SPeriod": "___SPeriod_7qpwt_gg_",
|
|
27
|
+
"__SButton": "___SButton_7qpwt_gg_",
|
|
28
|
+
"__SInner": "___SInner_7qpwt_gg_",
|
|
29
|
+
"__SInputMask": "___SInputMask_7qpwt_gg_",
|
|
30
|
+
"__SIndicator": "___SIndicator_7qpwt_gg_",
|
|
31
|
+
"__SHumanizedDate": "___SHumanizedDate_7qpwt_gg_",
|
|
32
|
+
"__SSingleDateInput": "___SSingleDateInput_7qpwt_gg_",
|
|
33
|
+
"__SValue": "___SValue_7qpwt_gg_",
|
|
34
|
+
"__SDateRange": "___SDateRange_7qpwt_gg_",
|
|
35
|
+
"__SMask": "___SMask_7qpwt_gg_",
|
|
36
|
+
"_noHumanizedDate": "__noHumanizedDate_7qpwt_gg_",
|
|
37
|
+
"__SRangeSep": "___SRangeSep_7qpwt_gg_",
|
|
38
|
+
"_fulfilled": "__fulfilled_7qpwt_gg_",
|
|
39
|
+
"__SPopper": "___SPopper_7qpwt_gg_"
|
|
40
40
|
});
|
|
41
41
|
var INTERACTION_TAGS = ['INPUT'];
|
|
42
42
|
var defaultDisplayedPeriod = new Date(new Date().setHours(0, 0, 0, 0));
|
|
@@ -24,24 +24,24 @@ var _dropdown = _interopRequireDefault(require("@semcore/dropdown"));
|
|
|
24
24
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
25
25
|
var _intergalacticDynamicLocales = require("../translations/__intergalactic-dynamic-locales");
|
|
26
26
|
/*__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
27
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
28
|
-
"__SHeader": "
|
|
29
|
-
"__STitle": "
|
|
30
|
-
"__SToday": "
|
|
31
|
-
"__SPeriod": "
|
|
32
|
-
"__SButton": "
|
|
33
|
-
"__SInner": "
|
|
34
|
-
"__SInputMask": "
|
|
35
|
-
"__SIndicator": "
|
|
36
|
-
"__SHumanizedDate": "
|
|
37
|
-
"__SSingleDateInput": "
|
|
38
|
-
"__SValue": "
|
|
39
|
-
"__SDateRange": "
|
|
40
|
-
"__SMask": "
|
|
41
|
-
"_noHumanizedDate": "
|
|
42
|
-
"__SRangeSep": "
|
|
43
|
-
"_fulfilled": "
|
|
44
|
-
"__SPopper": "
|
|
27
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPopper_7qpwt_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_7qpwt_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_7qpwt_gg_:active,.___SPopper_7qpwt_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_7qpwt_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_7qpwt_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_7qpwt_gg_,.___STitle_7qpwt_gg_{display:flex;align-items:center}.___STitle_7qpwt_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_7qpwt_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_7qpwt_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_7qpwt_gg_ .___SInner_7qpwt_gg_{justify-content:flex-start}.___SInputMask_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal}.___SIndicator_7qpwt_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SHumanizedDate_7qpwt_gg_{position:absolute;pointer-events:none}.___SDateRange_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_ .___SValue_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:0}.___SSingleDateInput_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_ .___SInputMask_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_7qpwt_gg_:focus-within .___SRangeSep_7qpwt_gg_,.___SRangeSep_7qpwt_gg_.__fulfilled_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23)}" /*__inner_css_end__*/, "7qpwt_gg_") /*__reshadow_css_end__*/, {
|
|
28
|
+
"__SHeader": "___SHeader_7qpwt_gg_",
|
|
29
|
+
"__STitle": "___STitle_7qpwt_gg_",
|
|
30
|
+
"__SToday": "___SToday_7qpwt_gg_",
|
|
31
|
+
"__SPeriod": "___SPeriod_7qpwt_gg_",
|
|
32
|
+
"__SButton": "___SButton_7qpwt_gg_",
|
|
33
|
+
"__SInner": "___SInner_7qpwt_gg_",
|
|
34
|
+
"__SInputMask": "___SInputMask_7qpwt_gg_",
|
|
35
|
+
"__SIndicator": "___SIndicator_7qpwt_gg_",
|
|
36
|
+
"__SHumanizedDate": "___SHumanizedDate_7qpwt_gg_",
|
|
37
|
+
"__SSingleDateInput": "___SSingleDateInput_7qpwt_gg_",
|
|
38
|
+
"__SValue": "___SValue_7qpwt_gg_",
|
|
39
|
+
"__SDateRange": "___SDateRange_7qpwt_gg_",
|
|
40
|
+
"__SMask": "___SMask_7qpwt_gg_",
|
|
41
|
+
"_noHumanizedDate": "__noHumanizedDate_7qpwt_gg_",
|
|
42
|
+
"__SRangeSep": "___SRangeSep_7qpwt_gg_",
|
|
43
|
+
"_fulfilled": "__fulfilled_7qpwt_gg_",
|
|
44
|
+
"__SPopper": "___SPopper_7qpwt_gg_"
|
|
45
45
|
});
|
|
46
46
|
var INTERACTION_TAGS = ['INPUT'];
|
|
47
47
|
var defaultDisplayedPeriod = new Date(new Date().setHours(0, 0, 0, 0));
|
|
@@ -88,7 +88,7 @@ function Prev(_ref14) {
|
|
|
88
88
|
"size": 'l',
|
|
89
89
|
"tabIndex": -1,
|
|
90
90
|
"aria-label": getI18nText('prev')
|
|
91
|
-
}, _ref6), children ? /*#__PURE__*/_react["default"].createElement(Children, null) : /*#__PURE__*/_react["default"].createElement(_m["default"], null));
|
|
91
|
+
}, _ref6), children ? /*#__PURE__*/_react["default"].createElement(Children, null) : /*#__PURE__*/_react["default"].createElement(_button["default"].Addon, null, /*#__PURE__*/_react["default"].createElement(_m["default"], null)));
|
|
92
92
|
}
|
|
93
93
|
function Next(_ref15) {
|
|
94
94
|
var _ref7 = arguments[0];
|
|
@@ -101,7 +101,7 @@ function Next(_ref15) {
|
|
|
101
101
|
"size": 'l',
|
|
102
102
|
"tabIndex": -1,
|
|
103
103
|
"aria-label": getI18nText('next')
|
|
104
|
-
}, _ref7), children ? /*#__PURE__*/_react["default"].createElement(Children, null) : /*#__PURE__*/_react["default"].createElement(_m2["default"], null));
|
|
104
|
+
}, _ref7), children ? /*#__PURE__*/_react["default"].createElement(Children, null) : /*#__PURE__*/_react["default"].createElement(_button["default"].Addon, null, /*#__PURE__*/_react["default"].createElement(_m2["default"], null)));
|
|
105
105
|
}
|
|
106
106
|
var Period = /*#__PURE__*/function (_Component) {
|
|
107
107
|
(0, _inherits2["default"])(Period, _Component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_core","require","_react","_interopRequireDefault","_dayjs","_dropdown","_flexBox","_button","_m","_m2","_assignProps9","_ButtonTrigger","_InputTrigger","_excluded","Trigger","_ref","arguments[0]","createElement","Dropdown","assignProps","ButtonTrigger","InputTrigger","_ref2","InputTriggerBase","Indicator","MaskedInput","Addon","SingleDateInput","DateRange","DateRangeFromInput","DateRangeToInput","Popper","props","_ref3","_ref9","SPopper","sstyled","styles","cn","_objectSpread2","Header","_ref4","_ref10","SHeader","Box","Title","_ref13","_ref5","_ref11","Children","STitle","exports","Prev","_ref14","_ref6","getI18nText","children","Button","Next","_ref15","_ref7","Period","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","period","undefined","value","compareMonth","monthOne","monthTwo","dayjs","isSame","isArray","_createClass2","key","render","_ref8","asProps","_ref12","_this2","SPeriod","_this$asProps","onChange","periods","onHighlightedChange","onDisplayedPeriodChange","map","_ref16","i","onClick","onMouseEnter","onMouseLeave","other","_objectWithoutProperties2","_extends2","use","theme","active","getActiveControl","callAllEventHandlers","toDate","Date","Component"],"sources":["../../../src/components/index.jsx"],"sourcesContent":["import React from 'react';\nimport dayjs from 'dayjs';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport Dropdown from '@semcore/dropdown';\nimport { Box } from '@semcore/flex-box';\nimport Button from '@semcore/button';\nimport ChevronLeft from '@semcore/icon/ChevronLeft/m';\nimport ChevronRight from '@semcore/icon/ChevronRight/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonTrigger from './ButtonTrigger';\nimport InputTriggerBase from './InputTrigger';\n\n/** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\nexport function Trigger() {\n return <Root render={Dropdown.Trigger} tag={ButtonTrigger} />;\n}\n\nexport function InputTrigger() {\n return (\n <Root\n render={Dropdown.Trigger}\n tag={InputTriggerBase}\n __excludeProps={['role', 'aria-haspopup', 'onChange', 'value']}\n />\n );\n}\nInputTrigger.Indicator = InputTriggerBase.Indicator;\nInputTrigger.MaskedInput = InputTriggerBase.MaskedInput;\nInputTrigger.Addon = InputTriggerBase.Addon;\nInputTrigger.SingleDateInput = InputTriggerBase.SingleDateInput;\nInputTrigger.DateRange = InputTriggerBase.DateRange;\nInputTrigger.DateRangeFromInput = InputTriggerBase.DateRangeFromInput;\nInputTrigger.DateRangeToInput = InputTriggerBase.DateRangeToInput;\n\nexport function Popper(props) {\n const SPopper = Root;\n return sstyled(props.styles)(<SPopper render={Dropdown.Popper} role='region' />);\n}\n\nexport function Header(props) {\n const SHeader = Root;\n return sstyled(props.styles)(<SHeader render={Box} />);\n}\n\nexport const Title = ({ Children, styles }) => {\n const STitle = Root;\n return sstyled(styles)(\n <STitle render={Box}>\n <Children />\n </STitle>,\n );\n};\n\nexport function Prev({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('prev')}\n >\n {children ? <Children /> : <ChevronLeft />}\n </Root>\n );\n}\n\nexport function Next({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('next')}\n >\n {children ? <Children /> : <ChevronRight />}\n </Root>\n );\n}\n\nexport class Period extends Component {\n getActiveControl = (period = [], value = undefined) => {\n function compareMonth(monthOne, monthTwo) {\n return dayjs(monthOne).isSame(dayjs(monthTwo), 'date');\n }\n\n if (!period || !value) return false;\n if (Array.isArray(value) && period.length !== value.length) return false;\n if (Array.isArray(value)) {\n return compareMonth(period[0], value[0]) && compareMonth(period[1], value[1]);\n }\n\n return compareMonth(period[0], value);\n };\n\n render() {\n const SPeriod = Root;\n const { styles, value, onChange, periods, onHighlightedChange, onDisplayedPeriodChange } =\n this.asProps;\n\n return sstyled(styles)(\n <SPeriod render={Box}>\n {periods.map(({ value: period, onClick, onMouseEnter, onMouseLeave, ...other }, i) => (\n <Button\n use='tertiary'\n theme='muted'\n styles={styles}\n key={i}\n active={this.getActiveControl(period, value)}\n onClick={callAllEventHandlers(onClick, () => onChange(period))}\n onMouseEnter={callAllEventHandlers(onMouseEnter, () => {\n onHighlightedChange(period);\n onDisplayedPeriodChange(dayjs(period[0]).toDate());\n })}\n onMouseLeave={callAllEventHandlers(onMouseLeave, () => {\n onHighlightedChange([]);\n onDisplayedPeriodChange(value[0] ? dayjs(value[0]).toDate() : new Date());\n })}\n {...other}\n />\n ))}\n </SPeriod>,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,EAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,GAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,aAAA,GAAAT,sBAAA,CAAAF,OAAA;AAA8C,IAAAY,SAAA;AAE9C;AACO,SAASC,OAAOA,CAAA,EAAG;EAAA,IAAAC,IAAA,GAAAC,YAAA;EACxB,oBAAOd,MAAA,YAAAe,aAAA,CAAcC,oBAAQ,CAACJ,OAAO,MAAAd,KAAA,CAAAmB,WAAA;IAAA,OAAOC;EAAa,GAAAL,IAAA,EAAI;AAC/D;AAEO,SAASM,YAAYA,CAAA,EAAG;EAAA,IAAAC,KAAA,GAAAN,YAAA;EAC7B,oBACEd,MAAA,YAAAe,aAAA,CACUC,oBAAQ,CAACJ,OAAO,MAAAd,KAAA,CAAAmB,WAAA;IAAA,OACnBI,wBAAgB;IAAA,kBACL,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO;EAAC,GAAAD,KAAA,EAC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B,OAAO,GAAAF,MAAA,CAAPE,OAAO;UAAEC,YAAY,GAAAH,MAAA,CAAZG,YAAY;UAAEC,YAAY,GAAAJ,MAAA,CAAZI,YAAY;UAAKC,KAAK,OAAAC,yBAAA,aAAAN,MAAA,EAAAzF,SAAA;QAAA,oBAC1EX,MAAA,YAAAe,aAAA,CAACV,OAAA,WAAM,MAAAsG,SAAA;UACLC,GAAG,EAAC,UAAU;UACdC,KAAK,EAAC,OAAO;UACb1E,MAAM,EAAEA,MAAO;UACfoD,GAAG,EAAEc,CAAE;UACPS,MAAM,EAAElB,MAAI,CAACmB,gBAAgB,CAAClC,MAAM,EAAEE,KAAK,CAAE;UAC7CuB,OAAO,EAAE,IAAAU,kCAAoB,EAACV,OAAO,EAAE;YAAA,OAAMP,QAAQ,CAAClB,MAAM,CAAC;UAAA,EAAE;UAC/D0B,YAAY,EAAE,IAAAS,kCAAoB,EAACT,YAAY,EAAE,YAAM;YACrDN,mBAAmB,CAACpB,MAAM,CAAC;YAC3BqB,uBAAuB,CAAC,IAAAf,iBAAK,EAACN,MAAM,CAAC,CAAC,CAAC,CAAC,CAACoC,MAAM,EAAE,CAAC;UACpD,CAAC,CAAE;UACHT,YAAY,EAAE,IAAAQ,kCAAoB,EAACR,YAAY,EAAE,YAAM;YACrDP,mBAAmB,CAAC,EAAE,CAAC;YACvBC,uBAAuB,CAACnB,KAAK,CAAC,CAAC,CAAC,GAAG,IAAAI,iBAAK,EAACJ,KAAK,CAAC,CAAC,CAAC,CAAC,CAACkC,MAAM,EAAE,GAAG,IAAIC,IAAI,EAAE,CAAC;UAC3E,CAAC;QAAE,GACCT,KAAK,EACT;MAAA,CACH,CAAC,CACM;IAEd;EAAC;EAAA,OAAA9C,MAAA;AAAA,EA3CyBwD,eAAS;AAAAlE,OAAA,CAAAU,MAAA,GAAAA,MAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_core","require","_react","_interopRequireDefault","_dayjs","_dropdown","_flexBox","_button","_m","_m2","_assignProps9","_ButtonTrigger","_InputTrigger","_excluded","Trigger","_ref","arguments[0]","createElement","Dropdown","assignProps","ButtonTrigger","InputTrigger","_ref2","InputTriggerBase","Indicator","MaskedInput","Addon","SingleDateInput","DateRange","DateRangeFromInput","DateRangeToInput","Popper","props","_ref3","_ref9","SPopper","sstyled","styles","cn","_objectSpread2","Header","_ref4","_ref10","SHeader","Box","Title","_ref13","_ref5","_ref11","Children","STitle","exports","Prev","_ref14","_ref6","getI18nText","children","Button","Next","_ref15","_ref7","Period","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","period","undefined","value","compareMonth","monthOne","monthTwo","dayjs","isSame","isArray","_createClass2","key","render","_ref8","asProps","_ref12","_this2","SPeriod","_this$asProps","onChange","periods","onHighlightedChange","onDisplayedPeriodChange","map","_ref16","i","onClick","onMouseEnter","onMouseLeave","other","_objectWithoutProperties2","_extends2","use","theme","active","getActiveControl","callAllEventHandlers","toDate","Date","Component"],"sources":["../../../src/components/index.jsx"],"sourcesContent":["import React from 'react';\nimport dayjs from 'dayjs';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport Dropdown from '@semcore/dropdown';\nimport { Box } from '@semcore/flex-box';\nimport Button from '@semcore/button';\nimport ChevronLeft from '@semcore/icon/ChevronLeft/m';\nimport ChevronRight from '@semcore/icon/ChevronRight/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonTrigger from './ButtonTrigger';\nimport InputTriggerBase from './InputTrigger';\n\n/** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\nexport function Trigger() {\n return <Root render={Dropdown.Trigger} tag={ButtonTrigger} />;\n}\n\nexport function InputTrigger() {\n return (\n <Root\n render={Dropdown.Trigger}\n tag={InputTriggerBase}\n __excludeProps={['role', 'aria-haspopup', 'onChange', 'value']}\n />\n );\n}\nInputTrigger.Indicator = InputTriggerBase.Indicator;\nInputTrigger.MaskedInput = InputTriggerBase.MaskedInput;\nInputTrigger.Addon = InputTriggerBase.Addon;\nInputTrigger.SingleDateInput = InputTriggerBase.SingleDateInput;\nInputTrigger.DateRange = InputTriggerBase.DateRange;\nInputTrigger.DateRangeFromInput = InputTriggerBase.DateRangeFromInput;\nInputTrigger.DateRangeToInput = InputTriggerBase.DateRangeToInput;\n\nexport function Popper(props) {\n const SPopper = Root;\n return sstyled(props.styles)(<SPopper render={Dropdown.Popper} role='region' />);\n}\n\nexport function Header(props) {\n const SHeader = Root;\n return sstyled(props.styles)(<SHeader render={Box} />);\n}\n\nexport const Title = ({ Children, styles }) => {\n const STitle = Root;\n return sstyled(styles)(\n <STitle render={Box}>\n <Children />\n </STitle>,\n );\n};\n\nexport function Prev({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('prev')}\n >\n {children ? (\n <Children />\n ) : (\n <Button.Addon>\n <ChevronLeft />\n </Button.Addon>\n )}\n </Root>\n );\n}\n\nexport function Next({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('next')}\n >\n {children ? (\n <Children />\n ) : (\n <Button.Addon>\n <ChevronRight />\n </Button.Addon>\n )}\n </Root>\n );\n}\n\nexport class Period extends Component {\n getActiveControl = (period = [], value = undefined) => {\n function compareMonth(monthOne, monthTwo) {\n return dayjs(monthOne).isSame(dayjs(monthTwo), 'date');\n }\n\n if (!period || !value) return false;\n if (Array.isArray(value) && period.length !== value.length) return false;\n if (Array.isArray(value)) {\n return compareMonth(period[0], value[0]) && compareMonth(period[1], value[1]);\n }\n\n return compareMonth(period[0], value);\n };\n\n render() {\n const SPeriod = Root;\n const { styles, value, onChange, periods, onHighlightedChange, onDisplayedPeriodChange } =\n this.asProps;\n\n return sstyled(styles)(\n <SPeriod render={Box}>\n {periods.map(({ value: period, onClick, onMouseEnter, onMouseLeave, ...other }, i) => (\n <Button\n use='tertiary'\n theme='muted'\n styles={styles}\n key={i}\n active={this.getActiveControl(period, value)}\n onClick={callAllEventHandlers(onClick, () => onChange(period))}\n onMouseEnter={callAllEventHandlers(onMouseEnter, () => {\n onHighlightedChange(period);\n onDisplayedPeriodChange(dayjs(period[0]).toDate());\n })}\n onMouseLeave={callAllEventHandlers(onMouseLeave, () => {\n onHighlightedChange([]);\n onDisplayedPeriodChange(value[0] ? dayjs(value[0]).toDate() : new Date());\n })}\n {...other}\n />\n ))}\n </SPeriod>,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,EAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,GAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,aAAA,GAAAT,sBAAA,CAAAF,OAAA;AAA8C,IAAAY,SAAA;AAE9C;AACO,SAASC,OAAOA,CAAA,EAAG;EAAA,IAAAC,IAAA,GAAAC,YAAA;EACxB,oBAAOd,MAAA,YAAAe,aAAA,CAAcC,oBAAQ,CAACJ,OAAO,MAAAd,KAAA,CAAAmB,WAAA;IAAA,OAAOC;EAAa,GAAAL,IAAA,EAAI;AAC/D;AAEO,SAASM,YAAYA,CAAA,EAAG;EAAA,IAAAC,KAAA,GAAAN,YAAA;EAC7B,oBACEd,MAAA,YAAAe,aAAA,CACUC,oBAAQ,CAACJ,OAAO,MAAAd,K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C;UAC3E,CAAC;QAAE,GACCT,KAAK,EACT;MAAA,CACH,CAAC,CACM;IAEd;EAAC;EAAA,OAAA9C,MAAA;AAAA,EA3CyBwD,eAAS;AAAAlE,OAAA,CAAAU,MAAA,GAAAA,MAAA"}
|
|
@@ -24,22 +24,22 @@ import fire from '@semcore/utils/lib/fire';
|
|
|
24
24
|
import includesDate from '../utils/includesDate';
|
|
25
25
|
import { getLocaleDate } from '../utils/formatDate';
|
|
26
26
|
/*__reshadow-styles__:"../style/calendar.shadow.css"*/
|
|
27
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
28
|
-
"__SCalendar": "
|
|
29
|
-
"__SGridDays": "
|
|
30
|
-
"__SGridMonths": "
|
|
31
|
-
"__SWeekDays": "
|
|
32
|
-
"__SWeekDay": "
|
|
33
|
-
"__SCalendarUnit": "
|
|
34
|
-
"_startHighlighted": "
|
|
35
|
-
"_selected": "
|
|
36
|
-
"_endHighlighted": "
|
|
37
|
-
"_startSelected": "
|
|
38
|
-
"_endSelected": "
|
|
39
|
-
"_outdated": "
|
|
40
|
-
"_disabled": "
|
|
41
|
-
"_highlighted": "
|
|
42
|
-
"_today": "
|
|
27
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SCalendar_1dmi3_gg_{display:flex;flex-direction:column}.___SGridDays_1dmi3_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto));grid-template-rows:repeat(auto-fit,minmax(32px,auto))}.___SGridMonths_1dmi3_gg_{display:grid;grid-row-gap:var(--intergalactic-spacing-2x, 8px);grid-template-columns:repeat(3,minmax(60px,auto));grid-template-rows:repeat(4,minmax(32px,auto))}.___SWeekDays_1dmi3_gg_{display:grid;grid-template-columns:repeat(7,minmax(32px,auto))}.___SCalendarUnit_1dmi3_gg_,.___SWeekDay_1dmi3_gg_{align-items:center;display:flex;font-size:var(--intergalactic-fs-200, 14px);justify-content:center;min-height:32px;min-width:32px}.___SWeekDay_1dmi3_gg_{color:var(--intergalactic-text-secondary, #6c6e79);font-weight:var(--intergalactic-regular, 400);overflow:hidden}.___SCalendarUnit_1dmi3_gg_{font-family:inherit;font-weight:400;line-height:normal;-webkit-text-decoration:none;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:var(--intergalactic-text-primary, #191b23);box-shadow:none;overflow:visible;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:var(--intergalactic-date-picker-cell, #ffffff);border-radius:var(--intergalactic-control-rounded, 6px);box-sizing:border-box;cursor:pointer;position:relative;transition:color .15s,background .15s,border-radius .15s .15s;outline:0;margin:0}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_:hover{color:var(--intergalactic-text-primary, #191b23);background:var(--intergalactic-date-picker-cell-hover, #e0e1e9)}}.___SCalendarUnit_1dmi3_gg_:focus-visible{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SCalendarUnit_1dmi3_gg_.__today_1dmi3_gg_:before{content:\"\";position:absolute;display:block;top:1px;left:1px;border-radius:var(--intergalactic-control-rounded, 6px);width:calc(100% - 2px);height:calc(100% - 2px);box-sizing:border-box;border:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SCalendarUnit_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__today_1dmi3_gg_.__endSelected_1dmi3_gg_:before,.___SCalendarUnit_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__today_1dmi3_gg_.__startSelected_1dmi3_gg_:before{border-color:var(--intergalactic-border-secondary, #e0e1e9)}.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_{border-radius:0;transition:color .15s,background .15s,border-radius 0s 0s;color:var(--intergalactic-text-primary, #191b23)}.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_{background:var(--intergalactic-date-picker-cell-range, #c4e5fe)}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_:hover{background:var(--intergalactic-date-picker-cell-range-hover, #8ecdff)}}.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_{background:var(--intergalactic-date-picker-cell-range-hover, #8ecdff)}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_:hover{background:var(--intergalactic-date-picker-cell-range-hover, #8ecdff)}}.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_{color:var(--intergalactic-text-primary-invert, #ffffff);background:var(--intergalactic-date-picker-cell-active, #2bb3ff)}.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_:not(.__highlighted_1dmi3_gg_){border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-bottom-right-radius:0;border-top-left-radius:var(--intergalactic-control-rounded, 6px);border-top-right-radius:0}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_:hover{color:var(--intergalactic-text-primary-invert, #ffffff);background:var(--intergalactic-date-picker-cell-active-hover, #008ff8)}}.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_{background:var(--intergalactic-date-picker-cell-active, #2bb3ff);color:var(--intergalactic-text-primary-invert, #ffffff)}.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_:not(.__highlighted_1dmi3_gg_){border-bottom-left-radius:0;border-bottom-right-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:0;border-top-right-radius:var(--intergalactic-control-rounded, 6px)}@media (hover:hover){.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_:hover{color:var(--intergalactic-text-primary-invert, #ffffff);background:var(--intergalactic-date-picker-cell-active-hover, #008ff8)}}.___SCalendarUnit_1dmi3_gg_.__startHighlighted_1dmi3_gg_:not(.__selected_1dmi3_gg_){border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-bottom-right-radius:0;border-top-left-radius:var(--intergalactic-control-rounded, 6px);border-top-right-radius:0}.___SCalendarUnit_1dmi3_gg_.__endHighlighted_1dmi3_gg_:not(.__selected_1dmi3_gg_){border-bottom-left-radius:0;border-bottom-right-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:0;border-top-right-radius:var(--intergalactic-control-rounded, 6px)}.___SCalendarUnit_1dmi3_gg_.__startHighlighted_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__endHighlighted_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__startSelected_1dmi3_gg_.___SCalendarUnit_1dmi3_gg_.__endSelected_1dmi3_gg_{border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-bottom-right-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px);border-top-right-radius:var(--intergalactic-control-rounded, 6px)}.___SCalendarUnit_1dmi3_gg_.__outdated_1dmi3_gg_{opacity:.2}.___SCalendarUnit_1dmi3_gg_.__disabled_1dmi3_gg_{opacity:.4;cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SCalendarUnit_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__highlighted_1dmi3_gg_,.___SCalendarUnit_1dmi3_gg_.__selected_1dmi3_gg_{transition:none}}" /*__inner_css_end__*/, "1dmi3_gg_") /*__reshadow_css_end__*/, {
|
|
28
|
+
"__SCalendar": "___SCalendar_1dmi3_gg_",
|
|
29
|
+
"__SGridDays": "___SGridDays_1dmi3_gg_",
|
|
30
|
+
"__SGridMonths": "___SGridMonths_1dmi3_gg_",
|
|
31
|
+
"__SWeekDays": "___SWeekDays_1dmi3_gg_",
|
|
32
|
+
"__SWeekDay": "___SWeekDay_1dmi3_gg_",
|
|
33
|
+
"__SCalendarUnit": "___SCalendarUnit_1dmi3_gg_",
|
|
34
|
+
"_startHighlighted": "__startHighlighted_1dmi3_gg_",
|
|
35
|
+
"_selected": "__selected_1dmi3_gg_",
|
|
36
|
+
"_endHighlighted": "__endHighlighted_1dmi3_gg_",
|
|
37
|
+
"_startSelected": "__startSelected_1dmi3_gg_",
|
|
38
|
+
"_endSelected": "__endSelected_1dmi3_gg_",
|
|
39
|
+
"_outdated": "__outdated_1dmi3_gg_",
|
|
40
|
+
"_disabled": "__disabled_1dmi3_gg_",
|
|
41
|
+
"_highlighted": "__highlighted_1dmi3_gg_",
|
|
42
|
+
"_today": "__today_1dmi3_gg_"
|
|
43
43
|
});
|
|
44
44
|
dayjs.extend(isBetween);
|
|
45
45
|
var range = function range(N, cb) {
|
|
@@ -33,24 +33,24 @@ import NeighborLocation from '@semcore/neighbor-location';
|
|
|
33
33
|
import includesDate from '../utils/includesDate';
|
|
34
34
|
import dayjs from 'dayjs';
|
|
35
35
|
/*__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
36
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
37
|
-
"__SHeader": "
|
|
38
|
-
"__STitle": "
|
|
39
|
-
"__SToday": "
|
|
40
|
-
"__SPeriod": "
|
|
41
|
-
"__SButton": "
|
|
42
|
-
"__SInner": "
|
|
43
|
-
"__SInputMask": "
|
|
44
|
-
"__SIndicator": "
|
|
45
|
-
"__SHumanizedDate": "
|
|
46
|
-
"__SSingleDateInput": "
|
|
47
|
-
"__SValue": "
|
|
48
|
-
"__SDateRange": "
|
|
49
|
-
"__SMask": "
|
|
50
|
-
"_noHumanizedDate": "
|
|
51
|
-
"__SRangeSep": "
|
|
52
|
-
"_fulfilled": "
|
|
53
|
-
"__SPopper": "
|
|
36
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPopper_7qpwt_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_7qpwt_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_7qpwt_gg_:active,.___SPopper_7qpwt_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_7qpwt_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_7qpwt_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_7qpwt_gg_,.___STitle_7qpwt_gg_{display:flex;align-items:center}.___STitle_7qpwt_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_7qpwt_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_7qpwt_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_7qpwt_gg_ .___SInner_7qpwt_gg_{justify-content:flex-start}.___SInputMask_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal}.___SIndicator_7qpwt_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SHumanizedDate_7qpwt_gg_{position:absolute;pointer-events:none}.___SDateRange_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_ .___SValue_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:0}.___SSingleDateInput_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_ .___SInputMask_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_7qpwt_gg_:focus-within .___SRangeSep_7qpwt_gg_,.___SRangeSep_7qpwt_gg_.__fulfilled_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23)}" /*__inner_css_end__*/, "7qpwt_gg_") /*__reshadow_css_end__*/, {
|
|
37
|
+
"__SHeader": "___SHeader_7qpwt_gg_",
|
|
38
|
+
"__STitle": "___STitle_7qpwt_gg_",
|
|
39
|
+
"__SToday": "___SToday_7qpwt_gg_",
|
|
40
|
+
"__SPeriod": "___SPeriod_7qpwt_gg_",
|
|
41
|
+
"__SButton": "___SButton_7qpwt_gg_",
|
|
42
|
+
"__SInner": "___SInner_7qpwt_gg_",
|
|
43
|
+
"__SInputMask": "___SInputMask_7qpwt_gg_",
|
|
44
|
+
"__SIndicator": "___SIndicator_7qpwt_gg_",
|
|
45
|
+
"__SHumanizedDate": "___SHumanizedDate_7qpwt_gg_",
|
|
46
|
+
"__SSingleDateInput": "___SSingleDateInput_7qpwt_gg_",
|
|
47
|
+
"__SValue": "___SValue_7qpwt_gg_",
|
|
48
|
+
"__SDateRange": "___SDateRange_7qpwt_gg_",
|
|
49
|
+
"__SMask": "___SMask_7qpwt_gg_",
|
|
50
|
+
"_noHumanizedDate": "__noHumanizedDate_7qpwt_gg_",
|
|
51
|
+
"__SRangeSep": "___SRangeSep_7qpwt_gg_",
|
|
52
|
+
"_fulfilled": "__fulfilled_7qpwt_gg_",
|
|
53
|
+
"__SPopper": "___SPopper_7qpwt_gg_"
|
|
54
54
|
});
|
|
55
55
|
import assignProps from '@semcore/utils/lib/assignProps';
|
|
56
56
|
var defaultAllowedParts = {
|
|
@@ -13,24 +13,24 @@ import Dropdown from '@semcore/dropdown';
|
|
|
13
13
|
import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
14
14
|
import { localizedMessages } from '../translations/__intergalactic-dynamic-locales';
|
|
15
15
|
/*__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
16
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
17
|
-
"__SHeader": "
|
|
18
|
-
"__STitle": "
|
|
19
|
-
"__SToday": "
|
|
20
|
-
"__SPeriod": "
|
|
21
|
-
"__SButton": "
|
|
22
|
-
"__SInner": "
|
|
23
|
-
"__SInputMask": "
|
|
24
|
-
"__SIndicator": "
|
|
25
|
-
"__SHumanizedDate": "
|
|
26
|
-
"__SSingleDateInput": "
|
|
27
|
-
"__SValue": "
|
|
28
|
-
"__SDateRange": "
|
|
29
|
-
"__SMask": "
|
|
30
|
-
"_noHumanizedDate": "
|
|
31
|
-
"__SRangeSep": "
|
|
32
|
-
"_fulfilled": "
|
|
33
|
-
"__SPopper": "
|
|
16
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPopper_7qpwt_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_7qpwt_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_7qpwt_gg_:active,.___SPopper_7qpwt_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_7qpwt_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_7qpwt_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_7qpwt_gg_,.___STitle_7qpwt_gg_{display:flex;align-items:center}.___STitle_7qpwt_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_7qpwt_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_7qpwt_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_7qpwt_gg_ .___SInner_7qpwt_gg_{justify-content:flex-start}.___SInputMask_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal}.___SIndicator_7qpwt_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SHumanizedDate_7qpwt_gg_{position:absolute;pointer-events:none}.___SDateRange_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_ .___SValue_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:0}.___SSingleDateInput_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_ .___SInputMask_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_7qpwt_gg_:focus-within .___SRangeSep_7qpwt_gg_,.___SRangeSep_7qpwt_gg_.__fulfilled_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23)}" /*__inner_css_end__*/, "7qpwt_gg_") /*__reshadow_css_end__*/, {
|
|
17
|
+
"__SHeader": "___SHeader_7qpwt_gg_",
|
|
18
|
+
"__STitle": "___STitle_7qpwt_gg_",
|
|
19
|
+
"__SToday": "___SToday_7qpwt_gg_",
|
|
20
|
+
"__SPeriod": "___SPeriod_7qpwt_gg_",
|
|
21
|
+
"__SButton": "___SButton_7qpwt_gg_",
|
|
22
|
+
"__SInner": "___SInner_7qpwt_gg_",
|
|
23
|
+
"__SInputMask": "___SInputMask_7qpwt_gg_",
|
|
24
|
+
"__SIndicator": "___SIndicator_7qpwt_gg_",
|
|
25
|
+
"__SHumanizedDate": "___SHumanizedDate_7qpwt_gg_",
|
|
26
|
+
"__SSingleDateInput": "___SSingleDateInput_7qpwt_gg_",
|
|
27
|
+
"__SValue": "___SValue_7qpwt_gg_",
|
|
28
|
+
"__SDateRange": "___SDateRange_7qpwt_gg_",
|
|
29
|
+
"__SMask": "___SMask_7qpwt_gg_",
|
|
30
|
+
"_noHumanizedDate": "__noHumanizedDate_7qpwt_gg_",
|
|
31
|
+
"__SRangeSep": "___SRangeSep_7qpwt_gg_",
|
|
32
|
+
"_fulfilled": "__fulfilled_7qpwt_gg_",
|
|
33
|
+
"__SPopper": "___SPopper_7qpwt_gg_"
|
|
34
34
|
});
|
|
35
35
|
import includesDate from '../utils/includesDate';
|
|
36
36
|
var INTERACTION_TAGS = ['INPUT'];
|
|
@@ -19,24 +19,24 @@ import Dropdown from '@semcore/dropdown';
|
|
|
19
19
|
import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
20
20
|
import { localizedMessages } from '../translations/__intergalactic-dynamic-locales';
|
|
21
21
|
/*__reshadow-styles__:"../style/date-picker.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SHeader": "
|
|
24
|
-
"__STitle": "
|
|
25
|
-
"__SToday": "
|
|
26
|
-
"__SPeriod": "
|
|
27
|
-
"__SButton": "
|
|
28
|
-
"__SInner": "
|
|
29
|
-
"__SInputMask": "
|
|
30
|
-
"__SIndicator": "
|
|
31
|
-
"__SHumanizedDate": "
|
|
32
|
-
"__SSingleDateInput": "
|
|
33
|
-
"__SValue": "
|
|
34
|
-
"__SDateRange": "
|
|
35
|
-
"__SMask": "
|
|
36
|
-
"_noHumanizedDate": "
|
|
37
|
-
"__SRangeSep": "
|
|
38
|
-
"_fulfilled": "
|
|
39
|
-
"__SPopper": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPopper_7qpwt_gg_{padding:var(--intergalactic-spacing-4x, 16px);outline:0}.___SPopper_7qpwt_gg_::-moz-focus-inner{border:0;padding:0}.___SPopper_7qpwt_gg_:active,.___SPopper_7qpwt_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SPopper_7qpwt_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SPopper_7qpwt_gg_:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SHeader_7qpwt_gg_,.___STitle_7qpwt_gg_{display:flex;align-items:center}.___STitle_7qpwt_gg_{font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-primary, #191b23);height:32px;width:100%;justify-content:center}.___SToday_7qpwt_gg_{display:flex;margin-top:var(--intergalactic-spacing-3x, 12px);justify-content:center}.___SPeriod_7qpwt_gg_{display:flex;flex-direction:column;margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SButton_7qpwt_gg_ .___SInner_7qpwt_gg_{justify-content:flex-start}.___SInputMask_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23);line-height:normal}.___SIndicator_7qpwt_gg_{color:var(--intergalactic-text-secondary, #6c6e79)}.___SHumanizedDate_7qpwt_gg_{position:absolute;pointer-events:none}.___SDateRange_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_ .___SValue_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:0}.___SSingleDateInput_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SSingleDateInput_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SSingleDateInput_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_:focus-within .___SHumanizedDate_7qpwt_gg_{opacity:0;z-index:var(--intergalactic-z-index-deep, -999)}.___SDateRange_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_,.___SDateRange_7qpwt_gg_:focus-within .___SValue_7qpwt_gg_{opacity:1}.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SMask_7qpwt_gg_,.___SInputMask_7qpwt_gg_.__noHumanizedDate_7qpwt_gg_ .___SValue_7qpwt_gg_{opacity:1}.___SDateRange_7qpwt_gg_ .___SInputMask_7qpwt_gg_:focus-within .___SMask_7qpwt_gg_{background-color:var(--intergalactic-bg-highlight-focus, rgba(0, 143, 248, 0.2))}.___SDateRange_7qpwt_gg_:focus-within .___SRangeSep_7qpwt_gg_,.___SRangeSep_7qpwt_gg_.__fulfilled_7qpwt_gg_{color:var(--intergalactic-text-primary, #191b23)}" /*__inner_css_end__*/, "7qpwt_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SHeader": "___SHeader_7qpwt_gg_",
|
|
24
|
+
"__STitle": "___STitle_7qpwt_gg_",
|
|
25
|
+
"__SToday": "___SToday_7qpwt_gg_",
|
|
26
|
+
"__SPeriod": "___SPeriod_7qpwt_gg_",
|
|
27
|
+
"__SButton": "___SButton_7qpwt_gg_",
|
|
28
|
+
"__SInner": "___SInner_7qpwt_gg_",
|
|
29
|
+
"__SInputMask": "___SInputMask_7qpwt_gg_",
|
|
30
|
+
"__SIndicator": "___SIndicator_7qpwt_gg_",
|
|
31
|
+
"__SHumanizedDate": "___SHumanizedDate_7qpwt_gg_",
|
|
32
|
+
"__SSingleDateInput": "___SSingleDateInput_7qpwt_gg_",
|
|
33
|
+
"__SValue": "___SValue_7qpwt_gg_",
|
|
34
|
+
"__SDateRange": "___SDateRange_7qpwt_gg_",
|
|
35
|
+
"__SMask": "___SMask_7qpwt_gg_",
|
|
36
|
+
"_noHumanizedDate": "__noHumanizedDate_7qpwt_gg_",
|
|
37
|
+
"__SRangeSep": "___SRangeSep_7qpwt_gg_",
|
|
38
|
+
"_fulfilled": "__fulfilled_7qpwt_gg_",
|
|
39
|
+
"__SPopper": "___SPopper_7qpwt_gg_"
|
|
40
40
|
});
|
|
41
41
|
var INTERACTION_TAGS = ['INPUT'];
|
|
42
42
|
var defaultDisplayedPeriod = new Date(new Date().setHours(0, 0, 0, 0));
|
|
@@ -82,7 +82,7 @@ export function Prev(_ref14) {
|
|
|
82
82
|
"size": 'l',
|
|
83
83
|
"tabIndex": -1,
|
|
84
84
|
"aria-label": getI18nText('prev')
|
|
85
|
-
}, _ref6), children ? /*#__PURE__*/React.createElement(Children, null) : /*#__PURE__*/React.createElement(ChevronLeft, null));
|
|
85
|
+
}, _ref6), children ? /*#__PURE__*/React.createElement(Children, null) : /*#__PURE__*/React.createElement(Button.Addon, null, /*#__PURE__*/React.createElement(ChevronLeft, null)));
|
|
86
86
|
}
|
|
87
87
|
export function Next(_ref15) {
|
|
88
88
|
var _ref7 = arguments[0];
|
|
@@ -95,7 +95,7 @@ export function Next(_ref15) {
|
|
|
95
95
|
"size": 'l',
|
|
96
96
|
"tabIndex": -1,
|
|
97
97
|
"aria-label": getI18nText('next')
|
|
98
|
-
}, _ref7), children ? /*#__PURE__*/React.createElement(Children, null) : /*#__PURE__*/React.createElement(ChevronRight, null));
|
|
98
|
+
}, _ref7), children ? /*#__PURE__*/React.createElement(Children, null) : /*#__PURE__*/React.createElement(Button.Addon, null, /*#__PURE__*/React.createElement(ChevronRight, null)));
|
|
99
99
|
}
|
|
100
100
|
export var Period = /*#__PURE__*/function (_Component) {
|
|
101
101
|
_inherits(Period, _Component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","dayjs","Component","Root","sstyled","Dropdown","Box","Button","ChevronLeft","ChevronRight","callAllEventHandlers","ButtonTrigger","InputTriggerBase","Trigger","_ref","arguments[0]","createElement","_assignProps","InputTrigger","_ref2","_assignProps2","Indicator","MaskedInput","Addon","SingleDateInput","DateRange","DateRangeFromInput","DateRangeToInput","Popper","props","_ref3","_ref9","SPopper","styles","cn","_objectSpread","_assignProps3","Header","_ref4","_ref10","SHeader","_assignProps4","Title","_ref13","_ref5","_ref11","Children","STitle","_assignProps5","Prev","_ref14","_ref6","getI18nText","children","_assignProps6","Next","_ref15","_ref7","_assignProps7","Period","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","period","undefined","value","compareMonth","monthOne","monthTwo","isSame","isArray","_createClass","key","render","_ref8","asProps","_ref12","_this2","SPeriod","_this$asProps","onChange","periods","onHighlightedChange","onDisplayedPeriodChange","_assignProps8","map","_ref16","i","onClick","onMouseEnter","onMouseLeave","other","_objectWithoutProperties","_excluded","_extends","use","theme","active","getActiveControl","toDate","Date"],"sources":["../../../src/components/index.jsx"],"sourcesContent":["import React from 'react';\nimport dayjs from 'dayjs';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport Dropdown from '@semcore/dropdown';\nimport { Box } from '@semcore/flex-box';\nimport Button from '@semcore/button';\nimport ChevronLeft from '@semcore/icon/ChevronLeft/m';\nimport ChevronRight from '@semcore/icon/ChevronRight/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonTrigger from './ButtonTrigger';\nimport InputTriggerBase from './InputTrigger';\n\n/** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\nexport function Trigger() {\n return <Root render={Dropdown.Trigger} tag={ButtonTrigger} />;\n}\n\nexport function InputTrigger() {\n return (\n <Root\n render={Dropdown.Trigger}\n tag={InputTriggerBase}\n __excludeProps={['role', 'aria-haspopup', 'onChange', 'value']}\n />\n );\n}\nInputTrigger.Indicator = InputTriggerBase.Indicator;\nInputTrigger.MaskedInput = InputTriggerBase.MaskedInput;\nInputTrigger.Addon = InputTriggerBase.Addon;\nInputTrigger.SingleDateInput = InputTriggerBase.SingleDateInput;\nInputTrigger.DateRange = InputTriggerBase.DateRange;\nInputTrigger.DateRangeFromInput = InputTriggerBase.DateRangeFromInput;\nInputTrigger.DateRangeToInput = InputTriggerBase.DateRangeToInput;\n\nexport function Popper(props) {\n const SPopper = Root;\n return sstyled(props.styles)(<SPopper render={Dropdown.Popper} role='region' />);\n}\n\nexport function Header(props) {\n const SHeader = Root;\n return sstyled(props.styles)(<SHeader render={Box} />);\n}\n\nexport const Title = ({ Children, styles }) => {\n const STitle = Root;\n return sstyled(styles)(\n <STitle render={Box}>\n <Children />\n </STitle>,\n );\n};\n\nexport function Prev({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('prev')}\n >\n {children ? <Children /> : <ChevronLeft />}\n </Root>\n );\n}\n\nexport function Next({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('next')}\n >\n {children ? <Children /> : <ChevronRight />}\n </Root>\n );\n}\n\nexport class Period extends Component {\n getActiveControl = (period = [], value = undefined) => {\n function compareMonth(monthOne, monthTwo) {\n return dayjs(monthOne).isSame(dayjs(monthTwo), 'date');\n }\n\n if (!period || !value) return false;\n if (Array.isArray(value) && period.length !== value.length) return false;\n if (Array.isArray(value)) {\n return compareMonth(period[0], value[0]) && compareMonth(period[1], value[1]);\n }\n\n return compareMonth(period[0], value);\n };\n\n render() {\n const SPeriod = Root;\n const { styles, value, onChange, periods, onHighlightedChange, onDisplayedPeriodChange } =\n this.asProps;\n\n return sstyled(styles)(\n <SPeriod render={Box}>\n {periods.map(({ value: period, onClick, onMouseEnter, onMouseLeave, ...other }, i) => (\n <Button\n use='tertiary'\n theme='muted'\n styles={styles}\n key={i}\n active={this.getActiveControl(period, value)}\n onClick={callAllEventHandlers(onClick, () => onChange(period))}\n onMouseEnter={callAllEventHandlers(onMouseEnter, () => {\n onHighlightedChange(period);\n onDisplayedPeriodChange(dayjs(period[0]).toDate());\n })}\n onMouseLeave={callAllEventHandlers(onMouseLeave, () => {\n onHighlightedChange([]);\n onDisplayedPeriodChange(value[0] ? dayjs(value[0]).toDate() : new Date());\n })}\n {...other}\n />\n ))}\n </SPeriod>,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACxD,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,WAAW,MAAM,6BAA6B;AACrD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,gBAAgB;;AAE7C;AACA,OAAO,SAASC,OAAOA,CAAA,EAAG;EAAA,IAAAC,IAAA,GAAAC,YAAA;EACxB,oBAAOf,KAAA,CAAAgB,aAAA,CAAcX,QAAQ,CAACQ,OAAO,EAAAI,YAAA;IAAA,OAAON;EAAa,GAAAG,IAAA,EAAI;AAC/D;AAEA,OAAO,SAASI,YAAYA,CAAA,EAAG;EAAA,IAAAC,KAAA,GAAAJ,YAAA;EAC7B,oBACEf,KAAA,CAAAgB,aAAA,CACUX,QAAQ,CAACQ,OAAO,EAAAO,aAAA;IAAA,OACn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AAEC,YAAY,GAAAJ,MAAA,CAAZI,YAAY;UAAKC,KAAK,GAAAC,wBAAA,CAAAN,MAAA,EAAAO,SAAA;QAAA,oBAC1E3G,KAAA,CAAAgB,aAAA,CAACT,MAAM,EAAAqG,QAAA;UACLC,GAAG,EAAC,UAAU;UACdC,KAAK,EAAC,OAAO;UACb7E,MAAM,EAAEA,MAAO;UACfqD,GAAG,EAAEe,CAAE;UACPU,MAAM,EAAEpB,MAAI,CAACqB,gBAAgB,CAACnC,MAAM,EAAEE,KAAK,CAAE;UAC7CuB,OAAO,EAAE5F,oBAAoB,CAAC4F,OAAO,EAAE;YAAA,OAAMR,QAAQ,CAACjB,MAAM,CAAC;UAAA,EAAE;UAC/D0B,YAAY,EAAE7F,oBAAoB,CAAC6F,YAAY,EAAE,YAAM;YACrDP,mBAAmB,CAACnB,MAAM,CAAC;YAC3BoB,uBAAuB,CAAChG,KAAK,CAAC4E,MAAM,CAAC,CAAC,CAAC,CAAC,CAACoC,MAAM,EAAE,CAAC;UACpD,CAAC,CAAE;UACHT,YAAY,EAAE9F,oBAAoB,CAAC8F,YAAY,EAAE,YAAM;YACrDR,mBAAmB,CAAC,EAAE,CAAC;YACvBC,uBAAuB,CAAClB,KAAK,CAAC,CAAC,CAAC,GAAG9E,KAAK,CAAC8E,KAAK,CAAC,CAAC,CAAC,CAAC,CAACkC,MAAM,EAAE,GAAG,IAAIC,IAAI,EAAE,CAAC;UAC3E,CAAC;QAAE,GACCT,KAAK,EACT;MAAA,CACH,CAAC,CACM;IAEd;EAAC;EAAA,OAAA9C,MAAA;AAAA,EA3CyBzD,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","dayjs","Component","Root","sstyled","Dropdown","Box","Button","ChevronLeft","ChevronRight","callAllEventHandlers","ButtonTrigger","InputTriggerBase","Trigger","_ref","arguments[0]","createElement","_assignProps","InputTrigger","_ref2","_assignProps2","Indicator","MaskedInput","Addon","SingleDateInput","DateRange","DateRangeFromInput","DateRangeToInput","Popper","props","_ref3","_ref9","SPopper","styles","cn","_objectSpread","_assignProps3","Header","_ref4","_ref10","SHeader","_assignProps4","Title","_ref13","_ref5","_ref11","Children","STitle","_assignProps5","Prev","_ref14","_ref6","getI18nText","children","_assignProps6","Next","_ref15","_ref7","_assignProps7","Period","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","period","undefined","value","compareMonth","monthOne","monthTwo","isSame","isArray","_createClass","key","render","_ref8","asProps","_ref12","_this2","SPeriod","_this$asProps","onChange","periods","onHighlightedChange","onDisplayedPeriodChange","_assignProps8","map","_ref16","i","onClick","onMouseEnter","onMouseLeave","other","_objectWithoutProperties","_excluded","_extends","use","theme","active","getActiveControl","toDate","Date"],"sources":["../../../src/components/index.jsx"],"sourcesContent":["import React from 'react';\nimport dayjs from 'dayjs';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport Dropdown from '@semcore/dropdown';\nimport { Box } from '@semcore/flex-box';\nimport Button from '@semcore/button';\nimport ChevronLeft from '@semcore/icon/ChevronLeft/m';\nimport ChevronRight from '@semcore/icon/ChevronRight/m';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport ButtonTrigger from './ButtonTrigger';\nimport InputTriggerBase from './InputTrigger';\n\n/** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\nexport function Trigger() {\n return <Root render={Dropdown.Trigger} tag={ButtonTrigger} />;\n}\n\nexport function InputTrigger() {\n return (\n <Root\n render={Dropdown.Trigger}\n tag={InputTriggerBase}\n __excludeProps={['role', 'aria-haspopup', 'onChange', 'value']}\n />\n );\n}\nInputTrigger.Indicator = InputTriggerBase.Indicator;\nInputTrigger.MaskedInput = InputTriggerBase.MaskedInput;\nInputTrigger.Addon = InputTriggerBase.Addon;\nInputTrigger.SingleDateInput = InputTriggerBase.SingleDateInput;\nInputTrigger.DateRange = InputTriggerBase.DateRange;\nInputTrigger.DateRangeFromInput = InputTriggerBase.DateRangeFromInput;\nInputTrigger.DateRangeToInput = InputTriggerBase.DateRangeToInput;\n\nexport function Popper(props) {\n const SPopper = Root;\n return sstyled(props.styles)(<SPopper render={Dropdown.Popper} role='region' />);\n}\n\nexport function Header(props) {\n const SHeader = Root;\n return sstyled(props.styles)(<SHeader render={Box} />);\n}\n\nexport const Title = ({ Children, styles }) => {\n const STitle = Root;\n return sstyled(styles)(\n <STitle render={Box}>\n <Children />\n </STitle>,\n );\n};\n\nexport function Prev({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('prev')}\n >\n {children ? (\n <Children />\n ) : (\n <Button.Addon>\n <ChevronLeft />\n </Button.Addon>\n )}\n </Root>\n );\n}\n\nexport function Next({ getI18nText, children, Children }) {\n return (\n <Root\n render={Button}\n use='tertiary'\n theme='muted'\n size='l'\n tabIndex={-1}\n aria-label={getI18nText('next')}\n >\n {children ? (\n <Children />\n ) : (\n <Button.Addon>\n <ChevronRight />\n </Button.Addon>\n )}\n </Root>\n );\n}\n\nexport class Period extends Component {\n getActiveControl = (period = [], value = undefined) => {\n function compareMonth(monthOne, monthTwo) {\n return dayjs(monthOne).isSame(dayjs(monthTwo), 'date');\n }\n\n if (!period || !value) return false;\n if (Array.isArray(value) && period.length !== value.length) return false;\n if (Array.isArray(value)) {\n return compareMonth(period[0], value[0]) && compareMonth(period[1], value[1]);\n }\n\n return compareMonth(period[0], value);\n };\n\n render() {\n const SPeriod = Root;\n const { styles, value, onChange, periods, onHighlightedChange, onDisplayedPeriodChange } =\n this.asProps;\n\n return sstyled(styles)(\n <SPeriod render={Box}>\n {periods.map(({ value: period, onClick, onMouseEnter, onMouseLeave, ...other }, i) => (\n <Button\n use='tertiary'\n theme='muted'\n styles={styles}\n key={i}\n active={this.getActiveControl(period, value)}\n onClick={callAllEventHandlers(onClick, () => onChange(period))}\n onMouseEnter={callAllEventHandlers(onMouseEnter, () => {\n onHighlightedChange(period);\n onDisplayedPeriodChange(dayjs(period[0]).toDate());\n })}\n onMouseLeave={callAllEventHandlers(onMouseLeave, () => {\n onHighlightedChange([]);\n onDisplayedPeriodChange(value[0] ? dayjs(value[0]).toDate() : new Date());\n })}\n {...other}\n />\n ))}\n </SPeriod>,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACxD,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,WAAW,MAAM,6BAA6B;AACrD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,gBAAgB;;AAE7C;AACA,OAAO,SAASC,OAAOA,CAAA,EAAG;EAAA,IAAAC,IAAA,GAAAC,YAAA;EACxB,oBAAOf,KAAA,CAAAgB,aAAA,CAAcX,QAAQ,CAACQ,OAAO,EAAAI,YAAA;IAAA,OAAON;EAAa,GAAAG,IAAA,EAAI;AAC/D;AAEA,OAAO,SAASI,YAAYA,CAAA,EAAG;EAAA,IAAAC,KAAA,GAAAJ,YAAA;EAC7B,oBACEf,KAAA,CAAAgB,aAAA,CACUX,QAAQ,CAACQ,OAAO,EAAAO,aAAA;IAAA,OACnBR,gBAAgB;IAAA,kBACL,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO;EAAC,GAAAO,KAAA,EAC9D;AAEN;AACAD,YAAY,CAACG,SAAS,GAAGT,gBAAgB,CAACS,SAAS;AACnDH,YAAY,CAACI,WAAW,GAAGV,gBAAgB,CAACU,WAAW;AACvDJ,YAAY,CAACK,KAAK,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CAAAgB,aAAA,CAACT,MAAM,EAAAqG,QAAA;UACLC,GAAG,EAAC,UAAU;UACdC,KAAK,EAAC,OAAO;UACb7E,MAAM,EAAEA,MAAO;UACfqD,GAAG,EAAEe,CAAE;UACPU,MAAM,EAAEpB,MAAI,CAACqB,gBAAgB,CAACnC,MAAM,EAAEE,KAAK,CAAE;UAC7CuB,OAAO,EAAE5F,oBAAoB,CAAC4F,OAAO,EAAE;YAAA,OAAMR,QAAQ,CAACjB,MAAM,CAAC;UAAA,EAAE;UAC/D0B,YAAY,EAAE7F,oBAAoB,CAAC6F,YAAY,EAAE,YAAM;YACrDP,mBAAmB,CAACnB,MAAM,CAAC;YAC3BoB,uBAAuB,CAAChG,KAAK,CAAC4E,MAAM,CAAC,CAAC,CAAC,CAAC,CAACoC,MAAM,EAAE,CAAC;UACpD,CAAC,CAAE;UACHT,YAAY,EAAE9F,oBAAoB,CAAC8F,YAAY,EAAE,YAAM;YACrDR,mBAAmB,CAAC,EAAE,CAAC;YACvBC,uBAAuB,CAAClB,KAAK,CAAC,CAAC,CAAC,GAAG9E,KAAK,CAAC8E,KAAK,CAAC,CAAC,CAAC,CAAC,CAACkC,MAAM,EAAE,GAAG,IAAIC,IAAI,EAAE,CAAC;UAC3E,CAAC;QAAE,GACCT,KAAK,EACT;MAAA,CACH,CAAC,CACM;IAEd;EAAC;EAAA,OAAA9C,MAAA;AAAA,EA3CyBzD,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/date-picker",
|
|
3
3
|
"description": "Semrush DatePicker Component",
|
|
4
|
-
"version": "4.16.
|
|
4
|
+
"version": "4.16.1",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@semcore/utils": "4.10.2",
|
|
13
13
|
"@semcore/base-trigger": "4.16.0",
|
|
14
|
-
"@semcore/button": "5.11.
|
|
14
|
+
"@semcore/button": "5.11.2",
|
|
15
15
|
"@semcore/divider": "4.10.1",
|
|
16
|
-
"@semcore/dropdown": "4.10.
|
|
16
|
+
"@semcore/dropdown": "4.10.2",
|
|
17
17
|
"@semcore/flex-box": "5.10.1",
|
|
18
18
|
"@semcore/icon": "4.16.0",
|
|
19
19
|
"@semcore/input": "4.12.1",
|