@coreui/react-pro 4.9.0-next.1 → 4.10.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.
Files changed (186) hide show
  1. package/README.md +1 -1
  2. package/dist/components/conditional-portal/CConditionalPortal.d.ts +12 -0
  3. package/dist/components/conditional-portal/index.d.ts +2 -0
  4. package/dist/components/date-range-picker/CDateRangePicker.d.ts +6 -0
  5. package/dist/components/form/CFormCheck.d.ts +7 -1
  6. package/dist/components/form/CFormSwitch.d.ts +6 -0
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/table/CTableResponsiveWrapper.d.ts +0 -1
  9. package/dist/components/time-picker/CTimePicker.d.ts +6 -0
  10. package/dist/index.es.js +507 -728
  11. package/dist/index.es.js.map +1 -1
  12. package/dist/index.js +506 -726
  13. package/dist/index.js.map +1 -1
  14. package/package.json +11 -6
  15. package/src/components/accordion/CAccordion.tsx +7 -3
  16. package/src/components/accordion/CAccordionBody.tsx +1 -2
  17. package/src/components/accordion/CAccordionButton.tsx +1 -3
  18. package/src/components/accordion/CAccordionHeader.tsx +1 -3
  19. package/src/components/accordion/CAccordionItem.tsx +2 -4
  20. package/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.tsx.snap +2 -2
  21. package/src/components/alert/CAlert.tsx +19 -27
  22. package/src/components/alert/CAlertHeading.tsx +1 -3
  23. package/src/components/alert/CAlertLink.tsx +1 -3
  24. package/src/components/alert/__tests__/__snapshots__/CAlert.spec.tsx.snap +1 -1
  25. package/src/components/avatar/CAvatar.tsx +14 -11
  26. package/src/components/backdrop/CBackdrop.tsx +9 -12
  27. package/src/components/badge/CBadge.tsx +19 -17
  28. package/src/components/breadcrumb/CBreadcrumb.tsx +1 -2
  29. package/src/components/breadcrumb/CBreadcrumbItem.tsx +12 -8
  30. package/src/components/button/CButton.tsx +7 -9
  31. package/src/components/button-group/CButtonGroup.tsx +9 -7
  32. package/src/components/button-group/CButtonToolbar.tsx +1 -3
  33. package/src/components/calendar/utils.ts +7 -9
  34. package/src/components/callout/CCallout.tsx +11 -9
  35. package/src/components/card/CCard.tsx +12 -10
  36. package/src/components/card/CCardBody.tsx +1 -3
  37. package/src/components/card/CCardFooter.tsx +1 -3
  38. package/src/components/card/CCardGroup.tsx +1 -3
  39. package/src/components/card/CCardHeader.tsx +1 -3
  40. package/src/components/card/CCardImage.tsx +5 -3
  41. package/src/components/card/CCardImageOverlay.tsx +1 -3
  42. package/src/components/card/CCardLink.tsx +1 -3
  43. package/src/components/card/CCardSubtitle.tsx +1 -3
  44. package/src/components/card/CCardText.tsx +1 -3
  45. package/src/components/card/CCardTitle.tsx +1 -3
  46. package/src/components/carousel/CCarousel.tsx +8 -8
  47. package/src/components/carousel/CCarouselCaption.tsx +1 -3
  48. package/src/components/carousel/CCarouselItem.tsx +11 -9
  49. package/src/components/close-button/CCloseButton.tsx +9 -10
  50. package/src/components/collapse/CCollapse.tsx +8 -20
  51. package/src/components/collapse/__tests__/CCollapse.spec.tsx +2 -3
  52. package/src/components/conditional-portal/CConditionalPortal.tsx +29 -0
  53. package/src/components/conditional-portal/index.ts +3 -0
  54. package/src/components/date-range-picker/CDateRangePicker.tsx +19 -11
  55. package/src/components/date-range-picker/utils.ts +2 -2
  56. package/src/components/dropdown/CDropdown.tsx +35 -30
  57. package/src/components/dropdown/CDropdownDivider.tsx +1 -3
  58. package/src/components/dropdown/CDropdownHeader.tsx +1 -3
  59. package/src/components/dropdown/CDropdownItem.tsx +6 -3
  60. package/src/components/dropdown/CDropdownItemPlain.tsx +1 -3
  61. package/src/components/dropdown/CDropdownMenu.tsx +27 -31
  62. package/src/components/dropdown/CDropdownToggle.tsx +29 -23
  63. package/src/components/dropdown/__tests__/CDropdown.spec.tsx +2 -4
  64. package/src/components/dropdown/__tests__/__snapshots__/CDropdown.spec.tsx.snap +1 -1
  65. package/src/components/footer/CFooter.tsx +5 -3
  66. package/src/components/form/CForm.tsx +5 -2
  67. package/src/components/form/CFormCheck.tsx +87 -63
  68. package/src/components/form/CFormControlWrapper.tsx +3 -3
  69. package/src/components/form/CFormFeedback.tsx +11 -8
  70. package/src/components/form/CFormFloating.tsx +1 -2
  71. package/src/components/form/CFormInput.tsx +10 -12
  72. package/src/components/form/CFormLabel.tsx +1 -2
  73. package/src/components/form/CFormRange.tsx +1 -2
  74. package/src/components/form/CFormSelect.tsx +15 -10
  75. package/src/components/form/CFormSwitch.tsx +31 -20
  76. package/src/components/form/CFormText.tsx +1 -2
  77. package/src/components/form/CFormTextarea.tsx +13 -9
  78. package/src/components/form/CInputGroup.tsx +11 -8
  79. package/src/components/form/CInputGroupText.tsx +1 -2
  80. package/src/components/form/__tests__/CFormRange.spec.tsx +1 -1
  81. package/src/components/form/__tests__/__snapshots__/CForm.spec.tsx.snap +2 -6
  82. package/src/components/form/__tests__/__snapshots__/CFormRange.spec.tsx.snap +2 -2
  83. package/src/components/grid/CCol.tsx +8 -6
  84. package/src/components/grid/CContainer.tsx +8 -6
  85. package/src/components/grid/CRow.tsx +4 -3
  86. package/src/components/header/CHeader.tsx +12 -13
  87. package/src/components/header/CHeaderBrand.tsx +1 -3
  88. package/src/components/header/CHeaderBrand.tsx~HEAD +1 -3
  89. package/src/components/header/CHeaderDivider.tsx +1 -3
  90. package/src/components/header/CHeaderNav.tsx +6 -3
  91. package/src/components/header/CHeaderText.tsx +1 -3
  92. package/src/components/header/CHeaderToggler.tsx +2 -4
  93. package/src/components/image/CImage.tsx +17 -10
  94. package/src/components/image/__tests__/__snapshots__/CImage.spec.tsx.snap +1 -3
  95. package/src/components/index.ts +1 -0
  96. package/src/components/link/CLink.tsx +2 -4
  97. package/src/components/list-group/CListGroup.tsx +11 -10
  98. package/src/components/list-group/CListGroupItem.tsx +13 -12
  99. package/src/components/loading-button/CLoadingButton.tsx +1 -3
  100. package/src/components/modal/CModal.tsx +55 -70
  101. package/src/components/modal/CModalBody.tsx +1 -3
  102. package/src/components/modal/CModalContent.tsx +1 -3
  103. package/src/components/modal/CModalDialog.tsx +16 -14
  104. package/src/components/modal/CModalFooter.tsx +1 -3
  105. package/src/components/modal/CModalHeader.tsx +1 -2
  106. package/src/components/modal/CModalTitle.tsx +1 -3
  107. package/src/components/modal/__tests__/CModal.spec.tsx +19 -20
  108. package/src/components/multi-select/CMultiSelect.tsx +19 -19
  109. package/src/components/multi-select/utils.ts +3 -3
  110. package/src/components/nav/CNav.tsx +13 -10
  111. package/src/components/nav/CNavGroup.tsx +1 -3
  112. package/src/components/nav/CNavGroupItems.tsx +1 -2
  113. package/src/components/nav/CNavItem.tsx +8 -10
  114. package/src/components/nav/CNavLink.tsx +1 -2
  115. package/src/components/nav/CNavTitle.tsx +1 -2
  116. package/src/components/navbar/CNavbar.tsx +21 -22
  117. package/src/components/navbar/CNavbarBrand.tsx +2 -3
  118. package/src/components/navbar/CNavbarNav.tsx +6 -3
  119. package/src/components/navbar/CNavbarText.tsx +1 -3
  120. package/src/components/navbar/CNavbarToggler.tsx +2 -4
  121. package/src/components/offcanvas/COffcanvas.tsx +39 -66
  122. package/src/components/offcanvas/COffcanvasBody.tsx +1 -3
  123. package/src/components/offcanvas/COffcanvasHeader.tsx +1 -3
  124. package/src/components/offcanvas/COffcanvasTitle.tsx +1 -3
  125. package/src/components/offcanvas/__tests__/COffcanvas.spec.tsx +7 -2
  126. package/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.tsx.snap +9 -4
  127. package/src/components/pagination/CPagination.tsx +12 -9
  128. package/src/components/pagination/CPaginationItem.tsx +12 -11
  129. package/src/components/pagination/__tests__/CPagination.spec.tsx +3 -3
  130. package/src/components/pagination/__tests__/CPaginationItem.spec.tsx +3 -3
  131. package/src/components/picker/CPicker.tsx +6 -6
  132. package/src/components/placeholder/CPlaceholder.tsx +13 -11
  133. package/src/components/popover/CPopover.tsx +22 -33
  134. package/src/components/progress/CProgress.tsx +12 -10
  135. package/src/components/progress/CProgressBar.tsx +9 -11
  136. package/src/components/sidebar/CSidebar.tsx +20 -18
  137. package/src/components/sidebar/CSidebarBrand.tsx +1 -2
  138. package/src/components/sidebar/CSidebarFooter.tsx +1 -2
  139. package/src/components/sidebar/CSidebarHeader.tsx +1 -2
  140. package/src/components/sidebar/CSidebarNav.tsx +2 -2
  141. package/src/components/sidebar/CSidebarToggler.tsx +1 -2
  142. package/src/components/smart-pagination/CSmartPagination.tsx +22 -20
  143. package/src/components/smart-table/CSmartTable.tsx +4 -8
  144. package/src/components/smart-table/utils.ts +3 -4
  145. package/src/components/spinner/CSpinner.tsx +11 -8
  146. package/src/components/table/CTable.tsx +20 -18
  147. package/src/components/table/CTableBody.tsx +12 -8
  148. package/src/components/table/CTableDataCell.tsx +14 -10
  149. package/src/components/table/CTableFoot.tsx +12 -8
  150. package/src/components/table/CTableHead.tsx +12 -8
  151. package/src/components/table/CTableHeaderCell.tsx +12 -8
  152. package/src/components/table/CTableResponsiveWrapper.tsx +2 -3
  153. package/src/components/table/CTableRow.tsx +14 -10
  154. package/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap +1 -5
  155. package/src/components/table/utils.ts +2 -7
  156. package/src/components/tabs/CTabContent.tsx +1 -2
  157. package/src/components/tabs/CTabPane.tsx +17 -20
  158. package/src/components/tabs/__tests__/CTabPane.spec.tsx +2 -5
  159. package/src/components/tabs/__tests__/__snapshots__/CTabPane.spec.tsx.snap +1 -1
  160. package/src/components/time-picker/CTimePicker.tsx +21 -14
  161. package/src/components/toast/CToast.tsx +29 -42
  162. package/src/components/toast/CToastBody.tsx +1 -2
  163. package/src/components/toast/CToastClose.tsx +3 -1
  164. package/src/components/toast/CToastHeader.tsx +1 -2
  165. package/src/components/toast/CToaster.tsx +26 -26
  166. package/src/components/toast/__tests__/CToast.spec.tsx +2 -1
  167. package/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap +1 -66
  168. package/src/components/tooltip/CTooltip.tsx +21 -32
  169. package/src/components/virtual-scroller/CVirtualScroller.tsx +4 -6
  170. package/src/components/widgets/CWidgetStatsA.tsx +8 -6
  171. package/src/components/widgets/CWidgetStatsD.tsx +9 -10
  172. package/src/components/widgets/CWidgetStatsE.tsx +1 -3
  173. package/src/components/widgets/CWidgetStatsF.tsx +1 -4
  174. package/dist/components/Types.d.ts +0 -14
  175. package/dist/components/multi-select/CMultiSelectCleaner.d.ts +0 -2
  176. package/dist/components/multi-select/CMultiSelectSearchInput.d.ts +0 -5
  177. package/dist/components/pagination/CSmartPagination.d.ts +0 -80
  178. package/dist/components/time-picker/CTimePicker copy.d.ts +0 -46
  179. package/dist/utils/calendar.d.ts +0 -23
  180. package/dist/utils/getNextSibling.d.ts +0 -2
  181. package/dist/utils/getPreviousSibling.d.ts +0 -2
  182. package/dist/utils/hooks/index.d.ts +0 -3
  183. package/dist/utils/hooks/useForkedRef.d.ts +0 -7
  184. package/dist/utils/hooks/useStateWithCallback.d.ts +0 -2
  185. package/dist/utils/isVisible.d.ts +0 -2
  186. package/dist/utils/time.d.ts +0 -21
