baseui 10.12.1 → 11.0.0
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/README.md +3 -3
- package/accordion/accordion.js +60 -13
- package/accordion/accordion.js.flow +49 -12
- package/accordion/index.d.ts +0 -3
- package/accordion/panel.js +7 -6
- package/accordion/panel.js.flow +20 -20
- package/accordion/stateless-accordion.js +2 -4
- package/accordion/stateless-accordion.js.flow +0 -2
- package/accordion/types.js.flow +0 -5
- package/button/constants.js +1 -2
- package/button/constants.js.flow +0 -1
- package/button/index.d.ts +0 -1
- package/button/styled-components.js +2 -29
- package/button/styled-components.js.flow +2 -30
- package/checkbox/checkbox.js +6 -30
- package/checkbox/checkbox.js.flow +7 -38
- package/checkbox/constants.js +2 -1
- package/checkbox/constants.js.flow +2 -1
- package/checkbox/index.d.ts +4 -6
- package/checkbox/index.js +0 -6
- package/checkbox/index.js.flow +0 -1
- package/checkbox/styled-components.js +52 -149
- package/checkbox/styled-components.js.flow +59 -165
- package/checkbox/types.js.flow +0 -5
- package/data-table/column-categorical.js +1 -1
- package/data-table/column-categorical.js.flow +1 -1
- package/data-table/column-datetime.js +1 -1
- package/data-table/column-datetime.js.flow +3 -1
- package/data-table/column.js +6 -2
- package/data-table/column.js.flow +9 -7
- package/data-table/data-table.js +1 -1
- package/data-table/data-table.js.flow +1 -1
- package/data-table/header-cell.js +3 -0
- package/data-table/header-cell.js.flow +1 -1
- package/datepicker/calendar.js +15 -7
- package/datepicker/calendar.js.flow +23 -9
- package/datepicker/constants.js +12 -2
- package/datepicker/constants.js.flow +10 -0
- package/datepicker/datepicker.js +61 -30
- package/datepicker/datepicker.js.flow +77 -37
- package/datepicker/day.js +85 -34
- package/datepicker/day.js.flow +118 -54
- package/datepicker/locale.js.flow +0 -1
- package/datepicker/month.js +3 -1
- package/datepicker/month.js.flow +2 -0
- package/datepicker/stateful-container.js.flow +2 -1
- package/datepicker/styled-components.js +23 -1
- package/datepicker/styled-components.js.flow +12 -2
- package/datepicker/types.js.flow +35 -10
- package/datepicker/utils/date-helpers.js +30 -0
- package/datepicker/utils/date-helpers.js.flow +12 -0
- package/datepicker/week.js +3 -1
- package/datepicker/week.js.flow +2 -0
- package/es/accordion/accordion.js +52 -12
- package/es/accordion/panel.js +7 -5
- package/es/accordion/stateless-accordion.js +2 -4
- package/es/button/constants.js +1 -2
- package/es/button/styled-components.js +2 -29
- package/es/checkbox/checkbox.js +7 -32
- package/es/checkbox/constants.js +2 -1
- package/es/checkbox/index.js +1 -1
- package/es/checkbox/styled-components.js +51 -146
- package/es/data-table/column-categorical.js +1 -1
- package/es/data-table/column-datetime.js +1 -1
- package/es/data-table/column.js +6 -2
- package/es/data-table/data-table.js +1 -1
- package/es/data-table/header-cell.js +3 -0
- package/es/datepicker/calendar.js +15 -7
- package/es/datepicker/constants.js +8 -0
- package/es/datepicker/datepicker.js +56 -29
- package/es/datepicker/day.js +77 -34
- package/es/datepicker/month.js +3 -1
- package/es/datepicker/styled-components.js +8 -2
- package/es/datepicker/types.js +1 -1
- package/es/datepicker/utils/date-helpers.js +16 -0
- package/es/datepicker/week.js +3 -1
- package/es/file-uploader/file-uploader.js +4 -4
- package/es/header-navigation/styled-components.js +3 -3
- package/es/helpers/overrides.js +1 -2
- package/es/input/styled-components.js +4 -4
- package/es/layer/layer.js +4 -4
- package/es/locale/index.js +0 -7
- package/es/menu/stateful-container.js +0 -1
- package/es/menu/styled-components.js +1 -1
- package/es/modal/index.js +1 -1
- package/es/modal/modal.js +19 -65
- package/es/modal/styled-components.js +12 -48
- package/es/phone-input/default-props.js +1 -1
- package/es/phone-input/index.js +0 -4
- package/es/phone-input/phone-input-lite.js +55 -31
- package/es/radio/radio.js +1 -7
- package/es/radio/radiogroup.js +3 -28
- package/es/radio/styled-components.js +4 -5
- package/es/rating/styled-components.js +3 -3
- package/es/select/index.js +1 -2
- package/es/select/select-component.js +4 -8
- package/es/select/styled-components.js +4 -4
- package/es/snackbar/styled-components.js +2 -2
- package/es/spinner/index.js +3 -9
- package/es/spinner/styled-components.js +2 -32
- package/es/table/filter.js +3 -3
- package/es/tag/styled-components.js +1 -1
- package/es/themes/dark-theme/color-component-tokens.js +0 -38
- package/es/themes/dark-theme/color-tokens.js +0 -2
- package/es/themes/dark-theme/create-dark-theme.js +0 -2
- package/es/themes/dark-theme/dark-theme.js +0 -2
- package/es/themes/light-theme/color-component-tokens.js +0 -38
- package/es/themes/light-theme/color-tokens.js +0 -2
- package/es/themes/light-theme/create-light-theme.js +0 -2
- package/es/themes/light-theme/light-theme.js +0 -2
- package/es/timepicker/timepicker.js +1 -8
- package/es/typography/index.js +1 -31
- package/esm/accordion/accordion.js +60 -13
- package/esm/accordion/panel.js +7 -6
- package/esm/accordion/stateless-accordion.js +2 -4
- package/esm/button/constants.js +1 -2
- package/esm/button/styled-components.js +2 -29
- package/esm/checkbox/checkbox.js +7 -30
- package/esm/checkbox/constants.js +2 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/checkbox/styled-components.js +52 -147
- package/esm/data-table/column-categorical.js +1 -1
- package/esm/data-table/column-datetime.js +1 -1
- package/esm/data-table/column.js +6 -2
- package/esm/data-table/data-table.js +1 -1
- package/esm/data-table/header-cell.js +3 -0
- package/esm/datepicker/calendar.js +15 -7
- package/esm/datepicker/constants.js +8 -0
- package/esm/datepicker/datepicker.js +60 -30
- package/esm/datepicker/day.js +84 -34
- package/esm/datepicker/month.js +3 -1
- package/esm/datepicker/styled-components.js +24 -2
- package/esm/datepicker/types.js +1 -1
- package/esm/datepicker/utils/date-helpers.js +30 -0
- package/esm/datepicker/week.js +3 -1
- package/esm/file-uploader/file-uploader.js +4 -4
- package/esm/header-navigation/styled-components.js +3 -3
- package/esm/helpers/overrides.js +1 -2
- package/esm/input/styled-components.js +4 -4
- package/esm/layer/layer.js +4 -4
- package/esm/locale/index.js +0 -7
- package/esm/menu/stateful-container.js +0 -1
- package/esm/menu/styled-components.js +1 -1
- package/esm/modal/index.js +1 -1
- package/esm/modal/modal.js +28 -71
- package/esm/modal/styled-components.js +6 -38
- package/esm/phone-input/default-props.js +1 -1
- package/esm/phone-input/index.js +0 -4
- package/esm/phone-input/phone-input-lite.js +60 -37
- package/esm/radio/radio.js +1 -7
- package/esm/radio/radiogroup.js +3 -28
- package/esm/radio/styled-components.js +4 -5
- package/esm/rating/styled-components.js +3 -3
- package/esm/select/index.js +1 -2
- package/esm/select/select-component.js +4 -8
- package/esm/select/styled-components.js +4 -4
- package/esm/snackbar/styled-components.js +2 -2
- package/esm/spinner/index.js +3 -9
- package/esm/spinner/styled-components.js +2 -40
- package/esm/table/filter.js +3 -3
- package/esm/tag/styled-components.js +1 -1
- package/esm/themes/dark-theme/color-component-tokens.js +0 -38
- package/esm/themes/dark-theme/color-tokens.js +0 -2
- package/esm/themes/dark-theme/create-dark-theme.js +1 -2
- package/esm/themes/dark-theme/dark-theme.js +1 -2
- package/esm/themes/light-theme/color-component-tokens.js +0 -38
- package/esm/themes/light-theme/color-tokens.js +0 -2
- package/esm/themes/light-theme/create-light-theme.js +1 -2
- package/esm/themes/light-theme/light-theme.js +1 -2
- package/esm/timepicker/timepicker.js +1 -8
- package/esm/typography/index.js +1 -35
- package/file-uploader/file-uploader.js +3 -3
- package/file-uploader/file-uploader.js.flow +4 -4
- package/header-navigation/styled-components.js +3 -3
- package/header-navigation/styled-components.js.flow +3 -3
- package/helpers/overrides.js +1 -2
- package/helpers/overrides.js.flow +1 -1
- package/input/index.d.ts +5 -9
- package/input/styled-components.js +4 -4
- package/input/styled-components.js.flow +4 -4
- package/layer/layer.js +4 -4
- package/layer/layer.js.flow +4 -3
- package/locale/index.js +0 -7
- package/locale/index.js.flow +0 -7
- package/locale.ts +0 -1
- package/menu/index.d.ts +1 -3
- package/menu/stateful-container.js +0 -1
- package/menu/stateful-container.js.flow +0 -1
- package/menu/styled-components.js +1 -1
- package/menu/styled-components.js.flow +1 -1
- package/modal/index.d.ts +4 -6
- package/modal/index.js +0 -6
- package/modal/index.js.flow +0 -1
- package/modal/modal.js +27 -70
- package/modal/modal.js.flow +17 -83
- package/modal/styled-components.js +7 -40
- package/modal/styled-components.js.flow +12 -44
- package/modal/types.js.flow +1 -10
- package/package.json +2 -2
- package/phone-input/default-props.js +1 -1
- package/phone-input/default-props.js.flow +1 -1
- package/phone-input/index.d.ts +0 -1
- package/phone-input/index.js +0 -36
- package/phone-input/index.js.flow +0 -4
- package/phone-input/phone-input-lite.js +63 -38
- package/phone-input/phone-input-lite.js.flow +66 -44
- package/radio/index.d.ts +4 -9
- package/radio/radio.js +1 -7
- package/radio/radio.js.flow +1 -8
- package/radio/radiogroup.js +3 -28
- package/radio/radiogroup.js.flow +2 -26
- package/radio/styled-components.js +4 -5
- package/radio/styled-components.js.flow +3 -4
- package/radio/types.js.flow +4 -15
- package/rating/styled-components.js +3 -3
- package/rating/styled-components.js.flow +3 -3
- package/select/index.d.ts +0 -2
- package/select/index.js +0 -6
- package/select/index.js.flow +0 -2
- package/select/select-component.js +4 -8
- package/select/select-component.js.flow +2 -3
- package/select/styled-components.js +4 -4
- package/select/styled-components.js.flow +4 -4
- package/snackbar/styled-components.js +1 -1
- package/snackbar/styled-components.js.flow +11 -11
- package/spinner/index.d.ts +5 -18
- package/spinner/index.js +2 -68
- package/spinner/index.js.flow +2 -27
- package/spinner/styled-components.js +9 -45
- package/spinner/styled-components.js.flow +2 -34
- package/spinner/types.js.flow +1 -19
- package/styles/types.js.flow +0 -2
- package/table/filter.js +3 -3
- package/table/filter.js.flow +3 -3
- package/tag/styled-components.js +1 -1
- package/tag/styled-components.js.flow +1 -1
- package/theme.ts +0 -81
- package/themes/dark-theme/color-component-tokens.js +0 -38
- package/themes/dark-theme/color-component-tokens.js.flow +0 -42
- package/themes/dark-theme/color-tokens.js +0 -2
- package/themes/dark-theme/color-tokens.js.flow +0 -2
- package/themes/dark-theme/create-dark-theme.js +1 -3
- package/themes/dark-theme/create-dark-theme.js.flow +0 -2
- package/themes/dark-theme/dark-theme.js +1 -3
- package/themes/dark-theme/dark-theme.js.flow +0 -2
- package/themes/light-theme/color-component-tokens.js +0 -38
- package/themes/light-theme/color-component-tokens.js.flow +0 -43
- package/themes/light-theme/color-tokens.js +0 -2
- package/themes/light-theme/color-tokens.js.flow +0 -2
- package/themes/light-theme/create-light-theme.js +1 -3
- package/themes/light-theme/create-light-theme.js.flow +0 -2
- package/themes/light-theme/light-theme.js +1 -3
- package/themes/light-theme/light-theme.js.flow +0 -2
- package/themes/types.js.flow +0 -68
- package/timepicker/timepicker.js +1 -8
- package/timepicker/timepicker.js.flow +4 -10
- package/typography/index.d.ts +0 -23
- package/typography/index.js +2 -57
- package/typography/index.js.flow +0 -31
- package/es/spinner/spinner.js +0 -68
- package/es/themes/dark-theme/color-deprecated-semantic-tokens.js +0 -35
- package/es/themes/light-theme/color-deprecated-semantic-tokens.js +0 -35
- package/esm/spinner/spinner.js +0 -125
- package/esm/themes/dark-theme/color-deprecated-semantic-tokens.js +0 -38
- package/esm/themes/light-theme/color-deprecated-semantic-tokens.js +0 -38
- package/spinner/spinner.js +0 -136
- package/spinner/spinner.js.flow +0 -75
- package/themes/dark-theme/color-deprecated-semantic-tokens.js +0 -50
- package/themes/dark-theme/color-deprecated-semantic-tokens.js.flow +0 -42
- package/themes/light-theme/color-deprecated-semantic-tokens.js +0 -50
- package/themes/light-theme/color-deprecated-semantic-tokens.js.flow +0 -42
package/datepicker/day.js
CHANGED
|
@@ -21,6 +21,8 @@ var _index = require("../locale/index.js");
|
|
|
21
21
|
|
|
22
22
|
var _focusVisible = require("../utils/focusVisible.js");
|
|
23
23
|
|
|
24
|
+
var _constants = require("./constants.js");
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
@@ -96,22 +98,49 @@ var Day = /*#__PURE__*/function (_React$Component) {
|
|
|
96
98
|
var _this$props = _this.props,
|
|
97
99
|
range = _this$props.range,
|
|
98
100
|
value = _this$props.value;
|
|
99
|
-
var
|
|
101
|
+
var nextDate;
|
|
102
|
+
|
|
103
|
+
if (Array.isArray(value) && range && _this.props.hasLockedBehavior) {
|
|
104
|
+
var currentDate = _this.props.value;
|
|
105
|
+
var nextStartDate = null;
|
|
106
|
+
var nextEndDate = null;
|
|
107
|
+
|
|
108
|
+
if (_this.props.selectedInput === _constants.INPUT_ROLE.startDate) {
|
|
109
|
+
nextStartDate = selectedDate;
|
|
110
|
+
nextEndDate = Array.isArray(currentDate) && currentDate[1] ? currentDate[1] : null;
|
|
111
|
+
} else if (_this.props.selectedInput === _constants.INPUT_ROLE.endDate) {
|
|
112
|
+
nextStartDate = Array.isArray(currentDate) && currentDate[0] ? currentDate[0] : null;
|
|
113
|
+
nextEndDate = selectedDate;
|
|
114
|
+
}
|
|
100
115
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
nextDate = [nextStartDate];
|
|
117
|
+
|
|
118
|
+
if (nextEndDate) {
|
|
119
|
+
nextDate.push(nextEndDate);
|
|
120
|
+
}
|
|
121
|
+
} else if (Array.isArray(value) && range && !_this.props.hasLockedBehavior) {
|
|
122
|
+
var _value = _slicedToArray(value, 2),
|
|
123
|
+
start = _value[0],
|
|
124
|
+
end = _value[1]; // Starting a new range
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
if (!start && !end || start && end) {
|
|
128
|
+
nextDate = [selectedDate, null]; // EndDate needs a StartDate, SelectedDate comes before EndDate
|
|
129
|
+
} else if (!start && end && _this.dateHelpers.isAfter(end, selectedDate)) {
|
|
130
|
+
nextDate = [selectedDate, end]; // EndDate needs a StartDate, but SelectedDate comes after EndDate
|
|
131
|
+
} else if (!start && end && _this.dateHelpers.isAfter(selectedDate, end)) {
|
|
132
|
+
nextDate = [end, selectedDate]; // StartDate needs an EndDate, SelectedDate comes after StartDate
|
|
133
|
+
} else if (start && !end && _this.dateHelpers.isAfter(selectedDate, start)) {
|
|
134
|
+
nextDate = [start, selectedDate];
|
|
106
135
|
} else {
|
|
107
|
-
|
|
136
|
+
nextDate = [selectedDate, start];
|
|
108
137
|
}
|
|
109
138
|
} else {
|
|
110
|
-
|
|
139
|
+
nextDate = selectedDate;
|
|
111
140
|
}
|
|
112
141
|
|
|
113
142
|
_this.props.onSelect({
|
|
114
|
-
date:
|
|
143
|
+
date: nextDate
|
|
115
144
|
});
|
|
116
145
|
});
|
|
117
146
|
|
|
@@ -298,13 +327,18 @@ var Day = /*#__PURE__*/function (_React$Component) {
|
|
|
298
327
|
var date = this.getDateProp();
|
|
299
328
|
var value = this.props.value;
|
|
300
329
|
|
|
301
|
-
if (Array.isArray(value)
|
|
302
|
-
|
|
303
|
-
|
|
330
|
+
if (Array.isArray(value)) {
|
|
331
|
+
var _value2 = _slicedToArray(value, 2),
|
|
332
|
+
start = _value2[0],
|
|
333
|
+
end = _value2[1];
|
|
304
334
|
|
|
335
|
+
if (!start && !end) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
305
338
|
|
|
306
|
-
|
|
307
|
-
|
|
339
|
+
if (start && end) {
|
|
340
|
+
return this.dateHelpers.isDayInRange(this.clampToDayStart(date), this.clampToDayStart(start), this.clampToDayStart(end));
|
|
341
|
+
}
|
|
308
342
|
}
|
|
309
343
|
} // calculated for range case only
|
|
310
344
|
|
|
@@ -316,16 +350,29 @@ var Day = /*#__PURE__*/function (_React$Component) {
|
|
|
316
350
|
value = _this$props4.value,
|
|
317
351
|
highlightedDate = _this$props4.highlightedDate;
|
|
318
352
|
|
|
319
|
-
if (Array.isArray(value)
|
|
320
|
-
|
|
321
|
-
|
|
353
|
+
if (Array.isArray(value)) {
|
|
354
|
+
var _value3 = _slicedToArray(value, 2),
|
|
355
|
+
start = _value3[0],
|
|
356
|
+
end = _value3[1];
|
|
322
357
|
|
|
358
|
+
if (!start && !end) {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
323
361
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
362
|
+
if (highlightedDate && start && !end) {
|
|
363
|
+
if (this.dateHelpers.isAfter(highlightedDate, start)) {
|
|
364
|
+
return this.dateHelpers.isDayInRange(this.clampToDayStart(date), this.clampToDayStart(start), this.clampToDayStart(highlightedDate));
|
|
365
|
+
} else {
|
|
366
|
+
return this.dateHelpers.isDayInRange(this.clampToDayStart(date), this.clampToDayStart(highlightedDate), this.clampToDayStart(start));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (highlightedDate && !start && end) {
|
|
371
|
+
if (this.dateHelpers.isAfter(highlightedDate, end)) {
|
|
372
|
+
return this.dateHelpers.isDayInRange(this.clampToDayStart(date), this.clampToDayStart(end), this.clampToDayStart(highlightedDate));
|
|
373
|
+
} else {
|
|
374
|
+
return this.dateHelpers.isDayInRange(this.clampToDayStart(date), this.clampToDayStart(highlightedDate), this.clampToDayStart(end));
|
|
375
|
+
}
|
|
329
376
|
}
|
|
330
377
|
}
|
|
331
378
|
}
|
|
@@ -337,21 +384,22 @@ var Day = /*#__PURE__*/function (_React$Component) {
|
|
|
337
384
|
value = _this$props5.value,
|
|
338
385
|
highlightedDate = _this$props5.highlightedDate,
|
|
339
386
|
range = _this$props5.range,
|
|
340
|
-
highlighted = _this$props5.highlighted
|
|
387
|
+
highlighted = _this$props5.highlighted,
|
|
388
|
+
peekNextMonth = _this$props5.peekNextMonth;
|
|
341
389
|
var $isHighlighted = highlighted;
|
|
342
390
|
var $selected = this.isSelected();
|
|
343
|
-
var $hasRangeHighlighted = !!(Array.isArray(value) && range && value
|
|
344
|
-
var $outsideMonth = !
|
|
345
|
-
var $outsideMonthWithinRange = !!(Array.isArray(value) && range && $outsideMonth && !
|
|
391
|
+
var $hasRangeHighlighted = !!(Array.isArray(value) && range && highlightedDate && (value[0] && !value[1] && !this.dateHelpers.isSameDay(value[0], highlightedDate) || !value[0] && value[1] && !this.dateHelpers.isSameDay(value[1], highlightedDate)));
|
|
392
|
+
var $outsideMonth = !peekNextMonth && this.isOutsideMonth();
|
|
393
|
+
var $outsideMonthWithinRange = !!(Array.isArray(value) && range && $outsideMonth && !peekNextMonth && this.isOutsideOfMonthButWithinRange());
|
|
346
394
|
return {
|
|
347
395
|
$date: date,
|
|
348
396
|
$density: this.props.density,
|
|
349
397
|
$disabled: this.props.disabled,
|
|
350
|
-
$endDate: Array.isArray(value) &&
|
|
398
|
+
$endDate: Array.isArray(value) && !!(value[0] && value[1]) && range && $selected && this.dateHelpers.isSameDay(date, value[1]) || false,
|
|
351
399
|
$hasDateLabel: !!this.props.dateLabel,
|
|
352
400
|
$hasRangeHighlighted: $hasRangeHighlighted,
|
|
353
|
-
$hasRangeOnRight: Array.isArray(value) && $hasRangeHighlighted && highlightedDate && value[0] && this.dateHelpers.isAfter(highlightedDate, value[0]),
|
|
354
|
-
$hasRangeSelected: Array.isArray(value) ? value
|
|
401
|
+
$hasRangeOnRight: Array.isArray(value) && $hasRangeHighlighted && highlightedDate && (value[0] && this.dateHelpers.isAfter(highlightedDate, value[0]) || value[1] && this.dateHelpers.isAfter(highlightedDate, value[1])),
|
|
402
|
+
$hasRangeSelected: Array.isArray(value) ? !!(value[0] && value[1]) : false,
|
|
355
403
|
$highlightedDate: highlightedDate,
|
|
356
404
|
$isHighlighted: $isHighlighted,
|
|
357
405
|
$isHovered: this.state.isHovered,
|
|
@@ -361,12 +409,15 @@ var Day = /*#__PURE__*/function (_React$Component) {
|
|
|
361
409
|
$month: this.getMonthProp(),
|
|
362
410
|
$outsideMonth: $outsideMonth,
|
|
363
411
|
$outsideMonthWithinRange: $outsideMonthWithinRange,
|
|
364
|
-
$peekNextMonth:
|
|
365
|
-
$pseudoHighlighted:
|
|
366
|
-
$pseudoSelected:
|
|
367
|
-
$range:
|
|
412
|
+
$peekNextMonth: peekNextMonth,
|
|
413
|
+
$pseudoHighlighted: range && !$isHighlighted && !$selected ? this.isPseudoHighlighted() : false,
|
|
414
|
+
$pseudoSelected: range && !$selected ? this.isPseudoSelected() : false,
|
|
415
|
+
$range: range,
|
|
368
416
|
$selected: $selected,
|
|
369
|
-
$startDate: Array.isArray(
|
|
417
|
+
$startDate: Array.isArray(value) && value[0] && value[1] && range && $selected ? this.dateHelpers.isSameDay(date, value[0]) : false,
|
|
418
|
+
$hasLockedBehavior: this.props.hasLockedBehavior,
|
|
419
|
+
$selectedInput: this.props.selectedInput,
|
|
420
|
+
$value: this.props.value
|
|
370
421
|
};
|
|
371
422
|
}
|
|
372
423
|
}, {
|
package/datepicker/day.js.flow
CHANGED
|
@@ -14,6 +14,7 @@ import type { DayPropsT, DayStateT } from './types.js';
|
|
|
14
14
|
import { LocaleContext } from '../locale/index.js';
|
|
15
15
|
import type { LocaleT } from '../locale/types.js';
|
|
16
16
|
import { isFocusVisible } from '../utils/focusVisible.js';
|
|
17
|
+
import { INPUT_ROLE } from './constants.js';
|
|
17
18
|
|
|
18
19
|
export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStateT> {
|
|
19
20
|
static defaultProps = {
|
|
@@ -72,21 +73,58 @@ export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStat
|
|
|
72
73
|
: this.props.month;
|
|
73
74
|
};
|
|
74
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Determines how the day value(s) should be updated when a new day is selected.
|
|
78
|
+
* Note: time values are incorporated into new day/date values downstream in `Calendar`.
|
|
79
|
+
* Note: Situations where Start Dates are after End Dates are handled downstream in `Datepicker`.
|
|
80
|
+
* */
|
|
75
81
|
onSelect: (T) => void = (selectedDate) => {
|
|
76
82
|
const { range, value } = this.props;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
|
|
84
|
+
let nextDate;
|
|
85
|
+
if (Array.isArray(value) && range && this.props.hasLockedBehavior) {
|
|
86
|
+
const currentDate = this.props.value;
|
|
87
|
+
let nextStartDate = null;
|
|
88
|
+
let nextEndDate = null;
|
|
89
|
+
|
|
90
|
+
if (this.props.selectedInput === INPUT_ROLE.startDate) {
|
|
91
|
+
nextStartDate = selectedDate;
|
|
92
|
+
nextEndDate = Array.isArray(currentDate) && currentDate[1] ? currentDate[1] : null;
|
|
93
|
+
} else if (this.props.selectedInput === INPUT_ROLE.endDate) {
|
|
94
|
+
nextStartDate = Array.isArray(currentDate) && currentDate[0] ? currentDate[0] : null;
|
|
95
|
+
nextEndDate = selectedDate;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
nextDate = [nextStartDate];
|
|
99
|
+
if (nextEndDate) {
|
|
100
|
+
nextDate.push(nextEndDate);
|
|
101
|
+
}
|
|
102
|
+
} else if (Array.isArray(value) && range && !this.props.hasLockedBehavior) {
|
|
103
|
+
const [start, end] = value;
|
|
104
|
+
|
|
105
|
+
// Starting a new range
|
|
106
|
+
if ((!start && !end) || (start && end)) {
|
|
107
|
+
nextDate = [selectedDate, null];
|
|
108
|
+
|
|
109
|
+
// EndDate needs a StartDate, SelectedDate comes before EndDate
|
|
110
|
+
} else if (!start && end && this.dateHelpers.isAfter(end, selectedDate)) {
|
|
111
|
+
nextDate = [selectedDate, end];
|
|
112
|
+
|
|
113
|
+
// EndDate needs a StartDate, but SelectedDate comes after EndDate
|
|
114
|
+
} else if (!start && end && this.dateHelpers.isAfter(selectedDate, end)) {
|
|
115
|
+
nextDate = [end, selectedDate];
|
|
116
|
+
|
|
117
|
+
// StartDate needs an EndDate, SelectedDate comes after StartDate
|
|
118
|
+
} else if (start && !end && this.dateHelpers.isAfter(selectedDate, start)) {
|
|
119
|
+
nextDate = [start, selectedDate];
|
|
83
120
|
} else {
|
|
84
|
-
|
|
121
|
+
nextDate = [selectedDate, start];
|
|
85
122
|
}
|
|
86
123
|
} else {
|
|
87
|
-
|
|
124
|
+
nextDate = selectedDate;
|
|
88
125
|
}
|
|
89
|
-
|
|
126
|
+
|
|
127
|
+
this.props.onSelect({ date: nextDate });
|
|
90
128
|
};
|
|
91
129
|
|
|
92
130
|
onKeyDown = (event: KeyboardEvent) => {
|
|
@@ -205,16 +243,21 @@ export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStat
|
|
|
205
243
|
isPseudoSelected() {
|
|
206
244
|
const date = this.getDateProp();
|
|
207
245
|
const { value } = this.props;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
246
|
+
|
|
247
|
+
if (Array.isArray(value)) {
|
|
248
|
+
const [start, end] = value;
|
|
249
|
+
|
|
250
|
+
if (!start && !end) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (start && end) {
|
|
255
|
+
return this.dateHelpers.isDayInRange(
|
|
256
|
+
this.clampToDayStart(date),
|
|
257
|
+
this.clampToDayStart(start),
|
|
258
|
+
this.clampToDayStart(end)
|
|
259
|
+
);
|
|
260
|
+
}
|
|
218
261
|
}
|
|
219
262
|
}
|
|
220
263
|
|
|
@@ -222,46 +265,66 @@ export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStat
|
|
|
222
265
|
isPseudoHighlighted() {
|
|
223
266
|
const date = this.getDateProp();
|
|
224
267
|
const { value, highlightedDate } = this.props;
|
|
225
|
-
if (Array.isArray(value) && !value[0] && !value[1]) {
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
268
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
269
|
+
if (Array.isArray(value)) {
|
|
270
|
+
const [start, end] = value;
|
|
271
|
+
|
|
272
|
+
if (!start && !end) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (highlightedDate && start && !end) {
|
|
277
|
+
if (this.dateHelpers.isAfter(highlightedDate, start)) {
|
|
278
|
+
return this.dateHelpers.isDayInRange(
|
|
279
|
+
this.clampToDayStart(date),
|
|
280
|
+
this.clampToDayStart(start),
|
|
281
|
+
this.clampToDayStart(highlightedDate)
|
|
282
|
+
);
|
|
283
|
+
} else {
|
|
284
|
+
return this.dateHelpers.isDayInRange(
|
|
285
|
+
this.clampToDayStart(date),
|
|
286
|
+
this.clampToDayStart(highlightedDate),
|
|
287
|
+
this.clampToDayStart(start)
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (highlightedDate && !start && end) {
|
|
293
|
+
if (this.dateHelpers.isAfter(highlightedDate, end)) {
|
|
294
|
+
return this.dateHelpers.isDayInRange(
|
|
295
|
+
this.clampToDayStart(date),
|
|
296
|
+
this.clampToDayStart(end),
|
|
297
|
+
this.clampToDayStart(highlightedDate)
|
|
298
|
+
);
|
|
299
|
+
} else {
|
|
300
|
+
return this.dateHelpers.isDayInRange(
|
|
301
|
+
this.clampToDayStart(date),
|
|
302
|
+
this.clampToDayStart(highlightedDate),
|
|
303
|
+
this.clampToDayStart(end)
|
|
304
|
+
);
|
|
305
|
+
}
|
|
243
306
|
}
|
|
244
307
|
}
|
|
245
308
|
}
|
|
246
309
|
|
|
247
310
|
getSharedProps() {
|
|
248
311
|
const date = this.getDateProp();
|
|
249
|
-
const { value, highlightedDate, range, highlighted } = this.props;
|
|
312
|
+
const { value, highlightedDate, range, highlighted, peekNextMonth } = this.props;
|
|
250
313
|
const $isHighlighted = highlighted;
|
|
251
314
|
const $selected = this.isSelected();
|
|
252
315
|
const $hasRangeHighlighted = !!(
|
|
253
316
|
Array.isArray(value) &&
|
|
254
317
|
range &&
|
|
255
|
-
value.length === 1 &&
|
|
256
318
|
highlightedDate &&
|
|
257
|
-
!this.dateHelpers.isSameDay(value[0], highlightedDate)
|
|
319
|
+
((value[0] && !value[1] && !this.dateHelpers.isSameDay(value[0], highlightedDate)) ||
|
|
320
|
+
(!value[0] && value[1] && !this.dateHelpers.isSameDay(value[1], highlightedDate)))
|
|
258
321
|
);
|
|
259
|
-
const $outsideMonth = !
|
|
322
|
+
const $outsideMonth = !peekNextMonth && this.isOutsideMonth();
|
|
260
323
|
const $outsideMonthWithinRange = !!(
|
|
261
324
|
Array.isArray(value) &&
|
|
262
325
|
range &&
|
|
263
326
|
$outsideMonth &&
|
|
264
|
-
!
|
|
327
|
+
!peekNextMonth &&
|
|
265
328
|
this.isOutsideOfMonthButWithinRange()
|
|
266
329
|
);
|
|
267
330
|
return {
|
|
@@ -270,7 +333,8 @@ export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStat
|
|
|
270
333
|
$disabled: this.props.disabled,
|
|
271
334
|
$endDate:
|
|
272
335
|
(Array.isArray(value) &&
|
|
273
|
-
|
|
336
|
+
!!(value[0] && value[1]) &&
|
|
337
|
+
range &&
|
|
274
338
|
$selected &&
|
|
275
339
|
this.dateHelpers.isSameDay(date, value[1])) ||
|
|
276
340
|
false,
|
|
@@ -280,9 +344,9 @@ export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStat
|
|
|
280
344
|
Array.isArray(value) &&
|
|
281
345
|
$hasRangeHighlighted &&
|
|
282
346
|
highlightedDate &&
|
|
283
|
-
value[0] &&
|
|
284
|
-
|
|
285
|
-
$hasRangeSelected: Array.isArray(value) ? value
|
|
347
|
+
((value[0] && this.dateHelpers.isAfter(highlightedDate, value[0])) ||
|
|
348
|
+
(value[1] && this.dateHelpers.isAfter(highlightedDate, value[1]))),
|
|
349
|
+
$hasRangeSelected: Array.isArray(value) ? !!(value[0] && value[1]) : false,
|
|
286
350
|
$highlightedDate: highlightedDate,
|
|
287
351
|
$isHighlighted,
|
|
288
352
|
$isHovered: this.state.isHovered,
|
|
@@ -292,19 +356,19 @@ export default class Day<T = Date> extends React.Component<DayPropsT<T>, DayStat
|
|
|
292
356
|
$month: this.getMonthProp(),
|
|
293
357
|
$outsideMonth,
|
|
294
358
|
$outsideMonthWithinRange,
|
|
295
|
-
$peekNextMonth:
|
|
359
|
+
$peekNextMonth: peekNextMonth,
|
|
296
360
|
$pseudoHighlighted:
|
|
297
|
-
|
|
298
|
-
$pseudoSelected:
|
|
299
|
-
$range:
|
|
361
|
+
range && !$isHighlighted && !$selected ? this.isPseudoHighlighted() : false,
|
|
362
|
+
$pseudoSelected: range && !$selected ? this.isPseudoSelected() : false,
|
|
363
|
+
$range: range,
|
|
300
364
|
$selected,
|
|
301
365
|
$startDate:
|
|
302
|
-
Array.isArray(
|
|
303
|
-
|
|
304
|
-
this.props.range &&
|
|
305
|
-
$selected
|
|
306
|
-
? this.dateHelpers.isSameDay(date, this.props.value[0])
|
|
366
|
+
Array.isArray(value) && value[0] && value[1] && range && $selected
|
|
367
|
+
? this.dateHelpers.isSameDay(date, value[0])
|
|
307
368
|
: false,
|
|
369
|
+
$hasLockedBehavior: this.props.hasLockedBehavior,
|
|
370
|
+
$selectedInput: this.props.selectedInput,
|
|
371
|
+
$value: this.props.value,
|
|
308
372
|
};
|
|
309
373
|
}
|
|
310
374
|
|
|
@@ -28,7 +28,6 @@ export type DatepickerLocaleT = {|
|
|
|
28
28
|
quickSelectPlaceholder: string,
|
|
29
29
|
timeSelectEndLabel: string,
|
|
30
30
|
timeSelectStartLabel: string,
|
|
31
|
-
timePickerAriaLabel?: string,
|
|
32
31
|
timePickerAriaLabel12Hour: string,
|
|
33
32
|
timePickerAriaLabel24Hour: string,
|
|
34
33
|
timezonePickerAriaLabel: string,
|
package/datepicker/month.js
CHANGED
|
@@ -143,7 +143,9 @@ var CalendarMonth = /*#__PURE__*/function (_React$Component) {
|
|
|
143
143
|
onChange: _this.props.onChange,
|
|
144
144
|
overrides: _this.props.overrides,
|
|
145
145
|
peekNextMonth: _this.props.peekNextMonth,
|
|
146
|
-
value: _this.props.value
|
|
146
|
+
value: _this.props.value,
|
|
147
|
+
hasLockedBehavior: _this.props.hasLockedBehavior,
|
|
148
|
+
selectedInput: _this.props.selectedInput
|
|
147
149
|
}));
|
|
148
150
|
i++;
|
|
149
151
|
currentWeekStart = _this.dateHelpers.addWeeks(currentWeekStart, 1); // It will break on the next week if the week is out of the month
|
package/datepicker/month.js.flow
CHANGED
|
@@ -100,6 +100,8 @@ export default class CalendarMonth<T = Date> extends React.Component<MonthPropsT
|
|
|
100
100
|
overrides={this.props.overrides}
|
|
101
101
|
peekNextMonth={this.props.peekNextMonth}
|
|
102
102
|
value={this.props.value}
|
|
103
|
+
hasLockedBehavior={this.props.hasLockedBehavior}
|
|
104
|
+
selectedInput={this.props.selectedInput}
|
|
103
105
|
/>
|
|
104
106
|
);
|
|
105
107
|
i++;
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
StatefulContainerPropsT,
|
|
15
15
|
StateChangeTypeT,
|
|
16
16
|
StateReducerT,
|
|
17
|
+
DateValueT,
|
|
17
18
|
} from './types.js';
|
|
18
19
|
|
|
19
20
|
type InputProps<T> = CalendarPropsT<T> | DatepickerPropsT<T>;
|
|
@@ -33,7 +34,7 @@ class StatefulContainer<T = Date> extends React.Component<PropsT<T>, ContainerSt
|
|
|
33
34
|
this.state = { value, ...props.initialState };
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
onChange: ({ date:
|
|
37
|
+
onChange: ({ date: DateValueT<T> }) => mixed = (data) => {
|
|
37
38
|
const { date } = data;
|
|
38
39
|
this.internalSetState(STATE_CHANGE_TYPE.change, { value: date });
|
|
39
40
|
if (typeof this.props.onChange === 'function') {
|
|
@@ -13,6 +13,18 @@ var _constants = require("./constants.js");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
+
|
|
18
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
|
|
20
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
+
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
|
+
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
25
|
+
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
|
|
16
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
17
29
|
|
|
18
30
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -448,6 +460,9 @@ var StyledDay = (0, _index.styled)('div', function (props) {
|
|
|
448
460
|
$outsideMonthWithinRange = props.$outsideMonthWithinRange,
|
|
449
461
|
$hasDateLabel = props.$hasDateLabel,
|
|
450
462
|
$density = props.$density,
|
|
463
|
+
$hasLockedBehavior = props.$hasLockedBehavior,
|
|
464
|
+
$selectedInput = props.$selectedInput,
|
|
465
|
+
$value = props.$value,
|
|
451
466
|
_props$$theme4 = props.$theme,
|
|
452
467
|
colors = _props$$theme4.colors,
|
|
453
468
|
typography = _props$$theme4.typography,
|
|
@@ -469,6 +484,13 @@ var StyledDay = (0, _index.styled)('div', function (props) {
|
|
|
469
484
|
}
|
|
470
485
|
}
|
|
471
486
|
|
|
487
|
+
var _ref9 = Array.isArray($value) ? $value : [$value, null],
|
|
488
|
+
_ref10 = _slicedToArray(_ref9, 2),
|
|
489
|
+
startDate = _ref10[0],
|
|
490
|
+
endDate = _ref10[1];
|
|
491
|
+
|
|
492
|
+
var oppositeInputIsPopulated = $selectedInput === _constants.INPUT_ROLE.startDate ? endDate !== null && typeof endDate !== 'undefined' : startDate !== null && typeof startDate !== 'undefined';
|
|
493
|
+
var shouldHighlightRange = $range && !($hasLockedBehavior && !oppositeInputIsPopulated);
|
|
472
494
|
return _objectSpread(_objectSpread(_objectSpread({}, $density === _constants.DENSITY.high ? typography.ParagraphSmall : typography.ParagraphMedium), {}, {
|
|
473
495
|
boxSizing: 'border-box',
|
|
474
496
|
position: 'relative',
|
|
@@ -530,7 +552,7 @@ var StyledDay = (0, _index.styled)('div', function (props) {
|
|
|
530
552
|
}, getDayStyles(code, props.$theme)[':after'] || {}), $outsideMonthWithinRange ? {
|
|
531
553
|
content: null
|
|
532
554
|
} : {})
|
|
533
|
-
},
|
|
555
|
+
}, shouldHighlightRange ? {
|
|
534
556
|
// :before pseudo element defines a grey background style that extends
|
|
535
557
|
// the selected/highlighted day's circle and spans through a range
|
|
536
558
|
':before': _objectSpread(_objectSpread({
|
|
@@ -8,7 +8,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
8
8
|
import { styled } from '../styles/index.js';
|
|
9
9
|
import getDayStateCode from './utils/day-state.js';
|
|
10
10
|
import type { SharedStylePropsT, CalendarPropsT } from './types.js';
|
|
11
|
-
import { ORIENTATION, DENSITY } from './constants.js';
|
|
11
|
+
import { ORIENTATION, DENSITY, INPUT_ROLE } from './constants.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Main component container element
|
|
@@ -408,6 +408,9 @@ export const StyledDay = styled<SharedStylePropsT>('div', (props) => {
|
|
|
408
408
|
$outsideMonthWithinRange,
|
|
409
409
|
$hasDateLabel,
|
|
410
410
|
$density,
|
|
411
|
+
$hasLockedBehavior,
|
|
412
|
+
$selectedInput,
|
|
413
|
+
$value,
|
|
411
414
|
$theme: { colors, typography, sizing },
|
|
412
415
|
} = props;
|
|
413
416
|
const code = getDayStateCode(props);
|
|
@@ -427,6 +430,13 @@ export const StyledDay = styled<SharedStylePropsT>('div', (props) => {
|
|
|
427
430
|
}
|
|
428
431
|
}
|
|
429
432
|
|
|
433
|
+
const [startDate, endDate] = Array.isArray($value) ? $value : [$value, null];
|
|
434
|
+
const oppositeInputIsPopulated =
|
|
435
|
+
$selectedInput === INPUT_ROLE.startDate
|
|
436
|
+
? endDate !== null && typeof endDate !== 'undefined'
|
|
437
|
+
: startDate !== null && typeof startDate !== 'undefined';
|
|
438
|
+
const shouldHighlightRange = $range && !($hasLockedBehavior && !oppositeInputIsPopulated);
|
|
439
|
+
|
|
430
440
|
return ({
|
|
431
441
|
...($density === DENSITY.high ? typography.ParagraphSmall : typography.ParagraphMedium),
|
|
432
442
|
boxSizing: 'border-box',
|
|
@@ -496,7 +506,7 @@ export const StyledDay = styled<SharedStylePropsT>('div', (props) => {
|
|
|
496
506
|
...(getDayStyles(code, props.$theme)[':after'] || {}),
|
|
497
507
|
...($outsideMonthWithinRange ? { content: null } : {}),
|
|
498
508
|
},
|
|
499
|
-
...(
|
|
509
|
+
...(shouldHighlightRange
|
|
500
510
|
? {
|
|
501
511
|
// :before pseudo element defines a grey background style that extends
|
|
502
512
|
// the selected/highlighted day's circle and spans through a range
|