x-ui-design 1.0.2 → 1.0.3
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/lib/components/Select/Select.tsx +3 -1
- package/package.json +1 -1
- package/src/app/page.tsx +11 -24
|
@@ -586,7 +586,9 @@ const Select = ({
|
|
|
586
586
|
(e) => e.value === selected || e.label === selected || e.children === selected
|
|
587
587
|
) || selected;
|
|
588
588
|
|
|
589
|
-
|
|
589
|
+
const title = typeof option === 'string' ? option : option?.children || option?.label || option?.value || null
|
|
590
|
+
|
|
591
|
+
return <div data-testid={title} style={{ display: 'contents' }}>{title}</div>;
|
|
590
592
|
}, [extractedOptions, selected]) || selected || null;
|
|
591
593
|
|
|
592
594
|
const hasMaxTagCount = hasMode && (typeof maxTagCount === 'number' || maxTagCount === 'responsive');
|
package/package.json
CHANGED
package/src/app/page.tsx
CHANGED
|
@@ -3,33 +3,20 @@
|
|
|
3
3
|
import { Result } from "../../lib/components/Result";
|
|
4
4
|
import { Button } from '../../lib/components/Button';
|
|
5
5
|
import { Popover } from '../../lib/components/Popover';
|
|
6
|
-
import {
|
|
6
|
+
import { Select } from "../../lib/components/Select";
|
|
7
|
+
import Option from "../../lib/components/Select/Option/Option";
|
|
8
|
+
import Tag from "../../lib/components/Select/Tag/Tag";
|
|
7
9
|
|
|
8
10
|
export default function Home() {
|
|
9
11
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getPopupContainer={() => document.body}
|
|
19
|
-
content={
|
|
20
|
-
<Result
|
|
21
|
-
status="success"
|
|
22
|
-
title="Success"
|
|
23
|
-
subTitle="Sorry, you are not authorized to access this page."
|
|
24
|
-
extra={<Button type="primary">Back Home</Button>}
|
|
25
|
-
/>
|
|
26
|
-
}
|
|
27
|
-
>
|
|
28
|
-
<ClearIcon />
|
|
29
|
-
</Popover>
|
|
30
|
-
<div style={{ width: '100%' }} />
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
12
|
+
<Select mode="tags"
|
|
13
|
+
tagRender={(tagProps) => {
|
|
14
|
+
return <Tag {...tagProps}>{tagProps.value}</Tag>
|
|
15
|
+
}}
|
|
16
|
+
options={[ {value: 'tag_1', label: 'Tag 1'}]}
|
|
17
|
+
/>
|
|
18
|
+
// {/* <Option value={'tag_1'}>tag 1</Option> */}
|
|
19
|
+
// </Select>
|
|
33
20
|
)
|
|
34
21
|
}
|
|
35
22
|
|