@@ -80,16 +80,6 @@ export const CTooltip: FC<CTooltipProps> = ({
80
80
  setVisible(visible)
81
81
  }, [visible])
82
82
 
83
- const getTransitionClass = (state: string) => {
84
- return state === 'entering'
85
- ? 'fade'
86
- : state === 'entered'
87
- ? 'fade show'
88
- : state === 'exiting'
89
- ? 'fade'
90
- : 'fade'
91
- }
92
-
93
83
  return (
94
84
  <>
95
85
  {React.cloneElement(children as React.ReactElement<any>, {
@@ -120,28 +110,27 @@ export const CTooltip: FC<CTooltipProps> = ({
120
110
  }}
121
111
  unmountOnExit
122
112
  >
123
- {(state) => {
124
- const transitionClass = getTransitionClass(state)
125
- return (
126
- <div
127
- className={classNames(
128
- `tooltip bs-tooltip-${
129
- placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement
130
- }`,
131
- className,
132
- transitionClass,
133
- )}
134
- ref={setPopperElement}
135
- role="tooltip"
136
- style={styles.popper}
137
- {...attributes.popper}
138
- {...rest}
139
- >
140
- <div className="tooltip-arrow" style={styles.arrow} ref={setArrowElement}></div>
141
- <div className="tooltip-inner">{content}</div>
142
- </div>
143
- )
144
- }}
113
+ {(state) => (
114
+ <div
115
+ className={classNames(
116
+ 'tooltip',
117
+ `bs-popover-${placement.replace('left', 'start').replace('right', 'end')}`,
118
+ 'fade',
119
+ {
120
+ show: state === 'entered',
121
+ },
122
+ className,
123
+ )}
124
+ ref={setPopperElement}
125
+ role="tooltip"
126
+ style={styles.popper}
127
+ {...attributes.popper}
128
+ {...rest}
129
+ >
130
+ <div className="tooltip-arrow" style={styles.arrow} ref={setArrowElement}></div>
131
+ <div className="tooltip-inner">{content}</div>
132
+ </div>
133
+ )}
145
134
  </Transition>,
146
135
  document.body,
147
136
  )}
@@ -39,7 +39,7 @@ export const CVirtualScroller = forwardRef<HTMLDivElement, CVirtualScrollerProps
39
39
  virtualScrollRef.current && virtualScrollRef.current.scrollTop
40
40
 
41
41
  virtualScrollRef.current &&
42
- setViewportPadding(parseFloat(getComputedStyle(virtualScrollRef.current).paddingTop))
42
+ setViewportPadding(Number.parseFloat(getComputedStyle(virtualScrollRef.current).paddingTop))
43
43
  })
