@coreui/react-pro 4.8.0 → 4.9.0-next.1
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/alert/CAlert.d.ts +1 -1
- package/dist/components/avatar/CAvatar.d.ts +1 -1
- package/dist/components/badge/CBadge.d.ts +1 -1
- package/dist/components/button/CButton.d.ts +1 -1
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/utils.d.ts +22 -0
- package/dist/components/callout/CCallout.d.ts +1 -1
- package/dist/components/card/CCard.d.ts +1 -1
- package/dist/components/date-picker/CDatePicker.d.ts +1 -1
- package/dist/components/date-range-picker/CDateRangePicker.d.ts +3 -3
- package/dist/components/date-range-picker/utils.d.ts +1 -0
- package/dist/components/dropdown/CDropdown.d.ts +1 -1
- package/dist/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/components/element-cover/CElementCover.d.ts +0 -4
- package/dist/components/element-cover/index.d.ts +2 -0
- package/dist/components/form/CFormCheck.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/list-group/CListGroupItem.d.ts +4 -5
- package/dist/components/multi-select/CMultiSelect.d.ts +1 -13
- package/dist/components/multi-select/CMultiSelectNativeSelect.d.ts +1 -1
- package/dist/components/multi-select/CMultiSelectOptions.d.ts +1 -1
- package/dist/components/multi-select/CMultiSelectSelection.d.ts +1 -1
- package/dist/components/multi-select/types.d.ts +14 -0
- package/dist/components/multi-select/utils.d.ts +6 -0
- package/dist/components/navbar/CNavbar.d.ts +1 -1
- package/dist/components/offcanvas/COffcanvas.d.ts +7 -1
- package/dist/components/picker/CPicker.d.ts +1 -1
- package/dist/components/placeholder/CPlaceholder.d.ts +1 -1
- package/dist/components/popover/CPopover.d.ts +1 -1
- package/dist/components/progress/CProgressBar.d.ts +1 -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 +38 -59
- package/dist/components/smart-table/types.d.ts +53 -0
- package/dist/components/smart-table/utils.d.ts +16 -0
- package/dist/components/spinner/CSpinner.d.ts +1 -1
- package/dist/components/table/CTable.d.ts +2 -18
- package/dist/components/table/CTableBody.d.ts +1 -1
- package/dist/components/table/CTableDataCell.d.ts +1 -1
- package/dist/components/table/CTableFoot.d.ts +1 -1
- package/dist/components/table/CTableHead.d.ts +1 -1
- package/dist/components/table/CTableHeaderCell.d.ts +1 -1
- package/dist/components/table/CTableRow.d.ts +1 -1
- package/dist/components/table/types.d.ts +17 -0
- package/dist/components/table/utils.d.ts +5 -0
- package/dist/components/time-picker/types.d.ts +15 -0
- package/dist/components/time-picker/utils.d.ts +23 -0
- package/dist/components/toast/CToast.d.ts +1 -1
- package/dist/components/toast/CToastClose.d.ts +1 -1
- package/dist/components/tooltip/CTooltip.d.ts +1 -1
- package/dist/components/virtual-scroller/CVirtualScroller.d.ts +0 -8
- package/dist/components/widgets/CWidgetStatsA.d.ts +1 -1
- package/dist/components/widgets/CWidgetStatsB.d.ts +1 -1
- package/dist/components/widgets/CWidgetStatsC.d.ts +1 -1
- package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
- package/dist/components/widgets/CWidgetStatsF.d.ts +1 -1
- 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 +1171 -1109
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1171 -1108
- package/dist/index.js.map +1 -1
- package/dist/props.d.ts +8 -0
- package/dist/types.d.ts +7 -0
- package/dist/utils/index.d.ts +2 -3
- package/dist/utils/isObjectInArray.d.ts +2 -0
- package/package.json +11 -11
- package/src/components/accordion/CAccordionBody.tsx +1 -0
- package/src/components/accordion/CAccordionCollapse.tsx +1 -0
- package/src/components/alert/CAlert.tsx +3 -2
- package/src/components/avatar/CAvatar.tsx +2 -8
- package/src/components/backdrop/CBackdrop.tsx +2 -2
- package/src/components/badge/CBadge.tsx +2 -10
- package/src/components/button/CButton.tsx +3 -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 -47
- package/src/components/callout/CCallout.tsx +2 -1
- package/src/components/card/CCard.tsx +2 -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 +4 -4
- package/src/components/date-range-picker/utils.ts +49 -0
- package/src/components/dropdown/CDropdown.tsx +3 -2
- package/src/components/dropdown/CDropdownItem.tsx +1 -2
- package/src/components/dropdown/CDropdownMenu.tsx +2 -1
- package/src/components/dropdown/CDropdownToggle.tsx +5 -4
- package/src/components/element-cover/CElementCover.tsx +16 -22
- package/src/components/element-cover/index.ts +3 -0
- package/src/components/form/CFormCheck.tsx +3 -3
- package/src/components/form/CFormControlValidation.tsx +0 -1
- package/src/components/form/CFormControlWrapper.tsx +0 -1
- package/src/components/form/CFormInput.tsx +8 -4
- package/src/components/form/CFormRange.tsx +1 -2
- package/src/components/form/CFormSelect.tsx +1 -2
- package/src/components/form/CFormTextarea.tsx +1 -2
- package/src/components/index.ts +1 -0
- package/src/components/list-group/CListGroupItem.tsx +8 -8
- package/src/components/list-group/CListGroupItem.tsx~HEAD +3 -1
- package/src/components/modal/CModal.tsx +2 -2
- package/src/components/modal/CModalHeader.tsx +3 -2
- package/src/components/multi-select/CMultiSelect.tsx +15 -74
- package/src/components/multi-select/CMultiSelectNativeSelect.tsx +1 -1
- package/src/components/multi-select/CMultiSelectOptions.tsx +2 -2
- package/src/components/multi-select/CMultiSelectSelection.tsx +1 -1
- package/src/components/multi-select/types.ts +15 -0
- package/src/components/multi-select/utils.ts +92 -0
- package/src/components/nav/CNavItem.tsx +1 -0
- package/src/components/nav/CNavLink.tsx +4 -3
- package/src/components/navbar/CNavbar.tsx +2 -1
- package/src/components/offcanvas/COffcanvas.tsx +38 -19
- package/src/components/picker/CPicker.tsx +1 -1
- package/src/components/placeholder/CPlaceholder.tsx +2 -1
- package/src/components/popover/CPopover.tsx +2 -1
- package/src/components/progress/CProgress.tsx +1 -0
- package/src/components/progress/CProgressBar.tsx +2 -1
- package/src/components/sidebar/CSidebar.tsx +3 -2
- package/src/components/smart-table/CSmartTable.tsx +263 -257
- package/src/components/smart-table/CSmartTableBody.tsx +98 -107
- 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 +56 -103
- package/src/components/smart-table/CSmartTableInterface.tsx +49 -71
- package/src/components/smart-table/CSmartTableItemsPerPageSelector.tsx +1 -2
- package/src/components/smart-table/types.ts +65 -0
- package/src/components/smart-table/utils.ts +199 -0
- package/src/components/spinner/CSpinner.tsx +2 -1
- package/src/components/table/CTable.tsx +25 -59
- package/src/components/table/CTableBody.tsx +2 -1
- package/src/components/table/CTableDataCell.tsx +2 -1
- package/src/components/table/CTableFoot.tsx +2 -1
- package/src/components/table/CTableHead.tsx +2 -1
- package/src/components/table/CTableHeaderCell.tsx +2 -1
- package/src/components/table/CTableRow.tsx +2 -1
- package/src/components/table/types.ts +20 -0
- package/src/components/table/utils.ts +29 -0
- package/src/components/tabs/CTabPane.tsx +2 -1
- package/src/components/time-picker/CTimePicker.tsx +48 -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 +4 -4
- package/src/components/toast/CToastClose.tsx +2 -2
- package/src/components/toast/CToaster.tsx +2 -1
- package/src/components/tooltip/CTooltip.tsx +3 -2
- package/src/components/virtual-scroller/CVirtualScroller.tsx +32 -55
- package/src/components/widgets/CWidgetStatsA.tsx +3 -3
- package/src/components/widgets/CWidgetStatsB.tsx +4 -4
- package/src/components/widgets/CWidgetStatsC.tsx +4 -4
- package/src/components/widgets/CWidgetStatsD.tsx +4 -5
- package/src/components/widgets/CWidgetStatsE.tsx +1 -2
- package/src/components/widgets/CWidgetStatsF.tsx +3 -4
- package/src/{components/Types.tsx → props.ts} +1 -68
- package/src/types.ts +68 -0
- package/src/utils/index.ts +2 -3
- package/src/utils/isObjectInArray.ts +14 -0
- package/src/components/multi-select/CMultiSelectCleaner.tsx +0 -18
- package/src/utils/getNextSibling.ts +0 -18
- package/src/utils/getPreviousSibling.ts +0 -18
- /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/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.1.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`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
3
|
export interface CAlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors, Shapes, TextColors } from '
|
|
2
|
+
import type { Colors, Shapes, TextColors } from '../../types';
|
|
3
3
|
export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors, Gradients, Shapes, TextColors } from '
|
|
2
|
+
import type { Colors, Gradients, Shapes, TextColors } from '../../types';
|
|
3
3
|
export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ElementType } from 'react';
|
|
2
|
-
import { Colors, Shapes } from '../Types';
|
|
3
2
|
import { CLinkProps } from '../link/CLink';
|
|
3
|
+
import type { Colors, Shapes } from '../../types';
|
|
4
4
|
export interface CButtonProps extends Omit<CLinkProps, 'size'> {
|
|
5
5
|
/**
|
|
6
6
|
* Toggle the active state for the component.
|
|
@@ -0,0 +1,22 @@
|
|
|
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 getMonthName: (month: number, locale: string) => string;
|
|
7
|
+
export declare const getMonthsNames: (locale: string) => string[];
|
|
8
|
+
export declare const getYears: (year: number) => number[];
|
|
9
|
+
export declare const getMonthDetails: (year: number, month: number, firstDayOfWeek: number) => {
|
|
10
|
+
date: Date;
|
|
11
|
+
month: string;
|
|
12
|
+
}[][];
|
|
13
|
+
export declare const isDisableDateInRange: (startDate?: Date | null, endDate?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean;
|
|
14
|
+
export declare const isDateDisabled: (date: Date, min?: Date | null, max?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean | undefined;
|
|
15
|
+
export declare const isDateInRange: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
16
|
+
export declare const isDateSelected: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
17
|
+
export declare const isEndDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
18
|
+
export declare const isLastDayOfMonth: (date: Date) => boolean;
|
|
19
|
+
export declare const isSameDateAs: (date: Date | null, date2: Date | null) => boolean;
|
|
20
|
+
export declare const isStartDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
|
|
21
|
+
export declare const isToday: (date: Date) => boolean;
|
|
22
|
+
export declare const isValidDate: (date: string) => number | false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
3
|
export interface CCalloutProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the base component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors, Gradients } from '
|
|
2
|
+
import type { Colors, Gradients } from '../../types';
|
|
3
3
|
export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the base component.
|
|
@@ -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
|
/**
|
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { CCalendarProps } from '../calendar/CCalendar';
|
|
3
3
|
import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
|
|
4
4
|
import { CPickerProps } from '../picker/CPicker';
|
|
5
|
-
import { Colors } from '
|
|
5
|
+
import { Colors } from '../../types';
|
|
6
6
|
export interface CDateRangePickerProps extends Omit<CFormControlWrapperProps, 'floatingLabel'>, Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant'>, Omit<CCalendarProps, 'onCalendarCellHover' | 'onCalendarDateChange'> {
|
|
7
7
|
/**
|
|
8
8
|
* The number of calendars that render on desktop devices.
|
|
@@ -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
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLocalDateFromString: (string: string, locale: string, time?: boolean) => Date | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { Triggers } from '../Types';
|
|
3
2
|
import { CButtonProps } from '../button/CButton';
|
|
3
|
+
import type { Triggers } from '../../types';
|
|
4
4
|
export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
5
5
|
/**
|
|
6
6
|
* Enables pseudo element caret on toggler.
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { Colors, Shapes } from '../Types';
|
|
3
2
|
import { CFormControlValidationProps } from './CFormControlValidation';
|
|
3
|
+
import type { Colors, Shapes } from '../../types';
|
|
4
4
|
export type ButtonObject = {
|
|
5
5
|
/**
|
|
6
6
|
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ElementType,
|
|
2
|
-
import { Colors } from '
|
|
3
|
-
export interface CListGroupItemProps extends
|
|
1
|
+
import React, { ElementType, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
|
+
export interface CListGroupItemProps extends AnchorHTMLAttributes<HTMLLIElement | HTMLAnchorElement | HTMLButtonElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Toggle the active state for the component.
|
|
6
6
|
*/
|
|
@@ -23,6 +23,5 @@ export interface CListGroupItemProps extends HTMLAttributes<HTMLLIElement | HTML
|
|
|
23
23
|
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
24
24
|
*/
|
|
25
25
|
component?: string | ElementType;
|
|
26
|
-
href?: string;
|
|
27
26
|
}
|
|
28
|
-
export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLButtonElement |
|
|
27
|
+
export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement | HTMLLIElement>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { CFormControlWrapperProps } from './../form/CFormControlWrapper';
|
|
3
|
+
import type { Option } from './types';
|
|
3
4
|
export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'floatingClassName' | 'floatingLabel'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
5
|
/**
|
|
5
6
|
* A string of all className you want applied to the base component.
|
|
@@ -89,17 +90,4 @@ export interface CMultiSelectProps extends Omit<CFormControlWrapperProps, 'float
|
|
|
89
90
|
*/
|
|
90
91
|
visibleItems?: number;
|
|
91
92
|
}
|
|
92
|
-
export interface Option {
|
|
93
|
-
disabled?: boolean;
|
|
94
|
-
label?: string;
|
|
95
|
-
options?: Option[];
|
|
96
|
-
selected?: boolean;
|
|
97
|
-
text?: string;
|
|
98
|
-
value?: number | string;
|
|
99
|
-
}
|
|
100
|
-
export interface SelectedOption {
|
|
101
|
-
disabled?: boolean;
|
|
102
|
-
text: string;
|
|
103
|
-
value: number | string;
|
|
104
|
-
}
|
|
105
93
|
export declare const CMultiSelect: React.ForwardRefExoticComponent<CMultiSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Option } from './
|
|
2
|
+
import type { Option } from './types';
|
|
3
3
|
export interface CMultiSelectNativeSelectProps extends Omit<HTMLAttributes<HTMLSelectElement>, 'options'> {
|
|
4
4
|
multiple?: boolean;
|
|
5
5
|
options: Option[] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { Option } from './
|
|
2
|
+
import type { Option } from './types';
|
|
3
3
|
export interface CMultiSelectOptionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
handleOptionOnClick?: (option: Option) => void;
|
|
5
5
|
options: Option[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import type { SelectedOption } from './
|
|
2
|
+
import type { SelectedOption } from './types';
|
|
3
3
|
export interface CMultiSelectSelectionProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
4
|
multiple?: boolean;
|
|
5
5
|
onRemove?: (option: SelectedOption) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Option = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
label?: string;
|
|
4
|
+
options?: Option[];
|
|
5
|
+
order?: number;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
text: string;
|
|
8
|
+
value: number | string;
|
|
9
|
+
};
|
|
10
|
+
export type SelectedOption = {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
text: string;
|
|
13
|
+
value: number | string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Option, SelectedOption } from './types';
|
|
2
|
+
export declare const filterOptionsList: (search: string, _options: Option[]) => Option[];
|
|
3
|
+
export declare const flattenArray: (options: Option[]) => Option[];
|
|
4
|
+
export declare const getNextSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
|
|
5
|
+
export declare const getPreviousSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
|
|
6
|
+
export declare const selectOptions: (options: Option[], selected: SelectedOption[], deselected?: Option[]) => SelectedOption[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
3
|
export interface CNavbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { CDropdownProps } from '../dropdown/CDropdown';
|
|
3
|
-
import { Colors } from '
|
|
3
|
+
import { Colors } from '../../types';
|
|
4
4
|
export interface CPickerProps extends Omit<CDropdownProps, 'variant'> {
|
|
5
5
|
/**
|
|
6
6
|
* Toggle visibility or set the content of cancel button.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
3
|
export interface CPlaceholderProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Set animation type to better convey the perception of something being actively loaded.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { Triggers } from '
|
|
2
|
+
import type { Triggers } from '../../types';
|
|
3
3
|
export interface CPopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors, Gradients } from '
|
|
2
|
+
import type { Colors, Gradients } from '../../types';
|
|
3
3
|
export interface CProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Use to animate the stripes right to left via CSS3 animations.
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import React, { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { ColumnFilter, ColumnFilterValue, Column, ItemInternal, Sorter, SorterValue } from './CSmartTableInterface';
|
|
3
2
|
import { CTableHeadProps } from '../table/CTableHead';
|
|
3
|
+
import type { ColumnFilter, ColumnFilterValue, Column, Item, Sorter, SorterValue } from './types';
|
|
4
4
|
export interface CSmartTableHeadProps extends CTableHeadProps {
|
|
5
5
|
columnFilter?: boolean | ColumnFilter;
|
|
6
6
|
columnFilterState?: ColumnFilterValue;
|
|
@@ -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.
|
|
@@ -130,8 +78,14 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
130
78
|
*
|
|
131
79
|
* Example item:
|
|
132
80
|
* `{ name: 'John' , age: 12, _props: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}`
|
|
81
|
+
*
|
|
82
|
+
* @since 4.9.0
|
|
133
83
|
*/
|
|
134
84
|
items?: Item[];
|
|
85
|
+
/**
|
|
86
|
+
* 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.
|
|
87
|
+
*/
|
|
88
|
+
itemsNumber?: number;
|
|
135
89
|
/**
|
|
136
90
|
* Number of items per site, when pagination is enabled.
|
|
137
91
|
*/
|
|
@@ -179,6 +133,12 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
179
133
|
* Row click callback.
|
|
180
134
|
*/
|
|
181
135
|
onRowClick?: (item: Item, index: number, columnName: string, event: MouseEvent | boolean) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Select all callback.
|
|
138
|
+
*
|
|
139
|
+
* @since 4.9.0
|
|
140
|
+
*/
|
|
141
|
+
onSelectAll?: () => void;
|
|
182
142
|
/**
|
|
183
143
|
* Selected items change callback.
|
|
184
144
|
*/
|
|
@@ -207,6 +167,25 @@ export interface CSmartTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
207
167
|
* Add checkboxes to make table rows selectable.
|
|
208
168
|
*/
|
|
209
169
|
selectable?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Enables select all checkbox displayed in the header of the table.
|
|
172
|
+
*
|
|
173
|
+
* Can be customized, by passing prop as object with additional options as keys. Available options:
|
|
174
|
+
* - external (Boolean) - Disables automatic selection inside the component.
|
|
175
|
+
*
|
|
176
|
+
* @since 4.9.0
|
|
177
|
+
*/
|
|
178
|
+
selectAll?: boolean | {
|
|
179
|
+
external?: boolean;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Array of selected objects, where each object represents one item - row in table.
|
|
183
|
+
*
|
|
184
|
+
* Example item: `{ name: 'John' , age: 12 }`
|
|
185
|
+
*
|
|
186
|
+
* @since 4.9.0
|
|
187
|
+
*/
|
|
188
|
+
selected?: Item[];
|
|
210
189
|
/**
|
|
211
190
|
* State of the sorter. Name key is column name, direction can be 'asc' or 'desc'.
|
|
212
191
|
*/
|
|
@@ -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
|
+
key: string;
|
|
8
|
+
label?: 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[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ElementType, HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
3
|
export interface CSpinnerProps extends HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React, { TableHTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '../Types';
|
|
3
2
|
import { CTableHeadProps } from './CTableHead';
|
|
4
|
-
import { CTableHeaderCellProps } from './CTableHeaderCell';
|
|
5
|
-
import { CTableDataCellProps } from './CTableDataCell';
|
|
6
|
-
import { CTableRowProps } from './CTableRow';
|
|
7
3
|
import { CTableFootProps } from './CTableFoot';
|
|
4
|
+
import type { Colors } from '../../types';
|
|
5
|
+
import type { Column, FooterItem, Item } from './types';
|
|
8
6
|
export interface CTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, 'align'> {
|
|
9
7
|
/**
|
|
10
8
|
* Set the vertical aligment.
|
|
@@ -115,18 +113,4 @@ export interface CTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>,
|
|
|
115
113
|
*/
|
|
116
114
|
tableHeadProps?: CTableHeadProps;
|
|
117
115
|
}
|
|
118
|
-
export interface Column {
|
|
119
|
-
label?: string;
|
|
120
|
-
key: string;
|
|
121
|
-
_style?: any;
|
|
122
|
-
_props?: CTableHeaderCellProps;
|
|
123
|
-
}
|
|
124
|
-
export interface Item {
|
|
125
|
-
[key: string]: number | string | any;
|
|
126
|
-
_props?: CTableRowProps;
|
|
127
|
-
}
|
|
128
|
-
export interface FooterItem {
|
|
129
|
-
label?: string;
|
|
130
|
-
_props?: CTableDataCellProps;
|
|
131
|
-
}
|
|
132
116
|
export declare const CTable: React.ForwardRefExoticComponent<CTableProps & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import { Colors } from '
|
|
2
|
+
import type { Colors } from '../../types';
|
|
3
3
|
export interface CTableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|