@coreui/react-pro 4.8.0 → 4.9.0-next.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/README.md +1 -1
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/utils.d.ts +23 -0
- package/dist/components/date-picker/CDatePicker.d.ts +1 -1
- package/dist/components/date-range-picker/CDateRangePicker.d.ts +2 -2
- package/dist/components/element-cover/CElementCover.d.ts +0 -4
- package/dist/components/element-cover/index.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/offcanvas/COffcanvas.d.ts +7 -1
- package/dist/components/smart-table/CSmartTableBody.d.ts +6 -5
- package/dist/components/smart-table/CSmartTableHead.d.ts +6 -3
- package/dist/components/smart-table/CSmartTableInterface.d.ts +30 -59
- package/dist/components/smart-table/types.d.ts +53 -0
- package/dist/components/smart-table/utils.d.ts +16 -0
- package/dist/components/time-picker/types.d.ts +15 -0
- package/dist/components/time-picker/utils.d.ts +23 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useForkedRef.d.ts +7 -0
- package/dist/hooks/useStateWithCallback.d.ts +2 -0
- package/dist/index.es.js +1076 -1005
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1076 -1004
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/isObjectInArray.d.ts +2 -0
- package/package.json +11 -11
- package/src/components/alert/CAlert.tsx +1 -1
- package/src/components/backdrop/CBackdrop.tsx +1 -1
- package/src/components/calendar/CCalendar.tsx +351 -240
- package/src/components/calendar/index.ts +3 -0
- package/src/{utils/calendar.ts → components/calendar/utils.ts} +1 -1
- package/src/components/carousel/CCarousel.tsx +1 -1
- package/src/components/carousel/CCarouselItem.tsx +1 -1
- package/src/components/collapse/CCollapse.tsx +1 -1
- package/src/components/date-picker/CDatePicker.tsx +1 -1
- package/src/components/date-range-picker/CDateRangePicker.tsx +3 -3
- package/src/components/dropdown/CDropdown.tsx +1 -1
- package/src/components/dropdown/CDropdownToggle.tsx +1 -1
- package/src/components/element-cover/CElementCover.tsx +16 -22
- package/src/components/element-cover/index.ts +3 -0
- package/src/components/form/CFormCheck.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/modal/CModal.tsx +1 -1
- package/src/components/nav/CNavLink.tsx +2 -1
- package/src/components/offcanvas/COffcanvas.tsx +35 -17
- package/src/components/sidebar/CSidebar.tsx +1 -1
- package/src/components/smart-table/CSmartTable.tsx +262 -256
- package/src/components/smart-table/CSmartTableBody.tsx +31 -41
- package/src/components/smart-table/CSmartTableCleaner.tsx +1 -1
- package/src/components/smart-table/CSmartTableFilter.tsx +1 -3
- package/src/components/smart-table/CSmartTableHead.tsx +53 -103
- package/src/components/smart-table/CSmartTableInterface.tsx +41 -71
- package/src/components/smart-table/CSmartTableItemsPerPageSelector.tsx +1 -2
- package/src/components/smart-table/types.tsx +65 -0
- package/src/components/smart-table/utils.tsx +199 -0
- package/src/components/tabs/CTabPane.tsx +1 -1
- package/src/components/time-picker/CTimePicker.tsx +50 -23
- package/src/components/time-picker/CTimePickerRollCol.tsx +1 -1
- package/src/components/time-picker/types.ts +15 -0
- package/src/{utils/time.ts → components/time-picker/utils.ts} +43 -2
- package/src/components/toast/CToast.tsx +1 -1
- package/src/components/virtual-scroller/CVirtualScroller.tsx +1 -1
- package/src/{utils/hooks → hooks}/index.ts +0 -0
- package/src/{utils/hooks → hooks}/useForkedRef.ts +0 -0
- package/src/{utils/hooks → hooks}/useStateWithCallback.ts +0 -0
- package/src/utils/index.ts +2 -1
- package/src/utils/isObjectInArray.ts +14 -0
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Several quick start options are available:
|
|
44
44
|
|
|
45
|
-
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.
|
|
45
|
+
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.9.0-next.0.zip)
|
|
46
46
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
47
47
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
48
48
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const convertToLocalDate: (d: Date, locale: string, options?: {}) => string;
|
|
2
|
+
export declare const convertToLocalTime: (d: Date, locale: string, options?: {}) => string;
|
|
3
|
+
export declare const createGroupsInArray: <T>(arr: T[], numberOfGroups: number) => T[][];
|
|
4
|
+
export declare const getCurrentYear: () => number;
|
|
5
|
+
export declare const getCurrentMonth: () => number;
|
|
6
|
+
export declare const getLocalDateFromString: (string: string, locale: string, time?: boolean) => Date | undefined;
|
|
7
|
+
export declare const getMonthName: (month: number, locale: string) => string;
|
|
8
|
+
export declare const getMonthsNames: (locale: string) => string[];
|
|
9
|
+
export declare const getYears: (year: number) => number[];
|
|
10
|
+
export declare const getMonthDetails: (year: number, month: number, firstDayOfWeek: number) => {
|
|
11
|
+
date: Date;
|
|
12
|
+
month: string;
|
|
13
|
+
}[][];
|
|
14
|
+
export declare const isDisableDateInRange: (startDate?: Date | null, endDate?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean;
|
|
15
|
+
export declare const isDateDisabled: (date: Date, min?: Date | null, max?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean | undefined;
|
|
16
|
+
export declare const isDateInRange: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
17
|
+
export declare const isDateSelected: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
18
|
+
export declare const isEndDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
19
|
+
export declare const isLastDayOfMonth: (date: Date) => boolean;
|
|
20
|
+
export declare const isSameDateAs: (date: Date | null, date2: Date | null) => boolean;
|
|
21
|
+
export declare const isStartDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
22
|
+
export declare const isToday: (date: Date) => boolean;
|
|
23
|
+
export declare const isValidDate: (date: string) => number | false;
|
|
@@ -9,7 +9,7 @@ export interface CDatePickerProps extends Omit<CDateRangePickerProps, 'calendars
|
|
|
9
9
|
* The id global attribute defines an identifier (ID) that must be unique in the whole document.
|
|
10
10
|
*
|
|
11
11
|
* The name attribute for the input element is generated based on the `id` property:
|
|
12
|
-
* - {id}-date
|
|
12
|
+
* - \{id\}-date
|
|
13
13
|
*/
|
|
14
14
|
id?: string;
|
|
15
15
|
/**
|
|
@@ -31,8 +31,8 @@ export interface CDateRangePickerProps extends Omit<CFormControlWrapperProps, 'f
|
|
|
31
31
|
* The id global attribute defines an identifier (ID) that must be unique in the whole document.
|
|
32
32
|
*
|
|
33
33
|
* The name attributes for input elements are generated based on the `id` property:
|
|
34
|
-
* - {id}-start-date
|
|
35
|
-
* - {id}-end-date
|
|
34
|
+
* - \{id\}-start-date
|
|
35
|
+
* - \{id\}-end-date
|
|
36
36
|
*/
|
|
37
37
|
id?: string;
|
|
38
38
|
/**
|
|
@@ -8,8 +8,6 @@ interface CElementCoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
* Array of custom boundaries. Use to create custom cover area (instead of parent element area). Area is defined by four sides: 'top', 'bottom', 'right', 'left'. If side is not defined by any custom boundary it is equal to parent element boundary. Each custom boundary is object with keys:
|
|
9
9
|
* - sides (array) - select boundaries of element to define boundaries. Sides names: 'top', 'bottom', 'right', 'left'.
|
|
10
10
|
* - query (string) - query used to get element which define boundaries. Search will be done only inside parent element, by parent.querySelector(query) function.
|
|
11
|
-
*
|
|
12
|
-
* @type {sides: string[], query: string}[]
|
|
13
11
|
*/
|
|
14
12
|
boundaries?: {
|
|
15
13
|
sides: string[];
|
|
@@ -17,8 +15,6 @@ interface CElementCoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
17
15
|
}[];
|
|
18
16
|
/**
|
|
19
17
|
* Opacity of the cover.
|
|
20
|
-
*
|
|
21
|
-
* @type number
|
|
22
18
|
*/
|
|
23
19
|
opacity?: number;
|
|
24
20
|
}
|
|
@@ -3,7 +3,7 @@ export interface COffcanvasProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
3
3
|
/**
|
|
4
4
|
* Apply a backdrop on body while offcanvas is open.
|
|
5
5
|
*/
|
|
6
|
-
backdrop?: boolean;
|
|
6
|
+
backdrop?: boolean | 'static';
|
|
7
7
|
/**
|
|
8
8
|
* A string of all className you want applied to the base component.
|
|
9
9
|
*/
|
|
@@ -28,6 +28,12 @@ export interface COffcanvasProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
28
28
|
* Generates modal using createPortal.
|
|
29
29
|
*/
|
|
30
30
|
portal?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Responsive offcanvas property hide content outside the viewport from a specified breakpoint and down.
|
|
33
|
+
*
|
|
34
|
+
* @since 4.6.0
|
|
35
|
+
*/
|
|
36
|
+
responsive?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
31
37
|
/**
|
|
32
38
|
* Allow body scrolling while offcanvas is open
|
|
33
39
|
*/
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { CTableBodyProps } from '../table/CTableBody';
|
|
3
|
-
import {
|
|
3
|
+
import type { Item, ScopedColumns } from './types';
|
|
4
4
|
export interface CSmartTableBodyProps extends CTableBodyProps {
|
|
5
5
|
clickableRows?: boolean;
|
|
6
|
-
|
|
6
|
+
columnNames: string[];
|
|
7
|
+
currentItems: Item[];
|
|
7
8
|
firstItemOnActivePageIndex: number;
|
|
8
9
|
noItemsLabel?: string | ReactNode;
|
|
9
|
-
onRowChecked?: (
|
|
10
|
-
onRowClick?: (item:
|
|
11
|
-
rawColumnNames: string[];
|
|
10
|
+
onRowChecked?: (item: Item, value: boolean) => void;
|
|
11
|
+
onRowClick?: (item: Item, index: number, columnName: string, event: MouseEvent | boolean) => void;
|
|
12
12
|
scopedColumns?: ScopedColumns;
|
|
13
13
|
selectable?: boolean;
|
|
14
|
+
selected?: Item[];
|
|
14
15
|
}
|
|
15
16
|
export declare const CSmartTableBody: React.ForwardRefExoticComponent<CSmartTableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { ColumnFilter, ColumnFilterValue, Column,
|
|
2
|
+
import type { ColumnFilter, ColumnFilterValue, Column, Item, Sorter, SorterValue } from './types';
|
|
3
3
|
import { CTableHeadProps } from '../table/CTableHead';
|
|
4
4
|
export interface CSmartTableHeadProps extends CTableHeadProps {
|
|
5
5
|
columnFilter?: boolean | ColumnFilter;
|
|
@@ -12,9 +12,12 @@ export interface CSmartTableHeadProps extends CTableHeadProps {
|
|
|
12
12
|
handleFilterOnInput?: (key: string, value: string) => void;
|
|
13
13
|
handleSelectAllChecked?: () => void;
|
|
14
14
|
handleSort?: (key: string, index: number) => void;
|
|
15
|
-
items:
|
|
15
|
+
items: Item[];
|
|
16
16
|
selectable?: boolean;
|
|
17
|
-
selectAll?: boolean |
|
|
17
|
+
selectAll?: boolean | {
|
|
18
|
+
external?: boolean;
|
|
19
|
+
};
|
|
20
|
+
selectedAll?: boolean | string;
|
|
18
21
|
sorterState?: SorterValue;
|
|
19
22
|
sortingIcon?: ReactNode;
|
|
20
23
|
sortingIconAscending?: ReactNode;
|
|
@@ -1,68 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { CSmartPaginationProps } from '../smart-pagination/CSmartPagination';
|
|
3
3
|
import { CTableProps } from '../table/CTable';
|
|
4
|
-
import { CTableDataCellProps } from '../table/CTableDataCell';
|
|
5
4
|
import { CTableBodyProps } from '../table/CTableBody';
|
|
6
5
|
import { CTableFootProps } from '../table/CTableFoot';
|
|
7
|
-
import { CTableHeaderCellProps } from '../table/CTableHeaderCell';
|
|
8
|
-
import { CTableRowProps } from '../table/CTableRow';
|
|
9
6
|
import { CTableHeadProps } from '../table/CTableHead';
|
|
10
|
-
|
|
11
|
-
filter?: boolean | ((values: any[], onChange: (value: any) => void) => ReactNode);
|
|
12
|
-
label?: string;
|
|
13
|
-
key: string;
|
|
14
|
-
sorter?: boolean;
|
|
15
|
-
_style?: any;
|
|
16
|
-
_props?: CTableHeaderCellProps;
|
|
17
|
-
}
|
|
18
|
-
export interface ColumnFilter {
|
|
19
|
-
lazy?: boolean;
|
|
20
|
-
external?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface ColumnFilterValue {
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}
|
|
25
|
-
export interface FooterItem {
|
|
26
|
-
label?: string;
|
|
27
|
-
_props?: CTableDataCellProps;
|
|
28
|
-
}
|
|
29
|
-
export interface Item {
|
|
30
|
-
[key: string]: number | string | any;
|
|
31
|
-
_cellProps?: any;
|
|
32
|
-
_props?: CTableRowProps;
|
|
33
|
-
_selected?: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface ItemInternal extends Item {
|
|
36
|
-
_id: number;
|
|
37
|
-
}
|
|
38
|
-
export interface ItemsPerPageSelect {
|
|
39
|
-
external?: boolean;
|
|
40
|
-
label?: string;
|
|
41
|
-
values?: Array<number>;
|
|
42
|
-
}
|
|
43
|
-
export interface Pagination {
|
|
44
|
-
external?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export interface Sorter {
|
|
47
|
-
resetable?: boolean;
|
|
48
|
-
external?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export interface ScopedColumns {
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
details?: (a: Item, b: number) => ReactNode;
|
|
53
|
-
}
|
|
54
|
-
export interface SorterValue {
|
|
55
|
-
column?: string;
|
|
56
|
-
state?: number | string;
|
|
57
|
-
}
|
|
58
|
-
export interface TableFilter {
|
|
59
|
-
lazy?: boolean;
|
|
60
|
-
external?: boolean;
|
|
61
|
-
}
|
|
62
|
-
export interface NoItemsView {
|
|
63
|
-
noResults?: string;
|
|
64
|
-
noItems?: string;
|
|
65
|
-
}
|
|
7
|
+
import type { Column, ColumnFilter, ColumnFilterValue, FooterItem, Item, ItemsPerPageSelect, Pagination, Sorter, ScopedColumns, SorterValue, TableFilter } from './types';
|
|
66
8
|
export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
67
9
|
/**
|
|
68
10
|
* Sets active page. If 'pagination' prop is enabled, activePage is set only initially.
|
|
@@ -111,6 +53,12 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
111
53
|
* - resetable (Boolean) - If set to true clicking on sorter have three states: ascending, descending and null. That means that third click on sorter will reset sorting, and restore table to original order.
|
|
112
54
|
*/
|
|
113
55
|
columnSorter?: boolean | Sorter;
|
|
56
|
+
/**
|
|
57
|
+
* ReactNode for passing custom CElementCover content.
|
|
58
|
+
*
|
|
59
|
+
* @since 4.9.0
|
|
60
|
+
*/
|
|
61
|
+
elementCover?: ReactNode;
|
|
114
62
|
/**
|
|
115
63
|
* If `true` Displays table footer, which mirrors table header. (without column filter).
|
|
116
64
|
* Or Array of objects or strings, where each element represents one cell in the table footer.
|
|
@@ -132,6 +80,10 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
132
80
|
* `{ name: 'John' , age: 12, _props: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}`
|
|
133
81
|
*/
|
|
134
82
|
items?: Item[];
|
|
83
|
+
/**
|
|
84
|
+
* The total number of items. Use if you pass a portion of data from an external source to let know component what is the total number of items.
|
|
85
|
+
*/
|
|
86
|
+
itemsNumber?: number;
|
|
135
87
|
/**
|
|
136
88
|
* Number of items per site, when pagination is enabled.
|
|
137
89
|
*/
|
|
@@ -179,6 +131,10 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
179
131
|
* Row click callback.
|
|
180
132
|
*/
|
|
181
133
|
onRowClick?: (item: Item, index: number, columnName: string, event: MouseEvent | boolean) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Select all callback.
|
|
136
|
+
*/
|
|
137
|
+
onSelectAll?: () => void;
|
|
182
138
|
/**
|
|
183
139
|
* Selected items change callback.
|
|
184
140
|
*/
|
|
@@ -207,6 +163,21 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
207
163
|
* Add checkboxes to make table rows selectable.
|
|
208
164
|
*/
|
|
209
165
|
selectable?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Enables select all checkbox displayed in the header of the table.
|
|
168
|
+
*
|
|
169
|
+
* Can be customized, by passing prop as object with additional options as keys. Available options:
|
|
170
|
+
* - external (Boolean) - Disables automatic selection inside the component.
|
|
171
|
+
*/
|
|
172
|
+
selectAll?: boolean | {
|
|
173
|
+
external?: boolean;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Array of selected objects, where each object represents one item - row in table.
|
|
177
|
+
*
|
|
178
|
+
* Example item: `{ name: 'John' , age: 12 }`
|
|
179
|
+
*/
|
|
180
|
+
selected?: Item[];
|
|
210
181
|
/**
|
|
211
182
|
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'.
|
|
212
183
|
*/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CTableDataCellProps } from '../table/CTableDataCell';
|
|
3
|
+
import { CTableHeaderCellProps } from '../table/CTableHeaderCell';
|
|
4
|
+
import { CTableRowProps } from '../table/CTableRow';
|
|
5
|
+
export type Column = {
|
|
6
|
+
filter?: boolean | ((values: any[], onChange: (value: any) => void) => ReactNode);
|
|
7
|
+
label?: string;
|
|
8
|
+
key: string;
|
|
9
|
+
sorter?: boolean;
|
|
10
|
+
_style?: any;
|
|
11
|
+
_props?: CTableHeaderCellProps;
|
|
12
|
+
};
|
|
13
|
+
export type ColumnFilter = {
|
|
14
|
+
lazy?: boolean;
|
|
15
|
+
external?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type ColumnFilterValue = {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
export type FooterItem = {
|
|
21
|
+
label?: string;
|
|
22
|
+
_props?: CTableDataCellProps;
|
|
23
|
+
};
|
|
24
|
+
export type Item = {
|
|
25
|
+
[key: string]: number | string | any;
|
|
26
|
+
_cellProps?: any;
|
|
27
|
+
_props?: CTableRowProps;
|
|
28
|
+
_selected?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type ItemsPerPageSelect = {
|
|
31
|
+
external?: boolean;
|
|
32
|
+
label?: string;
|
|
33
|
+
values?: Array<number>;
|
|
34
|
+
};
|
|
35
|
+
export type Pagination = {
|
|
36
|
+
external?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type Sorter = {
|
|
39
|
+
resetable?: boolean;
|
|
40
|
+
external?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type ScopedColumns = {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
details?: (a: Item, b: number) => ReactNode;
|
|
45
|
+
};
|
|
46
|
+
export type SorterValue = {
|
|
47
|
+
column?: string;
|
|
48
|
+
state?: number | string;
|
|
49
|
+
};
|
|
50
|
+
export type TableFilter = {
|
|
51
|
+
lazy?: boolean;
|
|
52
|
+
external?: boolean;
|
|
53
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Column, ColumnFilter, ColumnFilterValue, Item, Sorter, SorterValue, TableFilter } from './types';
|
|
2
|
+
export declare const filterColumns: (items: Item[], columnFilter: boolean | ColumnFilter | undefined, columnFilterState: ColumnFilterValue, itemsDataColumns: string[]) => Item[];
|
|
3
|
+
export declare const filterTable: (items: Item[], tableFilter: boolean | TableFilter | undefined, tableFilterState: string, itemsDataColumns: string[]) => Item[];
|
|
4
|
+
export declare const getClickedColumnName: (target: HTMLTextAreaElement, columnNames: string[]) => string;
|
|
5
|
+
export declare const getColumnKey: (column: Column | string) => string;
|
|
6
|
+
export declare const getColumnLabel: (column: Column | string) => string;
|
|
7
|
+
export declare const getColumnNames: (columns: (string | Column)[] | undefined, items: Item[]) => string[];
|
|
8
|
+
export declare const getColumnNamesFromItems: (items: Item[]) => string[];
|
|
9
|
+
export declare const getColumnSorterState: (key: string, sorterState: SorterValue | undefined) => string | number;
|
|
10
|
+
export declare const getColumnValues: (items: Item[], key: string) => any[];
|
|
11
|
+
export declare const getTableDataCellProps: (item: Item, colName: string) => any;
|
|
12
|
+
export declare const getTableHeaderCellProps: (column: Column | string) => import("../table/CTableHeaderCell").CTableHeaderCellProps;
|
|
13
|
+
export declare const getTableHeaderCellStyles: (column: Column | string, columnSorter: boolean | Sorter | undefined) => any;
|
|
14
|
+
export declare const isSortable: (i: number, columns: (string | Column)[] | undefined, columnSorter: Sorter | boolean | undefined, itemsDataColumns: string[], columnNames: string[]) => boolean | undefined;
|
|
15
|
+
export declare const pretifyName: (name: string) => string;
|
|
16
|
+
export declare const sortItems: (columnSorter: boolean | Sorter | undefined, items: Item[], itemsDataColumns: string[], sorterState: SorterValue) => Item[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LocalizedTimePartials } from './types';
|
|
2
|
+
export declare const convert12hTo24h: (abbr: 'am' | 'pm', hour: number) => number;
|
|
3
|
+
export declare const convert24hTo12h: (hour: number) => number;
|
|
4
|
+
export declare const convertTimeToDate: (time: Date | string | null | undefined) => Date | null;
|
|
5
|
+
export declare const getAmPm: (date: Date, locale: string) => "am" | "pm";
|
|
6
|
+
export declare const getListOfHours: (locale: string, ampm?: 'auto' | boolean) => {
|
|
7
|
+
value: number;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
export declare const getListOfMinutes: (locale: string, valueAsString?: boolean) => {
|
|
11
|
+
value: string | number;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const getListOfSeconds: (locale: string, valueAsString?: boolean) => {
|
|
15
|
+
value: string | number;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const getLocalizedTimePartials: (locale: string, ampm?: 'auto' | boolean) => LocalizedTimePartials;
|
|
19
|
+
export declare const getSelectedHour: (date: Date | null, locale: string, ampm?: 'auto' | boolean) => number | "";
|
|
20
|
+
export declare const getSelectedMinutes: (date: Date | null) => number | "";
|
|
21
|
+
export declare const getSelectedSeconds: (date: Date | null) => number | "";
|
|
22
|
+
export declare const isAmPm: (locale: string) => boolean;
|
|
23
|
+
export declare const isValidTime: (time: string) => number | false;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type AssignableRef<ValueType> = {
|
|
3
|
+
bivarianceHack(instance: ValueType | null): void;
|
|
4
|
+
}['bivarianceHack'] | React.MutableRefObject<ValueType | null>;
|
|
5
|
+
export declare function useForkedRef<RefValueType = any>(...refs: (AssignableRef<RefValueType> | null | undefined)[]): ((node: any) => void) | null;
|
|
6
|
+
export declare function assignRef<RefValueType = any>(ref: AssignableRef<RefValueType> | null | undefined, value: any): void;
|
|
7
|
+
export declare function isFunction(value: any): value is Function;
|