@os-design/core 1.0.183 → 1.0.185
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/DatePicker/index.js +7 -8
- package/dist/cjs/DatePicker/index.js.map +1 -1
- package/dist/cjs/FormItem/index.js +42 -28
- package/dist/cjs/FormItem/index.js.map +1 -1
- package/dist/cjs/MenuGroup/index.js +37 -16
- package/dist/cjs/MenuGroup/index.js.map +1 -1
- package/dist/cjs/Select/index.js +321 -63
- package/dist/cjs/Select/index.js.map +1 -1
- package/dist/esm/DatePicker/index.js +5 -6
- package/dist/esm/DatePicker/index.js.map +1 -1
- package/dist/esm/FormItem/index.js +37 -25
- package/dist/esm/FormItem/index.js.map +1 -1
- package/dist/esm/MenuGroup/index.js +44 -32
- package/dist/esm/MenuGroup/index.js.map +1 -1
- package/dist/esm/Select/index.js +342 -59
- package/dist/esm/Select/index.js.map +1 -1
- package/dist/types/DatePicker/index.d.ts.map +1 -1
- package/dist/types/FormItem/index.d.ts +2 -2
- package/dist/types/FormItem/index.d.ts.map +1 -1
- package/dist/types/MenuGroup/index.d.ts +13 -6
- package/dist/types/MenuGroup/index.d.ts.map +1 -1
- package/dist/types/Select/index.d.ts +65 -7
- package/dist/types/Select/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/Select/SelectList.js +0 -146
- package/dist/cjs/Select/SelectList.js.map +0 -1
- package/dist/cjs/Select/SelectToggle.js +0 -195
- package/dist/cjs/Select/SelectToggle.js.map +0 -1
- package/dist/esm/Select/SelectList.js +0 -125
- package/dist/esm/Select/SelectList.js.map +0 -1
- package/dist/esm/Select/SelectToggle.js +0 -217
- package/dist/esm/Select/SelectToggle.js.map +0 -1
- package/dist/types/Select/SelectList.d.ts +0 -22
- package/dist/types/Select/SelectList.d.ts.map +0 -1
- package/dist/types/Select/SelectToggle.d.ts +0 -73
- package/dist/types/Select/SelectToggle.d.ts.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React, { forwardRef, useContext, useMemo } from 'react';
|
|
3
2
|
import styled from '@emotion/styled';
|
|
4
|
-
import {
|
|
3
|
+
import { m } from '@os-design/media';
|
|
4
|
+
import { MenuContext } from '@os-design/menu-utils';
|
|
5
5
|
import { ellipsisStyles } from '@os-design/styles';
|
|
6
|
+
import { clr } from '@os-design/theming';
|
|
6
7
|
import { useForwardedState } from '@os-design/utils';
|
|
7
|
-
import {
|
|
8
|
-
import { useSelectHandler, MenuContext } from '@os-design/menu-utils';
|
|
8
|
+
import React, { forwardRef, useCallback, useContext, useMemo } from 'react';
|
|
9
9
|
import MenuItem from '../MenuItem';
|
|
10
10
|
const Title = styled.div`
|
|
11
11
|
font-weight: 500;
|
|
@@ -38,7 +38,8 @@ const Container = styled.div`
|
|
|
38
38
|
*/
|
|
39
39
|
const MenuGroup = /*#__PURE__*/forwardRef(({
|
|
40
40
|
title,
|
|
41
|
-
|
|
41
|
+
multiple = false,
|
|
42
|
+
maxSelectedItems = 0,
|
|
42
43
|
value,
|
|
43
44
|
defaultValue,
|
|
44
45
|
onChange = () => {},
|
|
@@ -48,39 +49,50 @@ const MenuGroup = /*#__PURE__*/forwardRef(({
|
|
|
48
49
|
const {
|
|
49
50
|
closeOnSelect
|
|
50
51
|
} = useContext(MenuContext);
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
53
|
const [forwardedValue, setForwardedValue] = useForwardedState({
|
|
52
54
|
value,
|
|
53
55
|
defaultValue,
|
|
54
56
|
onChange
|
|
55
57
|
});
|
|
56
|
-
const onSelect =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
58
|
+
const onSelect = useCallback(v => {
|
|
59
|
+
if (multiple) {
|
|
60
|
+
// Delete the value because it was already selected
|
|
61
|
+
if ((forwardedValue || []).includes(v)) {
|
|
62
|
+
setForwardedValue((forwardedValue || []).filter(item => item !== v));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Add a new value if the number of selected items is less than max
|
|
67
|
+
if (maxSelectedItems === 0 || (forwardedValue || []).length < maxSelectedItems) {
|
|
68
|
+
setForwardedValue([...(forwardedValue || []), v]);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setForwardedValue(v);
|
|
74
|
+
}, [forwardedValue, maxSelectedItems, multiple, setForwardedValue]);
|
|
75
|
+
const menuItems = useMemo(() => React.Children.map(children, child => {
|
|
76
|
+
if (! /*#__PURE__*/React.isValidElement(child) || child.type !== MenuItem) return child;
|
|
77
|
+
const {
|
|
78
|
+
value: childValue,
|
|
79
|
+
onClick: childOnClick
|
|
80
|
+
} = child.props;
|
|
81
|
+
const selected = multiple && (forwardedValue || []).includes(childValue) || !multiple && forwardedValue === childValue;
|
|
82
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
83
|
+
key: childValue,
|
|
84
|
+
selected,
|
|
85
|
+
onClick: e => {
|
|
86
|
+
if (!childValue) return;
|
|
87
|
+
onSelect(childValue);
|
|
88
|
+
if (childOnClick) childOnClick(e);
|
|
89
|
+
},
|
|
90
|
+
...(!closeOnSelect ? {
|
|
91
|
+
role: maxSelectedItems === 1 ? 'menuitemradio' : 'menuitemcheckbox',
|
|
92
|
+
'aria-checked': selected
|
|
93
|
+
} : {})
|
|
82
94
|
});
|
|
83
|
-
}, [children, closeOnSelect, forwardedValue, maxSelectedItems, onSelect]);
|
|
95
|
+
}), [children, closeOnSelect, forwardedValue, maxSelectedItems, multiple, onSelect]);
|
|
84
96
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
85
97
|
role: maxSelectedItems === 1 ? 'radiogroup' : 'group'
|
|
86
98
|
}, rest, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["styled","m","MenuContext","ellipsisStyles","clr","useForwardedState","React","forwardRef","useCallback","useContext","useMemo","MenuItem","Title","div","p","theme","sizes","small","menuGroupColorTitle","modalBodyPaddingHorizontal","min","xs","Container","menuGroupColorDivider","modalBodyPaddingVertical","MenuGroup","title","multiple","maxSelectedItems","value","defaultValue","onChange","children","rest","ref","closeOnSelect","forwardedValue","setForwardedValue","onSelect","v","includes","filter","item","length","menuItems","Children","map","child","isValidElement","type","childValue","onClick","childOnClick","props","selected","cloneElement","key","e","role","displayName"],"sources":["../../../src/MenuGroup/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { m } from '@os-design/media';\nimport { MenuContext } from '@os-design/menu-utils';\nimport { ellipsisStyles } from '@os-design/styles';\nimport { clr } from '@os-design/theming';\nimport { useForwardedState } from '@os-design/utils';\nimport React, { forwardRef, useCallback, useContext, useMemo } from 'react';\nimport MenuItem from '../MenuItem';\n\ntype JsxDivProps = Omit<\n JSX.IntrinsicElements['div'],\n 'defaultValue' | 'value' | 'onChange' | 'ref'\n>;\ninterface BaseMenuGroupProps<T> extends JsxDivProps {\n /**\n * The title of the menu group.\n * @default undefined\n */\n title?: string;\n /**\n * The max number of options that the user can select. Zero means unlimited.\n * Works only when multiple is true.\n * @default 0\n */\n maxSelectedItems?: number;\n /**\n * Selected menu items.\n * @default undefined\n */\n value?: T;\n /**\n * The default value.\n * @default undefined\n */\n defaultValue?: T;\n /**\n * The change event handler.\n * @default undefined\n */\n onChange?: (value: T) => void;\n}\ninterface MenuGroupNotMultipleProps extends BaseMenuGroupProps<string | null> {\n /**\n * Is it possible to select multiple values.\n * @default false\n */\n multiple?: false;\n}\ninterface MenuGroupMultipleProps extends BaseMenuGroupProps<string[]> {\n /**\n * Is it possible to select multiple values.\n * @default false\n */\n multiple: true;\n}\nexport type MenuGroupProps = MenuGroupNotMultipleProps | MenuGroupMultipleProps;\n\nconst Title = styled.div`\n font-weight: 500;\n font-size: ${(p) => p.theme.sizes.small}em;\n color: ${(p) => clr(p.theme.menuGroupColorTitle)};\n margin-bottom: 0.4em;\n\n padding: 0 ${(p) => p.theme.modalBodyPaddingHorizontal[0]}em;\n ${m.min.xs} {\n padding: 0 0.8em;\n }\n\n ${ellipsisStyles};\n`;\n\nconst Container = styled.div`\n &:not(:last-of-type) {\n padding-bottom: 0.4em;\n border-bottom: 1px solid ${(p) => clr(p.theme.menuGroupColorDivider)};\n }\n &:not(:first-of-type) {\n margin-top: ${(p) => p.theme.modalBodyPaddingVertical[0]}em;\n ${m.min.xs} {\n margin-top: 0.4em;\n }\n }\n`;\n\n/**\n * The group of menu items.\n */\nconst MenuGroup = forwardRef<HTMLDivElement, MenuGroupProps>(\n (\n {\n title,\n multiple = false,\n maxSelectedItems = 0,\n value,\n defaultValue,\n onChange = () => {},\n children,\n ...rest\n },\n ref\n ) => {\n const { closeOnSelect } = useContext(MenuContext);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [forwardedValue, setForwardedValue] = useForwardedState<any>({\n value,\n defaultValue,\n onChange,\n });\n\n const onSelect = useCallback(\n (v: string) => {\n if (multiple) {\n // Delete the value because it was already selected\n if ((forwardedValue || []).includes(v)) {\n setForwardedValue(\n (forwardedValue || []).filter((item) => item !== v)\n );\n return;\n }\n\n // Add a new value if the number of selected items is less than max\n if (\n maxSelectedItems === 0 ||\n (forwardedValue || []).length < maxSelectedItems\n ) {\n setForwardedValue([...(forwardedValue || []), v]);\n return;\n }\n return;\n }\n setForwardedValue(v);\n },\n [forwardedValue, maxSelectedItems, multiple, setForwardedValue]\n );\n\n const menuItems = useMemo(\n () =>\n React.Children.map(children, (child) => {\n if (!React.isValidElement(child) || child.type !== MenuItem)\n return child;\n const { value: childValue, onClick: childOnClick } = child.props;\n const selected =\n (multiple && (forwardedValue || []).includes(childValue)) ||\n (!multiple && forwardedValue === childValue);\n return React.cloneElement<any>(child, {\n key: childValue,\n selected,\n onClick: (e) => {\n if (!childValue) return;\n onSelect(childValue);\n if (childOnClick) childOnClick(e);\n },\n ...(!closeOnSelect\n ? {\n role:\n maxSelectedItems === 1\n ? 'menuitemradio'\n : 'menuitemcheckbox',\n 'aria-checked': selected,\n }\n : {}),\n });\n }),\n [\n children,\n closeOnSelect,\n forwardedValue,\n maxSelectedItems,\n multiple,\n onSelect,\n ]\n );\n\n return (\n <Container\n role={maxSelectedItems === 1 ? 'radiogroup' : 'group'}\n {...rest}\n ref={ref}\n >\n {title && <Title>{title}</Title>}\n {menuItems}\n </Container>\n );\n }\n);\n\nMenuGroup.displayName = 'MenuGroup';\n\nexport default MenuGroup;\n"],"mappings":"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"}
|
package/dist/esm/Select/index.js
CHANGED
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Close, CloseCircle, Down, Loading, Up } from '@os-design/icons';
|
|
5
|
+
import { m, useIsMinWidth } from '@os-design/media';
|
|
6
|
+
import { ellipsisStyles, resetButtonStyles, transitionStyles } from '@os-design/styles';
|
|
7
|
+
import { clr, ThemeOverrider, useTheme } from '@os-design/theming';
|
|
8
|
+
import { omitEmotionProps, useBrowserLayoutEffect, useEvent, useFontSize, useForwardedRef, useForwardedState, useResizeObserver, useSize } from '@os-design/utils';
|
|
8
9
|
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
|
+
import { FixedSizeList } from 'react-window';
|
|
11
|
+
import Button from '../Button';
|
|
9
12
|
import { InputContainer } from '../Input';
|
|
10
13
|
import InputSearch from '../InputSearch';
|
|
14
|
+
import useRWLoadNext from '../List/utils/useRWLoadNext';
|
|
11
15
|
import Menu from '../Menu';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
16
|
+
import MenuItem from '../MenuItem';
|
|
17
|
+
import Tag from '../Tag';
|
|
14
18
|
import defaultLocale from './utils/defaultLocale';
|
|
15
|
-
const
|
|
19
|
+
const selectContainerPaddingStyles = p => {
|
|
16
20
|
const paddingVertical = (p.theme.baseHeight - p.theme.selectToggleListItemHeight) / 2;
|
|
17
21
|
return css`
|
|
18
22
|
padding: calc(${paddingVertical}em - 1px) 0;
|
|
19
23
|
`;
|
|
20
24
|
};
|
|
21
|
-
const
|
|
25
|
+
const selectContainerOpenedStyles = p => p.opened && !p.unbordered && css`
|
|
22
26
|
border-color: ${clr(p.theme.inputFocusColorBorder)};
|
|
23
27
|
box-shadow: 0 0 0 0.15em ${clr(p.theme.inputFocusColorShadow)};
|
|
24
28
|
`;
|
|
25
|
-
const
|
|
29
|
+
const selectContainerUnborderedStyles = p => p.unbordered && css`
|
|
26
30
|
border: 0;
|
|
27
31
|
box-shadow: none !important;
|
|
28
32
|
${transitionStyles('background-color')(p)};
|
|
29
33
|
`;
|
|
30
|
-
const
|
|
34
|
+
const selectContainerUnborderedHoverStyles = p => p.unbordered && !p.disabled && css`
|
|
31
35
|
@media (hover: hover) {
|
|
32
36
|
&:hover,
|
|
33
37
|
&:focus {
|
|
@@ -45,10 +49,10 @@ export const SelectContainer = styled(InputContainer, omitEmotionProps('opened',
|
|
|
45
49
|
height: unset;
|
|
46
50
|
min-height: ${p => p.theme.baseHeight}em;
|
|
47
51
|
|
|
48
|
-
${
|
|
49
|
-
${
|
|
50
|
-
${
|
|
51
|
-
${
|
|
52
|
+
${selectContainerPaddingStyles};
|
|
53
|
+
${selectContainerOpenedStyles};
|
|
54
|
+
${selectContainerUnborderedStyles};
|
|
55
|
+
${selectContainerUnborderedHoverStyles};
|
|
52
56
|
`;
|
|
53
57
|
const SelectMenu = styled(Menu, omitEmotionProps('width'))`
|
|
54
58
|
padding-top: 0;
|
|
@@ -71,6 +75,116 @@ const InputSearchContainer = styled.div`
|
|
|
71
75
|
padding: ${p => p.theme.menuPaddingVertical}em
|
|
72
76
|
${p => p.theme.inputPaddingHorizontal}em 0;
|
|
73
77
|
`;
|
|
78
|
+
export const ToggleContainer = styled.div`
|
|
79
|
+
flex: 1;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
`;
|
|
84
|
+
const toggleContentNotHasLeftStyles = p => !p.hasLeft && css`
|
|
85
|
+
padding-left: ${p.theme.inputPaddingHorizontal}em;
|
|
86
|
+
`;
|
|
87
|
+
const toggleContentNotHasRightStyles = p => !p.hasRight && !p.unbordered && css`
|
|
88
|
+
padding-right: ${p.theme.inputPaddingHorizontal}em;
|
|
89
|
+
`;
|
|
90
|
+
export const ToggleContent = styled('div', omitEmotionProps('hasLeft', 'hasRight', 'unbordered'))`
|
|
91
|
+
flex: 1;
|
|
92
|
+
${toggleContentNotHasLeftStyles};
|
|
93
|
+
${toggleContentNotHasRightStyles};
|
|
94
|
+
${ellipsisStyles};
|
|
95
|
+
`;
|
|
96
|
+
export const Placeholder = styled.span`
|
|
97
|
+
color: ${p => clr(p.theme.inputColorPlaceholder)};
|
|
98
|
+
${ellipsisStyles};
|
|
99
|
+
`;
|
|
100
|
+
const titleUnborderedTitleStyles = p => p.unbordered && css`
|
|
101
|
+
font-weight: 500;
|
|
102
|
+
${!p.disabled && `color: ${clr(p.theme.colorPrimary)};`}
|
|
103
|
+
`;
|
|
104
|
+
const titleDisabledStyles = p => p.disabled && css`
|
|
105
|
+
color: ${clr(p.theme.inputDisabledColorText)};
|
|
106
|
+
`;
|
|
107
|
+
export const Title = styled('span', omitEmotionProps('disabled', 'unbordered'))`
|
|
108
|
+
color: ${p => clr(p.theme.colorText)};
|
|
109
|
+
${titleUnborderedTitleStyles};
|
|
110
|
+
${titleDisabledStyles};
|
|
111
|
+
${ellipsisStyles};
|
|
112
|
+
`;
|
|
113
|
+
const ToggleListItem = styled(Tag, omitEmotionProps('disabled'))`
|
|
114
|
+
// Reset tag styles
|
|
115
|
+
padding-top: 0;
|
|
116
|
+
padding-bottom: 0;
|
|
117
|
+
|
|
118
|
+
height: ${p => p.theme.selectToggleListItemHeight}em;
|
|
119
|
+
${titleDisabledStyles};
|
|
120
|
+
`;
|
|
121
|
+
const ToggleList = styled.div`
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-wrap: wrap;
|
|
124
|
+
overflow: hidden; // For ellipsis styles
|
|
125
|
+
|
|
126
|
+
margin: 0 ${p => p.theme.selectToggleListItemGap}em
|
|
127
|
+
${p => -p.theme.selectToggleListItemGap}em 0;
|
|
128
|
+
|
|
129
|
+
& > div {
|
|
130
|
+
margin: 0 ${p => p.theme.selectToggleListItemGap}em
|
|
131
|
+
${p => p.theme.selectToggleListItemGap}em 0;
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
const DeleteButton = styled.button`
|
|
135
|
+
${resetButtonStyles};
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
display: inherit;
|
|
138
|
+
font-size: 1em;
|
|
139
|
+
margin-left: 0.2em;
|
|
140
|
+
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
color: ${p => clr(p.theme.selectToggleDeleteButtonColorIcon)};
|
|
143
|
+
|
|
144
|
+
@media (hover: hover) {
|
|
145
|
+
&:hover,
|
|
146
|
+
&:focus {
|
|
147
|
+
color: ${p => clr(p.theme.selectToggleDeleteButtonColorIconHover)};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
${transitionStyles('color')};
|
|
152
|
+
`;
|
|
153
|
+
const toggleIconUnborderedStyles = p => p.unbordered && css`
|
|
154
|
+
padding-top: 0.2em;
|
|
155
|
+
font-size: 0.8em;
|
|
156
|
+
${!p.disabled && `color: ${clr(p.theme.colorPrimary)};`}
|
|
157
|
+
`;
|
|
158
|
+
export const ToggleIconContainer = styled('span', omitEmotionProps('unbordered', 'disabled'))`
|
|
159
|
+
color: ${p => clr(p.theme.selectColorIcon)};
|
|
160
|
+
line-height: 1;
|
|
161
|
+
${toggleIconUnborderedStyles};
|
|
162
|
+
`;
|
|
163
|
+
export const ClearIcon = styled(CloseCircle)`
|
|
164
|
+
transform: scale(1.2) !important;
|
|
165
|
+
`;
|
|
166
|
+
const Addon = styled('span', omitEmotionProps('hasPadding'))`
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
user-select: none;
|
|
170
|
+
color: ${p => clr(p.theme.inputColorPlaceholder)};
|
|
171
|
+
|
|
172
|
+
svg {
|
|
173
|
+
transform: scale(1.2);
|
|
174
|
+
}
|
|
175
|
+
`;
|
|
176
|
+
export const ToggleLeftAddon = styled(Addon)`
|
|
177
|
+
padding-right: ${p => p.theme.inputAddonPaddingHorizontal}em;
|
|
178
|
+
${p => p.hasPadding && css`
|
|
179
|
+
padding-left: ${p.theme.inputPaddingHorizontal}em;
|
|
180
|
+
`}
|
|
181
|
+
`;
|
|
182
|
+
export const ToggleRightAddon = styled(Addon)`
|
|
183
|
+
padding-left: ${p => p.theme.inputAddonPaddingHorizontal}em;
|
|
184
|
+
${p => p.hasPadding && css`
|
|
185
|
+
padding-right: ${p.theme.inputPaddingHorizontal}em;
|
|
186
|
+
`}
|
|
187
|
+
`;
|
|
74
188
|
|
|
75
189
|
/**
|
|
76
190
|
* The component that allows to pick a value from predefined options.
|
|
@@ -94,7 +208,8 @@ const Select = /*#__PURE__*/forwardRef(({
|
|
|
94
208
|
threshold = 10,
|
|
95
209
|
visibleCount = 6,
|
|
96
210
|
overscanCount = 10,
|
|
97
|
-
|
|
211
|
+
multiple = false,
|
|
212
|
+
maxSelectedItems = 0,
|
|
98
213
|
locale = defaultLocale,
|
|
99
214
|
value,
|
|
100
215
|
defaultValue,
|
|
@@ -110,14 +225,14 @@ const Select = /*#__PURE__*/forwardRef(({
|
|
|
110
225
|
const [width, setWidth] = useState(0);
|
|
111
226
|
const inputSearchContainerRef = useRef(null);
|
|
112
227
|
const [opened, setOpened] = useState(autoOpen);
|
|
228
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
229
|
const [forwardedValue, setForwardedValue] = useForwardedState({
|
|
114
230
|
value,
|
|
115
231
|
defaultValue,
|
|
116
232
|
onChange
|
|
117
233
|
});
|
|
118
234
|
useEffect(() => {
|
|
119
|
-
if (
|
|
120
|
-
containerRef.current?.focus();
|
|
235
|
+
if (autoFocus) containerRef.current?.focus();
|
|
121
236
|
}, [autoFocus, containerRef]);
|
|
122
237
|
const onCloseRef = useRef(onClose);
|
|
123
238
|
useEffect(() => {
|
|
@@ -151,17 +266,190 @@ const Select = /*#__PURE__*/forwardRef(({
|
|
|
151
266
|
if (!containerRef.current) return;
|
|
152
267
|
containerRef.current.setAttribute('aria-haspopup', 'listbox');
|
|
153
268
|
}, []);
|
|
154
|
-
const selectedItems = useMemo(() => (forwardedValue || []).map(v => {
|
|
155
|
-
const option = (options || []).find(item => item.value === v);
|
|
156
|
-
return {
|
|
157
|
-
title: option ? option.title || '' : '',
|
|
158
|
-
value: v
|
|
159
|
-
};
|
|
160
|
-
}), [forwardedValue, options]);
|
|
161
269
|
const listBoxId = useMemo(() => `listbox-${Math.random().toString(36).slice(2, 11)}`, []);
|
|
162
270
|
const blurHandler = useCallback(e => {
|
|
163
271
|
if (!opened) onBlur(e);
|
|
164
272
|
}, [onBlur, opened]);
|
|
273
|
+
const onDelete = useCallback(v => {
|
|
274
|
+
if (!multiple) return;
|
|
275
|
+
setForwardedValue((forwardedValue || []).filter(item => item !== v));
|
|
276
|
+
}, [forwardedValue, multiple, setForwardedValue]);
|
|
277
|
+
const toggleContent = useMemo(() => {
|
|
278
|
+
if (multiple) {
|
|
279
|
+
if (!forwardedValue || forwardedValue.length === 0) {
|
|
280
|
+
return /*#__PURE__*/React.createElement(Placeholder, null, placeholder);
|
|
281
|
+
}
|
|
282
|
+
const items = forwardedValue.map(v => {
|
|
283
|
+
const option = (options || []).find(item => item.value === v);
|
|
284
|
+
return {
|
|
285
|
+
title: option ? option.title || '' : '',
|
|
286
|
+
value: v
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
return /*#__PURE__*/React.createElement(ToggleList, null, items.map(({
|
|
290
|
+
title,
|
|
291
|
+
value: v
|
|
292
|
+
}) => /*#__PURE__*/React.createElement(ToggleListItem, {
|
|
293
|
+
key: v,
|
|
294
|
+
disabled: disabled,
|
|
295
|
+
right: !disabled ? /*#__PURE__*/React.createElement(DeleteButton, {
|
|
296
|
+
onClick: e => {
|
|
297
|
+
onDelete(v);
|
|
298
|
+
e.stopPropagation();
|
|
299
|
+
},
|
|
300
|
+
onKeyDown: e => e.stopPropagation(),
|
|
301
|
+
"aria-label": `${locale.deleteLabel} ${title}`,
|
|
302
|
+
"aria-hidden": true
|
|
303
|
+
}, /*#__PURE__*/React.createElement(Close, null)) : undefined,
|
|
304
|
+
"aria-hidden": true
|
|
305
|
+
}, title)));
|
|
306
|
+
}
|
|
307
|
+
if (!forwardedValue) {
|
|
308
|
+
return /*#__PURE__*/React.createElement(Placeholder, null, placeholder);
|
|
309
|
+
}
|
|
310
|
+
const option = (options || []).find(item => item.value === forwardedValue);
|
|
311
|
+
return /*#__PURE__*/React.createElement(Title, {
|
|
312
|
+
disabled: disabled,
|
|
313
|
+
unbordered: unbordered
|
|
314
|
+
}, option ? option.title : '');
|
|
315
|
+
}, [disabled, forwardedValue, locale.deleteLabel, multiple, onDelete, options, placeholder, unbordered]);
|
|
316
|
+
const toggleShowClearButton = useMemo(() => {
|
|
317
|
+
if (!clearVisible) return false;
|
|
318
|
+
if (multiple) return forwardedValue && forwardedValue.length > 0;
|
|
319
|
+
return !!forwardedValue;
|
|
320
|
+
}, [clearVisible, forwardedValue, multiple]);
|
|
321
|
+
const toggleOnClear = useCallback(() => {
|
|
322
|
+
setForwardedValue(multiple ? [] : null);
|
|
323
|
+
if (!containerRef.current) return;
|
|
324
|
+
containerRef.current.focus();
|
|
325
|
+
}, [containerRef, multiple, setForwardedValue]);
|
|
326
|
+
const toggleRightValue = useMemo(() => {
|
|
327
|
+
if (loading) return /*#__PURE__*/React.createElement(Loading, null);
|
|
328
|
+
if (toggleShowClearButton) {
|
|
329
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
330
|
+
type: "ghost",
|
|
331
|
+
wide: "never",
|
|
332
|
+
size: "small",
|
|
333
|
+
disabled: disabled,
|
|
334
|
+
onClick: e => {
|
|
335
|
+
toggleOnClear();
|
|
336
|
+
e.stopPropagation();
|
|
337
|
+
},
|
|
338
|
+
onKeyDown: e => {
|
|
339
|
+
if (e.key === 'Enter') toggleOnClear();
|
|
340
|
+
e.stopPropagation();
|
|
341
|
+
},
|
|
342
|
+
"aria-label": locale.clearLabel
|
|
343
|
+
}, /*#__PURE__*/React.createElement(ClearIcon, null));
|
|
344
|
+
}
|
|
345
|
+
return right || /*#__PURE__*/React.createElement(ToggleIconContainer, {
|
|
346
|
+
unbordered: unbordered,
|
|
347
|
+
disabled: disabled
|
|
348
|
+
}, opened ? /*#__PURE__*/React.createElement(Up, null) : /*#__PURE__*/React.createElement(Down, null));
|
|
349
|
+
}, [disabled, loading, locale.clearLabel, opened, right, toggleOnClear, toggleShowClearButton, unbordered]);
|
|
350
|
+
const toggleRightHasPaddingValue = useMemo(() => {
|
|
351
|
+
if (loading) return true;
|
|
352
|
+
if (toggleShowClearButton) return false;
|
|
353
|
+
return right ? rightHasPadding : true;
|
|
354
|
+
}, [loading, right, rightHasPadding, toggleShowClearButton]);
|
|
355
|
+
const onSelect = useCallback(v => {
|
|
356
|
+
if (multiple) {
|
|
357
|
+
// Delete the value because it was already selected
|
|
358
|
+
if ((forwardedValue || []).includes(v)) {
|
|
359
|
+
setForwardedValue((forwardedValue || []).filter(item => item !== v));
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Add a new value if the number of selected items is less than max
|
|
364
|
+
if (maxSelectedItems === 0 || (forwardedValue || []).length < maxSelectedItems) {
|
|
365
|
+
setForwardedValue([...(forwardedValue || []), v]);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
setForwardedValue(v);
|
|
371
|
+
}, [forwardedValue, maxSelectedItems, multiple, setForwardedValue]);
|
|
372
|
+
const windowSize = useSize();
|
|
373
|
+
const isMinXs = useIsMinWidth('xs');
|
|
374
|
+
const fontSize = useFontSize(document.body);
|
|
375
|
+
const {
|
|
376
|
+
theme
|
|
377
|
+
} = useTheme();
|
|
378
|
+
const scaleFactor = useMemo(() => {
|
|
379
|
+
const s = size || 'medium';
|
|
380
|
+
return ['small', 'medium', 'large'].includes(s) ? theme.sizes[s] : Number(s.replace(/^([0-9]+(\.[0-9]+)?).*/, '$1')) || 1; // Extract the number
|
|
381
|
+
}, [size, theme.sizes]);
|
|
382
|
+
const paddingBottom = useMemo(() => {
|
|
383
|
+
const paddingEm = isMinXs ? theme.menuPaddingVertical : theme.modalBodyPaddingVertical[0];
|
|
384
|
+
return paddingEm * fontSize * scaleFactor;
|
|
385
|
+
}, [isMinXs, theme.menuPaddingVertical, theme.modalBodyPaddingVertical, fontSize, scaleFactor]);
|
|
386
|
+
const paddingTop = useMemo(() => searchVisible ? 5 * scaleFactor : paddingBottom, [searchVisible, scaleFactor, paddingBottom]);
|
|
387
|
+
const searchInputHeight = useMemo(() => searchVisible ? (theme.baseHeight + theme.menuPaddingVertical) * fontSize * scaleFactor : 0, [searchVisible, theme.baseHeight, theme.menuPaddingVertical, fontSize, scaleFactor]);
|
|
388
|
+
const itemSize = useMemo(() => theme.menuItemHeight * fontSize * scaleFactor, [theme.menuItemHeight, fontSize, scaleFactor]);
|
|
389
|
+
const height = useMemo(() => {
|
|
390
|
+
// Modal
|
|
391
|
+
if (!isMinXs) {
|
|
392
|
+
const maxHeight = windowSize.height - theme.modalHeaderHeight * fontSize * scaleFactor - searchInputHeight;
|
|
393
|
+
const curHeight = options.length * itemSize + paddingTop + paddingBottom;
|
|
394
|
+
return curHeight < maxHeight ? curHeight : maxHeight;
|
|
395
|
+
}
|
|
396
|
+
// Popover
|
|
397
|
+
const count = options.length < visibleCount ? options.length : visibleCount;
|
|
398
|
+
return count * itemSize + paddingTop + paddingBottom;
|
|
399
|
+
}, [isMinXs, options.length, visibleCount, itemSize, windowSize.height, theme.modalHeaderHeight, fontSize, scaleFactor, searchInputHeight, paddingTop, paddingBottom]);
|
|
400
|
+
const scrollHandler = useRWLoadNext({
|
|
401
|
+
itemCount: options.length,
|
|
402
|
+
threshold,
|
|
403
|
+
itemSize,
|
|
404
|
+
paddingTop,
|
|
405
|
+
height,
|
|
406
|
+
onLoadNext
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
410
|
+
const InnerElement = useCallback(({
|
|
411
|
+
style,
|
|
412
|
+
...innerElementRest
|
|
413
|
+
}) => /*#__PURE__*/React.createElement("div", _extends({
|
|
414
|
+
style: {
|
|
415
|
+
...style,
|
|
416
|
+
height: `${parseFloat(style.height) + paddingTop + paddingBottom}px`
|
|
417
|
+
},
|
|
418
|
+
role: "listbox",
|
|
419
|
+
id: listBoxId
|
|
420
|
+
}, innerElementRest)), [listBoxId, paddingBottom, paddingTop]);
|
|
421
|
+
const listItemFn = useCallback(({
|
|
422
|
+
index,
|
|
423
|
+
style
|
|
424
|
+
}) => {
|
|
425
|
+
const {
|
|
426
|
+
title: optionTitle,
|
|
427
|
+
value: optionValue,
|
|
428
|
+
onClick: optionOnClick,
|
|
429
|
+
...restOption
|
|
430
|
+
} = options[index];
|
|
431
|
+
return /*#__PURE__*/React.createElement(MenuItem, _extends({
|
|
432
|
+
style: {
|
|
433
|
+
...style,
|
|
434
|
+
top: `${parseFloat(style.top ? style.top.toString() : '0') + paddingTop}px`
|
|
435
|
+
},
|
|
436
|
+
selected: multiple && (forwardedValue || []).includes(optionValue || '') || !multiple && forwardedValue === optionValue,
|
|
437
|
+
onClick: e => {
|
|
438
|
+
if (!optionValue) return;
|
|
439
|
+
onSelect(optionValue);
|
|
440
|
+
|
|
441
|
+
// Focus the input.
|
|
442
|
+
// Otherwise, if multiple is false and the user presses enter to select an item,
|
|
443
|
+
// the input will lose focus.
|
|
444
|
+
if (containerRef.current && !multiple) {
|
|
445
|
+
containerRef.current.focus();
|
|
446
|
+
}
|
|
447
|
+
if (optionOnClick) optionOnClick(e);
|
|
448
|
+
},
|
|
449
|
+
role: "option",
|
|
450
|
+
"aria-selected": multiple && (forwardedValue || []).includes(optionValue || '') || !multiple && forwardedValue === optionValue
|
|
451
|
+
}, restOption), optionTitle);
|
|
452
|
+
}, [containerRef, forwardedValue, multiple, onSelect, options, paddingTop]);
|
|
165
453
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SelectContainer, _extends({
|
|
166
454
|
opened: opened,
|
|
167
455
|
unbordered: unbordered,
|
|
@@ -188,51 +476,46 @@ const Select = /*#__PURE__*/forwardRef(({
|
|
|
188
476
|
"aria-owns": listBoxId
|
|
189
477
|
}, rest, {
|
|
190
478
|
ref: mergedContainerRef
|
|
191
|
-
}), /*#__PURE__*/React.createElement(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
locale: locale
|
|
211
|
-
})), /*#__PURE__*/React.createElement(SelectMenu, {
|
|
479
|
+
}), /*#__PURE__*/React.createElement(ToggleContainer, null, left && /*#__PURE__*/React.createElement(ThemeOverrider, {
|
|
480
|
+
overrides: t => ({
|
|
481
|
+
buttonPaddingHorizontal: 0.8,
|
|
482
|
+
baseHeight: t.selectToggleListItemHeight / t.sizes.small
|
|
483
|
+
})
|
|
484
|
+
}, /*#__PURE__*/React.createElement(ToggleLeftAddon, {
|
|
485
|
+
hasPadding: leftHasPadding
|
|
486
|
+
}, left)), /*#__PURE__*/React.createElement(ToggleContent, {
|
|
487
|
+
hasLeft: !!left,
|
|
488
|
+
hasRight: !!right,
|
|
489
|
+
unbordered: unbordered
|
|
490
|
+
}, toggleContent), toggleRightValue && /*#__PURE__*/React.createElement(ThemeOverrider, {
|
|
491
|
+
overrides: t => ({
|
|
492
|
+
buttonPaddingHorizontal: 0.8,
|
|
493
|
+
baseHeight: t.selectToggleListItemHeight / t.sizes.small
|
|
494
|
+
})
|
|
495
|
+
}, /*#__PURE__*/React.createElement(ToggleRightAddon, {
|
|
496
|
+
hasPadding: toggleRightHasPaddingValue
|
|
497
|
+
}, toggleRightValue)))), /*#__PURE__*/React.createElement(SelectMenu, {
|
|
212
498
|
trigger: containerRef,
|
|
213
499
|
visible: opened,
|
|
214
500
|
onClose: () => setOpened(false),
|
|
215
501
|
size: size,
|
|
216
502
|
width: width,
|
|
217
|
-
closeOnSelect:
|
|
503
|
+
closeOnSelect: !multiple,
|
|
218
504
|
modalTitle: placeholder,
|
|
219
505
|
placement: placement
|
|
220
506
|
}, searchVisible && /*#__PURE__*/React.createElement(InputSearchContainer, {
|
|
221
507
|
ref: inputSearchContainerRef
|
|
222
|
-
}, /*#__PURE__*/React.createElement(InputSearch, searchProps)), options.length > 0 ? /*#__PURE__*/React.createElement(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
508
|
+
}, /*#__PURE__*/React.createElement(InputSearch, searchProps)), options.length > 0 ? /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
509
|
+
width: "100%",
|
|
510
|
+
height: height,
|
|
511
|
+
itemSize: itemSize,
|
|
512
|
+
itemCount: options.length,
|
|
226
513
|
overscanCount: overscanCount,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
onChange: setForwardedValue,
|
|
233
|
-
id: listBoxId,
|
|
234
|
-
size: size
|
|
235
|
-
}) : /*#__PURE__*/React.createElement(NotFound, null, notFoundText)));
|
|
514
|
+
onScroll: ({
|
|
515
|
+
scrollOffset
|
|
516
|
+
}) => scrollHandler(scrollOffset),
|
|
517
|
+
innerElementType: InnerElement
|
|
518
|
+
}, listItemFn) : /*#__PURE__*/React.createElement(NotFound, null, notFoundText)));
|
|
236
519
|
});
|
|
237
520
|
Select.displayName = 'Select';
|
|
238
521
|
export default Select;
|