@coreui/vue-pro 4.7.0-alpha.0 → 4.7.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/components/element-cover/CElementCover.d.ts +14 -11
- package/dist/components/smart-table/CSmartTable.d.ts +19 -8
- package/dist/components/smart-table/CSmartTableHead.d.ts +3 -3
- package/dist/components/smart-table/CSmartTableInterface.d.ts +4 -0
- package/dist/components/table/CTable.d.ts +4 -10
- package/dist/index.es.js +287 -3553
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +288 -3554
- package/dist/index.js.map +1 -1
- package/dist/utils/calendar.d.ts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/isInViewport.d.ts +2 -0
- package/package.json +10 -14
- package/src/components/carousel/CCarousel.ts +3 -3
- package/src/components/date-range-picker/CDateRangePicker.ts +2 -0
- package/src/components/element-cover/CElementCover.ts +55 -40
- package/src/components/form/CFormControlWrapper.ts +36 -22
- package/src/components/sidebar/CSidebar.ts +5 -5
- package/src/components/smart-table/CSmartTable.ts +46 -6
- package/src/components/smart-table/CSmartTableHead.ts +1 -1
- package/src/components/smart-table/CSmartTableInterface.ts +6 -0
- package/src/components/table/CTable.ts +45 -42
- package/src/components/time-picker/CTimePicker.ts +4 -3
- package/src/utils/calendar.ts +2 -2
- package/src/utils/index.ts +2 -2
- package/src/utils/isInViewport.ts +11 -0
- package/src/utils/time.ts +8 -10
- package/src/utils/isVisible.ts +0 -11
package/src/utils/calendar.ts
CHANGED
|
@@ -164,7 +164,7 @@ export const getMonthDetails = (year: number, month: number, firstDayOfWeek: num
|
|
|
164
164
|
export const isDisableDateInRange = (
|
|
165
165
|
startDate?: Date | null,
|
|
166
166
|
endDate?: Date | null,
|
|
167
|
-
dates?: Date[] | Date[][],
|
|
167
|
+
dates?: Date[] | Date[][] | (Date | Date[])[],
|
|
168
168
|
) => {
|
|
169
169
|
if (startDate && endDate) {
|
|
170
170
|
const date = new Date(startDate)
|
|
@@ -188,7 +188,7 @@ export const isDateDisabled = (
|
|
|
188
188
|
date: Date,
|
|
189
189
|
min?: Date | null,
|
|
190
190
|
max?: Date | null,
|
|
191
|
-
dates?: Date[] | Date[][],
|
|
191
|
+
dates?: Date[] | Date[][] | (Date | Date[])[],
|
|
192
192
|
) => {
|
|
193
193
|
let disabled
|
|
194
194
|
if (dates) {
|
package/src/utils/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import getNextSibling from './getNextSibling'
|
|
2
2
|
import getPreviousSibling from './getPreviousSibling'
|
|
3
|
-
import
|
|
3
|
+
import isInViewport from './isInViewport'
|
|
4
4
|
|
|
5
|
-
export { getNextSibling, getPreviousSibling,
|
|
5
|
+
export { getNextSibling, getPreviousSibling, isInViewport }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const isInViewport = (element: HTMLElement) => {
|
|
2
|
+
const rect = element.getBoundingClientRect()
|
|
3
|
+
return (
|
|
4
|
+
Math.floor(rect.top) >= 0 &&
|
|
5
|
+
Math.floor(rect.left) >= 0 &&
|
|
6
|
+
Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
7
|
+
Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth)
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default isInViewport
|
package/src/utils/time.ts
CHANGED
|
@@ -27,10 +27,12 @@ export const getAmPm = (date: Date, locale: string) => {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const getListOfHours = (locale: string, ampm: 'auto' | boolean = 'auto') =>
|
|
30
|
-
Array.from({ length: (ampm === 'auto' && isAmPm(locale)) || ampm ? 12 : 24 }, (_, i) => {
|
|
30
|
+
Array.from({ length: (ampm === 'auto' && isAmPm(locale)) || ampm === true ? 12 : 24 }, (_, i) => {
|
|
31
31
|
return {
|
|
32
|
-
value: (ampm === 'auto' && isAmPm(locale)) || ampm ? i + 1 : i,
|
|
33
|
-
label: ((ampm === 'auto' && isAmPm(locale)) || ampm ? i + 1 : i).toLocaleString(
|
|
32
|
+
value: (ampm === 'auto' && isAmPm(locale)) || ampm === true ? i + 1 : i,
|
|
33
|
+
label: ((ampm === 'auto' && isAmPm(locale)) || ampm === true ? i + 1 : i).toLocaleString(
|
|
34
|
+
locale,
|
|
35
|
+
),
|
|
34
36
|
}
|
|
35
37
|
})
|
|
36
38
|
|
|
@@ -42,12 +44,10 @@ export const getListOfMinutes = (locale: string, valueAsString = false) =>
|
|
|
42
44
|
value: valueAsString ? i.toString() : i,
|
|
43
45
|
label: d
|
|
44
46
|
.toLocaleTimeString(locale, {
|
|
45
|
-
hour: '2-digit',
|
|
46
|
-
hour12: false,
|
|
47
47
|
minute: '2-digit',
|
|
48
48
|
second: '2-digit',
|
|
49
49
|
})
|
|
50
|
-
.split(
|
|
50
|
+
.split(/[^A-Za-z0-9]/)[0],
|
|
51
51
|
}
|
|
52
52
|
})
|
|
53
53
|
|
|
@@ -59,12 +59,10 @@ export const getListOfSeconds = (locale: string, valueAsString = false) =>
|
|
|
59
59
|
value: valueAsString ? i.toString() : i,
|
|
60
60
|
label: d
|
|
61
61
|
.toLocaleTimeString(locale, {
|
|
62
|
-
hour: '2-digit',
|
|
63
|
-
hour12: false,
|
|
64
62
|
minute: '2-digit',
|
|
65
63
|
second: '2-digit',
|
|
66
64
|
})
|
|
67
|
-
.split(
|
|
65
|
+
.split(/[^A-Za-z0-9]/)[1],
|
|
68
66
|
}
|
|
69
67
|
})
|
|
70
68
|
|
|
@@ -74,7 +72,7 @@ export const getSelectedHour = (
|
|
|
74
72
|
ampm: 'auto' | boolean = 'auto',
|
|
75
73
|
) =>
|
|
76
74
|
date
|
|
77
|
-
? (ampm === 'auto' && isAmPm(locale)) || ampm
|
|
75
|
+
? (ampm === 'auto' && isAmPm(locale)) || ampm === true
|
|
78
76
|
? convert24hTo12h(date.getHours())
|
|
79
77
|
: date.getHours()
|
|
80
78
|
: ''
|
package/src/utils/isVisible.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const isVisible = (element: HTMLElement) => {
|
|
2
|
-
const rect = element.getBoundingClientRect()
|
|
3
|
-
return (
|
|
4
|
-
rect.top >= 0 &&
|
|
5
|
-
rect.left >= 0 &&
|
|
6
|
-
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
7
|
-
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
|
|
8
|
-
)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default isVisible
|