@ssa-ui-kit/core 3.19.0 → 3.19.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/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/index.js +48 -27
- package/package.json +3 -3
|
@@ -62,6 +62,7 @@ export declare const DaysViewCell: import("@emotion/styled").StyledComponent<{
|
|
|
62
62
|
isCalendarDateNow: boolean;
|
|
63
63
|
isCalendarDateSelected: boolean;
|
|
64
64
|
isHighlighted: boolean;
|
|
65
|
+
isOutOfMonth?: boolean;
|
|
65
66
|
rangeEdge?: RangeEdge;
|
|
66
67
|
}, {}, {}>;
|
|
67
68
|
export declare const YearsViewCell: import("@emotion/styled").StyledComponent<{
|
package/dist/index.js
CHANGED
|
@@ -23916,8 +23916,12 @@ const DaysViewCell = /*#__PURE__*/base_default()(Wrapper_Wrapper, true ? {
|
|
|
23916
23916
|
isCalendarDateNow
|
|
23917
23917
|
}) => isCalendarDateNow ? `1px solid ${theme.colors.grey}` : 'none', ";color:", ({
|
|
23918
23918
|
theme,
|
|
23919
|
-
isCalendarDateSelected
|
|
23920
|
-
|
|
23919
|
+
isCalendarDateSelected,
|
|
23920
|
+
isOutOfMonth
|
|
23921
|
+
}) => {
|
|
23922
|
+
if (isCalendarDateSelected) return theme.colors.white;
|
|
23923
|
+
return isOutOfMonth ? theme.colors.grey : theme.colors.greyDarker;
|
|
23924
|
+
}, ";background:", ({
|
|
23921
23925
|
theme,
|
|
23922
23926
|
isCalendarDateSelected
|
|
23923
23927
|
}) => isCalendarDateSelected && theme.palette.primary.main, ";cursor:pointer;user-select:none;&[aria-disabled='true']{color:", ({
|
|
@@ -24656,11 +24660,20 @@ const DaysView = () => {
|
|
|
24656
24660
|
const {
|
|
24657
24661
|
target
|
|
24658
24662
|
} = event;
|
|
24659
|
-
const selectedDay =
|
|
24663
|
+
const selectedDay = target.getAttribute('data-day');
|
|
24660
24664
|
const isEnabled = target.getAttribute('aria-disabled') === 'false';
|
|
24661
|
-
if (isEnabled) {
|
|
24665
|
+
if (isEnabled && selectedDay) {
|
|
24666
|
+
// The clicked cell may belong to the previous/next month (leading or
|
|
24667
|
+
// trailing padding), so its year/month/day must come from data-day
|
|
24668
|
+
// rather than being applied to the currently displayed month —
|
|
24669
|
+
// otherwise e.g. clicking "30 Jul" while viewing August would
|
|
24670
|
+
// silently resolve to 30 Aug. Any time-of-day already chosen via the
|
|
24671
|
+
// time panel is preserved from calendarViewDateTime.
|
|
24672
|
+
const parsedDay = external_luxon_namespaceObject.DateTime.fromFormat(selectedDay, 'D');
|
|
24662
24673
|
const newDate = calendarViewDateTime?.set({
|
|
24663
|
-
|
|
24674
|
+
year: parsedDay.year,
|
|
24675
|
+
month: parsedDay.month,
|
|
24676
|
+
day: parsedDay.day
|
|
24664
24677
|
});
|
|
24665
24678
|
setCalendarViewDateTime(newDate);
|
|
24666
24679
|
setDateTime(newDate);
|
|
@@ -24707,28 +24720,31 @@ const DaysView = () => {
|
|
|
24707
24720
|
if (isHighlightEnabled && lastChangedDate && otherDateDT && dateTime) {
|
|
24708
24721
|
isHighlightDate = highlightDates.mode === 'dateTo' ? otherDateDT < currentDT && currentDT < dateTime : dateTime < currentDT && currentDT < otherDateDT;
|
|
24709
24722
|
}
|
|
24723
|
+
|
|
24724
|
+
// Leading/trailing days from adjacent months are only muted, not
|
|
24725
|
+
// disabled — they're real, selectable dates.
|
|
24710
24726
|
let isAriaDisabled = false;
|
|
24711
24727
|
if (dateMinDT && dateMaxDT) {
|
|
24712
|
-
isAriaDisabled = currentDT < dateMinDT || currentDT > dateMaxDT
|
|
24713
|
-
} else {
|
|
24714
|
-
|
|
24715
|
-
|
|
24716
|
-
|
|
24717
|
-
if (dateMaxDT) {
|
|
24718
|
-
isAriaDisabled = currentDT > dateMaxDT || !isCalendarMonth;
|
|
24719
|
-
}
|
|
24728
|
+
isAriaDisabled = currentDT < dateMinDT || currentDT > dateMaxDT;
|
|
24729
|
+
} else if (dateMinDT) {
|
|
24730
|
+
isAriaDisabled = currentDT < dateMinDT;
|
|
24731
|
+
} else if (dateMaxDT) {
|
|
24732
|
+
isAriaDisabled = currentDT > dateMaxDT;
|
|
24720
24733
|
}
|
|
24734
|
+
const isRangeActive = isHighlightEnabled && !!otherDateDT && !!dateTime;
|
|
24721
24735
|
const rangeEdge = getRangeEdge({
|
|
24722
24736
|
isFirstSelected: isCalendarFirstDateSelected,
|
|
24723
24737
|
isSecondSelected: isCalendarSecondDateSelected,
|
|
24724
|
-
isRangeActive
|
|
24738
|
+
isRangeActive,
|
|
24725
24739
|
mode: highlightDates?.mode
|
|
24726
24740
|
});
|
|
24727
24741
|
return (0,jsx_runtime_namespaceObject.jsx)(DaysViewCell, {
|
|
24728
24742
|
"aria-disabled": isAriaDisabled,
|
|
24729
24743
|
"aria-label": ariaLabel,
|
|
24744
|
+
"data-day": calendarDate,
|
|
24730
24745
|
isCalendarDateNow: isCalendarDateNow,
|
|
24731
24746
|
isCalendarDateSelected: isCalendarDateSelected,
|
|
24747
|
+
isOutOfMonth: !isCalendarMonth,
|
|
24732
24748
|
rangeEdge: rangeEdge,
|
|
24733
24749
|
isHighlighted: isHighlightDate,
|
|
24734
24750
|
children: calendarDay
|
|
@@ -26041,18 +26057,21 @@ const DaysView_DaysView = () => {
|
|
|
26041
26057
|
getDateSelectionState,
|
|
26042
26058
|
isRangeActive
|
|
26043
26059
|
} = useRangeSelection({
|
|
26044
|
-
|
|
26045
|
-
|
|
26046
|
-
|
|
26060
|
+
// The clicked cell may belong to the previous/next month (leading or
|
|
26061
|
+
// trailing padding), so its date must be parsed from data-day rather
|
|
26062
|
+
// than reconstructed from the day-of-month + currently displayed
|
|
26063
|
+
// month — otherwise e.g. clicking "30 Jul" while viewing August would
|
|
26064
|
+
// silently resolve to 30 Aug.
|
|
26065
|
+
createNewDate: selectedDay => external_luxon_namespaceObject.DateTime.fromFormat(String(selectedDay), 'D'),
|
|
26047
26066
|
getComparisonFormat: () => 'D'
|
|
26048
26067
|
});
|
|
26049
26068
|
const handleDaySelect = event => {
|
|
26050
26069
|
const {
|
|
26051
26070
|
target
|
|
26052
26071
|
} = event;
|
|
26053
|
-
const selectedDay = target.
|
|
26072
|
+
const selectedDay = target.getAttribute('data-day');
|
|
26054
26073
|
const isEnabled = target.getAttribute('aria-disabled') === 'false';
|
|
26055
|
-
if (isEnabled) {
|
|
26074
|
+
if (isEnabled && selectedDay) {
|
|
26056
26075
|
handleRangeSelect(selectedDay);
|
|
26057
26076
|
}
|
|
26058
26077
|
};
|
|
@@ -26087,16 +26106,17 @@ const DaysView_DaysView = () => {
|
|
|
26087
26106
|
isCalendarSecondDateSelected,
|
|
26088
26107
|
isCalendarDateSelected
|
|
26089
26108
|
} = getDateSelectionState(currentDT);
|
|
26109
|
+
|
|
26110
|
+
// Leading/trailing days from adjacent months are only muted, not
|
|
26111
|
+
// disabled — they're real, selectable dates (e.g. picking 30/31
|
|
26112
|
+
// Jul as the range end while the calendar is showing August).
|
|
26090
26113
|
let isAriaDisabled = false;
|
|
26091
26114
|
if (dateMinDT && dateMaxDT) {
|
|
26092
|
-
isAriaDisabled = currentDT < dateMinDT || currentDT > dateMaxDT
|
|
26093
|
-
} else {
|
|
26094
|
-
|
|
26095
|
-
|
|
26096
|
-
|
|
26097
|
-
if (dateMaxDT) {
|
|
26098
|
-
isAriaDisabled = currentDT > dateMaxDT || !isCalendarMonth;
|
|
26099
|
-
}
|
|
26115
|
+
isAriaDisabled = currentDT < dateMinDT || currentDT > dateMaxDT;
|
|
26116
|
+
} else if (dateMinDT) {
|
|
26117
|
+
isAriaDisabled = currentDT < dateMinDT;
|
|
26118
|
+
} else if (dateMaxDT) {
|
|
26119
|
+
isAriaDisabled = currentDT > dateMaxDT;
|
|
26100
26120
|
}
|
|
26101
26121
|
const classNames = getClassNames(currentDT, {
|
|
26102
26122
|
isCalendarFirstDateSelected,
|
|
@@ -26108,6 +26128,7 @@ const DaysView_DaysView = () => {
|
|
|
26108
26128
|
"data-day": calendarDate,
|
|
26109
26129
|
isCalendarDateNow: isCalendarDateNow,
|
|
26110
26130
|
isCalendarDateSelected: isCalendarDateSelected,
|
|
26131
|
+
isOutOfMonth: !isCalendarMonth,
|
|
26111
26132
|
rangeEdge: getRangeEdge({
|
|
26112
26133
|
isFirstSelected: isCalendarFirstDateSelected,
|
|
26113
26134
|
isSecondSelected: isCalendarSecondDateSelected,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssa-ui-kit/core",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"luxon": "3.5.0",
|
|
40
40
|
"plotly.js": "3.0.0",
|
|
41
41
|
"react-plotly.js": "2.6.0",
|
|
42
|
-
"@ssa-ui-kit/hooks": "^3.19.
|
|
43
|
-
"@ssa-ui-kit/utils": "^3.19.
|
|
42
|
+
"@ssa-ui-kit/hooks": "^3.19.1",
|
|
43
|
+
"@ssa-ui-kit/utils": "^3.19.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@emotion/css": "11.13.5",
|