@codeleap/web 3.25.2 → 3.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { StylesOf, TypeGuards } from '@codeleap/common'
|
|
2
|
+
import { StylesOf, TypeGuards, PropsOf } from '@codeleap/common'
|
|
3
3
|
import { ListComposition, ListParts } from './styles'
|
|
4
4
|
import { ListProps } from './types'
|
|
5
5
|
import { View } from '../View'
|
|
@@ -11,6 +11,7 @@ export type ListLayoutProps = Omit<ListProps, 'renderItem'> & UseInfiniteScrollR
|
|
|
11
11
|
variantStyles: StylesOf<ListComposition>
|
|
12
12
|
children?: React.ReactNode
|
|
13
13
|
showFooter?: boolean
|
|
14
|
+
wrapperProps?: Partial<PropsOf<typeof View>>
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
type ListRefreshControlComponent = Partial<ListLayoutProps> & {
|
|
@@ -67,6 +68,7 @@ export const ListLayout = (props: ListLayoutProps) => {
|
|
|
67
68
|
ListLoadingIndicatorComponent,
|
|
68
69
|
scrollableRef,
|
|
69
70
|
showFooter = true,
|
|
71
|
+
wrapperProps = {},
|
|
70
72
|
} = props
|
|
71
73
|
|
|
72
74
|
const getKeyStyle = React.useCallback((key: ListParts) => ([
|
|
@@ -77,7 +79,7 @@ export const ListLayout = (props: ListLayoutProps) => {
|
|
|
77
79
|
|
|
78
80
|
return (
|
|
79
81
|
// @ts-ignore
|
|
80
|
-
<View css={[getKeyStyle('wrapper'), style]} ref={scrollableRef}>
|
|
82
|
+
<View css={[getKeyStyle('wrapper'), style]} ref={scrollableRef} {...wrapperProps}>
|
|
81
83
|
{!!ListHeaderComponent ? <ListHeaderComponent /> : null}
|
|
82
84
|
|
|
83
85
|
{isEmpty ? <ListEmptyComponent debugName={debugName} {...placeholder} /> : null}
|
|
@@ -56,6 +56,7 @@ export function List<T = any>(props: ListProps<T>) {
|
|
|
56
56
|
masonryProps = {},
|
|
57
57
|
reloadTimeout,
|
|
58
58
|
showFooter,
|
|
59
|
+
layoutWrapperProps = {},
|
|
59
60
|
} = allProps
|
|
60
61
|
|
|
61
62
|
const variantStyles = useDefaultComponentStyle<'u:List', typeof ListPresets>('u:List', {
|
|
@@ -102,6 +103,7 @@ export function List<T = any>(props: ListProps<T>) {
|
|
|
102
103
|
<ListLayout
|
|
103
104
|
{...allProps}
|
|
104
105
|
{...layoutProps}
|
|
106
|
+
wrapperProps={layoutWrapperProps}
|
|
105
107
|
variantStyles={variantStyles}
|
|
106
108
|
showFooter={reloadingLayout ? false : showFooter}
|
|
107
109
|
>
|
|
@@ -33,8 +33,8 @@ const DefaultOption = (props: TCustomOption & { component: (props: TCustomOption
|
|
|
33
33
|
rightIcon={isSelected && selectedIcon}
|
|
34
34
|
debugName={debugName}
|
|
35
35
|
{...itemProps}
|
|
36
|
-
styles={styles}
|
|
37
36
|
{...props?.data?.itemProps}
|
|
37
|
+
styles={styles}
|
|
38
38
|
/>
|
|
39
39
|
)
|
|
40
40
|
} else {
|
|
@@ -176,7 +176,7 @@ const defaultProps: Partial<SelectProps> = {
|
|
|
176
176
|
|
|
177
177
|
export const Select = forwardRef<HTMLInputElement, SelectProps>(
|
|
178
178
|
<T extends string | number = string, Multi extends boolean = false>
|
|
179
|
-
|
|
179
|
+
(props: SelectProps<T, Multi>, inputRef: React.ForwardedRef<HTMLInputElement>) => {
|
|
180
180
|
|
|
181
181
|
type Option = FormTypes.Option<T>
|
|
182
182
|
|
package/src/types/utility.ts
CHANGED
|
@@ -22,6 +22,11 @@ export type ElementMap = {
|
|
|
22
22
|
'section': WithChildren<JSX.IntrinsicElements['section']>
|
|
23
23
|
'header': WithChildren<JSX.IntrinsicElements['header']>
|
|
24
24
|
'footer': WithChildren<JSX.IntrinsicElements['footer']>
|
|
25
|
+
'nav': WithChildren<JSX.IntrinsicElements['nav']>
|
|
26
|
+
'article': WithChildren<JSX.IntrinsicElements['article']>
|
|
27
|
+
'ul': WithChildren<JSX.IntrinsicElements['ul']>
|
|
28
|
+
'ol': WithChildren<JSX.IntrinsicElements['ol']>
|
|
29
|
+
'aside': WithChildren<JSX.IntrinsicElements['aside']>
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
export type NativeHTMLElement = keyof ElementMap
|