44
44
 
45
45
  useEffect(() => {
@@ -65,11 +65,9 @@ export const CVirtualScroller = forwardRef<HTMLDivElement, CVirtualScrollerProps
65
65
  onScroll && onScroll(_currentItemIndex)
66
66
  }
67
67
 
68
- const _className = classNames('virtual-scroller', className)
69
-
70
68
  return (
71
69
  <div
72
- className={_className}
70
+ className={classNames('virtual-scroller', className)}
73
71
  onScroll={(event: UIEvent<HTMLDivElement>) =>
74
72
  handleScroll((event.target as HTMLDivElement).scrollTop)
75
73
  }
@@ -108,8 +106,8 @@ export const CVirtualScroller = forwardRef<HTMLDivElement, CVirtualScrollerProps
108
106
  node.offsetHeight &&
109
107
  setItemHeight(
110
108
  node.offsetHeight +
111
- parseFloat(getComputedStyle(node).marginTop) +
112
- parseFloat(getComputedStyle(node).marginBottom),
109
+ Number.parseFloat(getComputedStyle(node).marginTop) +
110
+ Number.parseFloat(getComputedStyle(node).marginBottom),
113
111
  ),
114
112
  })
115
113
  }
@@ -38,13 +38,15 @@ export interface CWidgetStatsAProps extends Omit<HTMLAttributes<HTMLDivElement>,
38
38
 
