@pagamio/frontend-commons-lib 0.8.361 → 0.8.362
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.
|
@@ -111,7 +111,11 @@ const DateRangePickerWithPresets = ({ value, onChange, selectedPreset = 'last_7_
|
|
|
111
111
|
setPrimaryColor(getPrimaryColorFromTheme());
|
|
112
112
|
}, []);
|
|
113
113
|
const rangeColors = useMemo(() => [primaryColor], [primaryColor]);
|
|
114
|
-
// Display text for the trigger button
|
|
114
|
+
// Display text for the trigger button. With no selected range we show the
|
|
115
|
+
// placeholder, NOT a preset label — a relative preset like "Last 7 Days"
|
|
116
|
+
// names a concrete range, so it must only label the trigger when a range is
|
|
117
|
+
// actually applied. `all_time` is the one preset that legitimately has no
|
|
118
|
+
// range, so it keeps its label.
|
|
115
119
|
const displayText = useMemo(() => {
|
|
116
120
|
if (value?.from) {
|
|
117
121
|
if (value.to) {
|
|
@@ -122,11 +126,6 @@ const DateRangePickerWithPresets = ({ value, onChange, selectedPreset = 'last_7_
|
|
|
122
126
|
if (selectedPreset === ALL_TIME_PRESET_VALUE) {
|
|
123
127
|
return ALL_TIME_PRESET_LABEL;
|
|
124
128
|
}
|
|
125
|
-
if (selectedPreset && selectedPreset !== 'custom') {
|
|
126
|
-
const match = PRESET_RANGES.find((p) => p.value === selectedPreset);
|
|
127
|
-
if (match)
|
|
128
|
-
return match.label;
|
|
129
|
-
}
|
|
130
129
|
return placeholder;
|
|
131
130
|
}, [value, dateFormat, placeholder, selectedPreset]);
|
|
132
131
|
// Convert { from, to } to react-date-range format
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagamio/frontend-commons-lib",
|
|
3
3
|
"description": "Pagamio library for Frontend reusable components like the form engine and table container",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.362",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|