@stenajs-webui/calendar 21.12.1 → 21.14.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/dist/components/input-types/date-input/DateInput.d.ts +3 -1
- package/dist/components/input-types/date-range-input/DateRangeInput.d.ts +6 -1
- package/dist/components/input-types/date-text-input/DateTextInput.d.ts +5 -0
- package/dist/features/localize-date-format/LocaleMapper.d.ts +7 -0
- package/dist/features/month-picker/MonthPicker.d.ts +1 -2
- package/dist/features/month-picker/MonthPickerCell.d.ts +1 -2
- package/dist/index.es.js +1313 -1267
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -25,8 +25,10 @@ export interface DateInputProps<T = unknown> extends OptionalMinMaxDatesAsString
|
|
|
25
25
|
*/
|
|
26
26
|
placeholder?: string;
|
|
27
27
|
/**
|
|
28
|
-
* Portal target, HTML element. If not set,
|
|
28
|
+
* Portal target, HTML element. If not set, window.body is used.
|
|
29
29
|
*/
|
|
30
|
+
portalTarget?: HTMLElement;
|
|
31
|
+
zIndex?: number;
|
|
30
32
|
width?: string;
|
|
31
33
|
/**
|
|
32
34
|
* The calendar theme to use.
|
|
@@ -35,8 +35,13 @@ export interface DateRangeInputProps<T> extends OptionalMinMaxDatesAsString, Val
|
|
|
35
35
|
* Disables the Popover and both TextInputs.
|
|
36
36
|
*/
|
|
37
37
|
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Portal target, HTML element. If not set, window.body is used.
|
|
40
|
+
*/
|
|
41
|
+
portalTarget?: HTMLElement;
|
|
42
|
+
zIndex?: number;
|
|
38
43
|
}
|
|
39
44
|
/**
|
|
40
45
|
* @deprecated Please use DateRangeDualTextInput instead.
|
|
41
46
|
*/
|
|
42
|
-
export declare function DateRangeInput<T>({ displayFormat, placeholderStartDate, placeholderEndDate, value, onValueChange, width, calendarTheme, calendarProps, minDate, maxDate, disabled, }: DateRangeInputProps<T>): React.ReactElement<DateRangeInputProps<T>>;
|
|
47
|
+
export declare function DateRangeInput<T>({ displayFormat, placeholderStartDate, placeholderEndDate, value, onValueChange, width, calendarTheme, calendarProps, minDate, maxDate, disabled, portalTarget, zIndex, }: DateRangeInputProps<T>): React.ReactElement<DateRangeInputProps<T>>;
|
|
@@ -20,5 +20,10 @@ export interface DateTextInputProps<T> extends Omit<TextInputProps, "onChange" |
|
|
|
20
20
|
placeholder?: string;
|
|
21
21
|
/** The date text input theme to use. */
|
|
22
22
|
calendarTheme?: CalendarTheme;
|
|
23
|
+
/**
|
|
24
|
+
* Portal target for the popover, HTML element. If not set, window.body is used.
|
|
25
|
+
*/
|
|
26
|
+
portalTarget?: HTMLElement;
|
|
27
|
+
zIndex?: number;
|
|
23
28
|
}
|
|
24
29
|
export declare const DateTextInput: React.FC<DateTextInputProps<unknown>>;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
export declare const getLocaleForLocaleCode: (localeCode: string) => Locale | undefined;
|
|
3
|
+
export declare const getMappedLocaleCodeMatchingLanguage: (localeCode: string) => string | undefined;
|
|
3
4
|
export declare const getDefaultLocaleForFormatting: () => Locale;
|
|
5
|
+
/**
|
|
6
|
+
* This is only used by old calendar components, to pass localeCode to updated components.
|
|
7
|
+
* All updated calendar components just take localeCode, for example "en-GB", since that is what the browser provides,
|
|
8
|
+
* and is not library dependent.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getLocaleCodeForLocale: (locale: Locale) => string | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
|
|
3
|
-
import { Locale } from "date-fns";
|
|
4
3
|
export type MonthPickerSizeVariant = "small" | "medium" | "large";
|
|
5
4
|
export interface MonthPickerProps extends ValueAndOnValueChangeProps<Date> {
|
|
6
|
-
|
|
5
|
+
localeCode: string;
|
|
7
6
|
firstMonth: Date;
|
|
8
7
|
numMonths: number;
|
|
9
8
|
onCancel?: () => void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Locale } from "date-fns";
|
|
3
2
|
import { Position } from "./Position";
|
|
4
3
|
import { MonthPickerSizeVariant } from "./MonthPicker";
|
|
5
4
|
interface MonthPickerCellProps {
|
|
6
5
|
month: Date;
|
|
7
6
|
onClick: () => void;
|
|
8
7
|
selected: boolean;
|
|
9
|
-
|
|
8
|
+
localeCode: string;
|
|
10
9
|
autoFocus: boolean;
|
|
11
10
|
monthPickerId: string;
|
|
12
11
|
firstAvailableMonth: Date;
|