@coreui/react-pro 4.8.0-alpha.3 → 4.9.0-next.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 (82) hide show
  1. package/README.md +1 -1
  2. package/dist/components/calendar/index.d.ts +2 -0
  3. package/dist/components/calendar/utils.d.ts +23 -0
  4. package/dist/components/date-picker/CDatePicker.d.ts +1 -1
  5. package/dist/components/date-range-picker/CDateRangePicker.d.ts +2 -2
  6. package/dist/components/element-cover/CElementCover.d.ts +3 -7
  7. package/dist/components/element-cover/index.d.ts +2 -0
  8. package/dist/components/form/CFormInput.d.ts +1 -1
  9. package/dist/components/form/CFormSwitch.d.ts +1 -1
  10. package/dist/components/index.d.ts +2 -0
  11. package/dist/components/nav/CNavGroup.d.ts +4 -4
  12. package/dist/components/offcanvas/COffcanvas.d.ts +8 -2
  13. package/dist/components/sidebar/CSidebar.d.ts +4 -4
  14. package/dist/components/smart-table/CSmartTableBody.d.ts +6 -5
  15. package/dist/components/smart-table/CSmartTableHead.d.ts +6 -3
  16. package/dist/components/smart-table/CSmartTableInterface.d.ts +46 -109
  17. package/dist/components/smart-table/types.d.ts +53 -0
  18. package/dist/components/smart-table/utils.d.ts +16 -0
  19. package/dist/components/table/CTable.d.ts +5 -5
  20. package/dist/components/time-picker/types.d.ts +15 -0
  21. package/dist/components/time-picker/utils.d.ts +23 -0
  22. package/dist/hooks/index.d.ts +3 -0
  23. package/dist/hooks/useForkedRef.d.ts +7 -0
  24. package/dist/hooks/useStateWithCallback.d.ts +2 -0
  25. package/dist/index.es.js +1246 -1865
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.js +1246 -1863
  28. package/dist/index.js.map +1 -1
  29. package/dist/utils/index.d.ts +3 -2
  30. package/dist/utils/isInViewport.d.ts +2 -0
  31. package/dist/utils/isObjectInArray.d.ts +2 -0
  32. package/package.json +14 -14
  33. package/src/components/accordion/CAccordionBody.tsx +1 -1
  34. package/src/components/alert/CAlert.tsx +1 -1
  35. package/src/components/backdrop/CBackdrop.tsx +1 -1
  36. package/src/components/calendar/CCalendar.tsx +351 -240
  37. package/src/components/calendar/index.ts +3 -0
  38. package/src/{utils/calendar.ts → components/calendar/utils.ts} +1 -1
  39. package/src/components/carousel/CCarousel.tsx +4 -4
  40. package/src/components/carousel/CCarouselItem.tsx +1 -1
  41. package/src/components/collapse/CCollapse.tsx +1 -1
  42. package/src/components/date-picker/CDatePicker.tsx +1 -1
  43. package/src/components/date-range-picker/CDateRangePicker.tsx +3 -3
  44. package/src/components/dropdown/CDropdown.tsx +1 -1
  45. package/src/components/dropdown/CDropdownToggle.tsx +1 -1
  46. package/src/components/element-cover/CElementCover.tsx +19 -25
  47. package/src/components/element-cover/index.ts +3 -0
  48. package/src/components/form/CFormCheck.tsx +1 -1
  49. package/src/components/form/CFormControlWrapper.tsx +14 -20
  50. package/src/components/form/CFormInput.tsx +1 -1
  51. package/src/components/form/CFormSwitch.tsx +1 -1
  52. package/src/components/grid/CCol.tsx +4 -0
  53. package/src/components/index.ts +2 -0
  54. package/src/components/modal/CModal.tsx +1 -1
  55. package/src/components/nav/CNavGroup.tsx +4 -4
  56. package/src/components/nav/CNavLink.tsx +2 -1
  57. package/src/components/offcanvas/COffcanvas.tsx +36 -18
  58. package/src/components/sidebar/CSidebar.tsx +10 -10
  59. package/src/components/smart-table/CSmartTable.tsx +279 -259
  60. package/src/components/smart-table/CSmartTableBody.tsx +31 -41
  61. package/src/components/smart-table/CSmartTableCleaner.tsx +1 -1
  62. package/src/components/smart-table/CSmartTableFilter.tsx +1 -3
  63. package/src/components/smart-table/CSmartTableHead.tsx +53 -103
  64. package/src/components/smart-table/CSmartTableInterface.tsx +57 -120
  65. package/src/components/smart-table/CSmartTableItemsPerPageSelector.tsx +1 -2
  66. package/src/components/smart-table/types.tsx +65 -0
  67. package/src/components/smart-table/utils.tsx +199 -0
  68. package/src/components/table/CTable.tsx +12 -9
  69. package/src/components/tabs/CTabPane.tsx +1 -1
  70. package/src/components/time-picker/CTimePicker.tsx +50 -23
  71. package/src/components/time-picker/CTimePickerRollCol.tsx +1 -1
  72. package/src/components/time-picker/types.ts +15 -0
  73. package/src/{utils/time.ts → components/time-picker/utils.ts} +43 -2
  74. package/src/components/toast/CToast.tsx +1 -1
  75. package/src/components/virtual-scroller/CVirtualScroller.tsx +1 -1
  76. package/src/{utils/hooks → hooks}/index.ts +0 -0
  77. package/src/{utils/hooks → hooks}/useForkedRef.ts +0 -0
  78. package/src/{utils/hooks → hooks}/useStateWithCallback.ts +0 -0
  79. package/src/utils/index.ts +3 -2
  80. package/src/utils/isInViewport.ts +11 -0
  81. package/src/utils/isObjectInArray.ts +14 -0
  82. package/src/utils/isVisible.ts +0 -11
