@reykjavik/hanna-react 0.10.141 → 0.10.142
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 +8 -0
- package/Datepicker.js +3 -1
- package/esm/Datepicker.js +3 -1
- package/esm/focus-visible.js +8 -0
- package/focus-visible.js +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
- ... <!-- Add new lines here. -->
|
|
6
6
|
|
|
7
|
+
## 0.10.142
|
|
8
|
+
|
|
9
|
+
_2024-11-28_
|
|
10
|
+
|
|
11
|
+
- feat: Deprecate `focus-visible` polyfill module; browser support is now good
|
|
12
|
+
- `Datepicker`:
|
|
13
|
+
- fix: Set `minDate` prop values to `T00:00` to allow manual min date input
|
|
14
|
+
|
|
7
15
|
## 0.10.141
|
|
8
16
|
|
|
9
17
|
_2024-11-25_
|
package/Datepicker.js
CHANGED
|
@@ -116,6 +116,8 @@ const defaultDatepickerTexts = {
|
|
|
116
116
|
const Datepicker = (props) => {
|
|
117
117
|
const { placeholder, dateFormat, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, inputRef, isoMode, texts, lang = props.localeCode, // eslint-disable-line deprecation/deprecation
|
|
118
118
|
fieldWrapperProps, } = (0, FormField_js_1.groupFormFieldWrapperProps)(props);
|
|
119
|
+
// Make sure all minDates are at the start of the day
|
|
120
|
+
const minDateNormalized = minDate ? new Date(minDate.setHours(0, 0, 0, 0)) : undefined;
|
|
119
121
|
const [value, setValue] = utils_js_1.useMixedControlState.raw(props.value || props.initialDate, // eslint-disable-line deprecation/deprecation
|
|
120
122
|
props.defaultValue, 'value');
|
|
121
123
|
/*
|
|
@@ -164,7 +166,7 @@ const Datepicker = (props) => {
|
|
|
164
166
|
}, placeholderText: placeholder,
|
|
165
167
|
// TODO: Implement this
|
|
166
168
|
// selectsRange
|
|
167
|
-
minDate:
|
|
169
|
+
minDate: minDateNormalized, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) => weekday.charAt(0).toUpperCase(), showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, datepickerExtraProps))));
|
|
168
170
|
} })));
|
|
169
171
|
};
|
|
170
172
|
exports.Datepicker = Datepicker;
|
package/esm/Datepicker.js
CHANGED
|
@@ -111,6 +111,8 @@ const defaultDatepickerTexts = {
|
|
|
111
111
|
export const Datepicker = (props) => {
|
|
112
112
|
const { placeholder, dateFormat, name, startDate, endDate, minDate, maxDate, isStartDate = false, isEndDate = false, onChange, datepickerExtraProps, inputRef, isoMode, texts, lang = props.localeCode, // eslint-disable-line deprecation/deprecation
|
|
113
113
|
fieldWrapperProps, } = groupFormFieldWrapperProps(props);
|
|
114
|
+
// Make sure all minDates are at the start of the day
|
|
115
|
+
const minDateNormalized = minDate ? new Date(minDate.setHours(0, 0, 0, 0)) : undefined;
|
|
114
116
|
const [value, setValue] = useMixedControlState.raw(props.value || props.initialDate, // eslint-disable-line deprecation/deprecation
|
|
115
117
|
props.defaultValue, 'value');
|
|
116
118
|
/*
|
|
@@ -159,7 +161,7 @@ export const Datepicker = (props) => {
|
|
|
159
161
|
}, placeholderText: placeholder,
|
|
160
162
|
// TODO: Implement this
|
|
161
163
|
// selectsRange
|
|
162
|
-
minDate:
|
|
164
|
+
minDate: minDateNormalized, maxDate: maxDate, startDate: startDate, endDate: endDate, selectsStart: isStartDate, selectsEnd: isEndDate, formatWeekDay: (weekday) => weekday.charAt(0).toUpperCase(), showYearDropdown: true, scrollableYearDropdown: true, yearDropdownItemNumber: 15, showMonthDropdown: true }, inputProps, txts, datepickerExtraProps))));
|
|
163
165
|
} })));
|
|
164
166
|
};
|
|
165
167
|
export default Datepicker;
|
package/esm/focus-visible.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
// expose `focus-visible` to consumers of `@reykjavik/hanna-react`
|
|
2
2
|
// without requiring them to install it as a dependency in their project.
|
|
3
3
|
import '@reykjavik/hanna-utils/focus-visible';
|
|
4
|
+
/** @deprecated This polyfill is not needed anymore (Will be removed in v0.11) */
|
|
5
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6
|
+
console.warn('Deprecation Warning:\n' +
|
|
7
|
+
'The `focus-visible` polyfill isn not needed anymore as browser support ' +
|
|
8
|
+
' is now widespread. You can safely remove all imports of the ' +
|
|
9
|
+
'`@reykjavik/hanna-react/focus-visible` module from your project..\n' +
|
|
10
|
+
'(This module will be removed in v0.11 of `@reykjavik/hanna-react`)');
|
|
11
|
+
}
|
package/focus-visible.js
CHANGED
|
@@ -3,3 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// expose `focus-visible` to consumers of `@reykjavik/hanna-react`
|
|
4
4
|
// without requiring them to install it as a dependency in their project.
|
|
5
5
|
require("@reykjavik/hanna-utils/focus-visible");
|
|
6
|
+
/** @deprecated This polyfill is not needed anymore (Will be removed in v0.11) */
|
|
7
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
8
|
+
console.warn('Deprecation Warning:\n' +
|
|
9
|
+
'The `focus-visible` polyfill isn not needed anymore as browser support ' +
|
|
10
|
+
' is now widespread. You can safely remove all imports of the ' +
|
|
11
|
+
'`@reykjavik/hanna-react/focus-visible` module from your project..\n' +
|
|
12
|
+
'(This module will be removed in v0.11 of `@reykjavik/hanna-react`)');
|
|
13
|
+
}
|