@codeleap/web 5.8.21 → 6.1.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/dist/components/ActionIcon/index.d.ts +1 -1
- package/dist/components/ActionIcon/index.js +1 -1
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActivityIndicator/index.d.ts +9 -2
- package/dist/components/ActivityIndicator/index.js +8 -16
- package/dist/components/ActivityIndicator/index.js.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/types.d.ts +1 -2
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Carousel/index.d.ts +5 -0
- package/dist/components/Carousel/index.js +168 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/Carousel/styles.d.ts +3 -0
- package/dist/components/Carousel/styles.js.map +1 -0
- package/dist/components/Carousel/types.d.ts +34 -0
- package/dist/components/{Grid → Carousel}/types.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.d.ts +1 -1
- package/dist/components/Collapse/index.js +3 -3
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/Collapse/types.d.ts +1 -2
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/ColorPicker/index.js +4 -4
- package/dist/components/ColorPicker/index.js.map +1 -1
- package/dist/components/ColorPicker/types.d.ts +3 -3
- package/dist/components/CropPicker/index.d.ts +9 -2
- package/dist/components/CropPicker/index.js +6 -6
- package/dist/components/CropPicker/index.js.map +1 -1
- package/dist/components/CropPicker/types.d.ts +3 -1
- package/dist/components/DatePicker/components/DayContent.js +1 -1
- package/dist/components/DatePicker/components/DayContent.js.map +1 -1
- package/dist/components/DatePicker/components/Header.js +1 -1
- package/dist/components/DatePicker/components/Header.js.map +1 -1
- package/dist/components/DatePicker/components/OuterInput.js +2 -12
- package/dist/components/DatePicker/components/OuterInput.js.map +1 -1
- package/dist/components/DatePicker/components/YearContent.js +1 -1
- package/dist/components/DatePicker/components/YearContent.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.js +12 -13
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DatePicker/types.d.ts +8 -6
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropzone/index.d.ts +9 -2
- package/dist/components/Dropzone/index.js +7 -6
- package/dist/components/Dropzone/index.js.map +1 -1
- package/dist/components/Dropzone/types.d.ts +3 -2
- package/dist/components/EmptyPlaceholder/index.d.ts +1 -1
- package/dist/components/EmptyPlaceholder/index.js +3 -3
- package/dist/components/EmptyPlaceholder/index.js.map +1 -1
- package/dist/components/EmptyPlaceholder/types.d.ts +2 -2
- package/dist/components/FileInput/index.d.ts +5 -9
- package/dist/components/FileInput/index.js +6 -5
- package/dist/components/FileInput/index.js.map +1 -1
- package/dist/components/FileInput/types.d.ts +2 -0
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/InputBase/index.js +2 -2
- package/dist/components/InputBase/index.js.map +1 -1
- package/dist/components/InputBase/types.d.ts +0 -1
- package/dist/components/InputBase/useInputBase.d.ts +2 -3
- package/dist/components/InputBase/useInputBase.js +2 -3
- package/dist/components/InputBase/useInputBase.js.map +1 -1
- package/dist/components/InputBase/useInputBasePartialStyles.js +1 -2
- package/dist/components/InputBase/useInputBasePartialStyles.js.map +1 -1
- package/dist/components/InputBase/utils.d.ts +1 -1
- package/dist/components/InputBase/utils.js +3 -3
- package/dist/components/InputBase/utils.js.map +1 -1
- package/dist/components/List/index.d.ts +2 -3
- package/dist/components/List/index.js +87 -40
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/List/styles.d.ts +2 -4
- package/dist/components/List/types.d.ts +10 -52
- package/dist/components/LoadingOverlay/index.d.ts +1 -1
- package/dist/components/LoadingOverlay/index.js +1 -1
- package/dist/components/LoadingOverlay/index.js.map +1 -1
- package/dist/components/MaskedTextInput/index.d.ts +7 -0
- package/dist/components/MaskedTextInput/index.js +69 -0
- package/dist/components/MaskedTextInput/index.js.map +1 -0
- package/dist/components/MaskedTextInput/mask.d.ts +8 -0
- package/dist/components/MaskedTextInput/mask.js +37 -0
- package/dist/components/MaskedTextInput/mask.js.map +1 -0
- package/dist/components/MaskedTextInput/types.d.ts +10 -0
- package/dist/components/MaskedTextInput/types.js.map +1 -0
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +6 -6
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/NumberIncrement/index.d.ts +1 -1
- package/dist/components/NumberIncrement/index.js +1 -3
- package/dist/components/NumberIncrement/index.js.map +1 -1
- package/dist/components/NumberIncrement/useNumberIncrement.d.ts +4 -4
- package/dist/components/NumberIncrement/useNumberIncrement.js +1 -2
- package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -1
- package/dist/components/Overlay/index.d.ts +1 -1
- package/dist/components/PaginationButtons/index.d.ts +1 -1
- package/dist/components/PaginationButtons/index.js +2 -2
- package/dist/components/PaginationButtons/index.js.map +1 -1
- package/dist/components/PaginationButtons/types.d.ts +1 -2
- package/dist/components/PaginationIndicator/index.d.ts +2 -3
- package/dist/components/PaginationIndicator/index.js +2 -2
- package/dist/components/PaginationIndicator/index.js.map +1 -1
- package/dist/components/PaginationIndicator/types.d.ts +3 -3
- package/dist/components/Progress/Bar/index.d.ts +1 -1
- package/dist/components/Progress/Bar/index.js +1 -1
- package/dist/components/Progress/Bar/index.js.map +1 -1
- package/dist/components/Progress/Bar/types.d.ts +2 -3
- package/dist/components/Progress/Circle/index.d.ts +1 -1
- package/dist/components/Progress/Circle/index.js +2 -2
- package/dist/components/Progress/Circle/index.js.map +1 -1
- package/dist/components/Progress/Circle/types.d.ts +1 -2
- package/dist/components/Progress/index.d.ts +0 -1
- package/dist/components/Progress/utils.js +1 -2
- package/dist/components/Progress/utils.js.map +1 -1
- package/dist/components/RadioInput/index.d.ts +1 -1
- package/dist/components/RadioInput/index.js +2 -2
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/SearchInput/index.js.map +1 -1
- package/dist/components/SectionFilters/index.d.ts +1 -1
- package/dist/components/SectionFilters/index.js +4 -4
- package/dist/components/SectionFilters/index.js.map +1 -1
- package/dist/components/SectionFilters/types.d.ts +1 -2
- package/dist/components/SegmentedControl/index.d.ts +1 -1
- package/dist/components/SegmentedControl/index.js +12 -21
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/types.d.ts +2 -2
- package/dist/components/Select/index.js +5 -5
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.js +1 -2
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Select/types.d.ts +6 -6
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.js +3 -3
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +10 -2
- package/dist/components/Text/index.js +12 -20
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/types.d.ts +3 -2
- package/dist/components/TextEditor/index.d.ts +1 -1
- package/dist/components/TextEditor/index.js +21 -9
- package/dist/components/TextEditor/index.js.map +1 -1
- package/dist/components/TextEditor/types.d.ts +4 -5
- package/dist/components/TextInput/index.d.ts +9 -3
- package/dist/components/TextInput/index.js +14 -30
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/types.d.ts +4 -40
- package/dist/components/TextInput/useTextInput.d.ts +2 -6
- package/dist/components/TextInput/useTextInput.js +7 -16
- package/dist/components/TextInput/useTextInput.js.map +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/Tooltip/types.d.ts +1 -1
- package/dist/components/Touchable/index.d.ts +10 -2
- package/dist/components/Touchable/index.js +9 -19
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/types.d.ts +2 -1
- package/dist/components/View/index.d.ts +10 -2
- package/dist/components/View/index.js +7 -7
- package/dist/components/View/index.js.map +1 -1
- package/dist/components/View/types.d.ts +2 -2
- package/dist/components/VirtualList/context.d.ts +3 -0
- package/dist/components/VirtualList/context.js +93 -0
- package/dist/components/VirtualList/context.js.map +1 -0
- package/dist/components/VirtualList/index.d.ts +5 -0
- package/dist/components/VirtualList/index.js +14 -0
- package/dist/components/VirtualList/index.js.map +1 -0
- package/dist/components/VirtualList/list.d.ts +3 -0
- package/dist/components/VirtualList/list.js +102 -0
- package/dist/components/VirtualList/list.js.map +1 -0
- package/dist/components/VirtualList/types.d.ts +33 -0
- package/dist/components/{Pager/styles.js → VirtualList/types.js} +1 -1
- package/dist/components/VirtualList/types.js.map +1 -0
- package/dist/components/components.d.ts +4 -2
- package/dist/components/components.js +4 -2
- package/dist/components/components.js.map +1 -1
- package/dist/lib/ListMasonry.js +3 -3
- package/dist/lib/ListMasonry.js.map +1 -1
- package/dist/lib/WebStyleRegistry.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +0 -1
- package/dist/lib/hooks/index.js +0 -1
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useAnimatedStyle.d.ts +8 -4
- package/dist/lib/hooks/useAnimatedStyle.js.map +1 -1
- package/dist/lib/hooks/useAnimatedVariantStyles.d.ts +3 -3
- package/dist/lib/hooks/useAnimatedVariantStyles.js +1 -2
- package/dist/lib/hooks/useAnimatedVariantStyles.js.map +1 -1
- package/dist/lib/hooks/useBreakpointMatch.js +1 -2
- package/dist/lib/hooks/useBreakpointMatch.js.map +1 -1
- package/dist/lib/hooks/useClick.js +1 -2
- package/dist/lib/hooks/useClick.js.map +1 -1
- package/dist/lib/hooks/useClickOutside.d.ts +1 -2
- package/dist/lib/hooks/useClickOutside.js +2 -3
- package/dist/lib/hooks/useClickOutside.js.map +1 -1
- package/dist/lib/hooks/useCropPicker.d.ts +1 -2
- package/dist/lib/hooks/useCropPicker.js +19 -7
- package/dist/lib/hooks/useCropPicker.js.map +1 -1
- package/dist/lib/hooks/useFileInput.d.ts +1 -2
- package/dist/lib/hooks/useKeydown.js +2 -2
- package/dist/lib/hooks/useKeydown.js.map +1 -1
- package/dist/lib/hooks/useMediaQuery.js +2 -3
- package/dist/lib/hooks/useMediaQuery.js.map +1 -1
- package/dist/lib/hooks/usePageExitBlocker.js.map +1 -1
- package/dist/lib/hooks/usePagination.js +1 -2
- package/dist/lib/hooks/usePagination.js.map +1 -1
- package/dist/lib/hooks/usePopState.js.map +1 -1
- package/dist/lib/hooks/useRefresh.d.ts +1 -1
- package/dist/lib/hooks/useRefresh.js.map +1 -1
- package/dist/lib/hooks/useScrollEffect.js +1 -2
- package/dist/lib/hooks/useScrollEffect.js.map +1 -1
- package/dist/lib/hooks/useSearchParams.d.ts +0 -1
- package/dist/lib/hooks/useSearchParams.js +1 -2
- package/dist/lib/hooks/useSearchParams.js.map +1 -1
- package/dist/lib/hooks/useStaticAnimationStyles.js +1 -2
- package/dist/lib/hooks/useStaticAnimationStyles.js.map +1 -1
- package/dist/lib/hooks/useWindowSize.js +1 -2
- package/dist/lib/hooks/useWindowSize.js.map +1 -1
- package/dist/lib/tools/localStorage.js.map +1 -1
- package/dist/lib/tools/mediaQuery.js +3 -4
- package/dist/lib/tools/mediaQuery.js.map +1 -1
- package/dist/lib/tools/modal.js +3 -3
- package/dist/lib/tools/modal.js.map +1 -1
- package/dist/lib/utils/pollyfils/scroll.js.map +1 -1
- package/dist/lib/utils/stopPropagation.js +1 -2
- package/dist/lib/utils/stopPropagation.js.map +1 -1
- package/dist/lib/utils/test.js.map +1 -1
- package/dist/types/utility.d.ts +2 -2
- package/package.json +39 -39
- package/package.json.bak +24 -24
- package/src/components/ActionIcon/index.tsx +1 -1
- package/src/components/ActivityIndicator/index.tsx +3 -4
- package/src/components/Badge/types.ts +1 -1
- package/src/components/Carousel/index.tsx +230 -0
- package/src/components/{Pager → Carousel}/styles.ts +2 -2
- package/src/components/Carousel/types.ts +41 -0
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Collapse/index.tsx +1 -1
- package/src/components/Collapse/types.ts +1 -1
- package/src/components/ColorPicker/types.ts +3 -3
- package/src/components/CropPicker/index.tsx +4 -3
- package/src/components/CropPicker/types.ts +3 -1
- package/src/components/DatePicker/components/OuterInput.tsx +3 -12
- package/src/components/DatePicker/index.tsx +18 -10
- package/src/components/DatePicker/types.ts +8 -5
- package/src/components/Dropzone/index.tsx +3 -2
- package/src/components/Dropzone/types.ts +3 -1
- package/src/components/EmptyPlaceholder/types.ts +2 -2
- package/src/components/FileInput/index.tsx +4 -3
- package/src/components/FileInput/types.ts +2 -0
- package/src/components/InputBase/useInputBase.ts +1 -1
- package/src/components/InputBase/utils.ts +1 -1
- package/src/components/List/index.tsx +56 -78
- package/src/components/List/styles.ts +2 -10
- package/src/components/List/types.ts +10 -52
- package/src/components/MaskedTextInput/index.tsx +58 -0
- package/src/components/MaskedTextInput/mask.ts +41 -0
- package/src/components/MaskedTextInput/types.ts +18 -0
- package/src/components/NumberIncrement/index.tsx +1 -3
- package/src/components/PaginationButtons/types.ts +1 -1
- package/src/components/PaginationIndicator/types.ts +2 -2
- package/src/components/Progress/Bar/types.ts +2 -2
- package/src/components/Progress/Circle/types.ts +1 -1
- package/src/components/SectionFilters/types.ts +1 -1
- package/src/components/SegmentedControl/index.tsx +6 -5
- package/src/components/SegmentedControl/types.ts +2 -2
- package/src/components/Select/index.tsx +3 -3
- package/src/components/Select/types.ts +6 -6
- package/src/components/Switch/index.tsx +1 -1
- package/src/components/Text/index.tsx +4 -3
- package/src/components/Text/types.ts +3 -2
- package/src/components/TextEditor/index.tsx +20 -18
- package/src/components/TextEditor/types.ts +5 -5
- package/src/components/TextInput/index.tsx +14 -34
- package/src/components/TextInput/types.ts +5 -57
- package/src/components/TextInput/useTextInput.ts +10 -19
- package/src/components/Tooltip/types.ts +1 -1
- package/src/components/Touchable/index.tsx +4 -4
- package/src/components/Touchable/types.ts +2 -1
- package/src/components/View/index.tsx +6 -5
- package/src/components/View/types.ts +3 -3
- package/src/components/VirtualList/context.tsx +93 -0
- package/src/components/VirtualList/index.tsx +11 -0
- package/src/components/VirtualList/list.tsx +85 -0
- package/src/components/VirtualList/types.ts +38 -0
- package/src/components/components.ts +4 -2
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useAnimatedStyle.ts +11 -7
- package/src/lib/hooks/useAnimatedVariantStyles.ts +2 -2
- package/src/lib/hooks/useClickOutside.ts +1 -1
- package/src/lib/hooks/useMediaQuery.ts +1 -1
- package/src/types/utility.ts +2 -2
- package/dist/components/Grid/index.d.ts +0 -13
- package/dist/components/Grid/index.js +0 -94
- package/dist/components/Grid/index.js.map +0 -1
- package/dist/components/Grid/styles.d.ts +0 -2
- package/dist/components/Grid/styles.js.map +0 -1
- package/dist/components/Grid/types.d.ts +0 -9
- package/dist/components/List/ListLayout.d.ts +0 -2
- package/dist/components/List/ListLayout.js +0 -39
- package/dist/components/List/ListLayout.js.map +0 -1
- package/dist/components/Pager/index.d.ts +0 -7
- package/dist/components/Pager/index.js +0 -118
- package/dist/components/Pager/index.js.map +0 -1
- package/dist/components/Pager/styles.d.ts +0 -3
- package/dist/components/Pager/styles.js.map +0 -1
- package/dist/components/Pager/types.d.ts +0 -27
- package/dist/components/Pager/types.js.map +0 -1
- package/dist/components/TextInput/mask.d.ts +0 -5
- package/dist/components/TextInput/mask.js +0 -110
- package/dist/components/TextInput/mask.js.map +0 -1
- package/dist/lib/deprecated/OSAlert.d.ts +0 -38
- package/dist/lib/deprecated/OSAlert.js +0 -139
- package/dist/lib/deprecated/OSAlert.js.map +0 -1
- package/dist/lib/deprecated/index.d.ts +0 -1
- package/dist/lib/deprecated/index.js +0 -22
- package/dist/lib/deprecated/index.js.map +0 -1
- package/dist/lib/hooks/useInfiniteScroll.d.ts +0 -22
- package/dist/lib/hooks/useInfiniteScroll.js +0 -98
- package/dist/lib/hooks/useInfiniteScroll.js.map +0 -1
- package/src/components/Grid/index.tsx +0 -126
- package/src/components/Grid/styles.ts +0 -3
- package/src/components/Grid/types.ts +0 -13
- package/src/components/List/ListLayout.tsx +0 -87
- package/src/components/Pager/index.tsx +0 -156
- package/src/components/Pager/types.ts +0 -35
- package/src/components/TextInput/mask.tsx +0 -117
- package/src/lib/deprecated/OSAlert.tsx +0 -200
- package/src/lib/deprecated/index.ts +0 -6
- package/src/lib/hooks/useInfiniteScroll.ts +0 -77
- /package/dist/components/{Grid → Carousel}/styles.js +0 -0
- /package/dist/components/{Grid → Carousel}/types.js +0 -0
- /package/dist/components/{Pager → MaskedTextInput}/types.js +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PartialKeys, Virtualizer, VirtualizerOptions } from '@tanstack/react-virtual'
|
|
2
|
+
import { ReactElement } from 'react'
|
|
3
|
+
import { AnyFunction, PropsOf } from '@codeleap/types'
|
|
4
|
+
import { EmptyPlaceholder } from '../EmptyPlaceholder'
|
|
5
|
+
|
|
6
|
+
type VirtualListItem<T> = {
|
|
7
|
+
item: T
|
|
8
|
+
index: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type VirtualOptions = PartialKeys<VirtualizerOptions<HTMLDivElement, Element>, "observeElementRect" | "observeElementOffset" | "scrollToFn">
|
|
12
|
+
|
|
13
|
+
export type VirtualListProps<T> = Partial<Omit<VirtualOptions, 'estimateSize' | 'data'>> & {
|
|
14
|
+
data: T[]
|
|
15
|
+
fetchNextPage?: AnyFunction
|
|
16
|
+
isFetchingNextPage?: boolean
|
|
17
|
+
hasNextPage?: boolean
|
|
18
|
+
estimateSize?: (item: T) => number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type VirtualListContextValue<T> = {
|
|
22
|
+
virtualizer: Virtualizer<HTMLDivElement, Element>
|
|
23
|
+
scrollRef: React.RefObject<HTMLDivElement>
|
|
24
|
+
loadNextPage: () => void
|
|
25
|
+
list: Pick<VirtualListProps<T>, 'data' | 'fetchNextPage' | 'isFetchingNextPage' | 'hasNextPage'>
|
|
26
|
+
virtualizerItemCount: number
|
|
27
|
+
paginationIndicatorIndex: number | null
|
|
28
|
+
lastItemIndex: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type VirtualListItemsProps<T> = {
|
|
32
|
+
renderItem: (data: VirtualListItem<T>) => ReactElement
|
|
33
|
+
ListFooterComponent?: () => ReactElement
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type VirtualListContainerProps = React.PropsWithChildren<React.ComponentPropsWithoutRef<'div'>> & {
|
|
37
|
+
placeholder?: ReactElement | Partial<PropsOf<typeof EmptyPlaceholder>>
|
|
38
|
+
}
|
|
@@ -13,6 +13,7 @@ export * from './Collapse'
|
|
|
13
13
|
export * from './Drawer'
|
|
14
14
|
export * from './Overlay'
|
|
15
15
|
export * from './TextInput'
|
|
16
|
+
export * from './MaskedTextInput'
|
|
16
17
|
export * from './RadioInput'
|
|
17
18
|
export * from './Select'
|
|
18
19
|
export * from './FileInput'
|
|
@@ -25,9 +26,8 @@ export * from './NumberIncrement'
|
|
|
25
26
|
export * from './SearchInput'
|
|
26
27
|
export * from './Tooltip'
|
|
27
28
|
export * from './SegmentedControl'
|
|
28
|
-
export * from './
|
|
29
|
+
export * from './Carousel'
|
|
29
30
|
export * from './EmptyPlaceholder'
|
|
30
|
-
export * from './Grid'
|
|
31
31
|
export * from './Badge'
|
|
32
32
|
export * from './CropPicker'
|
|
33
33
|
export * from './DatePicker'
|
|
@@ -39,3 +39,5 @@ export * from './ColorPicker'
|
|
|
39
39
|
export * from './PaginationButtons'
|
|
40
40
|
export * from './SectionFilters'
|
|
41
41
|
export * from './PaginationIndicator'
|
|
42
|
+
export * from './Carousel'
|
|
43
|
+
export * from './VirtualList'
|
package/src/lib/hooks/index.ts
CHANGED
|
@@ -14,7 +14,6 @@ export * from './useStaticAnimationStyles'
|
|
|
14
14
|
export * from './useWindowFocus'
|
|
15
15
|
export * from './useWindowSize'
|
|
16
16
|
export * from './useKeydown'
|
|
17
|
-
export * from './useInfiniteScroll'
|
|
18
17
|
export * from './useRefresh'
|
|
19
18
|
export * from './useCropPicker'
|
|
20
19
|
export * from './useFileInput'
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { useRef, useEffect, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { TargetAndTransition, Transition } from 'motion/react'
|
|
3
3
|
|
|
4
|
-
type UpdaterReturn =
|
|
5
|
-
transition
|
|
4
|
+
type UpdaterReturn = TargetAndTransition & {
|
|
5
|
+
transition?: Transition
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
type UseAnimatedStyleReturn =
|
|
8
|
+
type UseAnimatedStyleReturn = {
|
|
9
|
+
animate: TargetAndTransition
|
|
10
|
+
initial: boolean
|
|
11
|
+
transition: Transition | undefined
|
|
12
|
+
}
|
|
9
13
|
|
|
10
14
|
export const useAnimatedStyle = (updater: () => UpdaterReturn, deps: Array<any>): UseAnimatedStyleReturn => {
|
|
11
15
|
const initialStyle = updater()
|
|
12
16
|
|
|
13
|
-
const [animatedStyle, setAnimatedStyle] = useState(initialStyle)
|
|
14
|
-
const transition = useRef(initialStyle.transition)
|
|
17
|
+
const [animatedStyle, setAnimatedStyle] = useState<TargetAndTransition>(initialStyle)
|
|
18
|
+
const transition = useRef<Transition | undefined>(initialStyle.transition)
|
|
15
19
|
|
|
16
20
|
useEffect(() => {
|
|
17
21
|
const animatedStyleUpdated = updater()
|
|
@@ -24,4 +28,4 @@ export const useAnimatedStyle = (updater: () => UpdaterReturn, deps: Array<any>)
|
|
|
24
28
|
transition: transition.current,
|
|
25
29
|
initial: false,
|
|
26
30
|
}
|
|
27
|
-
}
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TargetAndTransition } from 'motion/react'
|
|
2
2
|
import { SelectProperties } from '../../types'
|
|
3
3
|
import { useStaticAnimationStyles } from './useStaticAnimationStyles'
|
|
4
4
|
import { useState, useEffect } from 'react'
|
|
@@ -6,7 +6,7 @@ import { useState, useEffect } from 'react'
|
|
|
6
6
|
type UseAnimatedVariantStylesConfig<T extends Record<string | number | symbol, any>, K extends keyof T> = {
|
|
7
7
|
variantStyles: T
|
|
8
8
|
animatedProperties: K[]
|
|
9
|
-
updater: (states: SelectProperties<T, K>) =>
|
|
9
|
+
updater: (states: SelectProperties<T, K>) => TargetAndTransition
|
|
10
10
|
dependencies?: any[]
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ import { attachMediaListener, getMediaQuery, isMediaQuery } from '../tools'
|
|
|
4
4
|
export function useMediaQuery(query: string) {
|
|
5
5
|
const [matches, setMatches] = useState(isMediaQuery(query))
|
|
6
6
|
|
|
7
|
-
const queryRef = useRef<MediaQueryList>()
|
|
7
|
+
const queryRef = useRef<MediaQueryList>(undefined)
|
|
8
8
|
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
if (query?.trim() === '' || !query) return
|
package/src/types/utility.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICSS } from '@codeleap/styles'
|
|
2
|
-
import React from 'react'
|
|
2
|
+
import React, { JSX } from 'react'
|
|
3
3
|
|
|
4
4
|
export type StylesOf<C extends string> = Partial<Record<C, ICSS>>
|
|
5
5
|
|
|
@@ -33,7 +33,7 @@ export type NativeHTMLElement = keyof ElementMap
|
|
|
33
33
|
|
|
34
34
|
export type HTMLProps<T extends NativeHTMLElement> = ElementMap[T]
|
|
35
35
|
|
|
36
|
-
export type ComponentWithDefaultProps<P> = ((props: P) =>
|
|
36
|
+
export type ComponentWithDefaultProps<P> = ((props: P) => React.ReactElement) & { defaultProps?: Partial<P> }
|
|
37
37
|
|
|
38
38
|
export type ComponentCommonProps = {
|
|
39
39
|
debugName?: string
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { GridProps } from './types';
|
|
2
|
-
import { ListItem } from '../List';
|
|
3
|
-
import { AnyRecord, IJSX, StyledComponentProps } from '@codeleap/styles';
|
|
4
|
-
export * from './styles';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export declare const Grid: {
|
|
7
|
-
(props: GridProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
-
styleRegistryName: string;
|
|
9
|
-
elements: string[];
|
|
10
|
-
rootElement: string;
|
|
11
|
-
withVariantTypes<S extends AnyRecord>(styles: S): <T extends ListItem = ListItem>(props: StyledComponentProps<GridProps<T>, S>) => IJSX;
|
|
12
|
-
defaultProps: Partial<GridProps>;
|
|
13
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
-
};
|
|
27
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.Grid = void 0;
|
|
32
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
33
|
-
var react_1 = __importDefault(require("react"));
|
|
34
|
-
var View_1 = require("../View");
|
|
35
|
-
var EmptyPlaceholder_1 = require("../EmptyPlaceholder");
|
|
36
|
-
var List_1 = require("../List");
|
|
37
|
-
var lib_1 = require("../../lib");
|
|
38
|
-
var useStylesFor_1 = require("../../lib/hooks/useStylesFor");
|
|
39
|
-
var WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
|
|
40
|
-
__exportStar(require("./styles"), exports);
|
|
41
|
-
__exportStar(require("./types"), exports);
|
|
42
|
-
var RenderSeparator = function (props) {
|
|
43
|
-
return (0, jsx_runtime_1.jsx)(View_1.View, { style: props === null || props === void 0 ? void 0 : props.separatorStyles });
|
|
44
|
-
};
|
|
45
|
-
var Grid = function (props) {
|
|
46
|
-
var allProps = __assign(__assign({}, exports.Grid.defaultProps), props);
|
|
47
|
-
var style = allProps.style, RenderItem = allProps.renderItem, columnItemsSpacing = allProps.columnItemsSpacing, rowItemsSpacing = allProps.rowItemsSpacing, ListSeparatorComponent = allProps.ListSeparatorComponent, data = allProps.data, overscan = allProps.overscan, separators = allProps.separators, masonryProps = allProps.masonryProps, numColumns = allProps.numColumns, reloadTimeout = allProps.reloadTimeout, showFooter = allProps.showFooter;
|
|
48
|
-
var styles = (0, useStylesFor_1.useStylesFor)(exports.Grid.styleRegistryName, style);
|
|
49
|
-
var _a = (0, lib_1.useInfiniteScroll)(allProps), layoutProps = _a.layoutProps, onLoadMore = _a.onLoadMore;
|
|
50
|
-
var _b = (0, lib_1.useMasonryReload)({
|
|
51
|
-
data: data,
|
|
52
|
-
reloadTimeout: reloadTimeout,
|
|
53
|
-
}), reloadingLayout = _b.reloadingLayout, previousLength = _b.previousLength;
|
|
54
|
-
var separator = react_1.default.useMemo(function () {
|
|
55
|
-
return separators ? (0, jsx_runtime_1.jsx)(ListSeparatorComponent, { separatorStyles: styles.separator }) : null;
|
|
56
|
-
}, []);
|
|
57
|
-
var renderItem = react_1.default.useCallback(function (_item) {
|
|
58
|
-
if (!RenderItem)
|
|
59
|
-
return null;
|
|
60
|
-
var gridLength = (data === null || data === void 0 ? void 0 : data.length) || 0;
|
|
61
|
-
var isFirst = (_item === null || _item === void 0 ? void 0 : _item.index) === 0;
|
|
62
|
-
var isLast = (_item === null || _item === void 0 ? void 0 : _item.index) === gridLength - 1;
|
|
63
|
-
var isOnly = isFirst && isLast;
|
|
64
|
-
var _itemProps = __assign(__assign({}, _item), { isOnly: isOnly, isLast: isLast, isFirst: isFirst, item: _item === null || _item === void 0 ? void 0 : _item.data });
|
|
65
|
-
if (!(_itemProps === null || _itemProps === void 0 ? void 0 : _itemProps.item))
|
|
66
|
-
return null;
|
|
67
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(_item === null || _item === void 0 ? void 0 : _item.index) <= numColumns ? null : separator, (0, jsx_runtime_1.jsx)(RenderItem, __assign({}, _itemProps))] });
|
|
68
|
-
}, []);
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(List_1.ListLayout, __assign({}, allProps, layoutProps, { styles: styles, showFooter: reloadingLayout ? false : showFooter }, { children: (0, jsx_runtime_1.jsx)(lib_1.ListMasonry, __assign({ items: data, render: renderItem, itemKey: function (item, _index) { var _a; return ((_a = item === null || item === void 0 ? void 0 : item.id) !== null && _a !== void 0 ? _a : _index); }, columnGutter: columnItemsSpacing, rowGutter: rowItemsSpacing, columnCount: numColumns, maxColumnCount: numColumns, onRender: onLoadMore, overscanBy: overscan, previousItemsLength: previousLength, reloadingLayout: reloadingLayout }, masonryProps)) })));
|
|
70
|
-
};
|
|
71
|
-
exports.Grid = Grid;
|
|
72
|
-
exports.Grid.styleRegistryName = 'Grid';
|
|
73
|
-
exports.Grid.elements = ['wrapper', 'innerWrapper', 'separator', 'refreshControl', 'refreshControlIndicator'];
|
|
74
|
-
exports.Grid.rootElement = 'wrapper';
|
|
75
|
-
exports.Grid.withVariantTypes = function (styles) {
|
|
76
|
-
return exports.Grid;
|
|
77
|
-
};
|
|
78
|
-
exports.Grid.defaultProps = {
|
|
79
|
-
ListEmptyComponent: EmptyPlaceholder_1.EmptyPlaceholder,
|
|
80
|
-
ListSeparatorComponent: RenderSeparator,
|
|
81
|
-
refreshDebounce: 1500,
|
|
82
|
-
refreshSize: 40,
|
|
83
|
-
refreshThreshold: 0.1,
|
|
84
|
-
refreshPosition: 16,
|
|
85
|
-
refresh: true,
|
|
86
|
-
columnItemsSpacing: 8,
|
|
87
|
-
rowItemsSpacing: 8,
|
|
88
|
-
overscan: 2,
|
|
89
|
-
reloadTimeout: 350,
|
|
90
|
-
showFooter: true,
|
|
91
|
-
numColumns: 2,
|
|
92
|
-
};
|
|
93
|
-
WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.Grid);
|
|
94
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Grid/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,gCAAyC;AACzC,wDAAsD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,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,mCAAI,MAAM,CAAC,CAAA,EAAA,EAC/C,YAAY,EAAE,kBAAkB,EAChC,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,UAAU,EACvB,cAAc,EAAE,UAAU,EAC1B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,QAAQ,EACpB,mBAAmB,EAAE,cAAc,EACnC,eAAe,EAAE,eAAe,IAC5B,YAAY,EAChB,IACS,CACd,CAAA;AACH,CAAC,CAAA;AAlFY,QAAA,IAAI,QAkFhB;AAED,YAAI,CAAC,iBAAiB,GAAG,MAAM,CAAA;AAC/B,YAAI,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;AACrG,YAAI,CAAC,WAAW,GAAG,SAAS,CAAA;AAE5B,YAAI,CAAC,gBAAgB,GAAG,UAAsB,MAAS;IACrD,OAAO,YAAyG,CAAA;AAClH,CAAC,CAAA;AAED,YAAI,CAAC,YAAY,GAAG;IAClB,kBAAkB,EAAE,mCAAgB;IACpC,sBAAsB,EAAE,eAAe;IACvC,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE,EAAE;IACf,gBAAgB,EAAE,GAAG;IACrB,eAAe,EAAE,EAAE;IACnB,OAAO,EAAE,IAAI;IACb,kBAAkB,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC;IAClB,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,GAAG;IAClB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,CAAC;CACQ,CAAA;AAEvB,mCAAgB,CAAC,iBAAiB,CAAC,YAAI,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Grid/styles.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StyledProp } from '@codeleap/styles';
|
|
2
|
-
import { GridComposition } from './styles';
|
|
3
|
-
import { ComponentCommonProps } from '../../types';
|
|
4
|
-
import { ListItem, ListProps } from '../List';
|
|
5
|
-
export type GridProps<T extends ListItem = ListItem> = Omit<ListProps<T>, 'style'> & ComponentCommonProps & {
|
|
6
|
-
style?: StyledProp<GridComposition>;
|
|
7
|
-
columnItemsSpacing?: number;
|
|
8
|
-
numColumns?: number;
|
|
9
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ListLayout = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
16
|
-
var View_1 = require("../View");
|
|
17
|
-
var styles_1 = require("@codeleap/styles");
|
|
18
|
-
var ActivityIndicator_1 = require("../ActivityIndicator");
|
|
19
|
-
var types_1 = require("@codeleap/types");
|
|
20
|
-
var framer_motion_1 = require("framer-motion");
|
|
21
|
-
var DefaultRefreshIndicator = function (props) {
|
|
22
|
-
var refreshing = props.refreshing, styles = props.styles, refreshPosition = props.refreshPosition, refreshControlProps = props.refreshControlProps, debugName = props.debugName, refreshSize = props.refreshSize, refreshControlIndicatorProps = props.refreshControlIndicatorProps;
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, __assign({ initial: false, animate: {
|
|
24
|
-
opacity: refreshing ? 1 : 0,
|
|
25
|
-
top: refreshing ? refreshPosition : 0,
|
|
26
|
-
} }, refreshControlProps, { style: styles === null || styles === void 0 ? void 0 : styles.refreshControl }, { children: (0, jsx_runtime_1.jsx)(ActivityIndicator_1.ActivityIndicator, __assign({ debugName: debugName + 'refresh-indicator', size: refreshSize }, refreshControlIndicatorProps, { style: styles.refreshControlIndicator })) })));
|
|
27
|
-
};
|
|
28
|
-
var ListLayout = function (props) {
|
|
29
|
-
var ListEmptyComponent = props.ListEmptyComponent, ListFooterComponent = props.ListFooterComponent, ListHeaderComponent = props.ListHeaderComponent, refresh = props.refresh, _a = props.ListRefreshControlComponent, ListRefreshControlComponent = _a === void 0 ? DefaultRefreshIndicator : _a, styles = props.styles, isEmpty = props.isEmpty, isLoading = props.isLoading, _b = props.placeholder, placeholder = _b === void 0 ? {} : _b, children = props.children, debugName = props.debugName, isFetching = props.isFetching, isFetchingNextPage = props.isFetchingNextPage, ListLoadingIndicatorComponent = props.ListLoadingIndicatorComponent, scrollableRef = props.scrollableRef, _c = props.showFooter, showFooter = _c === void 0 ? true : _c, wrapperProps = props.wrapperProps;
|
|
30
|
-
var getKeyStyle = function (key) { return (0, styles_1.mergeStyles)([
|
|
31
|
-
styles[key],
|
|
32
|
-
isLoading ? styles["".concat(key, ":loading")] : null,
|
|
33
|
-
isEmpty ? styles["".concat(key, ":empty")] : null,
|
|
34
|
-
]); };
|
|
35
|
-
var showIndicator = (isFetching || isFetchingNextPage) && !types_1.TypeGuards.isNil(ListLoadingIndicatorComponent);
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ style: getKeyStyle('wrapper'), ref: scrollableRef }, wrapperProps, { children: [!!ListHeaderComponent ? (0, jsx_runtime_1.jsx)(ListHeaderComponent, {}) : null, isEmpty ? (0, jsx_runtime_1.jsx)(ListEmptyComponent, __assign({ debugName: debugName }, placeholder)) : null, (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ style: [getKeyStyle('innerWrapper'), isEmpty && { display: 'none' }] }, { children: [(!ListRefreshControlComponent || !refresh) ? null : (0, jsx_runtime_1.jsx)(ListRefreshControlComponent, __assign({}, props, { styles: styles })), children] })), showIndicator ? (0, jsx_runtime_1.jsx)(ListLoadingIndicatorComponent, {}) : null, (!!ListFooterComponent && showFooter) ? (0, jsx_runtime_1.jsx)(ListFooterComponent, __assign({}, props)) : null] })));
|
|
37
|
-
};
|
|
38
|
-
exports.ListLayout = ListLayout;
|
|
39
|
-
//# sourceMappingURL=ListLayout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListLayout.js","sourceRoot":"","sources":["../../../src/components/List/ListLayout.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gCAA8B;AAE9B,2CAA8C;AAC9C,0DAAwD;AAExD,yCAA4C;AAC5C,+CAAsC;AAEtC,IAAM,uBAAuB,GAAG,UAAC,KAAkC;IAE/D,IAAA,UAAU,GAOR,KAAK,WAPG,EACV,MAAM,GAMJ,KAAK,OAND,EACN,eAAe,GAKb,KAAK,gBALQ,EACf,mBAAmB,GAIjB,KAAK,oBAJY,EACnB,SAAS,GAGP,KAAK,UAHE,EACT,WAAW,GAET,KAAK,YAFI,EACX,4BAA4B,GAC1B,KAAK,6BADqB,CACrB;IAET,OAAO,CACL,uBAAC,sBAAM,CAAC,GAAG,aACT,OAAO,EAAE,KAAK,EACd,OAAO,EAAE;YACP,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3B,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;SACtC,IACG,mBAAmB,IACvB,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,gBAE7B,uBAAC,qCAAiB,aAChB,SAAS,EAAE,SAAS,GAAG,mBAAmB,EAC1C,IAAI,EAAE,WAAW,IACb,4BAA4B,IAChC,KAAK,EAAE,MAAM,CAAC,uBAAuB,IACrC,IACS,CACd,CAAA;AACH,CAAC,CAAA;AA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AC,uBAAC,mBAAmB,KAAG,CAAC,CAAC,CAAC,IAAI,EAEtD,OAAO,CAAC,CAAC,CAAC,uBAAC,kBAAkB,aAAC,SAAS,EAAE,SAAS,IAAM,WAAW,EAAI,CAAC,CAAC,CAAC,IAAI,EAE/E,wBAAC,WAAI,aAAC,KAAK,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,OAAO,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,iBACvE,CAAC,CAAC,2BAA2B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAC,2BAA2B,eAAK,KAAK,IAAE,MAAM,EAAE,MAAM,IAAI,EAE9G,QAAQ,KACJ,EAEN,aAAa,CAAC,CAAC,CAAC,uBAAC,6BAA6B,KAAG,CAAC,CAAC,CAAC,IAAI,EAExD,CAAC,CAAC,CAAC,mBAAmB,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,uBAAC,mBAAmB,eAAK,KAAK,EAAI,CAAC,CAAC,CAAC,IAAI,KAC7E,CACR,CAAA;AACH,CAAC,CAAA;AA9CY,QAAA,UAAU,cA8CtB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PagerProps } from './types';
|
|
2
|
-
import { StyledComponentWithProps } from '@codeleap/styles';
|
|
3
|
-
import 'slick-carousel/slick/slick.css';
|
|
4
|
-
import 'slick-carousel/slick/slick-theme.css';
|
|
5
|
-
export * from './styles';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export declare const Pager: StyledComponentWithProps<PagerProps>;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
37
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38
|
-
};
|
|
39
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
40
|
-
var t = {};
|
|
41
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
42
|
-
t[p] = s[p];
|
|
43
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
44
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
45
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
46
|
-
t[p[i]] = s[p[i]];
|
|
47
|
-
}
|
|
48
|
-
return t;
|
|
49
|
-
};
|
|
50
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.Pager = void 0;
|
|
55
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
56
|
-
var hooks_1 = require("@codeleap/hooks");
|
|
57
|
-
var react_slick_1 = __importDefault(require("react-slick"));
|
|
58
|
-
var react_1 = __importStar(require("react"));
|
|
59
|
-
var View_1 = require("../View");
|
|
60
|
-
var Touchable_1 = require("../Touchable");
|
|
61
|
-
var WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
|
|
62
|
-
var useStylesFor_1 = require("../../lib/hooks/useStylesFor");
|
|
63
|
-
require("slick-carousel/slick/slick.css");
|
|
64
|
-
require("slick-carousel/slick/slick-theme.css");
|
|
65
|
-
__exportStar(require("./styles"), exports);
|
|
66
|
-
__exportStar(require("./types"), exports);
|
|
67
|
-
var Dots = function (params) {
|
|
68
|
-
var page = params.page, childArray = params.childArray, onPress = params.onPress, styles = params.styles, dotsDisabled = params.dotsDisabled;
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(View_1.View, __assign({ style: styles.dots }, { children: childArray.map(function (_, index) {
|
|
70
|
-
var isSelected = index === page;
|
|
71
|
-
var style = [
|
|
72
|
-
styles.dot,
|
|
73
|
-
isSelected && styles['dot:selected'],
|
|
74
|
-
dotsDisabled && styles['dot:disabled'],
|
|
75
|
-
];
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { onPress: function () { return onPress === null || onPress === void 0 ? void 0 : onPress(index); }, style: style, disabled: dotsDisabled, debugName: 'dots' }, index));
|
|
77
|
-
}) })));
|
|
78
|
-
};
|
|
79
|
-
exports.Pager = (0, react_1.forwardRef)(function (props, ref) {
|
|
80
|
-
var sliderRef = (0, react_1.useRef)();
|
|
81
|
-
var _a = __assign(__assign({}, exports.Pager.defaultProps), props), style = _a.style, children = _a.children, PageWrapper = _a.renderPageWrapper, page = _a.page, dots = _a.dots, dotsDisabled = _a.dotsDisabled, infinite = _a.infinite, disableSwipe = _a.disableSwipe, onChange = _a.onChange, footer = _a.footer, dotsProps = _a.dotsProps, pageWrapperProps = _a.pageWrapperProps, rest = __rest(_a, ["style", "children", "renderPageWrapper", "page", "dots", "dotsDisabled", "infinite", "disableSwipe", "onChange", "footer", "dotsProps", "pageWrapperProps"]);
|
|
82
|
-
var styles = (0, useStylesFor_1.useStylesFor)(exports.Pager.styleRegistryName, style);
|
|
83
|
-
var childArray = react_1.default.Children.toArray(children);
|
|
84
|
-
var goTo = (0, react_1.useCallback)(function (page) {
|
|
85
|
-
if (sliderRef.current)
|
|
86
|
-
sliderRef.current.slickGoTo(page);
|
|
87
|
-
}, [sliderRef === null || sliderRef === void 0 ? void 0 : sliderRef.current]);
|
|
88
|
-
(0, react_1.useImperativeHandle)(ref, function () { return (__assign({ goTo: goTo }, sliderRef.current)); }, [!!(sliderRef === null || sliderRef === void 0 ? void 0 : sliderRef.current)]);
|
|
89
|
-
(0, hooks_1.onUpdate)(function () {
|
|
90
|
-
goTo(page);
|
|
91
|
-
}, [page]);
|
|
92
|
-
return ((0, jsx_runtime_1.jsxs)(View_1.View, __assign({ style: styles.wrapper }, { children: [(0, jsx_runtime_1.jsx)(react_slick_1.default, __assign({ adaptiveHeight: true }, rest, { arrows: false, ref: sliderRef, dots: false, swipe: !disableSwipe, infinite: infinite, accessibility: false, afterChange: onChange }, { children: childArray.map(function (child, index) {
|
|
93
|
-
return (
|
|
94
|
-
// @ts-expect-error @verify
|
|
95
|
-
(0, jsx_runtime_1.jsx)(PageWrapper, __assign({ style: styles.pageWrapper }, pageWrapperProps, { children: child }), index));
|
|
96
|
-
}) })), (0, jsx_runtime_1.jsxs)(View_1.View, __assign({ style: styles.footerWrapper }, { children: [footer, dots ? ((0, jsx_runtime_1.jsx)(Dots, __assign({ page: page, onPress: onChange, childArray: childArray, styles: styles, dotsDisabled: dotsDisabled }, dotsProps))) : null] }))] })));
|
|
97
|
-
});
|
|
98
|
-
exports.Pager.styleRegistryName = 'Pager';
|
|
99
|
-
exports.Pager.elements = [
|
|
100
|
-
'wrapper',
|
|
101
|
-
'dot',
|
|
102
|
-
'dots',
|
|
103
|
-
'pageWrapper',
|
|
104
|
-
'footerWrapper',
|
|
105
|
-
];
|
|
106
|
-
exports.Pager.rootElement = 'wrapper';
|
|
107
|
-
exports.Pager.withVariantTypes = function (styles) {
|
|
108
|
-
return exports.Pager;
|
|
109
|
-
};
|
|
110
|
-
exports.Pager.defaultProps = {
|
|
111
|
-
dots: false,
|
|
112
|
-
dotsDisabled: false,
|
|
113
|
-
infinite: false,
|
|
114
|
-
disableSwipe: false,
|
|
115
|
-
renderPageWrapper: View_1.View,
|
|
116
|
-
};
|
|
117
|
-
WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.Pager);
|
|
118
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Pager/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA0C;AAC1C,4DAAgC;AAChC,6CAAmF;AACnF,gCAA8B;AAC9B,0CAAwC;AAGxC,+DAA6D;AAC7D,6DAA2D;AAE3D,0CAAuC;AACvC,gDAA6C;AAE7C,2CAAwB;AACxB,0CAAuB;AAEvB,IAAM,IAAI,GAAG,UAAC,MAAiB;IACrB,IAAA,IAAI,GAAgD,MAAM,KAAtD,EAAE,UA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AI,CAAC,CAAC,CAAC,CACN,uBAAC,IAAI,aACH,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,IACtB,SAAS,EACb,CACH,CAAC,CAAC,CAAC,IAAI,KACH,KACF,CACR,CAAA;AACH,CAAC,CAAyC,CAAA;AAE1C,aAAK,CAAC,iBAAiB,GAAG,OAAO,CAAA;AAEjC,aAAK,CAAC,QAAQ,GAAG;IACf,SAAS;IACT,KAAK;IACL,MAAM;IACN,aAAa;IACb,eAAe;CAChB,CAAA;AAED,aAAK,CAAC,WAAW,GAAG,SAAS,CAAA;AAE7B,aAAK,CAAC,gBAAgB,GAAG,UAAsB,MAAS;IACtD,OAAO,aAAyE,CAAA;AAClF,CAAC,CAAA;AAED,aAAK,CAAC,YAAY,GAAG;IACnB,IAAI,EAAE,KAAK;IACX,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,KAAK;IACnB,iBAAiB,EAAE,WAAI;CACD,CAAA;AAExB,mCAAgB,CAAC,iBAAiB,CAAC,aAAK,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Pager/styles.ts"],"names":[],"mappings":""}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { StylesOf } from '@codeleap/types';
|
|
2
|
-
import { Settings } from 'react-slick';
|
|
3
|
-
import { PagerComposition } from './styles';
|
|
4
|
-
import React, { ReactNode, ReactElement } from 'react';
|
|
5
|
-
import { ViewProps } from '../View';
|
|
6
|
-
import { ComponentCommonProps } from '../../types';
|
|
7
|
-
import { StyledProp } from '@codeleap/styles';
|
|
8
|
-
export type PagerRef = {
|
|
9
|
-
goTo: (page: number) => void;
|
|
10
|
-
};
|
|
11
|
-
export type PagerProps = Omit<Settings, 'style'> & ComponentCommonProps & {
|
|
12
|
-
style?: StyledProp<PagerComposition>;
|
|
13
|
-
page?: number;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
onChange?: (page: number) => void;
|
|
16
|
-
renderPageWrapper?: React.FC;
|
|
17
|
-
footer?: ReactElement;
|
|
18
|
-
dotsProps?: DotsProps;
|
|
19
|
-
pageWrapperProps?: ViewProps;
|
|
20
|
-
dotsDisabled?: boolean;
|
|
21
|
-
disableSwipe?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type DotsProps = Pick<PagerProps, 'page' | 'dotsDisabled'> & {
|
|
24
|
-
childArray: ReactNode[];
|
|
25
|
-
onPress?: (index: number) => void;
|
|
26
|
-
styles: StylesOf<PagerComposition>;
|
|
27
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Pager/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InputMaskProps, MaskProps, TextInputMaskTypeProp } from './types';
|
|
2
|
-
export declare const getMaskInputProps: ({ masking }: InputMaskProps) => MaskProps & {
|
|
3
|
-
notSaveFormatted: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare const maskPreset: Record<TextInputMaskTypeProp | 'cel-phone-brl', MaskProps>;
|