@@ -0,0 +1,15 @@
1
+ export type LocalizedTimePartials = {
2
+ listOfHours: {
3
+ value: number;
4
+ label: string;
5
+ }[];
6
+ listOfMinutes: {
7
+ value: number;
8
+ label: string;
9
+ }[];
10
+ listOfSeconds: {
11
+ value: number;
12
+ label: string;
13
+ }[];
14
+ hour12: boolean;
15
+ };
@@ -0,0 +1,23 @@
1
+ import type { LocalizedTimePartials } from './types';
2
+ export declare const convert12hTo24h: (abbr: 'am' | 'pm', hour: number) => number;
3
+ export declare const convert24hTo12h: (hour: number) => number;
4
+ export declare const convertTimeToDate: (time: Date | string | null | undefined) => Date | null;
5
+ export declare const getAmPm: (date: Date, locale: string) => "am" | "pm";
6
+ export declare const getListOfHours: (locale: string, ampm?: 'auto' | boolean) => {
7
+ value: number;
8
+ label: string;
9
+ }[];
10
+ export declare const getListOfMinutes: (locale: string, valueAsString?: boolean) => {
11
+ value: string | number;
12
+ label: string;
13
+ }[];
14
+ export declare const getListOfSeconds: (locale: string, valueAsString?: boolean) => {
15
+ value: string | number;
16
+ label: string;
17
+ }[];
18
+ export declare const getLocalizedTimePartials: (locale: string, ampm?: 'auto' | boolean) => LocalizedTimePartials;
19
+ export declare const getSelectedHour: (date: Date | null, locale: string, ampm?: 'auto' | boolean) => number | "";
20
+ export declare const getSelectedMinutes: (date: Date | null) => number | "";
21
+ export declare const getSelectedSeconds: (date: Date | null) => number | "";
22
+ export declare const isAmPm: (locale: string) => boolean;
23
+ export declare const isValidTime: (time: string) => number | false;
@@ -0,0 +1,3 @@
1
+ import { useForkedRef } from './useForkedRef';
2
+ import { useStateWithCallback } from './useStateWithCallback';
3
+ export { useForkedRef, useStateWithCallback };
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,2 @@
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>>];