@veracity/vui 2.21.0 → 2.21.2-rc.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/dist/cjs/accordion/accordionItem.js.map +1 -1
- package/dist/cjs/accordion/accordionItemHorizontal.js.map +1 -1
- package/dist/cjs/definition/definition.d.ts.map +1 -1
- package/dist/cjs/definition/definition.js +18 -14
- package/dist/cjs/definition/definition.js.map +1 -1
- package/dist/cjs/definition/definition.types.d.ts +4 -4
- package/dist/cjs/definition/definition.types.d.ts.map +1 -1
- package/dist/cjs/definition/definitionContent.d.ts.map +1 -1
- package/dist/cjs/definition/definitionContent.js +5 -5
- package/dist/cjs/definition/definitionContent.js.map +1 -1
- package/dist/cjs/definition/theme.d.ts +0 -2
- package/dist/cjs/definition/theme.d.ts.map +1 -1
- package/dist/cjs/definition/theme.js +0 -2
- package/dist/cjs/definition/theme.js.map +1 -1
- package/dist/cjs/header/headerMainLinks.d.ts.map +1 -1
- package/dist/cjs/header/headerMainLinks.js.map +1 -1
- package/dist/cjs/icon/icon.d.ts.map +1 -1
- package/dist/cjs/icon/icon.js +1 -1
- package/dist/cjs/icon/icon.js.map +1 -1
- package/dist/cjs/pagination/helpers.js.map +1 -1
- package/dist/cjs/select/select.d.ts.map +1 -1
- package/dist/cjs/select/select.js +3 -6
- package/dist/cjs/select/select.js.map +1 -1
- package/dist/cjs/select/select.types.d.ts +4 -0
- package/dist/cjs/select/select.types.d.ts.map +1 -1
- package/dist/cjs/select/selectOption.d.ts.map +1 -1
- package/dist/cjs/select/selectOption.js +13 -2
- package/dist/cjs/select/selectOption.js.map +1 -1
- package/dist/cjs/table/tbody.d.ts.map +1 -1
- package/dist/cjs/table/tbody.js +1 -1
- package/dist/cjs/table/tbody.js.map +1 -1
- package/dist/cjs/table/thead.d.ts.map +1 -1
- package/dist/cjs/table/thead.js +1 -1
- package/dist/cjs/table/thead.js.map +1 -1
- package/dist/cjs/theme/components.d.ts +0 -2
- package/dist/cjs/theme/components.d.ts.map +1 -1
- package/dist/cjs/theme/defaultTheme.d.ts +0 -2
- package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
- package/dist/cjs/tree/treeItem.js.map +1 -1
- package/dist/esm/accordion/accordionItem.js.map +1 -1
- package/dist/esm/accordion/accordionItemHorizontal.js.map +1 -1
- package/dist/esm/definition/definition.d.ts.map +1 -1
- package/dist/esm/definition/definition.js +18 -14
- package/dist/esm/definition/definition.js.map +1 -1
- package/dist/esm/definition/definition.types.d.ts +4 -4
- package/dist/esm/definition/definition.types.d.ts.map +1 -1
- package/dist/esm/definition/definitionContent.d.ts.map +1 -1
- package/dist/esm/definition/definitionContent.js +5 -5
- package/dist/esm/definition/definitionContent.js.map +1 -1
- package/dist/esm/definition/theme.d.ts +0 -2
- package/dist/esm/definition/theme.d.ts.map +1 -1
- package/dist/esm/definition/theme.js +0 -2
- package/dist/esm/definition/theme.js.map +1 -1
- package/dist/esm/header/headerMainLinks.d.ts.map +1 -1
- package/dist/esm/header/headerMainLinks.js.map +1 -1
- package/dist/esm/icon/icon.d.ts.map +1 -1
- package/dist/esm/icon/icon.js +1 -1
- package/dist/esm/icon/icon.js.map +1 -1
- package/dist/esm/pagination/helpers.js.map +1 -1
- package/dist/esm/select/select.d.ts.map +1 -1
- package/dist/esm/select/select.js +3 -5
- package/dist/esm/select/select.js.map +1 -1
- package/dist/esm/select/select.types.d.ts +4 -0
- package/dist/esm/select/select.types.d.ts.map +1 -1
- package/dist/esm/select/selectOption.d.ts.map +1 -1
- package/dist/esm/select/selectOption.js +13 -2
- package/dist/esm/select/selectOption.js.map +1 -1
- package/dist/esm/table/tbody.d.ts.map +1 -1
- package/dist/esm/table/tbody.js +1 -1
- package/dist/esm/table/tbody.js.map +1 -1
- package/dist/esm/table/thead.d.ts.map +1 -1
- package/dist/esm/table/thead.js +1 -1
- package/dist/esm/table/thead.js.map +1 -1
- package/dist/esm/theme/components.d.ts +0 -2
- package/dist/esm/theme/components.d.ts.map +1 -1
- package/dist/esm/theme/defaultTheme.d.ts +0 -2
- package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
- package/dist/esm/tree/treeItem.js.map +1 -1
- package/dist/tsconfig.legacy.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/accordion/accordionItem.tsx +2 -2
- package/src/accordion/accordionItemHorizontal.tsx +2 -2
- package/src/definition/definition.tsx +19 -17
- package/src/definition/definition.types.ts +6 -3
- package/src/definition/definitionContent.tsx +25 -16
- package/src/definition/theme.ts +0 -2
- package/src/header/headerMainLinks.tsx +0 -2
- package/src/icon/icon.tsx +1 -3
- package/src/pagination/helpers.ts +4 -4
- package/src/select/select.tsx +5 -4
- package/src/select/select.types.ts +4 -0
- package/src/select/selectOption.tsx +14 -3
- package/src/table/tbody.tsx +1 -5
- package/src/table/thead.tsx +1 -7
- package/src/tree/treeItem.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.21.0",
|
|
3
|
+
"version": "2.21.2-rc.0",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"@xstyled/styled-components": "2.5.0",
|
|
26
26
|
"@xstyled/system": "2.5.0",
|
|
27
27
|
"@xstyled/util": "2.2.3",
|
|
28
|
-
"react-focus-lock": "2.9.
|
|
28
|
+
"react-focus-lock": "2.9.7",
|
|
29
29
|
"styled-components": "5.3.11",
|
|
30
30
|
"tippy.js": "6.3.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"@types/react": "^18.2.
|
|
35
|
-
"@types/react-dom": "^18.2.
|
|
33
|
+
"@types/node": "^20.11.16",
|
|
34
|
+
"@types/react": "^18.2.55",
|
|
35
|
+
"@types/react-dom": "^18.2.19",
|
|
36
36
|
"@veracity/eslint-config": "*",
|
|
37
37
|
"@veracity/prettier-config": "*",
|
|
38
38
|
"@veracity/tsconfig": "*",
|
|
39
39
|
"eslint": "^8.56.0",
|
|
40
|
-
"prettier": "^2.
|
|
40
|
+
"prettier": "^3.2.5",
|
|
41
41
|
"rimraf": "^5.0.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -62,8 +62,8 @@ export const AccordionItem = (props: AccordionItemProps) => {
|
|
|
62
62
|
disabled
|
|
63
63
|
? 'transparent'
|
|
64
64
|
: collapsedInternal
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
? styles.item.itemTitleHoverBg
|
|
66
|
+
: styles.item.expandedItemTitleHoverBg
|
|
67
67
|
}
|
|
68
68
|
justifyContent={iconPosition === 'start' ? 'initial' : 'space-between'}
|
|
69
69
|
onClick={toggle}
|
|
@@ -55,8 +55,8 @@ export const AccordionItemHorizontal = (props: AccordionItemProps) => {
|
|
|
55
55
|
disabled
|
|
56
56
|
? 'transparent'
|
|
57
57
|
: collapsedInternal
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
? styles.item.itemTitleHoverBg
|
|
59
|
+
: styles.item.expandedItemTitleHoverBg
|
|
60
60
|
}
|
|
61
61
|
justifyContent="space-between"
|
|
62
62
|
minH={styles.item.minH}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
1
|
import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
|
|
4
2
|
import { cs } from '../utils'
|
|
5
3
|
import { DefinitionProps } from './definition.types'
|
|
@@ -19,10 +17,17 @@ export const DefinitionVerticalBase = styled.dlBox`
|
|
|
19
17
|
flex-direction: column;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
dt
|
|
23
|
-
dd {
|
|
20
|
+
dt {
|
|
24
21
|
display: inline-flex;
|
|
25
22
|
}
|
|
23
|
+
|
|
24
|
+
dd {
|
|
25
|
+
white-space: pre-wrap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
dd > * {
|
|
29
|
+
margin-left: 0 !important;
|
|
30
|
+
}
|
|
26
31
|
`
|
|
27
32
|
|
|
28
33
|
export const DefinitionHorizontalBase = styled.dlBox`
|
|
@@ -44,21 +49,18 @@ export const DefinitionHorizontalBase = styled.dlBox`
|
|
|
44
49
|
padding-left: 5px;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
|
-
dd {
|
|
48
|
-
::after {
|
|
49
|
-
content: '';
|
|
50
|
-
}
|
|
51
|
-
@media (min-width: 1024px) {
|
|
52
|
-
::after {
|
|
53
|
-
content: ',';
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
52
|
dt {
|
|
59
53
|
width: 20%;
|
|
60
54
|
min-width: 130px;
|
|
61
55
|
}
|
|
56
|
+
|
|
57
|
+
dd {
|
|
58
|
+
white-space: pre-wrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
dd > * {
|
|
62
|
+
margin-left: 0 !important;
|
|
63
|
+
}
|
|
62
64
|
`
|
|
63
65
|
// @formatter:on
|
|
64
66
|
|
|
@@ -72,7 +74,7 @@ export const Definition = vui<'dl', DefinitionProps>((props, ref) => {
|
|
|
72
74
|
{...styles.container}
|
|
73
75
|
{...rest}
|
|
74
76
|
>
|
|
75
|
-
<DefinitionContent {...rest} />
|
|
77
|
+
<DefinitionContent orientation="horizontal" {...rest} />
|
|
76
78
|
</DefinitionHorizontalBase>
|
|
77
79
|
) : (
|
|
78
80
|
<DefinitionVerticalBase
|
|
@@ -81,7 +83,7 @@ export const Definition = vui<'dl', DefinitionProps>((props, ref) => {
|
|
|
81
83
|
{...styles.container}
|
|
82
84
|
{...rest}
|
|
83
85
|
>
|
|
84
|
-
<DefinitionContent {...rest} />
|
|
86
|
+
<DefinitionContent orientation="vertical" {...rest} />
|
|
85
87
|
</DefinitionVerticalBase>
|
|
86
88
|
)
|
|
87
89
|
})
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
|
|
1
3
|
import { IconProp } from '../icon'
|
|
2
4
|
import { SystemProps } from '../system'
|
|
3
5
|
import { ThemingProps } from '../theme'
|
|
4
6
|
|
|
5
|
-
export type
|
|
7
|
+
export type DefinitionItem = SystemProps & {
|
|
6
8
|
key: string
|
|
7
9
|
keyHasIcon?: boolean
|
|
8
|
-
value: string | number | string[] |
|
|
10
|
+
value: string | number | string[] | ReactNode
|
|
9
11
|
valueHasIcon?: boolean
|
|
10
12
|
}
|
|
13
|
+
|
|
11
14
|
export type DefinitionProps = SystemProps &
|
|
12
15
|
ThemingProps<'Definition'> & {
|
|
13
16
|
/** Socket displaying icon on the left side. */
|
|
@@ -16,7 +19,7 @@ export type DefinitionProps = SystemProps &
|
|
|
16
19
|
iconRight?: IconProp | JSX.Element
|
|
17
20
|
isLabelBold?: boolean
|
|
18
21
|
isValueBold?: boolean
|
|
19
|
-
items?:
|
|
22
|
+
items?: DefinitionItem[]
|
|
20
23
|
/** Socket defining orientation. */
|
|
21
24
|
orientation?: 'horizontal' | 'vertical'
|
|
22
25
|
size?: 'sm' | 'md'
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
1
|
import Box from '../box'
|
|
4
2
|
import { styled, useStyleConfig, vui } from '../core'
|
|
5
3
|
import Icon from '../icon'
|
|
4
|
+
import P from '../p'
|
|
6
5
|
import { cs, isArray } from '../utils'
|
|
7
|
-
import {
|
|
6
|
+
import { DefinitionItem, DefinitionProps } from './definition.types'
|
|
8
7
|
|
|
9
8
|
export const DefinitionItemKey = styled.dtBox``
|
|
10
9
|
export const DefinitionItemValue = styled.ddBox``
|
|
11
10
|
|
|
12
11
|
export const DefinitionContent = vui<'dl', DefinitionProps>((props, ref) => {
|
|
13
|
-
const { iconLeft, iconRight, isLabelBold, isValueBold, items } = props as DefinitionProps
|
|
12
|
+
const { iconLeft, iconRight, isLabelBold, isValueBold, items, orientation } = props as DefinitionProps
|
|
14
13
|
|
|
15
14
|
const styles = useStyleConfig('Definition', props)
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
17
|
<>
|
|
19
|
-
{isArray<
|
|
18
|
+
{isArray<DefinitionItem>(items)
|
|
20
19
|
? items.map(({ key, value, ...props }, index) => (
|
|
21
20
|
<Box className="vui-definitionItemWrapper" key={index} ref={ref}>
|
|
22
21
|
<DefinitionItemKey fontWeight={isLabelBold ? 'demi' : 'default'} {...styles.dt}>
|
|
@@ -29,17 +28,27 @@ export const DefinitionContent = vui<'dl', DefinitionProps>((props, ref) => {
|
|
|
29
28
|
)}
|
|
30
29
|
</DefinitionItemKey>
|
|
31
30
|
{isArray(value) ? (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
<DefinitionItemValue
|
|
32
|
+
display="block"
|
|
33
|
+
fontWeight={isValueBold ? 'demi' : 'default'}
|
|
34
|
+
{...styles.dd}
|
|
35
|
+
key={index}
|
|
36
|
+
>
|
|
37
|
+
{orientation === 'horizontal'
|
|
38
|
+
? value.join(', ')
|
|
39
|
+
: value.map((value, index) => (
|
|
40
|
+
<P display="flex" key={index + value}>
|
|
41
|
+
{props.valueHasIcon && iconLeft && (
|
|
42
|
+
<Icon className={cs('vui-definitionIcon')} name={iconLeft} {...styles.icon} />
|
|
43
|
+
)}
|
|
44
|
+
{value}
|
|
45
|
+
{props.valueHasIcon && iconRight && (
|
|
46
|
+
<Icon className={cs('vui-definitionIcon')} name={iconRight} {...styles.icon} />
|
|
47
|
+
)}
|
|
48
|
+
</P>
|
|
49
|
+
))}
|
|
50
|
+
{}
|
|
51
|
+
</DefinitionItemValue>
|
|
43
52
|
) : (
|
|
44
53
|
<DefinitionItemValue fontWeight={isValueBold ? 'demi' : 'default'} {...styles.dd}>
|
|
45
54
|
{props.valueHasIcon && iconLeft && (
|
package/src/definition/theme.ts
CHANGED
package/src/icon/icon.tsx
CHANGED
|
@@ -32,9 +32,7 @@ export const Icon = vui<'svg', IconProps>((props, ref) => {
|
|
|
32
32
|
{...aliasedProps}
|
|
33
33
|
{...rest}
|
|
34
34
|
>
|
|
35
|
-
{customIcon?.d.map((d, i) =>
|
|
36
|
-
<path d={d} fill="currentColor" key={i} {...customIcon.pathProps[i]}></path>
|
|
37
|
-
))}
|
|
35
|
+
{customIcon?.d.map((d, i) => <path d={d} fill="currentColor" key={i} {...customIcon.pathProps[i]}></path>)}
|
|
38
36
|
</Svg>
|
|
39
37
|
)
|
|
40
38
|
})
|
|
@@ -31,8 +31,8 @@ export function getPaginationItems(page: number, pageCount: number) {
|
|
|
31
31
|
...(siblingsStart > boundaryCount + 2
|
|
32
32
|
? ['ellipsisStart']
|
|
33
33
|
: boundaryCount + 1 < pageCount - boundaryCount
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
? [boundaryCount + 1]
|
|
35
|
+
: []),
|
|
36
36
|
|
|
37
37
|
// Sibling pages
|
|
38
38
|
...range(siblingsStart, siblingsEnd),
|
|
@@ -41,8 +41,8 @@ export function getPaginationItems(page: number, pageCount: number) {
|
|
|
41
41
|
...(siblingsEnd < pageCount - boundaryCount - 1
|
|
42
42
|
? ['ellipsisEnd']
|
|
43
43
|
: pageCount - boundaryCount > boundaryCount
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
? [pageCount - boundaryCount]
|
|
45
|
+
: []),
|
|
46
46
|
|
|
47
47
|
...endPages,
|
|
48
48
|
'next',
|
package/src/select/select.tsx
CHANGED
|
@@ -27,6 +27,7 @@ export function Select(props: SelectProps) {
|
|
|
27
27
|
defaultValue,
|
|
28
28
|
disabled,
|
|
29
29
|
errorText,
|
|
30
|
+
closeOnScroll,
|
|
30
31
|
helpText,
|
|
31
32
|
id: idProp,
|
|
32
33
|
isInvalid,
|
|
@@ -73,9 +74,7 @@ export function Select(props: SelectProps) {
|
|
|
73
74
|
variant,
|
|
74
75
|
...selectProps,
|
|
75
76
|
}
|
|
76
|
-
const onQueryChange = (e: any) =>
|
|
77
|
-
setQuery(e.target.value?.toLowerCase())
|
|
78
|
-
}
|
|
77
|
+
const onQueryChange = (e: any) => setQuery(e.target.value?.toLowerCase())
|
|
79
78
|
|
|
80
79
|
const filterOptions = (i: SelectOptionData) =>
|
|
81
80
|
!showOptionsFilter || !query?.length ? true : i?.text?.toLowerCase()?.includes(query)
|
|
@@ -115,7 +114,9 @@ export function Select(props: SelectProps) {
|
|
|
115
114
|
)}
|
|
116
115
|
<SelectGroup maxH={maxHeight} tabIndex={1000}>
|
|
117
116
|
{children ??
|
|
118
|
-
filteredOptions?.map?.(option =>
|
|
117
|
+
filteredOptions?.map?.(option => (
|
|
118
|
+
<SelectOption closeOnScroll={closeOnScroll} key={option.value} title={option.text} {...option} />
|
|
119
|
+
))}
|
|
119
120
|
</SelectGroup>
|
|
120
121
|
</SelectContent>
|
|
121
122
|
</>
|
|
@@ -24,6 +24,8 @@ export type SelectProps = ThemingProps<'Select'> &
|
|
|
24
24
|
UseSelectProps & {
|
|
25
25
|
/** Select cannot be opened and is styled accordingly. */
|
|
26
26
|
disabled?: boolean
|
|
27
|
+
/** Hiding the options list on scroll event. Recommended for scrollable containers. */
|
|
28
|
+
closeOnScroll?: boolean
|
|
27
29
|
/** Socket displaying error text below an input. */
|
|
28
30
|
errorText?: string | React.ReactNode
|
|
29
31
|
/** Socket displaying help text below an input. */
|
|
@@ -64,6 +66,8 @@ export type SelectOptionData = {
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
export type SelectOptionProps = ListItemProps & {
|
|
69
|
+
/** Hiding the options list on scroll event. */
|
|
70
|
+
closeOnScroll?: boolean
|
|
67
71
|
/** Currently selected value. Can be a string/number or array of those when using 'isMultiple'. */
|
|
68
72
|
value?: SelectValue
|
|
69
73
|
/** Hover title text. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
2
|
|
|
3
3
|
import { Checkbox } from '../checkbox'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
@@ -14,13 +14,15 @@ import { SelectOptionProps } from './select.types'
|
|
|
14
14
|
* 'onChange' is triggered with a modified click event, which adds 'value' and 'name' properties.
|
|
15
15
|
*/
|
|
16
16
|
export const SelectOption = vui<'li', SelectOptionProps>((props, ref) => {
|
|
17
|
-
const { children, className, disabled, title, onClick: onClickProp, value: valueProp, ...rest } = props
|
|
17
|
+
const { children, closeOnScroll, className, disabled, title, onClick: onClickProp, value: valueProp, ...rest } = props
|
|
18
18
|
const { instance } = usePopoverContext() ?? {}
|
|
19
19
|
const { isMultiple, name, onChange, value } = useSelectContext() ?? {}
|
|
20
20
|
const styles = useStyleConfig('Select', useSelectContext())
|
|
21
21
|
|
|
22
22
|
const isSelected = Array.isArray(value) && valueProp ? value.includes(valueProp) : value === valueProp
|
|
23
23
|
|
|
24
|
+
const hide = () => instance?.hide()
|
|
25
|
+
|
|
24
26
|
const onClick = useCallbackRef((e: MouseEvent<HTMLLIElement> | KeyboardEvent<HTMLLIElement>) => {
|
|
25
27
|
const nativeEvent = e.nativeEvent || e
|
|
26
28
|
const clonedEvent = new (nativeEvent.constructor as any)(nativeEvent.type, nativeEvent)
|
|
@@ -32,11 +34,20 @@ export const SelectOption = vui<'li', SelectOptionProps>((props, ref) => {
|
|
|
32
34
|
|
|
33
35
|
onClickProp?.(e as MouseEvent<HTMLLIElement>)
|
|
34
36
|
onChange?.(clonedEvent)
|
|
35
|
-
!isMultiple &&
|
|
37
|
+
!isMultiple && hide()
|
|
36
38
|
})
|
|
37
39
|
|
|
38
40
|
const onKeyDown = useCallbackRef((e: KeyboardEvent<HTMLLIElement>) => e.key === 'Enter' && onClick(e))
|
|
39
41
|
|
|
42
|
+
// Hiding the popover on scroll
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (closeOnScroll) document.addEventListener('scroll', hide, true)
|
|
45
|
+
|
|
46
|
+
return () => {
|
|
47
|
+
if (closeOnScroll) document.removeEventListener('scroll', hide, true)
|
|
48
|
+
}
|
|
49
|
+
}, [closeOnScroll])
|
|
50
|
+
|
|
40
51
|
return (
|
|
41
52
|
<ListItem
|
|
42
53
|
activeBg="skyBlue.active"
|
package/src/table/tbody.tsx
CHANGED
|
@@ -41,11 +41,7 @@ export const Tbody = vui<'tbody', TbodyProps>((props, ref) => {
|
|
|
41
41
|
<TbodyBase className={cs('vui-tbody', className)} ref={ref} {...styles.tbody} {...rest}>
|
|
42
42
|
{children ??
|
|
43
43
|
rows?.map((row, index) => (
|
|
44
|
-
<Tr key={index}>
|
|
45
|
-
{columns?.map(column => (
|
|
46
|
-
<Td key={column.field}>{row[column.field]}</Td>
|
|
47
|
-
))}
|
|
48
|
-
</Tr>
|
|
44
|
+
<Tr key={index}>{columns?.map(column => <Td key={column.field}>{row[column.field]}</Td>)}</Tr>
|
|
49
45
|
))}
|
|
50
46
|
</TbodyBase>
|
|
51
47
|
)
|
package/src/table/thead.tsx
CHANGED
|
@@ -33,13 +33,7 @@ export const Thead = vui<'thead', TheadProps>((props, ref) => {
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<TheadBase className={cs('vui-thead', className)} ref={ref} {...stickyProps} {...styles.thead} {...rest}>
|
|
36
|
-
{children ?? (
|
|
37
|
-
<Tr>
|
|
38
|
-
{columns?.map(column => (
|
|
39
|
-
<Th key={column.field} role="columnheader" {...column} />
|
|
40
|
-
))}
|
|
41
|
-
</Tr>
|
|
42
|
-
)}
|
|
36
|
+
{children ?? <Tr>{columns?.map(column => <Th key={column.field} role="columnheader" {...column} />)}</Tr>}
|
|
43
37
|
</TheadBase>
|
|
44
38
|
)
|
|
45
39
|
})
|
package/src/tree/treeItem.tsx
CHANGED
|
@@ -157,8 +157,8 @@ export const TreeItem = vui<'li', TreeItemProps>((props, ref) => {
|
|
|
157
157
|
? styles?.firstLevelItem?.activeBg
|
|
158
158
|
: styles?.firstLevelItem?.bg
|
|
159
159
|
: isActiveInternal
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
? styles?.item?.activeBg
|
|
161
|
+
: bg
|
|
162
162
|
}
|
|
163
163
|
hoverBg={undefined}
|
|
164
164
|
{...aliasedProps}
|