39
39
  export const CWidgetStatsA = forwardRef<HTMLDivElement, CWidgetStatsAProps>(
40
40
  ({ action, chart, className, color, title, value, ...rest }, ref) => {
41
- const _className = classNames(
42
- { [`bg-${color}`]: color, 'text-high-emphasis-inverse': color },
43
- className,
44
- )
45
-
46
41
  return (
47
- <CCard className={_className} {...rest} ref={ref}>
42
+ <CCard
43
+ className={classNames(
44
+ { [`bg-${color}`]: color, 'text-high-emphasis-inverse': color },
45
+ className,
46
+ )}
47
+ {...rest}
48
+ ref={ref}
49
+ >
48
50
  <CCardBody className="pb-0 d-flex justify-content-between align-items-start">
49
51
  <div>
50
52
  {value && <div className="fs-4 fw-semibold">{value}</div>}
@@ -40,17 +40,16 @@ export interface CWidgetStatsDProps extends HTMLAttributes<HTMLDivElement> {
40
40
 
41
41
  export const CWidgetStatsD = forwardRef<HTMLDivElement, CWidgetStatsDProps>(
42
42
  ({ className, chart, color, icon, values, ...rest }, ref) => {
43
- const _className = classNames(className)
44
- const classNameHeader = classNames(
45
- 'position-relative d-flex justify-content-center align-items-center',
46
- {
47
- [`bg-${color}`]: color,
48
- },
49
- )
50
-
51
43
  return (
52
- <CCard className={_className} {...rest} ref={ref}>
53
- <CCardHeader className={classNameHeader}>
44
+ <CCard className={className} {...rest} ref={ref}>
45
+ <CCardHeader
46
+ className={classNames(
47
+ 'position-relative d-flex justify-content-center align-items-center',
48
+ {
49
+ [`bg-${color}`]: color,
50
+ },
51
+ )}
52
+ >
54
53
  {icon}
55
54
  {chart}
56
55
  </CCardHeader>
@@ -25,10 +25,8 @@ export interface CWidgetStatsEProps extends Omit<HTMLAttributes<HTMLDivElement>,
25
25
 
26
26
  export const CWidgetStatsE = forwardRef<HTMLDivElement, CWidgetStatsEProps>(
27
27
  ({ chart, className, title, value, ...rest }, ref) => {
28
- const _className = classNames(className)
29
-
30
28
  return (
31
- <CCard className={_className} {...rest} ref={ref}>
29
+ <CCard className={classNames(className)} {...rest} ref={ref}>
32
30
  <CCardBody className="text-center">
33
31
  {title && (
34
32
  <div className="text-medium-emphasis small text-uppercase fw-semibold">{title}</div>
@@ -1,6 +1,5 @@
1
1
  import React, { forwardRef, HTMLAttributes, ReactNode } from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import classNames from 'classnames'
4
3
 
5
4
  import { CCard, CCardBody, CCardFooter } from '../card'
6
5
 
@@ -42,10 +41,8 @@ export interface CWidgetStatsFProps extends Omit<HTMLAttributes<HTMLDivElement>,
42
41
 
43
42
  export const CWidgetStatsF = forwardRef<HTMLDivElement, CWidgetStatsFProps>(
44
43
  ({ className, color, footer, icon, padding = true, title, value, ...rest }, ref) => {
45
- const _className = classNames(className)
46
-
47
44
  return (
48
- <CCard className={_className} {...rest} ref={ref}>
45
+ <CCard className={className} {...rest} ref={ref}>
49
46
  <CCardBody className={`d-flex align-items-center ${padding === false && 'p-0'}`}>
50
47
  <div className={`me-3 text-white bg-${color} ${padding ? 'p-3' : 'p-4'}`}>{icon}</div>
51
48
  <div>
@@ -1,14 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
3
- export type Colors = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
4
- export declare const colorPropType: PropTypes.Requireable<string>;
5
- export type Gradients = 'primary-gradient' | 'secondary-gradient' | 'success-gradient' | 'danger-gradient' | 'warning-gradient' | 'info-gradient' | 'dark-gradient' | 'light-gradient';
6
- export declare const gradientsPropType: PropTypes.Requireable<string>;
7
- export type Placements = 'auto' | 'auto-start' | 'auto-end' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end' | undefined;
8
- export declare const placementPropType: PropTypes.Requireable<Placements>;
9
- export type Shapes = 'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string;
10
- export declare const shapePropType: PropTypes.Requireable<string>;
11
- export type TextColors = Colors | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string;
12
- export declare const textColorsPropType: PropTypes.Requireable<string>;
13
- export type Triggers = 'hover' | 'focus' | 'click';
14
- export declare const triggerPropType: PropTypes.Requireable<Triggers>;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const CMultiSelectCleaner: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,5 +0,0 @@
1
- import React, { InputHTMLAttributes } from 'react';
2
- export interface CMultiSelectSearchInputProps extends InputHTMLAttributes<HTMLInputElement> {
3
- placeholder?: string;
4
- }
5
- export declare const CMultiSelectSearchInput: React.ForwardRefExoticComponent<CMultiSelectSearchInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,80 +0,0 @@
1
- import React, { ReactNode, HTMLAttributes } from 'react';
2
- export interface CSmartPaginationProps extends HTMLAttributes<HTMLUListElement> {
3
- /**
4
- * A string of all className you want applied to the base component. [docs]
5
- */
6
- className?: string;
7
- /**
8
- * Current page number. [docs]
9
- *
10
- * @default 1
11
- */
12
- activePage?: number;
13
- /**
14
- * Show/hide dots. [docs]
15
- *
16
- * @default true
17
- */
18
- dots?: boolean;
19
- /**
20
- * Show/hide arrows. [docs]
21
- *
22
- * @default true
23
- */
24
- arrows?: boolean;
25
- /**
26
- * Show double arrows buttons. [docs]
27
- *
28
- * @default doubleArrows
29
- */
30
- doubleArrows?: boolean;
31
- /**
32
- * The content of 'firstButton' button. [docs]
33
- *
34
- * @default '<React.Fragment>&laquo;</React.Fragment>''
35
- */
36
- firstButton?: ReactNode | string;
37
- /**
38
- * The content of 'previousButton' button. [docs]
39
- *
40
- * @default '<React.Fragment>&lsaquo;</React.Fragment>'
41
- */
42
- previousButton?: ReactNode | string;
43
- /**
44
- * The content of 'nextButton' button. [docs]
45
- *
46
- * @default '<React.Fragment>&rsaquo;</React.Fragment>''
47
- */
48
- nextButton?: ReactNode | string;
49
- /**
50
- * The content of 'lastButton' button. [docs]
51
- *
52
- * @default '<React.Fragment>&raquo;</React.Fragment>'
53
- */
54
- lastButton?: ReactNode | string;
55
- /**
56
- * Size of pagination, valid values: 'sm', 'lg'. [docs]
57
- */
58
- size?: 'sm' | 'lg';
59
- /**
60
- * Horizontall align. [docs]
61
- *
62
- * @default 'start'
63
- */
64
- align?: 'start' | 'center' | 'end';
65
- /**
66
- * Maximum items number. [docs]
67
- *
68
- * @default 5
69
- */
70
- limit?: number;
71
- /**
72
- * Number of pages. [docs]
73
- */
74
- pages: number;
75
- /**
76
- * On active page change callback. [docs]
77
- */
78
- onActivePageChange: (a: number, b?: boolean) => void;
79
- }
80
- export declare const CSmartPagination: React.ForwardRefExoticComponent<CSmartPaginationProps & React.RefAttributes<HTMLUListElement>>;
@@ -1,46 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
3
- import { CPickerProps } from './../picker/CPicker';
4
- export interface CTimePickerProps extends Omit<CFormControlWrapperProps, 'floatingLabel'>, Omit<CPickerProps, 'autoClose' | 'component' | 'dark' | 'placeholder' | 'variant' | 'onChange'> {
5
- /**
6
- * A string of all className you want applied to the component.
7
- */
8
- className?: string;
9
- /**
10
- * Toggle visibility or set the content of the cleaner button.
11
- */
12
- cleaner?: ReactNode | boolean;
13
- /**
14
- * Toggle visibility or set the content of the input indicator.
15
- */
16
- indicator?: ReactNode | boolean;
17
- /**
18
- * Toggle the readonly state for the component.
19
- */
20
- inputReadOnly?: boolean;
21
- /**
22
- * Sets the default locale for components. If not set, it is inherited from the browser.
23
- */
24
- locale?: string;
25
- /**
26
- * Callback fired when the time changed.
27
- */
28
- onTimeChange?: (timeString: string | null, localeTimeString?: string, date?: Date) => void;
29
- /**
30
- * Specifies a short hint that is visible in the input.
31
- */
32
- placeholder?: string;
33
- /**
34
- * Size the component small or large.
35
- */
36
- size?: 'sm' | 'lg';
37
- /**
38
- * Initial selected time.
39
- */
40
- time?: Date | string | null;
41
- /**
42
- * Set the time picker variant to a roll or select.
43
- */
44
- variant?: 'roll' | 'select';
45
- }
46
- export declare const CTimePicker: React.ForwardRefExoticComponent<CTimePickerProps & React.RefAttributes<HTMLDivElement | HTMLLIElement>>;
@@ -1,23 +0,0 @@
1
- export declare const convertToLocalDate: (d: Date, locale: string, options?: {}) => string;
2
- export declare const convertToLocalTime: (d: Date, locale: string, options?: {}) => string;
3
- export declare const createGroupsInArray: (arr: any[], numberOfGroups: number) => any[][];
4
- export declare const getCurrentYear: () => number;
5
- export declare const getCurrentMonth: () => number;
6
- export declare const getLocalDateFromString: (string: string, locale: string, time?: boolean) => Date | undefined;
7
- export declare const getMonthName: (month: number, locale: string) => string;
8
- export declare const getMonthsNames: (locale: string) => string[];
9
- export declare const getYears: (year: number) => number[];
10
- export declare const getMonthDetails: (year: number, month: number, firstDayOfWeek: number) => {
11
- date: Date;
12
- month: string;
13
- }[][];
14
- export declare const isDisableDateInRange: (startDate?: Date | null, endDate?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean;
15
- export declare const isDateDisabled: (date: Date, min?: Date | null, max?: Date | null, dates?: Date[] | Date[][] | (Date | Date[])[]) => boolean | undefined;
16
- export declare const isDateInRange: (date: Date, start: Date | null, end: Date | null) => boolean | null;
17
- export declare const isDateSelected: (date: Date, start: Date | null, end: Date | null) => boolean | null;
18
- export declare const isEndDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
19
- export declare const isLastDayOfMonth: (date: Date) => boolean;
20
- export declare const isSameDateAs: (date: Date | null, date2: Date | null) => boolean;
21
- export declare const isStartDate: (date: Date, start: Date | null, end: Date | null) => boolean | null;
22
- export declare const isToday: (date: Date) => boolean;
23
- export declare const isValidDate: (date: string) => number | false;
@@ -1,2 +0,0 @@
1
- declare const getNextSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
2
- export default getNextSibling;
@@ -1,2 +0,0 @@
1
- declare const getPreviousSibling: (elem: HTMLElement, selector?: string) => Element | null | undefined;
2
- export default getPreviousSibling;
@@ -1,3 +0,0 @@
1
- import { useForkedRef } from './useForkedRef';
2
- import { useStateWithCallback } from './useStateWithCallback';
3
- export { useForkedRef, useStateWithCallback };
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export type AssignableRef<ValueType> = {
3
- bivarianceHack(instance: ValueType | null): void;
4
- }['bivarianceHack'] | React.MutableRefObject<ValueType | null>;
5
- export declare function useForkedRef<RefValueType = any>(...refs: (AssignableRef<RefValueType> | null | undefined)[]): ((node: any) => void) | null;
6
- export declare function assignRef<RefValueType = any>(ref: AssignableRef<RefValueType> | null | undefined, value: any): void;
7
- export declare function isFunction(value: any): value is Function;
@@ -1,2 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- export declare const useStateWithCallback: <S>(initialState: S, handler?: ((prevState: S) => void) | undefined, runHandler?: boolean) => [S, Dispatch<SetStateAction<S>>];
@@ -1,2 +0,0 @@
1
- declare const isVisible: (element: HTMLElement) => boolean;
2
- export default isVisible;
@@ -1,21 +0,0 @@
1
- export declare const convert12hTo24h: (abbr: 'am' | 'pm', hour: number) => number;
2
- export declare const convert24hTo12h: (hour: number) => number;
3
- export declare const convertTimeToDate: (time: Date | string | null | undefined) => Date | null;
4
- export declare const getAmPm: (date: Date, locale: string) => "am" | "pm";
5
- export declare const getListOfHours: (locale: string, ampm?: 'auto' | boolean) => {
6
- value: number;
7
- label: string;
8
- }[];
9
- export declare const getListOfMinutes: (locale: string, valueAsString?: boolean) => {
10
- value: string | number;
11
- label: string;
12
- }[];
13
- export declare const getListOfSeconds: (locale: string, valueAsString?: boolean) => {
14
- value: string | number;
15
- label: string;
16
- }[];
17
- export declare const getSelectedHour: (date: Date | null, locale: string, ampm?: 'auto' | boolean) => number | "";
18
- export declare const getSelectedMinutes: (date: Date | null) => number | "";
19
- export declare const getSelectedSeconds: (date: Date | null) => number | "";
20
- export declare const isAmPm: (locale: string) => boolean;
21
- export declare const isValidTime: (time: string) => number | false;