@selfdecode/sd-component-library 2.46.17 → 2.46.20
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/lib/components/boxes/outside-click-box/interfaces.d.ts +2 -1
- package/lib/components/containers/grid-containers/base-grid-container/interfaces.d.ts +7 -7
- package/lib/components/inputs/date-inputs/base-date-range-input/interfaces.d.ts +7 -4
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/apply-button/apply-button.d.ts +3 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/apply-button/index.d.ts +1 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/apply-button/interfaces.d.ts +6 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-desktop/base-date-range-input-desktop.d.ts +3 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-desktop/index.d.ts +1 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-desktop/interfaces.d.ts +3 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-mobile/base-date-range-input-mobile.d.ts +3 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-mobile/index.d.ts +1 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-mobile/interfaces.d.ts +8 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/selected-range-text/index.d.ts +1 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/selected-range-text/interfaces.d.ts +5 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/partials/selected-range-text/selected-range-text.d.ts +3 -0
- package/lib/components/inputs/date-inputs/base-date-range-input/utils.d.ts +35 -0
- package/lib/components/inputs/date-inputs/primary-date-range-input/interfaces.d.ts +4 -0
- package/lib/components/inputs/secondary-text-input/interfaces.d.ts +1 -1
- package/lib/components/modals/modal/interfaces.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { BoxProps } from "rebass";
|
|
2
3
|
export interface OutsideClickBoxProps extends Omit<BoxProps, "ref"> {
|
|
3
4
|
/**
|
|
4
5
|
* Callback to be executed after clicking outside of the box.
|
|
5
6
|
*/
|
|
6
|
-
onClickOutside: () => void;
|
|
7
|
+
onClickOutside: (event?: React.MouseEvent<HTMLDivElement>) => void;
|
|
7
8
|
/**
|
|
8
9
|
* List of listened events.
|
|
9
10
|
*/
|
|
@@ -8,27 +8,27 @@ export interface BaseGridContainerProps extends BaseComponentProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* The grid template columuns
|
|
10
10
|
*/
|
|
11
|
-
gridTemplateColumns?:
|
|
11
|
+
gridTemplateColumns?: string | string[];
|
|
12
12
|
/**
|
|
13
13
|
* The grid template rows
|
|
14
14
|
*/
|
|
15
|
-
gridTemplateRows?:
|
|
15
|
+
gridTemplateRows?: string | string[];
|
|
16
16
|
/**
|
|
17
17
|
* The width of the container. Defaults to 100%
|
|
18
18
|
*/
|
|
19
|
-
width?:
|
|
19
|
+
width?: string | string[];
|
|
20
20
|
/**
|
|
21
21
|
* The height of the container. Defaults to 100%
|
|
22
22
|
*/
|
|
23
|
-
height?:
|
|
23
|
+
height?: string | string[];
|
|
24
24
|
/**
|
|
25
25
|
* The grid gap
|
|
26
26
|
*/
|
|
27
|
-
gap?:
|
|
27
|
+
gap?: string | string[];
|
|
28
28
|
/**
|
|
29
29
|
* The container's padding
|
|
30
30
|
*/
|
|
31
|
-
p?:
|
|
31
|
+
p?: string | string[];
|
|
32
32
|
/**
|
|
33
33
|
* The desired items alignment. Defaults to "center"
|
|
34
34
|
*/
|
|
@@ -60,7 +60,7 @@ export interface BaseGridContainerProps extends BaseComponentProps {
|
|
|
60
60
|
/**
|
|
61
61
|
* Possible border radius
|
|
62
62
|
*/
|
|
63
|
-
borderRadius?:
|
|
63
|
+
borderRadius?: string | string[];
|
|
64
64
|
/**
|
|
65
65
|
* The background to the container
|
|
66
66
|
*/
|
|
@@ -80,15 +80,18 @@ export interface BaseDateRangeInputProps {
|
|
|
80
80
|
* Z-index of the calendar.
|
|
81
81
|
*/
|
|
82
82
|
zIndex?: number;
|
|
83
|
-
customStaticRanges?:
|
|
83
|
+
customStaticRanges?: StaticRangeOption[];
|
|
84
84
|
quickSelectionLabel?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Condition to use mobile version.
|
|
87
|
+
*/
|
|
88
|
+
useMobileStyles?: boolean;
|
|
85
89
|
}
|
|
86
90
|
export declare type OnRangeSelection = {
|
|
87
91
|
range1: Range;
|
|
88
92
|
};
|
|
89
|
-
declare type
|
|
93
|
+
export declare type StaticRangeOption = {
|
|
90
94
|
startDate: Date;
|
|
91
95
|
endDate: Date;
|
|
92
96
|
label: string;
|
|
93
|
-
}
|
|
94
|
-
export {};
|
|
97
|
+
};
|
package/lib/components/inputs/date-inputs/base-date-range-input/partials/apply-button/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ApplyButton } from "./apply-button";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Range } from "react-date-range";
|
|
2
|
+
import { BaseDateRangeInputProps } from "../../interfaces";
|
|
3
|
+
export interface ApplyButtonProps extends Pick<BaseDateRangeInputProps, "onSelect" | "onClose"> {
|
|
4
|
+
selectedRange: Range | null;
|
|
5
|
+
setSelectedRange: (range: Range | null) => void;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BaseDateRangeInputDesktop } from "./base-date-range-input-desktop";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BaseDateRangeInputMobile } from "./base-date-range-input-mobile";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StaticRange } from "react-date-range";
|
|
2
|
+
import { BaseDateRangeInputProps } from "../../interfaces";
|
|
3
|
+
import { ApplyButtonProps } from "../apply-button/interfaces";
|
|
4
|
+
export interface BaseDateRangeInputMobileProps extends Omit<BaseDateRangeInputProps, "customStaticRanges" | "children">, ApplyButtonProps {
|
|
5
|
+
customOptionSelected: boolean;
|
|
6
|
+
getStaticRanges: (mobile?: boolean) => StaticRange[];
|
|
7
|
+
handleCancel: () => void;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectedRangeText } from "./selected-range-text";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { OnChangeProps, Range, StaticRange } from "react-date-range";
|
|
2
|
+
import { StaticRangeOption } from "./interfaces";
|
|
3
|
+
import { BaseDateRangeInputMobileProps } from "./partials/base-date-range-input-mobile/interfaces";
|
|
4
|
+
export declare const getSelectedRangeText: (range: Range | null | undefined) => string;
|
|
5
|
+
export declare const getStaticRanges: (selectedRange: Range | undefined | null, onCustomRangeSelect: () => void, deselectCustomRange: () => void, customOptionSelected: boolean, customRanges?: StaticRangeOption[] | undefined, mobile?: boolean | undefined) => StaticRange[];
|
|
6
|
+
export declare const getCalendarProps: (props: BaseDateRangeInputMobileProps) => {
|
|
7
|
+
rangeColors: string[];
|
|
8
|
+
weekStartsOn: number;
|
|
9
|
+
inputRanges: never[];
|
|
10
|
+
ranges: Range[];
|
|
11
|
+
months: number | undefined;
|
|
12
|
+
onChange: (value: OnChangeProps) => void;
|
|
13
|
+
customOptionSelected: boolean;
|
|
14
|
+
getStaticRanges: (mobile?: boolean | undefined) => StaticRange[];
|
|
15
|
+
handleCancel: () => void;
|
|
16
|
+
width?: string | string[] | undefined;
|
|
17
|
+
color?: string | undefined;
|
|
18
|
+
onSelect: (range: Range) => void;
|
|
19
|
+
zIndex?: number | undefined;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
initialRange: Range | null;
|
|
22
|
+
onCancel?: (() => void) | undefined;
|
|
23
|
+
showMonthAndYearPickers?: boolean | undefined;
|
|
24
|
+
showCalendar: boolean;
|
|
25
|
+
dateDisplayFormat?: string | undefined;
|
|
26
|
+
dayDisplayFormat?: string | undefined;
|
|
27
|
+
monthDisplayFormat?: string | undefined;
|
|
28
|
+
alignCalendar?: "left" | "right" | undefined;
|
|
29
|
+
minDate?: Date | undefined;
|
|
30
|
+
maxDate?: Date | undefined;
|
|
31
|
+
quickSelectionLabel?: string | undefined;
|
|
32
|
+
useMobileStyles?: boolean | undefined;
|
|
33
|
+
selectedRange: Range | null;
|
|
34
|
+
setSelectedRange: (range: Range | null) => void;
|
|
35
|
+
};
|
|
@@ -4,7 +4,7 @@ import { PrimaryTextInputProps } from "../primary-text-input";
|
|
|
4
4
|
/**
|
|
5
5
|
* Defines the SecondaryTextInput component's properties.
|
|
6
6
|
*/
|
|
7
|
-
export declare type SecondaryTextInputProps = Pick<PrimaryTextInputProps, "onChange" | "value" | "type" | "padding" | "placeholder" | "errorMessage" | "hideErrorText" | "focusInput" | "textAlign" | "width" | "m" | "mt" | "mr" | "mb" | "ml" | "onFocus" | "autoFocus" | "errorBackground" | "disabled" | "sx"> & {
|
|
7
|
+
export declare type SecondaryTextInputProps = Pick<PrimaryTextInputProps, "onChange" | "value" | "type" | "padding" | "placeholder" | "errorMessage" | "hideErrorText" | "focusInput" | "textAlign" | "width" | "m" | "mt" | "mr" | "mb" | "ml" | "onFocus" | "autoFocus" | "errorBackground" | "disabled" | "sx" | "maxLength"> & {
|
|
8
8
|
/**
|
|
9
9
|
* The label for the text input
|
|
10
10
|
*/
|