@coreui/react 4.0.1 → 4.0.2
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
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
Several quick start options are available:
|
|
45
45
|
|
|
46
|
-
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.0.
|
|
46
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.0.2.zip)
|
|
47
47
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
48
48
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
49
49
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
export interface CFormLabelProps extends
|
|
1
|
+
import React, { AllHTMLAttributes } from 'react';
|
|
2
|
+
export interface CFormLabelProps extends AllHTMLAttributes<HTMLLabelElement> {
|
|
3
3
|
/**
|
|
4
4
|
* A string of all className you want applied to the component.
|
|
5
5
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreui/react",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "UI Components Library for React.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-dom": "^17.0.2",
|
|
51
51
|
"react-popper": "^2.2.5",
|
|
52
52
|
"react-transition-group": "^4.4.2",
|
|
53
|
-
"rollup": "^2.
|
|
53
|
+
"rollup": "^2.60.0",
|
|
54
54
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
55
55
|
"typescript": "^4.4.4"
|
|
56
56
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { forwardRef,
|
|
1
|
+
import React, { forwardRef, AllHTMLAttributes } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
|
-
export interface CFormLabelProps extends
|
|
5
|
+
export interface CFormLabelProps extends AllHTMLAttributes<HTMLLabelElement> {
|
|
6
6
|
/**
|
|
7
7
|
* A string of all className you want applied to the component.
|
|
8
8
|
*/
|
|
@@ -15,3 +15,11 @@ test('CFormLabel customize className', async () => {
|
|
|
15
15
|
expect(container.firstChild).toHaveClass('form-label')
|
|
16
16
|
expect(container.firstChild).toHaveTextContent('Test')
|
|
17
17
|
})
|
|
18
|
+
|
|
19
|
+
test('CFormLabel customize htmlFor', async () => {
|
|
20
|
+
const { container } = render(<CFormLabel htmlFor="bazinga">Test</CFormLabel>)
|
|
21
|
+
expect(container).toMatchSnapshot()
|
|
22
|
+
expect(container.firstChild).toHaveAttribute('for', 'bazinga')
|
|
23
|
+
expect(container.firstChild).toHaveClass('form-label')
|
|
24
|
+
expect(container.firstChild).toHaveTextContent('Test')
|
|
25
|
+
})
|
|
@@ -10,6 +10,17 @@ exports[`CFormLabel customize className 1`] = `
|
|
|
10
10
|
</div>
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
|
+
exports[`CFormLabel customize htmlFor 1`] = `
|
|
14
|
+
<div>
|
|
15
|
+
<label
|
|
16
|
+
class="form-label"
|
|
17
|
+
for="bazinga"
|
|
18
|
+
>
|
|
19
|
+
Test
|
|
20
|
+
</label>
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
23
|
+
|
|
13
24
|
exports[`loads and displays CFormLabel component 1`] = `
|
|
14
25
|
<div>
|
|
15
26
|
<label
|