@coreui/react-pro 5.0.0-beta.1 → 5.0.0-rc.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/cjs/components/button/CButton.js +1 -1
- package/dist/cjs/components/button/CButton.js.map +1 -1
- package/dist/cjs/components/calendar/CCalendar.d.ts +3 -3
- package/dist/cjs/components/carousel/CCarousel.js +1 -1
- package/dist/cjs/components/date-range-picker/CDateRangePicker.d.ts +3 -3
- package/dist/cjs/components/dropdown/CDropdown.js +3 -1
- package/dist/cjs/components/dropdown/CDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/cjs/components/dropdown/utils.js.map +1 -1
- package/dist/cjs/components/picker/CPicker.d.ts +2 -2
- package/dist/cjs/components/picker/CPicker.js +1 -1
- package/dist/cjs/components/picker/CPicker.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTable.d.ts +0 -1
- package/dist/cjs/components/smart-table/CSmartTable.js +5 -6
- package/dist/cjs/components/smart-table/CSmartTable.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTableBody.js +3 -3
- package/dist/cjs/components/smart-table/CSmartTableBody.js.map +1 -1
- package/dist/cjs/components/smart-table/consts.d.ts +1 -0
- package/dist/cjs/components/smart-table/consts.js +6 -0
- package/dist/cjs/components/smart-table/consts.js.map +1 -0
- package/dist/cjs/components/toast/CToaster.js +1 -1
- package/dist/cjs/components/toast/CToaster.js.map +1 -1
- package/dist/cjs/components/widgets/CWidgetStatsA.js.map +1 -1
- package/dist/cjs/components/widgets/CWidgetStatsC.js +2 -1
- package/dist/cjs/components/widgets/CWidgetStatsC.js.map +1 -1
- package/dist/esm/components/button/CButton.js +1 -1
- package/dist/esm/components/button/CButton.js.map +1 -1
- package/dist/esm/components/calendar/CCalendar.d.ts +3 -3
- package/dist/esm/components/carousel/CCarousel.js +1 -1
- package/dist/esm/components/date-range-picker/CDateRangePicker.d.ts +3 -3
- package/dist/esm/components/dropdown/CDropdown.js +3 -1
- package/dist/esm/components/dropdown/CDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/esm/components/dropdown/utils.js.map +1 -1
- package/dist/esm/components/picker/CPicker.d.ts +2 -2
- package/dist/esm/components/picker/CPicker.js +1 -1
- package/dist/esm/components/picker/CPicker.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTable.d.ts +0 -1
- package/dist/esm/components/smart-table/CSmartTable.js +2 -2
- package/dist/esm/components/smart-table/CSmartTable.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTableBody.js +1 -1
- package/dist/esm/components/smart-table/consts.d.ts +1 -0
- package/dist/esm/components/smart-table/consts.js +4 -0
- package/dist/esm/components/smart-table/consts.js.map +1 -0
- package/dist/esm/components/toast/CToaster.js +1 -1
- package/dist/esm/components/toast/CToaster.js.map +1 -1
- package/dist/esm/components/widgets/CWidgetStatsA.js.map +1 -1
- package/dist/esm/components/widgets/CWidgetStatsC.js +2 -1
- package/dist/esm/components/widgets/CWidgetStatsC.js.map +1 -1
- package/package.json +12 -16
- package/src/components/button/CButton.tsx +1 -1
- package/src/components/calendar/CCalendar.tsx +3 -3
- package/src/components/carousel/CCarousel.tsx +1 -1
- package/src/components/close-button/CCloseButton.tsx +1 -1
- package/src/components/date-range-picker/CDateRangePicker.tsx +3 -3
- package/src/components/dropdown/CDropdown.tsx +8 -2
- package/src/components/dropdown/CDropdownMenu.tsx +0 -1
- package/src/components/dropdown/CDropdownToggle.tsx +2 -2
- package/src/components/dropdown/__tests__/CDropdown.spec.tsx +12 -12
- package/src/components/dropdown/utils.ts +5 -4
- package/src/components/picker/CPicker.tsx +3 -3
- package/src/components/sidebar/__tests__/__snapshots__/CSidebar.spec.tsx.snap +1 -1
- package/src/components/smart-table/CSmartTable.tsx +1 -2
- package/src/components/smart-table/CSmartTableBody.tsx +1 -1
- package/src/components/smart-table/consts.ts +1 -0
- package/src/components/toast/CToaster.tsx +1 -1
- package/src/components/toast/__tests__/__snapshots__/CToaster.spec.tsx.snap +2 -2
- package/src/components/tooltip/__tests__/CTooltip.spec.tsx +7 -12
- package/src/components/widgets/CWidgetStatsA.tsx +1 -4
- package/src/components/widgets/CWidgetStatsC.tsx +11 -1
- package/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +1 -3
- package/src/utils/getTransitionDurationFromElement.ts +1 -1
|
@@ -15,6 +15,7 @@ import { CSmartTableProps } from './CSmartTableInterface'
|
|
|
15
15
|
|
|
16
16
|
import { isObjectInArray } from '../../utils'
|
|
17
17
|
|
|
18
|
+
import { ITEM_INTERNAL_KEYS } from './consts'
|
|
18
19
|
import type { ColumnFilterValue, FooterItem, Item, SorterValue } from './types'
|
|
19
20
|
import {
|
|
20
21
|
filterColumns,
|
|
@@ -25,8 +26,6 @@ import {
|
|
|
25
26
|
sortItems,
|
|
26
27
|
} from './utils'
|
|
27
28
|
|
|
28
|
-
export const ITEM_INTERNAL_KEYS = ['_cellProps', '_props', '_selectable', '_selected']
|
|
29
|
-
|
|
30
29
|
export const CSmartTable = forwardRef<HTMLDivElement, CSmartTableProps>(
|
|
31
30
|
(
|
|
32
31
|
{
|
|
@@ -4,10 +4,10 @@ import PropTypes from 'prop-types'
|
|
|
4
4
|
import { CTableBody, CTableBodyProps } from '../table/CTableBody'
|
|
5
5
|
import { CFormCheck } from '../form'
|
|
6
6
|
import { CTableDataCell, CTableRow } from '../table'
|
|
7
|
-
import { ITEM_INTERNAL_KEYS } from './CSmartTable'
|
|
8
7
|
|
|
9
8
|
import { isObjectInArray } from '../../utils'
|
|
10
9
|
|
|
10
|
+
import { ITEM_INTERNAL_KEYS } from './consts'
|
|
11
11
|
import type { Column, Item, ScopedColumns } from './types'
|
|
12
12
|
import {
|
|
13
13
|
getClickedColumnName,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ITEM_INTERNAL_KEYS = ['_cellProps', '_props', '_selectable', '_selected']
|
|
@@ -57,7 +57,7 @@ export const CToaster = forwardRef<HTMLDivElement, CToasterProps>(
|
|
|
57
57
|
{toasts.length > 0 || children ? (
|
|
58
58
|
<div
|
|
59
59
|
className={classNames(
|
|
60
|
-
'toaster toast-container
|
|
60
|
+
'toaster toast-container',
|
|
61
61
|
{
|
|
62
62
|
'position-fixed': placement,
|
|
63
63
|
'top-0': placement && placement.includes('top'),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`CToaster customize 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
|
-
class="toaster toast-container
|
|
6
|
+
class="toaster toast-container bazinga"
|
|
7
7
|
/>
|
|
8
8
|
<button
|
|
9
9
|
class="btn btn-primary"
|
|
@@ -17,7 +17,7 @@ exports[`CToaster customize 1`] = `
|
|
|
17
17
|
exports[`loads and displays CToaster component 1`] = `
|
|
18
18
|
<div>
|
|
19
19
|
<div
|
|
20
|
-
class="toaster toast-container
|
|
20
|
+
class="toaster toast-container"
|
|
21
21
|
>
|
|
22
22
|
Test
|
|
23
23
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import ReactDOM from 'react-dom'
|
|
3
2
|
import { act } from 'react-dom/test-utils'
|
|
4
|
-
import { fireEvent } from '@testing-library/react'
|
|
3
|
+
import { fireEvent, render } from '@testing-library/react'
|
|
5
4
|
import '@testing-library/jest-dom'
|
|
6
5
|
import { CTooltip, CLink } from '../../../index'
|
|
7
6
|
|
|
@@ -18,24 +17,20 @@ afterEach(() => {
|
|
|
18
17
|
})
|
|
19
18
|
|
|
20
19
|
test('loads and displays CTooltip component', async () => {
|
|
21
|
-
|
|
20
|
+
const { container } = render(
|
|
22
21
|
<CTooltip content="content">
|
|
23
22
|
<CLink>Test</CLink>
|
|
24
23
|
</CTooltip>,
|
|
25
|
-
container,
|
|
26
24
|
)
|
|
27
25
|
expect(container).toMatchSnapshot()
|
|
28
26
|
})
|
|
29
27
|
|
|
30
28
|
test('CTooltip customize', async () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
container,
|
|
37
|
-
)
|
|
38
|
-
})
|
|
29
|
+
const { container } = render(
|
|
30
|
+
<CTooltip trigger="hover" placement="right" content="content">
|
|
31
|
+
<CLink className="link">Test</CLink>
|
|
32
|
+
</CTooltip>,
|
|
33
|
+
)
|
|
39
34
|
const link = document.querySelector('.link')
|
|
40
35
|
act(() => {
|
|
41
36
|
if (link !== null) {
|
|
@@ -40,10 +40,7 @@ export const CWidgetStatsA = forwardRef<HTMLDivElement, CWidgetStatsAProps>(
|
|
|
40
40
|
({ action, chart, className, color, title, value, ...rest }, ref) => {
|
|
41
41
|
return (
|
|
42
42
|
<CCard
|
|
43
|
-
className={classNames(
|
|
44
|
-
{ [`bg-${color}`]: color, 'text-white': color },
|
|
45
|
-
className,
|
|
46
|
-
)}
|
|
43
|
+
className={classNames({ [`bg-${color}`]: color, 'text-white': color }, className)}
|
|
47
44
|
{...rest}
|
|
48
45
|
ref={ref}
|
|
49
46
|
>
|
|
@@ -6,6 +6,7 @@ import { CProgress, CProgressProps } from '../progress/CProgress'
|
|
|
6
6
|
|
|
7
7
|
import { colorPropType } from '../../props'
|
|
8
8
|
import type { Colors } from '../../types'
|
|
9
|
+
import classNames from 'classnames'
|
|
9
10
|
|
|
10
11
|
export interface CWidgetStatsCProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
11
12
|
/**
|
|
@@ -53,7 +54,16 @@ export const CWidgetStatsC = forwardRef<HTMLDivElement, CWidgetStatsCProps>(
|
|
|
53
54
|
ref={ref}
|
|
54
55
|
>
|
|
55
56
|
<CCardBody>
|
|
56
|
-
{icon &&
|
|
57
|
+
{icon && (
|
|
58
|
+
<div
|
|
59
|
+
className={classNames(
|
|
60
|
+
'text-end mb-4',
|
|
61
|
+
inverse ? 'text-white text-opacity-75' : 'text-body-secondary',
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
{icon}
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
57
67
|
{value && <div className="fs-4 fw-semibold">{value}</div>}
|
|
58
68
|
{title && (
|
|
59
69
|
<div className={inverse ? 'text-white text-opacity-75' : 'text-body-secondary'}>
|
|
@@ -41,9 +41,7 @@ test('CWidgetStatsD customize', async () => {
|
|
|
41
41
|
expect(container.firstChild.lastChild.firstChild.firstChild).toHaveClass('fw-semibold')
|
|
42
42
|
expect(container.firstChild.lastChild.firstChild.firstChild).toHaveTextContent('89K')
|
|
43
43
|
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('text-uppercase')
|
|
44
|
-
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass(
|
|
45
|
-
'text-body-secondary',
|
|
46
|
-
)
|
|
44
|
+
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('text-body-secondary')
|
|
47
45
|
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('small')
|
|
48
46
|
expect(container.firstChild.lastChild.firstChild.lastChild).toHaveTextContent('friends')
|
|
49
47
|
}
|
|
@@ -21,4 +21,4 @@ const getTransitionDurationFromElement = (element: HTMLElement) => {
|
|
|
21
21
|
return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * 1000
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export default getTransitionDurationFromElement
|
|
24
|
+
export default getTransitionDurationFromElement
|