@skedulo/sked-ui 0.0.0-preview-react-18
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/README.md +107 -0
- package/dist/components/IntersectionObserverWrapper/IntersectionObserverWrapper.d.ts +39 -0
- package/dist/components/IntersectionObserverWrapper/IntersectionObserverWrapper.stories.d.ts +1 -0
- package/dist/components/avatar/Avatar.d.ts +46 -0
- package/dist/components/avatar/Avatar.stories.d.ts +1 -0
- package/dist/components/avatar/AvatarDetail.d.ts +18 -0
- package/dist/components/avatar/AvatarGroup.d.ts +27 -0
- package/dist/components/avatar/Slot.d.ts +42 -0
- package/dist/components/avatar/__tests__/Avatar.spec.d.ts +1 -0
- package/dist/components/avatar/__tests__/AvatarDetail.spec.d.ts +1 -0
- package/dist/components/avatar/__tests__/GroupAvatars.spec.d.ts +1 -0
- package/dist/components/avatar/__tests__/Slot.spec.d.ts +1 -0
- package/dist/components/badge/Badge.d.ts +18 -0
- package/dist/components/badge/Badge.stories.d.ts +17 -0
- package/dist/components/badge/__tests__/Badge.spec.d.ts +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +6 -0
- package/dist/components/button-group/ButtonGroup.stories.d.ts +1 -0
- package/dist/components/button-group/__tests__/ButtonGroup.spec.d.ts +1 -0
- package/dist/components/buttons/Buttons.stories.d.ts +1 -0
- package/dist/components/buttons/button/Button.d.ts +60 -0
- package/dist/components/buttons/button/__tests__/Button.spec.d.ts +1 -0
- package/dist/components/buttons/button-dropdown/ButtonDropdown.d.ts +14 -0
- package/dist/components/buttons/button-dropdown/__tests__/ButtonDropdown.spec.d.ts +1 -0
- package/dist/components/buttons/icon-button/IconButton.d.ts +13 -0
- package/dist/components/buttons/icon-button/__tests__/IconButton.spec.d.ts +1 -0
- package/dist/components/buttons/icon-button-dropdown/IconButtonDropdown.d.ts +5 -0
- package/dist/components/buttons/icon-button-dropdown/__tests__/IconButtonDropdown.spec.d.ts +1 -0
- package/dist/components/buttons/interfaces.d.ts +10 -0
- package/dist/components/calendar-controls/CalendarControls-utils.d.ts +7 -0
- package/dist/components/calendar-controls/CalendarControls.d.ts +30 -0
- package/dist/components/calendar-controls/CalendarControls.stories.d.ts +1 -0
- package/dist/components/calendar-controls/elements/DateSelector.d.ts +47 -0
- package/dist/components/calendar-controls/elements/NavigationButtons.d.ts +6 -0
- package/dist/components/calendar-controls/elements/RangePicker.d.ts +21 -0
- package/dist/components/calendar-controls/elements/TodayButton.d.ts +5 -0
- package/dist/components/datepicker/DateTime.d.ts +51 -0
- package/dist/components/datepicker/DateTime.stories.d.ts +1 -0
- package/dist/components/datepicker/Datepicker.d.ts +125 -0
- package/dist/components/datepicker/Datepicker.stories.d.ts +1 -0
- package/dist/components/datepicker/Time.d.ts +43 -0
- package/dist/components/datepicker/Time.stories.d.ts +1 -0
- package/dist/components/datepicker/__tests__/DateTime.spec.d.ts +1 -0
- package/dist/components/datepicker/__tests__/Datepicker.spec.d.ts +1 -0
- package/dist/components/datepicker/__tests__/Time.spec.d.ts +1 -0
- package/dist/components/dynamic-table/DynamicTable-utils.d.ts +45 -0
- package/dist/components/dynamic-table/DynamicTable.d.ts +79 -0
- package/dist/components/dynamic-table/DynamicTable.stories.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable-renders.spec.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable-test-utils.d.ts +3 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable-utils.spec.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/DynamicTable.spec.d.ts +1 -0
- package/dist/components/dynamic-table/__tests__/__mocks__/table-data.d.ts +16 -0
- package/dist/components/dynamic-table/interfaces.d.ts +52 -0
- package/dist/components/emptystate/EmptyState.d.ts +9 -0
- package/dist/components/emptystate/EmptyState.spec.d.ts +1 -0
- package/dist/components/emptystate/EmptyState.stories.d.ts +1 -0
- package/dist/components/filter-bar/FilterBar.d.ts +54 -0
- package/dist/components/filter-bar/FilterBar.stories.d.ts +1 -0
- package/dist/components/filter-bar/__tests__/FilterBar.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/FilterList.d.ts +10 -0
- package/dist/components/filter-bar/filter-list/FilterListWithApply.d.ts +24 -0
- package/dist/components/filter-bar/filter-list/FilterSearch.d.ts +21 -0
- package/dist/components/filter-bar/filter-list/RemoteSearch.d.ts +25 -0
- package/dist/components/filter-bar/filter-list/__tests__/FilterList.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/__tests__/FilterListWithApply.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/__tests__/FilterSearch.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-list/__tests__/RemoteSearch.spec.d.ts +1 -0
- package/dist/components/filter-bar/filter-pill/FilterPill.d.ts +23 -0
- package/dist/components/filter-bar/filter-pill/__tests__/FilterPill.spec.d.ts +1 -0
- package/dist/components/filter-bar/interfaces.d.ts +43 -0
- package/dist/components/forms/Forms.stories.d.ts +1 -0
- package/dist/components/forms/ReadOnly.d.ts +11 -0
- package/dist/components/forms/SkedFormValidation.d.ts +98 -0
- package/dist/components/forms/SkedFormValidation.spec.d.ts +1 -0
- package/dist/components/forms/__tests__/ReadOnly.spec.d.ts +1 -0
- package/dist/components/forms/elements/AsyncMultiSearchSelect.d.ts +3 -0
- package/dist/components/forms/elements/AsyncSearchSelect.d.ts +6 -0
- package/dist/components/forms/elements/AsyncSelectSearch.stories.d.ts +1 -0
- package/dist/components/forms/elements/FormElements.d.ts +54 -0
- package/dist/components/forms/elements/MultiSearchSelect.d.ts +3 -0
- package/dist/components/forms/elements/MultiSearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/NumberInput.d.ts +17 -0
- package/dist/components/forms/elements/PlainAsyncMultiSearchSelect.d.ts +8 -0
- package/dist/components/forms/elements/PlainAsyncMultiSearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/PlainMultiSearchSelect.d.ts +24 -0
- package/dist/components/forms/elements/PlainMultiSearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/SearchSelect.d.ts +6 -0
- package/dist/components/forms/elements/SearchSelect.stories.d.ts +1 -0
- package/dist/components/forms/elements/TextArea.d.ts +25 -0
- package/dist/components/forms/elements/TextArea.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/AsyncMultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/AsyncSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/FormElements.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/MultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/NumberInput.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/PlainAsyncMultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/PlainMultiSearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/SearchSelect-renders.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/SearchSelect.spec.d.ts +1 -0
- package/dist/components/forms/elements/__tests__/__mocks__/searchData.d.ts +11 -0
- package/dist/components/forms/elements/interfaces.d.ts +105 -0
- package/dist/components/forms/elements/select-components.d.ts +38 -0
- package/dist/components/forms/elements/select-hooks.d.ts +38 -0
- package/dist/components/forms/elements/select-utils.d.ts +22 -0
- package/dist/components/icon/Icon.d.ts +26 -0
- package/dist/components/icon/Icon.spec.d.ts +1 -0
- package/dist/components/icon/Icon.stories.d.ts +1 -0
- package/dist/components/icon/iconPaths.d.ts +131 -0
- package/dist/components/info-card/InfoCard.d.ts +5 -0
- package/dist/components/info-card/InfoCard.stories.d.ts +1 -0
- package/dist/components/info-card/InfoCardBody.d.ts +13 -0
- package/dist/components/info-card/InfoCardFooter.d.ts +2 -0
- package/dist/components/info-card/InfoCardHeader.d.ts +11 -0
- package/dist/components/info-card/index.d.ts +4 -0
- package/dist/components/inline-banner/InlineBanner.d.ts +9 -0
- package/dist/components/inline-banner/InlineBanner.spec.d.ts +1 -0
- package/dist/components/inline-banner/InlineBanner.stories.d.ts +1 -0
- package/dist/components/link/Link.d.ts +5 -0
- package/dist/components/link/Link.spec.d.ts +1 -0
- package/dist/components/link/Link.stories.d.ts +17 -0
- package/dist/components/loader/Loading.d.ts +16 -0
- package/dist/components/loader/Loading.stories.d.ts +1 -0
- package/dist/components/loader/__tests__/Loading.spec.d.ts +1 -0
- package/dist/components/loader/spinner/LoadingSpinner.d.ts +21 -0
- package/dist/components/lozenge/CustomLozenge.d.ts +21 -0
- package/dist/components/lozenge/Lozenge.d.ts +22 -0
- package/dist/components/lozenge/Lozenge.stories.d.ts +1 -0
- package/dist/components/lozenge/__tests__/Lozenge.spec.d.ts +1 -0
- package/dist/components/menus/Menus.stories.d.ts +1 -0
- package/dist/components/menus/actionmenu/ActionMenu.d.ts +13 -0
- package/dist/components/menus/cardactionmenu/CardActionMenu.d.ts +10 -0
- package/dist/components/menus/index.d.ts +2 -0
- package/dist/components/menus/menu/Menu.d.ts +18 -0
- package/dist/components/modals/Modal.spec.d.ts +1 -0
- package/dist/components/modals/Modal.stories.d.ts +1 -0
- package/dist/components/modals/Modals.d.ts +33 -0
- package/dist/components/pagination/Pagination-utils.d.ts +1 -0
- package/dist/components/pagination/Pagination-utils.spec.d.ts +1 -0
- package/dist/components/pagination/Pagination.d.ts +3 -0
- package/dist/components/pagination/Pagination.spec.d.ts +1 -0
- package/dist/components/pagination/Pagination.stories.d.ts +1 -0
- package/dist/components/pagination/PaginationCount/PaginationCount.d.ts +3 -0
- package/dist/components/pagination/PaginationCount/PaginationCount.spec.d.ts +1 -0
- package/dist/components/pagination/PaginationPages/PaginationPages.d.ts +14 -0
- package/dist/components/pagination/PaginationPages/PaginationPages.spec.d.ts +1 -0
- package/dist/components/pagination/interfaces.d.ts +18 -0
- package/dist/components/pill/Pill.d.ts +25 -0
- package/dist/components/pill/Pill.spec.d.ts +1 -0
- package/dist/components/pill/Pill.stories.d.ts +1 -0
- package/dist/components/popout/PopOut.d.ts +61 -0
- package/dist/components/popout/PopOut.stories.d.ts +1 -0
- package/dist/components/popout/PopOutBase.d.ts +39 -0
- package/dist/components/popout/useClickAway.d.ts +2 -0
- package/dist/components/popout/usePopOut.d.ts +9 -0
- package/dist/components/popups/info-window/InfoWindow.d.ts +45 -0
- package/dist/components/popups/info-window/InfoWindow.spec.d.ts +1 -0
- package/dist/components/popups/info-window/InfoWindow.stories.d.ts +1 -0
- package/dist/components/popups/info-window/InfoWindowOld.d.ts +160 -0
- package/dist/components/popups/info-window/InfoWindowPopOut.d.ts +84 -0
- package/dist/components/popups/info-window/LegacyInfoWindow.d.ts +159 -0
- package/dist/components/popups/info-window/PortalWrapper.d.ts +6 -0
- package/dist/components/popups/info-window/info-window-utils.d.ts +43 -0
- package/dist/components/popups/info-window/info-window-utils.spec.d.ts +1 -0
- package/dist/components/popups/info-window/useClickAway.d.ts +25 -0
- package/dist/components/popups/info-window/useInfoWindowModifiers.d.ts +2 -0
- package/dist/components/popups/overflow-tooltip/OverflowTooltip.d.ts +30 -0
- package/dist/components/popups/tooltip/LegacyInfoWindow.d.ts +154 -0
- package/dist/components/popups/tooltip/Tooltip.d.ts +21 -0
- package/dist/components/popups/tooltip/Tooltip.spec.d.ts +1 -0
- package/dist/components/popups/tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/popups/tooltip/info-window-utils.d.ts +43 -0
- package/dist/components/popups/tooltip/info-window-utils.spec.d.ts +1 -0
- package/dist/components/portal/Portal.d.ts +22 -0
- package/dist/components/search-box/SearchBox.d.ts +9 -0
- package/dist/components/search-box/SearchBox.spec.d.ts +1 -0
- package/dist/components/status-icon/StatusIcon.d.ts +11 -0
- package/dist/components/status-icon/StatusIcon.spec.d.ts +1 -0
- package/dist/components/status-icon/StatusIcon.stories.d.ts +1 -0
- package/dist/components/table/Table.d.ts +16 -0
- package/dist/components/table/Table.spec.d.ts +1 -0
- package/dist/components/table/Table.stories.d.ts +1 -0
- package/dist/components/tabs/Tabs/Tabs.d.ts +36 -0
- package/dist/components/tabs/Tabs/TabsMenuItem.d.ts +22 -0
- package/dist/components/tabs/Tabs/TabsRoutingUtils.d.ts +28 -0
- package/dist/components/tabs/Tabs/__tests__/Tabs.spec.d.ts +1 -0
- package/dist/components/tabs/Tabs/__tests__/TabsMenuItem.spec.d.ts +1 -0
- package/dist/components/tabs/Tabs/__tests__/TabsRoutingUtils.spec.d.ts +1 -0
- package/dist/components/tabs/Tabs/interfaces.d.ts +64 -0
- package/dist/components/tabs/Tabs.stories.d.ts +1 -0
- package/dist/components/text/MultilineContent.d.ts +6 -0
- package/dist/components/text/MultilineContent.spec.d.ts +1 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +66690 -0
- package/dist/utils/Option.d.ts +58 -0
- package/dist/utils/Option.spec.d.ts +1 -0
- package/dist/utils/Route.d.ts +4 -0
- package/dist/utils/Strings.d.ts +1 -0
- package/dist/utils/Types.d.ts +6 -0
- package/dist/utils/__tests__/Route.spec.d.ts +1 -0
- package/dist/utils/testing-utils.d.ts +7 -0
- package/package.json +179 -0
- package/yarn.lock +17865 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/// <reference types="@emotion/core" />
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactDatePickerProps } from 'react-datepicker';
|
|
4
|
+
import { RangeType } from '../calendar-controls/elements/RangePicker';
|
|
5
|
+
export declare type LocaleType = 'AU' | 'US' | 'UK';
|
|
6
|
+
export interface DatepickerProps {
|
|
7
|
+
/**
|
|
8
|
+
* The currently selected date.
|
|
9
|
+
*/
|
|
10
|
+
selected: Date;
|
|
11
|
+
/**
|
|
12
|
+
* The action to take when the date changes
|
|
13
|
+
*/
|
|
14
|
+
onChange: (value?: Date) => void;
|
|
15
|
+
/**
|
|
16
|
+
* The date to open the calendar to
|
|
17
|
+
*/
|
|
18
|
+
openToDate?: Date;
|
|
19
|
+
/**
|
|
20
|
+
* The locale to display the date in
|
|
21
|
+
*/
|
|
22
|
+
locale?: LocaleType;
|
|
23
|
+
/**
|
|
24
|
+
* Should the calendar be displayed in the expanded state
|
|
25
|
+
*/
|
|
26
|
+
inline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Maintain a consistent height by showing five weeks regardless of the month
|
|
29
|
+
*/
|
|
30
|
+
fixedHeight?: ReactDatePickerProps['fixedHeight'];
|
|
31
|
+
/**
|
|
32
|
+
* Earliest date allowed to be selected. This will also affect the month navigation
|
|
33
|
+
*/
|
|
34
|
+
minDate?: ReactDatePickerProps['minDate'];
|
|
35
|
+
/**
|
|
36
|
+
* Latest date allowed to be selected. This will also affect the month navigation
|
|
37
|
+
*/
|
|
38
|
+
maxDate?: ReactDatePickerProps['maxDate'];
|
|
39
|
+
/**
|
|
40
|
+
* Disable updating the date picker
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Provide placeholder text for the input
|
|
45
|
+
*/
|
|
46
|
+
placeholderText?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The format of the date to display
|
|
49
|
+
*/
|
|
50
|
+
dateFormat?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Any additional styling to add to the datepicker
|
|
53
|
+
*/
|
|
54
|
+
className?: string;
|
|
55
|
+
/**
|
|
56
|
+
* An Array of Date that will be highlighted
|
|
57
|
+
*/
|
|
58
|
+
highlightDates?: ReactDatePickerProps['highlightDates'];
|
|
59
|
+
/**
|
|
60
|
+
* Used to filter out dates that are not selectable
|
|
61
|
+
*/
|
|
62
|
+
filterDate?: ReactDatePickerProps['filterDate'];
|
|
63
|
+
/**
|
|
64
|
+
* A component that will override the default Input
|
|
65
|
+
*/
|
|
66
|
+
customInput?: CustomInputType['Component'];
|
|
67
|
+
/**
|
|
68
|
+
* Select the week Sunday to Saturday based on the current selected date
|
|
69
|
+
*/
|
|
70
|
+
selectWeek?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Used for calculating weeks to highlight and formatted date
|
|
73
|
+
*/
|
|
74
|
+
selectedRange?: RangeType;
|
|
75
|
+
/**
|
|
76
|
+
* Highlight the week which contains the highlightWeek Date
|
|
77
|
+
*/
|
|
78
|
+
highlightWeek?: Date;
|
|
79
|
+
/**
|
|
80
|
+
* The callback that will receive the dates for the week selected
|
|
81
|
+
*/
|
|
82
|
+
onWeekSelect?: (value: Date[]) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Capture the date that a mouse hovers over
|
|
85
|
+
*/
|
|
86
|
+
onDayMouseEnter?: (value: Date) => void;
|
|
87
|
+
/**
|
|
88
|
+
* The callback used when a mouse leaves the calendar component
|
|
89
|
+
*/
|
|
90
|
+
onMonthMouseLeave?: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* The captured event when someone clicks away from the datepicker
|
|
93
|
+
*/
|
|
94
|
+
onClickOutside?: () => void;
|
|
95
|
+
/**
|
|
96
|
+
* The element name for vaildation
|
|
97
|
+
*/
|
|
98
|
+
name?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The element id for vaildation
|
|
101
|
+
*/
|
|
102
|
+
id?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Allow the datepicker to be cleared
|
|
105
|
+
*/
|
|
106
|
+
clearable?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* onCalendarClose fuction
|
|
109
|
+
*/
|
|
110
|
+
onCalendarClose?: () => void;
|
|
111
|
+
}
|
|
112
|
+
declare type CustomInputType = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
113
|
+
onBlurCustom: () => void;
|
|
114
|
+
openCalendar: (open: boolean) => void;
|
|
115
|
+
onBackspace: () => void;
|
|
116
|
+
Component: (props: React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>) => JSX.Element;
|
|
117
|
+
};
|
|
118
|
+
export declare const CustomInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
119
|
+
onBlurCustom: () => void;
|
|
120
|
+
openCalendar: (open: boolean) => void;
|
|
121
|
+
onBackspace: () => void;
|
|
122
|
+
Component: (props: React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>) => JSX.Element;
|
|
123
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
124
|
+
export declare const Datepicker: React.FC<DatepickerProps>;
|
|
125
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TIME_FORMAT = "h:mma";
|
|
3
|
+
export declare const formatTime: (date: Date | number) => string;
|
|
4
|
+
export declare const readonlyTimeFormat: ({ value, suffix }: {
|
|
5
|
+
value: string;
|
|
6
|
+
suffix?: string;
|
|
7
|
+
}) => string;
|
|
8
|
+
export interface ITimeProps {
|
|
9
|
+
/**
|
|
10
|
+
* The incremental time to add for each selectable time window, by minutes
|
|
11
|
+
*/
|
|
12
|
+
increment: number;
|
|
13
|
+
id?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The current value of the component.
|
|
17
|
+
* N.B. The component will scroll to the nearest 'before' time increment of the value provided
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Any suffix to add after the time input
|
|
22
|
+
*/
|
|
23
|
+
suffix?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Is this input disabled?
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The placeholder text for the input. Defaults to 'Select time'
|
|
30
|
+
*/
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/**
|
|
33
|
+
* increment-only will only allow selection of an interval
|
|
34
|
+
* freeform will allow valid time values that are not included in the intervals
|
|
35
|
+
* Defaults to increment-only
|
|
36
|
+
*/
|
|
37
|
+
valueSelection?: 'increment-only' | 'freeform';
|
|
38
|
+
/**
|
|
39
|
+
* The time as it is selected by the user
|
|
40
|
+
*/
|
|
41
|
+
onChange?: (value: string) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const Time: ({ value, increment, suffix, onChange, placeholder, valueSelection, ...rest }: ITimeProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CellProps, TableToggleRowsSelectedProps, Hooks, Row, UseTableCellProps } from 'react-table';
|
|
3
|
+
import { IDynamicTable } from './DynamicTable';
|
|
4
|
+
import { ControlStates, ITableWrapper, ITableHeaderCell, IDynamicTableColumn } from './interfaces';
|
|
5
|
+
export declare const ROW_SELECTION_ID = "sked-select-row";
|
|
6
|
+
export declare const isEmptyCell: (value: any, columnId: string) => boolean;
|
|
7
|
+
export declare function createTypedCellRenderer<T extends object>(): <K extends keyof T>(key: K, cellRenderer: (cellProps: CellProps<T, T[K]>) => React.ReactNode) => {
|
|
8
|
+
Cell: (cellProps: CellProps<T, T[K]>) => React.ReactNode;
|
|
9
|
+
accessor: K;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Before we render the table, if row selection has been requested, we add the selection header
|
|
13
|
+
* and table cells to the column config
|
|
14
|
+
*/
|
|
15
|
+
export declare const getRowSelectionHook: <T extends object>(props: IDynamicTable<T>) => (hooks: Hooks<T>) => number | ((columns: import("react-table").Column<T>[], meta: import("react-table").MetaBase<T>) => import("react-table").Column<T>[])[];
|
|
16
|
+
export declare const getRowClickHook: <T extends object>(hooks: Hooks<T>) => number;
|
|
17
|
+
export declare const getSortArgs: (sortByControl: ControlStates) => {
|
|
18
|
+
disableSortBy: boolean;
|
|
19
|
+
disableSortRemove?: undefined;
|
|
20
|
+
disableMultiSort?: undefined;
|
|
21
|
+
manualSortBy?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
disableSortRemove: boolean;
|
|
24
|
+
disableSortBy: boolean;
|
|
25
|
+
disableMultiSort: boolean;
|
|
26
|
+
manualSortBy: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const wrapperProps: ITableWrapper['getWrapperProps'];
|
|
29
|
+
export declare type SortIconProps<T extends object> = Pick<ITableHeaderCell<T>, 'canSort' | 'isSorted' | 'isSortedDesc' | 'getSortByToggleProps' | 'displayType'>;
|
|
30
|
+
export declare const SortIcon: <T extends object>({ canSort, isSorted, isSortedDesc, getSortByToggleProps, displayType }: SortIconProps<T>) => JSX.Element;
|
|
31
|
+
export declare const SelectCell: (props: Partial<TableToggleRowsSelectedProps>) => JSX.Element;
|
|
32
|
+
export declare const TableHeaderCell: <T extends object>(props: ITableHeaderCell<T>) => JSX.Element;
|
|
33
|
+
export declare const ExpandedTableCell: <T extends object>(props: UseTableCellProps<T, any> & {
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}) => JSX.Element;
|
|
36
|
+
export declare const CondensedTableCell: <T extends object>(props: UseTableCellProps<T, any>) => JSX.Element;
|
|
37
|
+
export declare const DefaultRenderer: <T extends object>(instance: import("react-table").TableInstance<T> & {
|
|
38
|
+
column: import("react-table").ColumnInstance<T>;
|
|
39
|
+
row: Row<T>;
|
|
40
|
+
cell: import("react-table").Cell<T, any>;
|
|
41
|
+
value: any;
|
|
42
|
+
} & {
|
|
43
|
+
column: IDynamicTableColumn<T>;
|
|
44
|
+
}) => JSX.Element;
|
|
45
|
+
export declare const DefaultWrapper: (wrapperClassName?: string) => React.FC<ITableWrapper>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dictionary } from 'lodash';
|
|
3
|
+
import { SortingRule, TableOptions } from 'react-table';
|
|
4
|
+
import { IDynamicTableColumn, ControlStates, RowControlStates, DisplayType, ITableWrapper, UseRowClickOptions } from './interfaces';
|
|
5
|
+
interface IDynamicTableProps<T extends object> {
|
|
6
|
+
columns: IDynamicTableColumn<T>[];
|
|
7
|
+
/**
|
|
8
|
+
* By default DynamicTable will display an expanded view that will use table-layout: auto to try to fit content as best it can based on what columns have in them, adhering to column width configurations. This is standard/common table behaviour. For the condensed view, table-layout: fixed is used which will create evenly spaced columns (unless otherwise told via width parameters) to create truncated columns within the width of the container. If you have many columns in a small container, then you'll need to give widths to each column for it to overflow, otherwise it could shrink them down to nothing.
|
|
9
|
+
* Also note that table-fixed only listens to the width property and will ignore min-width and max-width.
|
|
10
|
+
* @default expanded
|
|
11
|
+
*/
|
|
12
|
+
displayType?: DisplayType;
|
|
13
|
+
/**
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
stickyHeader?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Controlled expects the consumer to handle the sorting of data and will
|
|
19
|
+
* call onSortBy.
|
|
20
|
+
*
|
|
21
|
+
* Uncontrolled will use the built-in react-table sorting.
|
|
22
|
+
*
|
|
23
|
+
* Disabled will turn off sorting on the table.
|
|
24
|
+
*
|
|
25
|
+
* @default disabled
|
|
26
|
+
*/
|
|
27
|
+
sortByControl?: ControlStates;
|
|
28
|
+
/**
|
|
29
|
+
* The function to call when the user has sorted a column and
|
|
30
|
+
* sortByControl is set to 'controlled'
|
|
31
|
+
* Must be memoized
|
|
32
|
+
*/
|
|
33
|
+
onSortBy?: (props: SortingRule<T>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* rowOnly will not include a checkbox to select all rows.
|
|
36
|
+
*
|
|
37
|
+
* allRows will include a select all checkbox
|
|
38
|
+
*
|
|
39
|
+
* disabled will disable row selection on the table
|
|
40
|
+
*
|
|
41
|
+
* @default disabled
|
|
42
|
+
*/
|
|
43
|
+
rowSelectControl?: RowControlStates;
|
|
44
|
+
/**
|
|
45
|
+
* The function called any row selection changes.
|
|
46
|
+
* Must be memoized.
|
|
47
|
+
*/
|
|
48
|
+
onRowSelect?: (selectedRowIds: string[], isAllRowsSelected?: boolean, selectedRowData?: Dictionary<T>) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Classes to be applied to the default wrapper.
|
|
51
|
+
* If you need additional control over the wrapper itself,
|
|
52
|
+
* supply the wrapper component to TableWrapper prop
|
|
53
|
+
*/
|
|
54
|
+
wrapperClassName?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Override the default table wrapper with your own.
|
|
57
|
+
* There are certain classes that ensure the table behaves the
|
|
58
|
+
* way it should, specifically around overflowing. If you need
|
|
59
|
+
* to add classes to your wrapper component, you can pass through
|
|
60
|
+
* classes to getWrapperProps and it will add them in addition to
|
|
61
|
+
* the required classes for the table.
|
|
62
|
+
*
|
|
63
|
+
* If you choose to overwrite the classes all together by supplying your
|
|
64
|
+
* own className to the wrapper container, ensure you add overflow-x overlay or auto
|
|
65
|
+
* to your classes so that the table can accommodate many columns of specified widths.
|
|
66
|
+
*
|
|
67
|
+
* Example:
|
|
68
|
+
* const TableWrapper: IDynamicTable<DataModelInterface>['TableWrapper'] = ({children, getWrapperProps}) => (
|
|
69
|
+
* <div {...getWrapperProps('tw-flex-grow scroll')}>
|
|
70
|
+
* {children} // this will be the table
|
|
71
|
+
* <Pagination itemsPerPage={50} itemsTotal={data.length} currentPage={1} />
|
|
72
|
+
* </div>
|
|
73
|
+
* )
|
|
74
|
+
*/
|
|
75
|
+
TableWrapper?: React.FC<ITableWrapper>;
|
|
76
|
+
}
|
|
77
|
+
export declare type IDynamicTable<T extends object> = Pick<TableOptions<T>, 'getRowId' | 'data' | 'initialState' | 'autoResetSortBy' | 'autoResetSelectedRows' | 'manualRowSelectedKey'> & UseRowClickOptions<T> & IDynamicTableProps<T>;
|
|
78
|
+
export declare const DynamicTable: <T extends object>(props: IDynamicTable<T>) => JSX.Element;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DataModel {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
account: string | null;
|
|
6
|
+
contact: {
|
|
7
|
+
name: string;
|
|
8
|
+
} | null;
|
|
9
|
+
jobType: string;
|
|
10
|
+
scheduled: string;
|
|
11
|
+
status: string;
|
|
12
|
+
resources: string[];
|
|
13
|
+
locked: boolean;
|
|
14
|
+
followUp?: Date;
|
|
15
|
+
}
|
|
16
|
+
export declare const tableData: DataModel[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ColumnInterface, ColumnInstance, UseTableCellProps, Row, ColumnInterfaceBasedOnValue } from 'react-table';
|
|
2
|
+
export interface UseRowClickOptions<D extends object> {
|
|
3
|
+
/**
|
|
4
|
+
* This will add row click behaviour. Whenever a cell is clicked within a row,
|
|
5
|
+
* it will call this function.
|
|
6
|
+
*/
|
|
7
|
+
onRowClick?: (row: Row<D>) => void;
|
|
8
|
+
}
|
|
9
|
+
declare module 'react-table' {
|
|
10
|
+
interface TableOptions<D extends object> extends UseSortByOptions<D>, UseRowSelectOptions<D>, UseRowClickOptions<D> {
|
|
11
|
+
}
|
|
12
|
+
interface Hooks<D extends object = {}> extends UseSortByHooks<D>, UseRowSelectHooks<D> {
|
|
13
|
+
}
|
|
14
|
+
interface TableInstance<D extends object = {}> extends UseSortByInstanceProps<D>, UseRowSelectInstanceProps<D>, UseRowClickOptions<D> {
|
|
15
|
+
}
|
|
16
|
+
interface TableState<D extends object = {}> extends UseSortByState<D>, UseRowSelectState<D> {
|
|
17
|
+
}
|
|
18
|
+
interface ColumnInterface<D extends object = {}> extends UseSortByColumnOptions<D> {
|
|
19
|
+
accessor: keyof D;
|
|
20
|
+
emptyCellText?: string;
|
|
21
|
+
}
|
|
22
|
+
interface ColumnInstance<D extends object = {}> extends UseSortByColumnProps<D>, UseRowSelectRowProps<D> {
|
|
23
|
+
Header?: string;
|
|
24
|
+
}
|
|
25
|
+
interface Row<D extends object = {}> extends UseRowSelectRowProps<D> {
|
|
26
|
+
}
|
|
27
|
+
interface Cell<D extends object = {}> extends UseRowSelectRowProps<D> {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Deliberately setting Header to string only since we want to control headers
|
|
32
|
+
* within DynamicTable and because we want to use it for a default message
|
|
33
|
+
* for empty values.
|
|
34
|
+
*/
|
|
35
|
+
export interface IDynamicTableColumn<T extends object> extends Omit<ColumnInterface<T>, 'Header'>, ColumnInterfaceBasedOnValue<T> {
|
|
36
|
+
Header?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare type ControlStates = 'controlled' | 'uncontrolled' | 'disabled';
|
|
39
|
+
export declare type RowControlStates = 'rowOnly' | 'allRows' | 'disabled';
|
|
40
|
+
export declare type DisplayType = 'expanded' | 'condensed';
|
|
41
|
+
export interface ITableHeaderCell<T extends object> extends ColumnInstance<T> {
|
|
42
|
+
sticky: boolean;
|
|
43
|
+
displayType: DisplayType;
|
|
44
|
+
}
|
|
45
|
+
export declare type ICellContentRenderer<T extends object> = Pick<IDynamicTableColumn<T>, 'Header' | 'emptyCellText' | 'id'> & Pick<UseTableCellProps<T>, 'value'>;
|
|
46
|
+
interface IGetWrapperProps {
|
|
47
|
+
className: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ITableWrapper {
|
|
50
|
+
getWrapperProps: (additionalClasses?: string) => IGetWrapperProps;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IFilter, IAppliedFilter as AppliedFilter, IFilterItem as FilterItem, IAddedFilter } from './interfaces';
|
|
3
|
+
export declare type IAppliedFilter<T extends FilterItem> = AppliedFilter<T>;
|
|
4
|
+
export declare type IFilterItem = FilterItem;
|
|
5
|
+
export interface IFilterBarProps<T extends IFilterItem> {
|
|
6
|
+
/**
|
|
7
|
+
* An array of filter options. If a filter item is set to 'static' then it is permanently fixed and unable to be edited.
|
|
8
|
+
*/
|
|
9
|
+
filters: IFilter<T>[];
|
|
10
|
+
onFilter: (filters: IFilterBarState<T>['appliedFilters']) => void;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Apply custom styles to the content of the filter list.
|
|
14
|
+
*/
|
|
15
|
+
scrollableContentClasses?: string;
|
|
16
|
+
}
|
|
17
|
+
interface IFilterBarState<T extends IFilterItem> {
|
|
18
|
+
appliedFilters: IAppliedFilter<T>[];
|
|
19
|
+
addedFilter: IAddedFilter;
|
|
20
|
+
editFilterId: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class FilterBar<T extends IFilterItem> extends React.PureComponent<IFilterBarProps<T>, IFilterBarState<T>> {
|
|
23
|
+
constructor(props: IFilterBarProps<T>);
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
/**
|
|
26
|
+
* When we 'add' a filter, we add a pill item to the filter bar and then list the options for it. It is not yet 'applied' until we select options.
|
|
27
|
+
* If we click on the add button for a filter that is already added, we want to launch an edit mode for it.
|
|
28
|
+
*/
|
|
29
|
+
addFilter: (hideAddFilterDropdownList: () => void, filterToAdd: IAddedFilter) => () => void;
|
|
30
|
+
applyChangesToExistingFilter: (editFilterId: string, selectedItems: T[], existingFilters: IAppliedFilter<T>[]) => IAppliedFilter<T>[];
|
|
31
|
+
applyChangesToNewFilter: (filter: IFilter<T>, selectedItems: T[], existingFilters: IAppliedFilter<T>[]) => IAppliedFilter<T>[];
|
|
32
|
+
/**
|
|
33
|
+
* Apply a filter to the filter bar with the options we have selected.
|
|
34
|
+
*/
|
|
35
|
+
applySelectedItemsToFilter: (filter: IFilter<T>, selectedFilterItems: T[]) => IAppliedFilter<T>[];
|
|
36
|
+
applyAndSaveFilters: (filter: IFilter<T>) => (selectedFilterItems: T[]) => void;
|
|
37
|
+
saveFilters: (filters: IAppliedFilter<T>[]) => void;
|
|
38
|
+
renderAddFilterButton: () => JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* Render the add filter control button.
|
|
41
|
+
*/
|
|
42
|
+
renderAddFilterControl: () => JSX.Element;
|
|
43
|
+
clearTemporaryPill: () => void;
|
|
44
|
+
closeTemporaryPill: () => () => void;
|
|
45
|
+
renderFilterItemSearch: (filter: IFilter<T>, preSelectedItems: T[], scrollableContentClasses?: string) => JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* After we 'add' a filter, we want to render this 'temporary' pill in the filter bar. This temporary pill will be removed once we hit apply or exit out of the dropdown.
|
|
48
|
+
*/
|
|
49
|
+
renderTemporaryPill: (filterName: string, filterId: string, preSelectedItems: T[]) => JSX.Element;
|
|
50
|
+
removeFilter: (filterId: string) => void;
|
|
51
|
+
editFilter: (filterId: string) => void;
|
|
52
|
+
render(): JSX.Element;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IFilterItem } from '../interfaces';
|
|
3
|
+
export interface IFilterListProps<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
itemRenderer: (item: T) => JSX.Element;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
scrollableContentClasses?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const FilterList: <T extends IFilterItem>({ items, itemRenderer, loading, className, scrollableContentClasses }: IFilterListProps<T>) => JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IFilterListProps } from './FilterList';
|
|
3
|
+
import { InputType, IFilterItem } from '../interfaces';
|
|
4
|
+
interface IFilterListWithApplyProps<T> {
|
|
5
|
+
items: T[];
|
|
6
|
+
preSelectedItems: T[];
|
|
7
|
+
inputType: InputType;
|
|
8
|
+
applyFilter: (selectedFilterItems: T[]) => void;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
isListCollapsed?: boolean;
|
|
11
|
+
scrollableContentClasses?: IFilterListProps<T>['scrollableContentClasses'];
|
|
12
|
+
}
|
|
13
|
+
interface IFilterListWithApplyState<T extends IFilterItem> {
|
|
14
|
+
selected: T[];
|
|
15
|
+
}
|
|
16
|
+
export declare class FilterListWithApply<T extends IFilterItem> extends React.PureComponent<IFilterListWithApplyProps<T>, IFilterListWithApplyState<T>> {
|
|
17
|
+
constructor(props: IFilterListWithApplyProps<T>);
|
|
18
|
+
getSelectedItems: (item: T, checked?: boolean) => T[];
|
|
19
|
+
onItemChange: (item: T) => ({ target }: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
itemRenderer: (item: T) => JSX.Element;
|
|
21
|
+
applyFilters: () => void;
|
|
22
|
+
render(): JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IFilterItem } from '../interfaces';
|
|
3
|
+
export interface IFilterSearchProps<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
children: React.SFC<{
|
|
6
|
+
filteredItems: T[];
|
|
7
|
+
}>;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
interface IFilterSearchState<T> {
|
|
12
|
+
itemsWithSearchTermApplied: T[];
|
|
13
|
+
}
|
|
14
|
+
export declare class FilterSearch<T extends IFilterItem> extends React.PureComponent<IFilterSearchProps<T>, IFilterSearchState<T>> {
|
|
15
|
+
constructor(props: IFilterSearchProps<T>);
|
|
16
|
+
componentDidUpdate(prevProps: IFilterSearchProps<T>): void;
|
|
17
|
+
updateItemsState: (items: T[]) => void;
|
|
18
|
+
onFilterSearch: (value: string) => void;
|
|
19
|
+
render(): JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IFilterItem } from '../interfaces';
|
|
3
|
+
export interface IRemoteSearchProps<T> {
|
|
4
|
+
useFetch: (searchTerm: string) => Promise<T[]>;
|
|
5
|
+
children: React.SFC<{
|
|
6
|
+
fetchedItems: T[];
|
|
7
|
+
searchTerm: string;
|
|
8
|
+
isFetching: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
preSelectedItems: T[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IRemoteSearchState {
|
|
15
|
+
loading: boolean;
|
|
16
|
+
searchTerm: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEBOUNCE_TIME = 700;
|
|
19
|
+
export declare class RemoteSearch<T extends IFilterItem> extends React.PureComponent<IRemoteSearchProps<T>, IRemoteSearchState> {
|
|
20
|
+
private _fetchedItems;
|
|
21
|
+
private _debouncedSearch;
|
|
22
|
+
constructor(props: IRemoteSearchProps<T>);
|
|
23
|
+
onFilterSearch: (value: string) => void;
|
|
24
|
+
render(): JSX.Element;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IAppliedFilter, IFilterItem } from '../interfaces';
|
|
3
|
+
interface IFilterPillProps {
|
|
4
|
+
onRemove: (filterId: string) => void;
|
|
5
|
+
onEdit: (filterId: string) => void;
|
|
6
|
+
isReadonly?: boolean;
|
|
7
|
+
removable?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type FilterPillProps<T extends IFilterItem> = IFilterPillProps & Omit<IAppliedFilter<T>, 'isReadonly' | 'removable'>;
|
|
11
|
+
export declare class FilterPill<T extends IFilterItem> extends React.PureComponent<FilterPillProps<T>, {}> {
|
|
12
|
+
static defaultProps: {
|
|
13
|
+
onRemove: (...args: any[]) => void;
|
|
14
|
+
onEdit: (...args: any[]) => void;
|
|
15
|
+
removable: boolean;
|
|
16
|
+
};
|
|
17
|
+
renderedSelectedItems: (selected: IFilterItem[]) => string;
|
|
18
|
+
removeFilter: (filterId: string, onRemove: IFilterPillProps['onRemove']) => (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
editFilter: (filterId: string, onEdit: IFilterPillProps['onRemove'], isReadonly: boolean) => () => void;
|
|
20
|
+
renderCloseButton: (name: string, onRemove: IFilterPillProps['onRemove'], selected: IFilterItem[], removable: boolean, isReadonly?: boolean) => JSX.Element;
|
|
21
|
+
render(): JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare type InputType = 'checkbox' | 'radio';
|
|
2
|
+
export interface IFilterItem {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAddedFilter {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
preSelectedItems: IFilterItem[];
|
|
10
|
+
}
|
|
11
|
+
export interface IAppliedFilter<T extends IFilterItem> {
|
|
12
|
+
name: string;
|
|
13
|
+
id: string;
|
|
14
|
+
selectedItems: T[];
|
|
15
|
+
removable: boolean;
|
|
16
|
+
isReadonly: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IFilter<T extends IFilterItem> {
|
|
19
|
+
name: string;
|
|
20
|
+
id: string;
|
|
21
|
+
items: T[];
|
|
22
|
+
/**
|
|
23
|
+
* Provide an array of filter item IDs that are already selected.
|
|
24
|
+
*/
|
|
25
|
+
selectedIds: string[];
|
|
26
|
+
inputType: InputType;
|
|
27
|
+
isReadonly?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Defaults to true
|
|
30
|
+
*/
|
|
31
|
+
removable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Provide a search term that will return results back based on that term.
|
|
34
|
+
*/
|
|
35
|
+
useFetch?: (searchTerm: string) => Promise<{
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
}[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Provide a boolean that determines if the filter list is searchable or not.
|
|
41
|
+
*/
|
|
42
|
+
searchable?: boolean;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|