@coreui/react 4.2.2 → 4.3.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 +113 -9
- package/dist/components/button/CButton.d.ts +1 -1
- package/dist/components/dropdown/CDropdownItem.d.ts +1 -1
- package/dist/components/form/CFormTextarea.d.ts +2 -2
- package/dist/components/link/CLink.d.ts +1 -1
- package/dist/components/list-group/CListGroupItem.d.ts +1 -1
- package/dist/components/nav/CNavLink.d.ts +1 -1
- package/dist/components/table/CTable.d.ts +83 -4
- package/dist/components/table/CTableDataCell.d.ts +8 -4
- package/dist/components/table/CTableHeaderCell.d.ts +2 -2
- package/dist/components/table/CTableResponsiveWrapper.d.ts +9 -0
- package/dist/components/table/CTableRow.d.ts +1 -1
- package/dist/index.es.js +139 -72
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +139 -72
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
- package/src/components/alert/__tests__/__snapshots__/CAlert.spec.tsx.snap +1 -0
- package/src/components/button/__tests__/__snapshots__/CButtonClose.spec.tsx.snap +2 -0
- package/src/components/close-button/__tests__/__snapshots__/CCloseButton.spec.tsx.snap +2 -0
- package/src/components/form/CFormTextarea.tsx +2 -2
- package/src/components/form/__tests__/CFormTextarea.spec.tsx +1 -0
- package/src/components/form/__tests__/__snapshots__/CFormTextarea.spec.tsx.snap +1 -0
- package/src/components/modal/__tests__/__snapshots__/CModalHeader.spec.tsx.snap +2 -0
- package/src/components/popover/CPopover.tsx +5 -0
- package/src/components/table/CTable.tsx +184 -18
- package/src/components/table/CTableDataCell.tsx +13 -6
- package/src/components/table/CTableHeaderCell.tsx +2 -2
- package/src/components/table/CTableResponsiveWrapper.tsx +39 -0
- package/src/components/table/CTableRow.tsx +1 -1
- package/src/components/table/__tests__/CTable.spec.tsx +45 -0
- package/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap +86 -2
- package/src/components/toast/CToast.tsx +1 -1
- package/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap +0 -13
package/README.md
CHANGED
|
@@ -20,21 +20,24 @@
|
|
|
20
20
|
·
|
|
21
21
|
<a href="https://github.com/coreui/coreui-react/issues/new?template=feature_request.md">Request feature</a>
|
|
22
22
|
·
|
|
23
|
-
<a href="https://
|
|
23
|
+
<a href="https://coreui.io/blog/">Blog</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
## Table of contents
|
|
28
28
|
|
|
29
29
|
- [Quick start](#quick-start)
|
|
30
|
+
- [Components](#components)
|
|
30
31
|
- [Status](#status)
|
|
31
|
-
- [What's included](#whats-included)
|
|
32
32
|
- [Bugs and feature requests](#bugs-and-feature-requests)
|
|
33
33
|
- [Documentation](#documentation)
|
|
34
|
+
- [Frameworks](#frameworks)
|
|
35
|
+
- [Templates](#templates)
|
|
34
36
|
- [Contributing](#contributing)
|
|
35
37
|
- [Community](#community)
|
|
36
38
|
- [Versioning](#versioning)
|
|
37
39
|
- [Creators](#creators)
|
|
40
|
+
- [Support CoreUI Development](#support-coreui-development)
|
|
38
41
|
- [Copyright and license](#copyright-and-license)
|
|
39
42
|
|
|
40
43
|
## Quick start
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
|
|
44
47
|
Several quick start options are available:
|
|
45
48
|
|
|
46
|
-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.3.1.zip)
|
|
47
50
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
48
51
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
49
52
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
|
@@ -94,13 +97,58 @@ npm install bootstrap
|
|
|
94
97
|
import "bootstrap/dist/css/bootstrap.min.css";
|
|
95
98
|
```
|
|
96
99
|
|
|
100
|
+
## Components
|
|
101
|
+
|
|
102
|
+
- [React Accordion](https://coreui.io/react/docs/components/accordion/)
|
|
103
|
+
- [React Alert](https://coreui.io/react/docs/components/alert/)
|
|
104
|
+
- [React Avatar](https://coreui.io/react/docs/components/avatar/)
|
|
105
|
+
- [React Badge](https://coreui.io/react/docs/components/badge/)
|
|
106
|
+
- [React Breadcrumb](https://coreui.io/react/docs/components/breadcrumb/)
|
|
107
|
+
- [React Button](https://coreui.io/react/docs/components/button/)
|
|
108
|
+
- [React Button Group](https://coreui.io/react/docs/components/button-group/)
|
|
109
|
+
- [React Callout](https://coreui.io/react/docs/components/callout/)
|
|
110
|
+
- [React Card](https://coreui.io/react/docs/components/card/)
|
|
111
|
+
- [React Carousel](https://coreui.io/react/docs/components/carousel/)
|
|
112
|
+
- [React Checkbox](https://coreui.io/react/docs/forms/checkbox/)
|
|
113
|
+
- [React Close Button](https://coreui.io/react/docs/components/close-button/)
|
|
114
|
+
- [React Collapse](https://coreui.io/react/docs/components/collapse/)
|
|
115
|
+
- [React Date Picker](https://coreui.io/react/docs/forms/date-picker/) **PRO**
|
|
116
|
+
- [React Date Range Picker](https://coreui.io/react/docs/forms/date-range-picker/) **PRO**
|
|
117
|
+
- [React Dropdown](https://coreui.io/react/docs/components/dropdown/)
|
|
118
|
+
- [React Floating Labels](https://coreui.io/react/docs/forms/floating-labels/)
|
|
119
|
+
- [React Footer](https://coreui.io/react/docs/components/footer/)
|
|
120
|
+
- [React Header](https://coreui.io/react/docs/components/header/)
|
|
121
|
+
- [React Image](https://coreui.io/react/docs/components/image/)
|
|
122
|
+
- [React Input](https://coreui.io/react/docs/forms/input/)
|
|
123
|
+
- [React Input Group](https://coreui.io/react/docs/forms/input-group/)
|
|
124
|
+
- [React List Group](https://coreui.io/react/docs/components/list-group/)
|
|
125
|
+
- [React Loading Button](https://coreui.io/react/docs/components/loading-button/) **PRO**
|
|
126
|
+
- [React Modal](https://coreui.io/react/docs/components/modal/)
|
|
127
|
+
- [React Multi Select](https://coreui.io/react/docs/forms/multi-select/) **PRO**
|
|
128
|
+
- [React Navs & Tabs](https://coreui.io/react/docs/components/navs-tabs/)
|
|
129
|
+
- [React Navbar](https://coreui.io/react/docs/components/navbar/)
|
|
130
|
+
- [React Offcanvas](https://coreui.io/react/docs/components/offcanvas/)
|
|
131
|
+
- [React Pagination](https://coreui.io/react/docs/components/pagination/)
|
|
132
|
+
- [React Placeholder](https://coreui.io/react/docs/components/placeholder/)
|
|
133
|
+
- [React Popover](https://coreui.io/react/docs/components/popover/)
|
|
134
|
+
- [React Progress](https://coreui.io/react/docs/components/progress/)
|
|
135
|
+
- [React Radio](https://coreui.io/react/docs/forms/radio/)
|
|
136
|
+
- [React Range](https://coreui.io/react/docs/forms/range/)
|
|
137
|
+
- [React Select](https://coreui.io/react/docs/forms/select/)
|
|
138
|
+
- [React Sidebar](https://coreui.io/react/docs/components/sidebar/)
|
|
139
|
+
- [React Smart Pagination](https://coreui.io/react/docs/components/smart-pagination/) **PRO**
|
|
140
|
+
- [React Smart Table](https://coreui.io/react/docs/components/smart-table/) **PRO**
|
|
141
|
+
- [React Spinner](https://coreui.io/react/docs/components/spinner/)
|
|
142
|
+
- [React Switch](https://coreui.io/react/docs/forms/switch/)
|
|
143
|
+
- [React Table](https://coreui.io/react/docs/components/table/)
|
|
144
|
+
- [React Textarea](https://coreui.io/react/docs/forms/textarea/)
|
|
145
|
+
- [React Time Picker](https://coreui.io/react/docs/forms/time-picker/) **PRO**
|
|
146
|
+
- [React Toast](https://coreui.io/react/docs/components/toast/)
|
|
147
|
+
- [React Tooltip](https://coreui.io/react/docs/components/tooltip/)
|
|
148
|
+
|
|
97
149
|
## Status
|
|
98
150
|
|
|
99
|
-
[](https://github.com/coreui/coreui-react/actions?query=workflow%3AJS+Tests+branch%3Amain)
|
|
100
151
|
[](https://www.npmjs.com/package/@coreui/react)
|
|
101
|
-
[](https://david-dm.org/coreui/coreui?type=peer)
|
|
102
|
-
[](https://david-dm.org/coreui/coreui?type=dev)
|
|
103
|
-
[](https://coveralls.io/github/coreui/coreui-react?branch=v4)
|
|
104
152
|
|
|
105
153
|
## Bugs and feature requests
|
|
106
154
|
|
|
@@ -117,6 +165,24 @@ The documentation for the CoreUI & CoreUI PRO is hosted at our website [CoreUI f
|
|
|
117
165
|
3. From the root directory, run `yarn docs:dev` or `npm run docs:dev` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
|
|
118
166
|
4. Open `http://localhost:8000/` in your browser, and voilà.
|
|
119
167
|
|
|
168
|
+
## Frameworks
|
|
169
|
+
|
|
170
|
+
CoreUI supports most popular frameworks.
|
|
171
|
+
|
|
172
|
+
- [CoreUI for Angular](https://github.com/coreui/coreui-angular)
|
|
173
|
+
- [CoreUI for Bootstrap (Vanilla JS)](https://github.com/coreui/coreui)
|
|
174
|
+
- [CoreUI for React](https://github.com/coreui/coreui-react)
|
|
175
|
+
- [CoreUI for Vue](https://github.com/coreui/coreui-vue)
|
|
176
|
+
|
|
177
|
+
## Templates
|
|
178
|
+
|
|
179
|
+
Fully featured, out-of-the-box, templates for your application based on CoreUI.
|
|
180
|
+
|
|
181
|
+
- [Angular Admin Template](https://coreui.io/angular)
|
|
182
|
+
- [Bootstrap Admin Template](https://coreui.io/)
|
|
183
|
+
- [React Admin Template](https://coreui.io/react)
|
|
184
|
+
- [Vue Admin Template](https://coreui.io/vue)
|
|
185
|
+
|
|
120
186
|
## Contributing
|
|
121
187
|
|
|
122
188
|
Please read through our [contributing guidelines](https://github.com/coreui/coreui-react/blob/v4/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
|
@@ -127,7 +193,7 @@ Editor preferences are available in the [editor config](https://github.com/coreu
|
|
|
127
193
|
|
|
128
194
|
Stay up to date on the development of CoreUI and reach out to the community with these helpful resources.
|
|
129
195
|
|
|
130
|
-
- Read and subscribe to [The Official CoreUI Blog](https://
|
|
196
|
+
- Read and subscribe to [The Official CoreUI Blog](https://coreui.io/blog/).
|
|
131
197
|
|
|
132
198
|
You can also follow [@core_ui on Twitter](https://twitter.com/core_ui).
|
|
133
199
|
|
|
@@ -152,6 +218,44 @@ See [the Releases section of our project](https://github.com/coreui/coreui-react
|
|
|
152
218
|
|
|
153
219
|
- <https://github.com/orgs/coreui/people>
|
|
154
220
|
|
|
221
|
+
## Support CoreUI Development
|
|
222
|
+
|
|
223
|
+
CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing. You can support development by buying the [CoreUI PRO](https://coreui.io/pricing/) or by becoming a sponsor via [Open Collective](https://opencollective.com/coreui/).
|
|
224
|
+
|
|
225
|
+
<!--- StartOpenCollectiveBackers -->
|
|
226
|
+
|
|
227
|
+
### Platinum Sponsors
|
|
228
|
+
|
|
229
|
+
Support this project by [becoming a Platinum Sponsor](https://opencollective.com/coreui/contribute/platinum-sponsor-40959/). A large company logo will be added here with a link to your website.
|
|
230
|
+
|
|
231
|
+
<a href="https://opencollective.com/coreui/contribute/platinum-sponsor-40959/checkout"><img src="https://opencollective.com/coreui/tiers/platinum-sponsor/0/avatar.svg?avatarHeight=100"></a>
|
|
232
|
+
|
|
233
|
+
### Gold Sponsors
|
|
234
|
+
|
|
235
|
+
Support this project by [becoming a Gold Sponsor](https://opencollective.com/coreui/contribute/gold-sponsor-40960/). A big company logo will be added here with a link to your website.
|
|
236
|
+
|
|
237
|
+
<a href="https://opencollective.com/coreui/contribute/gold-sponsor-40960/checkout"><img src="https://opencollective.com/coreui/tiers/gold-sponsor/0/avatar.svg?avatarHeight=100"></a>
|
|
238
|
+
|
|
239
|
+
### Silver Sponsors
|
|
240
|
+
|
|
241
|
+
Support this project by [becoming a Silver Sponsor](https://opencollective.com/coreui/contribute/silver-sponsor-40967/). A medium company logo will be added here with a link to your website.
|
|
242
|
+
|
|
243
|
+
<a href="https://opencollective.com/coreui/contribute/silver-sponsor-40967/checkout"><img src="https://opencollective.com/coreui/tiers/gold-sponsor/0/avatar.svg?avatarHeight=100"></a>
|
|
244
|
+
|
|
245
|
+
### Bronze Sponsors
|
|
246
|
+
|
|
247
|
+
Support this project by [becoming a Bronze Sponsor](https://opencollective.com/coreui/contribute/bronze-sponsor-40966/). The company avatar will show up here with a link to your OpenCollective Profile.
|
|
248
|
+
|
|
249
|
+
<a href="https://opencollective.com/coreui/contribute/bronze-sponsor-40966/checkout"><img src="https://opencollective.com/coreui/tiers/bronze-sponsor/0/avatar.svg?avatarHeight=100"></a>
|
|
250
|
+
|
|
251
|
+
### Backers
|
|
252
|
+
|
|
253
|
+
Thanks to all the backers and sponsors! Support this project by [becoming a backer](https://opencollective.com/coreui/contribute/backer-40965/).
|
|
254
|
+
|
|
255
|
+
<a href="https://opencollective.com/coreui/contribute/backer-40965/checkout" target="_blank" rel="noopener"><img src="https://opencollective.com/coreui/backers.svg?width=890"></a>
|
|
256
|
+
|
|
257
|
+
<!--- EndOpenCollectiveBackers -->
|
|
258
|
+
|
|
155
259
|
## Copyright and license
|
|
156
260
|
|
|
157
|
-
Copyright
|
|
261
|
+
Copyright 2022 creativeLabs Łukasz Holeczek. Code released under the [MIT License](https://github.com/coreui/coreui-react/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
|
@@ -51,4 +51,4 @@ export interface CButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
51
51
|
*/
|
|
52
52
|
variant?: 'outline' | 'ghost';
|
|
53
53
|
}
|
|
54
|
-
export declare const CButton: React.ForwardRefExoticComponent<CButtonProps & React.RefAttributes<
|
|
54
|
+
export declare const CButton: React.ForwardRefExoticComponent<CButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -10,4 +10,4 @@ export interface CDropdownItemProps extends CLinkProps {
|
|
|
10
10
|
*/
|
|
11
11
|
component?: string | ElementType;
|
|
12
12
|
}
|
|
13
|
-
export declare const CDropdownItem: React.ForwardRefExoticComponent<CDropdownItemProps & React.RefAttributes<
|
|
13
|
+
export declare const CDropdownItem: React.ForwardRefExoticComponent<CDropdownItemProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ChangeEventHandler,
|
|
1
|
+
import React, { ChangeEventHandler, TextareaHTMLAttributes } from 'react';
|
|
2
2
|
import { CFormControlWrapperProps } from './CFormControlWrapper';
|
|
3
|
-
export interface CFormTextareaProps extends CFormControlWrapperProps,
|
|
3
|
+
export interface CFormTextareaProps extends CFormControlWrapperProps, TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
6
6
|
*/
|
|
@@ -21,4 +21,4 @@ export interface CLinkProps extends AllHTMLAttributes<HTMLElement> {
|
|
|
21
21
|
*/
|
|
22
22
|
href?: string;
|
|
23
23
|
}
|
|
24
|
-
export declare const CLink: React.ForwardRefExoticComponent<CLinkProps & React.RefAttributes<
|
|
24
|
+
export declare const CLink: React.ForwardRefExoticComponent<CLinkProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -24,4 +24,4 @@ export interface CListGroupItemProps extends HTMLAttributes<HTMLLIElement | HTML
|
|
|
24
24
|
*/
|
|
25
25
|
component?: string | ElementType;
|
|
26
26
|
}
|
|
27
|
-
export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<
|
|
27
|
+
export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLLIElement>>;
|
|
@@ -26,4 +26,4 @@ export interface CNavLinkProps extends Omit<CLinkProps, 'idx'> {
|
|
|
26
26
|
*/
|
|
27
27
|
to?: string;
|
|
28
28
|
}
|
|
29
|
-
export declare const CNavLink: React.ForwardRefExoticComponent<CNavLinkProps & React.RefAttributes<
|
|
29
|
+
export declare const CNavLink: React.ForwardRefExoticComponent<CNavLinkProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLLIElement>>;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React, { TableHTMLAttributes } from 'react';
|
|
2
2
|
import { Colors } from '../Types';
|
|
3
|
-
|
|
3
|
+
import { CTableHeadProps } from './CTableHead';
|
|
4
|
+
import { CTableHeaderCellProps } from './CTableHeaderCell';
|
|
5
|
+
import { CTableDataCellProps } from './CTableDataCell';
|
|
6
|
+
import { CTableRowProps } from './CTableRow';
|
|
7
|
+
import { CTableFootProps } from './CTableFoot';
|
|
8
|
+
export interface CTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, 'align'> {
|
|
4
9
|
/**
|
|
5
10
|
* Set the vertical aligment.
|
|
6
11
|
*/
|
|
7
|
-
align?: 'bottom' | 'middle' | 'top';
|
|
12
|
+
align?: 'bottom' | 'middle' | 'top' | string;
|
|
8
13
|
/**
|
|
9
14
|
* Sets the border color of the component to one of CoreUI’s themed colors.
|
|
10
15
|
*
|
|
@@ -20,23 +25,63 @@ export interface CTableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
|
20
25
|
*/
|
|
21
26
|
borderless?: boolean;
|
|
22
27
|
/**
|
|
23
|
-
* Put the
|
|
28
|
+
* Put the caption on the top if you set `caption="top"` of the table or set the text of the table caption.
|
|
24
29
|
*/
|
|
25
|
-
caption?: 'top';
|
|
30
|
+
caption?: 'top' | string;
|
|
31
|
+
/**
|
|
32
|
+
* Set the text of the table caption and the caption on the top of the table.
|
|
33
|
+
*
|
|
34
|
+
* @since 4.3.0
|
|
35
|
+
*/
|
|
36
|
+
captionTop?: string;
|
|
26
37
|
/**
|
|
27
38
|
* A string of all className you want applied to the component.
|
|
28
39
|
*/
|
|
29
40
|
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_props')
|
|
43
|
+
*
|
|
44
|
+
* In columns prop each array item represents one column. Item might be specified in two ways:
|
|
45
|
+
* String: each item define column name equal to item value.
|
|
46
|
+
* Object: item is object with following keys available as column configuration:
|
|
47
|
+
* - key (required)(String) - define column name equal to item key.
|
|
48
|
+
* - label (String) - define visible label of column. If not defined, label will be generated automatically based on column name, by converting kebab-case and snake_case to individual words and capitalization of each word.
|
|
49
|
+
* - _props (Object) - adds classes to all cels in column, ex. _props: { scope: 'col', className: 'custom-class' },
|
|
50
|
+
* - _style (Object) - adds styles to the column header (useful for defining widths)
|
|
51
|
+
*
|
|
52
|
+
* @since 4.3.0
|
|
53
|
+
*/
|
|
54
|
+
columns?: (string | Column)[];
|
|
30
55
|
/**
|
|
31
56
|
* Sets the color context of the component to one of CoreUI’s themed colors.
|
|
32
57
|
*
|
|
33
58
|
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
34
59
|
*/
|
|
35
60
|
color?: Colors;
|
|
61
|
+
/**
|
|
62
|
+
* Array of objects or strings, where each element represents one cell in the table footer.
|
|
63
|
+
*
|
|
64
|
+
* Example items:
|
|
65
|
+
* ['FooterCell', 'FooterCell', 'FooterCell']
|
|
66
|
+
* or
|
|
67
|
+
* [{ label: 'FooterCell', _props: { color: 'success' }, ...]
|
|
68
|
+
*
|
|
69
|
+
* @since 4.3.0
|
|
70
|
+
*/
|
|
71
|
+
footer?: FooterItem[];
|
|
36
72
|
/**
|
|
37
73
|
* Enable a hover state on table rows within a `<CTableBody>`.
|
|
38
74
|
*/
|
|
39
75
|
hover?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Array of objects, where each object represents one item - row in table. Additionally, you can add style classes to each row by passing them by '_props' key and to single cell by '_cellProps'.
|
|
78
|
+
*
|
|
79
|
+
* Example item:
|
|
80
|
+
* { name: 'John' , age: 12, _props: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}
|
|
81
|
+
*
|
|
82
|
+
* @since 4.3.0
|
|
83
|
+
*/
|
|
84
|
+
items?: Item[];
|
|
40
85
|
/**
|
|
41
86
|
* Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to.
|
|
42
87
|
*/
|
|
@@ -49,5 +94,39 @@ export interface CTableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
|
49
94
|
* Add zebra-striping to any table row within the `<CTableBody>`.
|
|
50
95
|
*/
|
|
51
96
|
striped?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Add zebra-striping to any table column.
|
|
99
|
+
*
|
|
100
|
+
* @since 4.3.0
|
|
101
|
+
*/
|
|
102
|
+
stripedColumns?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Properties that will be passed to the table footer component.
|
|
105
|
+
*
|
|
106
|
+
* @link https://coreui.io/react/docs/components/table/#ctablefoot
|
|
107
|
+
* @since 4.3.0
|
|
108
|
+
*/
|
|
109
|
+
tableFootProps?: CTableFootProps;
|
|
110
|
+
/**
|
|
111
|
+
* Properties that will be passed to the table head component.
|
|
112
|
+
*
|
|
113
|
+
* @link https://coreui.io/react/docs/components/table/#ctablehead
|
|
114
|
+
* @since 4.3.0
|
|
115
|
+
*/
|
|
116
|
+
tableHeadProps?: CTableHeadProps;
|
|
117
|
+
}
|
|
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;
|
|
52
131
|
}
|
|
53
132
|
export declare const CTable: React.ForwardRefExoticComponent<CTableProps & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { TdHTMLAttributes } from 'react';
|
|
1
|
+
import React, { TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
2
|
import { Colors } from '../Types';
|
|
3
|
-
export interface CTableDataCellProps extends Omit<TdHTMLAttributes<
|
|
3
|
+
export interface CTableDataCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'>, Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
4
4
|
/**
|
|
5
5
|
* Highlight a table row or cell.
|
|
6
6
|
*/
|
|
@@ -8,7 +8,7 @@ export interface CTableDataCellProps extends Omit<TdHTMLAttributes<HTMLTableData
|
|
|
8
8
|
/**
|
|
9
9
|
* Set the vertical aligment.
|
|
10
10
|
*/
|
|
11
|
-
align?: 'bottom' | 'middle' | 'top';
|
|
11
|
+
align?: 'bottom' | 'middle' | 'top' | string;
|
|
12
12
|
/**
|
|
13
13
|
* A string of all className you want applied to the component.
|
|
14
14
|
*/
|
|
@@ -19,5 +19,9 @@ export interface CTableDataCellProps extends Omit<TdHTMLAttributes<HTMLTableData
|
|
|
19
19
|
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
20
20
|
*/
|
|
21
21
|
color?: Colors;
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
colSpan?: number;
|
|
22
26
|
}
|
|
23
|
-
export declare const CTableDataCell: React.ForwardRefExoticComponent<CTableDataCellProps & React.RefAttributes<
|
|
27
|
+
export declare const CTableDataCell: React.ForwardRefExoticComponent<CTableDataCellProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ThHTMLAttributes } from 'react';
|
|
2
2
|
import { Colors } from '../Types';
|
|
3
|
-
export interface CTableHeaderCellProps extends ThHTMLAttributes<
|
|
3
|
+
export interface CTableHeaderCellProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A string of all className you want applied to the component.
|
|
6
6
|
*/
|
|
@@ -12,4 +12,4 @@ export interface CTableHeaderCellProps extends ThHTMLAttributes<HTMLTableHeaderC
|
|
|
12
12
|
*/
|
|
13
13
|
color?: Colors;
|
|
14
14
|
}
|
|
15
|
-
export declare const CTableHeaderCell: React.ForwardRefExoticComponent<CTableHeaderCellProps & React.RefAttributes<
|
|
15
|
+
export declare const CTableHeaderCell: React.ForwardRefExoticComponent<CTableHeaderCellProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
export interface CTableResponsiveWrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: any;
|
|
4
|
+
/**
|
|
5
|
+
* Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to.
|
|
6
|
+
*/
|
|
7
|
+
responsive?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
8
|
+
}
|
|
9
|
+
export declare const CTableResponsiveWrapper: FC<CTableResponsiveWrapperProps>;
|
|
@@ -8,7 +8,7 @@ export interface CTableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
|
8
8
|
/**
|
|
9
9
|
* Set the vertical aligment.
|
|
10
10
|
*/
|
|
11
|
-
align?: 'bottom' | 'middle' | 'top';
|
|
11
|
+
align?: 'bottom' | 'middle' | 'top' | string;
|
|
12
12
|
/**
|
|
13
13
|
* A string of all className you want applied to the component.
|
|
14
14
|
*/
|