@coreui/react-pro 4.12.2 → 4.12.4
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/index.es.js +851 -833
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +851 -833
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/components/date-range-picker/CDateRangePicker.tsx +2 -2
- package/src/components/nav/CNavGroup.tsx +9 -2
- package/src/components/time-picker/CTimePicker.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreui/react-pro",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.4",
|
|
4
4
|
"description": "UI Components Library for React.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,33 +38,33 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@coreui/icons": "^3.0.1",
|
|
41
|
-
"@coreui/icons-react": "^2.1
|
|
41
|
+
"@coreui/icons-react": "^2.2.1",
|
|
42
42
|
"@popperjs/core": "^2.11.8",
|
|
43
|
-
"@rollup/plugin-commonjs": "^25.0.
|
|
43
|
+
"@rollup/plugin-commonjs": "^25.0.3",
|
|
44
44
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
45
45
|
"@rollup/plugin-typescript": "^11.1.2",
|
|
46
|
-
"@testing-library/jest-dom": "^5.
|
|
46
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
47
47
|
"@testing-library/react": "^14.0.0",
|
|
48
|
-
"@types/react": "18.2.
|
|
49
|
-
"@types/react-dom": "^18.2.
|
|
48
|
+
"@types/react": "18.2.18",
|
|
49
|
+
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.6",
|
|
51
51
|
"classnames": "^2.3.2",
|
|
52
52
|
"date-fns": "^2.30.0",
|
|
53
|
-
"jest": "^29.6.
|
|
54
|
-
"jest-environment-jsdom": "^29.6.
|
|
53
|
+
"jest": "^29.6.2",
|
|
54
|
+
"jest-environment-jsdom": "^29.6.2",
|
|
55
55
|
"prop-types": "^15.8.1",
|
|
56
56
|
"react": "^18.2.0",
|
|
57
57
|
"react-device-detect": "^2.2.3",
|
|
58
58
|
"react-dom": "^18.2.0",
|
|
59
59
|
"react-popper": "^2.3.0",
|
|
60
60
|
"react-transition-group": "^4.4.5",
|
|
61
|
-
"rollup": "^3.
|
|
61
|
+
"rollup": "^3.27.1",
|
|
62
62
|
"ts-jest": "^29.1.1",
|
|
63
|
-
"tslib": "^2.6.
|
|
63
|
+
"tslib": "^2.6.1",
|
|
64
64
|
"typescript": "^4.9.5"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@coreui/coreui-pro": ">=4.
|
|
67
|
+
"@coreui/coreui-pro": ">=4.6.1",
|
|
68
68
|
"react": ">=17",
|
|
69
69
|
"react-dom": ">=17"
|
|
70
70
|
}
|
|
@@ -262,11 +262,11 @@ export const CDateRangePicker = forwardRef<HTMLDivElement | HTMLLIElement, CDate
|
|
|
262
262
|
)
|
|
263
263
|
const [inputStartHoverValue, setInputStartHoverValue] = useState<Date | null>(null)
|
|
264
264
|
const [inputEndHoverValue, setInputEndHoverValue] = useState<Date | null>(null)
|
|
265
|
-
const [isValid, setIsValid] = useState(valid
|
|
265
|
+
const [isValid, setIsValid] = useState(valid ?? (invalid === true ? false : undefined))
|
|
266
266
|
const [selectEndDate, setSelectEndDate] = useState(false)
|
|
267
267
|
|
|
268
268
|
useEffect(() => {
|
|
269
|
-
setIsValid(valid
|
|
269
|
+
setIsValid(valid ?? (invalid === true ? false : undefined))
|
|
270
270
|
}, [valid, invalid])
|
|
271
271
|
|
|
272
272
|
useEffect(() => {
|
|
@@ -36,6 +36,13 @@ export interface CNavGroupProps {
|
|
|
36
36
|
idx?: string
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const isInVisibleGroup = (el1: string, el2: string) => {
|
|
40
|
+
const array1 = el1.toString().split('.')
|
|
41
|
+
const array2 = el2.toString().split('.')
|
|
42
|
+
|
|
43
|
+
return array2.every((item, index) => item === array1[index])
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
export const CNavGroup = forwardRef<HTMLLIElement, CNavGroupProps>(
|
|
40
47
|
({ children, className, compact, idx, toggler, visible, ...rest }, ref) => {
|
|
41
48
|
const [height, setHeight] = useState<number | string>()
|
|
@@ -45,12 +52,12 @@ export const CNavGroup = forwardRef<HTMLLIElement, CNavGroupProps>(
|
|
|
45
52
|
|
|
46
53
|
const [_visible, setVisible] = useState(
|
|
47
54
|
Boolean(
|
|
48
|
-
visible || (idx && visibleGroup && visibleGroup
|
|
55
|
+
visible || (idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)),
|
|
49
56
|
),
|
|
50
57
|
)
|
|
51
58
|
|
|
52
59
|
useEffect(() => {
|
|
53
|
-
setVisible(Boolean(idx && visibleGroup && visibleGroup
|
|
60
|
+
setVisible(Boolean(idx && visibleGroup && isInVisibleGroup(visibleGroup, idx)))
|
|
54
61
|
}, [visibleGroup])
|
|
55
62
|
|
|
56
63
|
const handleTogglerOnCLick = (event: React.MouseEvent<HTMLElement>) => {
|
|
@@ -171,7 +171,7 @@ export const CTimePicker = forwardRef<HTMLDivElement | HTMLLIElement, CTimePicke
|
|
|
171
171
|
|
|
172
172
|
const [date, setDate] = useState<Date | null>(convertTimeToDate(time))
|
|
173
173
|
const [initialDate, setInitialDate] = useState<Date | null>(null)
|
|
174
|
-
const [isValid, setIsValid] = useState(valid
|
|
174
|
+
const [isValid, setIsValid] = useState(valid ?? (invalid === true ? false : undefined))
|
|
175
175
|
const [_ampm, setAmPm] = useState<'am' | 'pm'>(date ? getAmPm(new Date(date), locale) : 'am')
|
|
176
176
|
const [_visible, setVisible] = useState(visible)
|
|
177
177
|
|
|
@@ -187,7 +187,7 @@ export const CTimePicker = forwardRef<HTMLDivElement | HTMLLIElement, CTimePicke
|
|
|
187
187
|
}, [time])
|
|
188
188
|
|
|
189
189
|
useEffect(() => {
|
|
190
|
-
setIsValid(valid
|
|
190
|
+
setIsValid(valid ?? (invalid === true ? false : undefined))
|
|
191
191
|
}, [valid, invalid])
|
|
192
192
|
|
|
193
193
|
useEffect(() => {
|