@ltht-react/select 2.0.190 → 2.0.191
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/README.md +15 -15
- package/package.json +6 -6
- package/src/index.tsx +30 -30
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Select
|
|
2
|
-
|
|
3
|
-
<!-- STORY -->
|
|
4
|
-
|
|
5
|
-
### Import
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import Select from '@ltht-react/select'
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
<Select />
|
|
15
|
-
```
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
### Import
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import Select from '@ltht-react/select'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<Select />
|
|
15
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/select",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.191",
|
|
4
4
|
"description": "ltht-react atoms Select component.",
|
|
5
5
|
"author": "LTHT",
|
|
6
6
|
"homepage": "",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@emotion/react": "^11.0.0",
|
|
30
30
|
"@emotion/styled": "^11.0.0",
|
|
31
|
-
"@ltht-react/icon": "^2.0.
|
|
32
|
-
"@ltht-react/styles": "^2.0.
|
|
33
|
-
"@ltht-react/types": "^2.0.
|
|
34
|
-
"@ltht-react/utils": "^2.0.
|
|
31
|
+
"@ltht-react/icon": "^2.0.191",
|
|
32
|
+
"@ltht-react/styles": "^2.0.191",
|
|
33
|
+
"@ltht-react/types": "^2.0.191",
|
|
34
|
+
"@ltht-react/utils": "^2.0.191",
|
|
35
35
|
"react": "^18.2.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "c5113953a19f4ed9ae82b545f073b5feb7d5a20b"
|
|
38
38
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { FC, OptionHTMLAttributes, SelectHTMLAttributes } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
import { inputBaseStyles } from '@ltht-react/styles'
|
|
4
|
-
|
|
5
|
-
const StyledSelect = styled.select`
|
|
6
|
-
${inputBaseStyles}
|
|
7
|
-
height:100%;
|
|
8
|
-
width: 100%;
|
|
9
|
-
color: black;
|
|
10
|
-
|
|
11
|
-
option:disabled {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
`
|
|
15
|
-
|
|
16
|
-
const Select: FC<ISelectProps> = ({ onChange, options, value, ...rest }) => (
|
|
17
|
-
<StyledSelect onChange={(e) => onChange && onChange(e)} value={value} {...rest}>
|
|
18
|
-
{options.map((item, key) => (
|
|
19
|
-
<option key={key} value={item.value}>
|
|
20
|
-
{item.label}
|
|
21
|
-
</option>
|
|
22
|
-
))}
|
|
23
|
-
</StyledSelect>
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
interface ISelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
27
|
-
options: OptionHTMLAttributes<HTMLOptionElement>[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default Select
|
|
1
|
+
import { FC, OptionHTMLAttributes, SelectHTMLAttributes } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
import { inputBaseStyles } from '@ltht-react/styles'
|
|
4
|
+
|
|
5
|
+
const StyledSelect = styled.select`
|
|
6
|
+
${inputBaseStyles}
|
|
7
|
+
height:100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
color: black;
|
|
10
|
+
|
|
11
|
+
option:disabled {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
`
|
|
15
|
+
|
|
16
|
+
const Select: FC<ISelectProps> = ({ onChange, options, value, ...rest }) => (
|
|
17
|
+
<StyledSelect onChange={(e) => onChange && onChange(e)} value={value} {...rest}>
|
|
18
|
+
{options.map((item, key) => (
|
|
19
|
+
<option key={key} value={item.value}>
|
|
20
|
+
{item.label}
|
|
21
|
+
</option>
|
|
22
|
+
))}
|
|
23
|
+
</StyledSelect>
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
interface ISelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
27
|
+
options: OptionHTMLAttributes<HTMLOptionElement>[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default Select
|