@ostack.tech/ui 0.11.1 → 0.11.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentPropsWithRef } from 'react';
|
|
1
|
+
import { ComponentPropsWithRef, RefObject } from 'react';
|
|
2
2
|
import { DayPickerProps } from 'react-day-picker';
|
|
3
3
|
import { IconButton } from '../IconButton';
|
|
4
4
|
import { Select } from '../Select';
|
|
@@ -18,10 +18,22 @@ export interface DateRange {
|
|
|
18
18
|
/** End of the date-range. */
|
|
19
19
|
end: Date | null;
|
|
20
20
|
}
|
|
21
|
+
/** API to manipulate the calendar imperatively. */
|
|
22
|
+
export interface CalendarApi<TValue extends Date | Date[] | DateRange | null = Date | Date[] | DateRange | null> {
|
|
23
|
+
getValue: () => TValue;
|
|
24
|
+
/** Sets the selected value of the calendar. */
|
|
25
|
+
setValue: (value: string | Date | (string | Date)[] | AcceptedDateRange | null) => void;
|
|
26
|
+
/** Gets the currently visible month of the calendar. */
|
|
27
|
+
getMonth: () => Date;
|
|
28
|
+
/** Sets the visible month of the calendar. */
|
|
29
|
+
setMonth: (month: Date) => void;
|
|
30
|
+
/** Whether the provided date is visible in the calendar. */
|
|
31
|
+
isVisible: (date: Date | string) => boolean;
|
|
32
|
+
}
|
|
21
33
|
/** Properties of the calendar component. */
|
|
22
34
|
export type CalendarProps = CalendarNoneSelectionProps | CalendarSingleSelectionProps | CalendarMultipleSelectionProps | CalendarRangeSelectionProps;
|
|
23
35
|
/** Base properties of the calendar component. */
|
|
24
|
-
export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | null = Date | Date[] | DateRange | null> extends Pick<DayPickerProps, "required" | "className" | "style" | "id" | "
|
|
36
|
+
export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | null = Date | Date[] | DateRange | null> extends Pick<DayPickerProps, "required" | "className" | "style" | "id" | "numberOfMonths" | "pagedNavigation" | "disableNavigation" | "fixedWeeks" | "hideWeekdays" | "showOutsideDays" | "showWeekNumber" | "broadcastCalendar" | "ISOWeek" | "timeZone" | "noonSafe" | "footer" | "autoFocus" | "disabled" | "hidden" | "today" | "modifiers" | "aria-label" | "aria-labelledby" | "numerals" | "weekStartsOn" | "firstWeekContainsDate" | "useAdditionalWeekYearTokens" | "useAdditionalDayOfYearTokens" | "onMonthChange" | "onNextClick" | "onPrevClick" | "onDayClick" | "onDayFocus" | "onDayBlur" | "onDayKeyDown" | "onDayMouseEnter" | "onDayMouseLeave"> {
|
|
25
37
|
/**
|
|
26
38
|
* Mode for selecting calendar dates.
|
|
27
39
|
*
|
|
@@ -34,6 +46,10 @@ export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | nu
|
|
|
34
46
|
value?: string | Date | (string | Date)[] | AcceptedDateRange | null;
|
|
35
47
|
/** Function called when the selected value changes. */
|
|
36
48
|
onValueChange?: (value: TValue) => void;
|
|
49
|
+
/** The initial month to show in the calendar. */
|
|
50
|
+
defaultMonth?: string | Date;
|
|
51
|
+
/** Controlled month displayed in the calendar. */
|
|
52
|
+
month?: string | Date;
|
|
37
53
|
/** Minimum date allowed. */
|
|
38
54
|
minDate?: string | Date | null;
|
|
39
55
|
/** Maximum date allowed. */
|
|
@@ -54,6 +70,8 @@ export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | nu
|
|
|
54
70
|
previousMonthLabel?: string;
|
|
55
71
|
/** Label of the "next month" button. */
|
|
56
72
|
nextMonthLabel?: string;
|
|
73
|
+
/** Reference to the calendar API. */
|
|
74
|
+
apiRef?: RefObject<CalendarApi<TValue> | null>;
|
|
57
75
|
/** Properties to pass to the header element. */
|
|
58
76
|
headerProps?: ComponentPropsWithRef<"header">;
|
|
59
77
|
/** Properties to pass to the header label element. */
|
|
@@ -97,4 +115,4 @@ export interface CalendarRangeSelectionProps extends CalendarPropsBase<DateRange
|
|
|
97
115
|
* }
|
|
98
116
|
* ```
|
|
99
117
|
*/
|
|
100
|
-
export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel, yearSelectLabel, previousMonthLabel, nextMonthLabel, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, ...otherProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel, yearSelectLabel, previousMonthLabel, nextMonthLabel, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, apiRef, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, ...otherProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
|
|
50
50
|
&__rows-per-page-label {
|
|
51
51
|
margin-right: $data-table-rows-per-page-gap-x;
|
|
52
|
-
font-size: $data-table-rows-per-page-font-size;
|
|
53
|
-
line-height: $data-table-rows-per-page-line-height;
|
|
52
|
+
font-size: maybe-important($data-table-rows-per-page-font-size);
|
|
53
|
+
line-height: maybe-important($data-table-rows-per-page-line-height);
|
|
54
54
|
font-weight: maybe-important($data-table-rows-per-page-font-weight);
|
|
55
55
|
color: maybe-important($data-table-rows-per-page-color);
|
|
56
56
|
}
|