@startupjs-ui/select 0.3.5 → 0.3.7
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/CHANGELOG.md +16 -0
- package/index.cssx.styl +11 -0
- package/index.tsx +19 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.3.7](https://github.com/startupjs/startupjs-ui/compare/v0.3.6...v0.3.7) (2026-06-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/select
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.3.6](https://github.com/startupjs/startupjs-ui/compare/v0.3.5...v0.3.6) (2026-06-19)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @startupjs-ui/select
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.3.5](https://github.com/startupjs/startupjs-ui/compare/v0.3.4...v0.3.5) (2026-06-19)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @startupjs-ui/select
|
package/index.cssx.styl
ADDED
package/index.tsx
CHANGED
|
@@ -4,6 +4,18 @@ import TextInput, { type UITextInputProps } from '@startupjs-ui/text-input'
|
|
|
4
4
|
import { faAngleDown } from '@fortawesome/free-solid-svg-icons/faAngleDown'
|
|
5
5
|
import Wrapper from './Wrapper'
|
|
6
6
|
import { getLabelFromValue, type SelectOption } from './Wrapper/helpers'
|
|
7
|
+
import STYLES from './index.cssx.styl'
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
config: {
|
|
11
|
+
emptyValueLabel: defaultEmptyValueLabel,
|
|
12
|
+
multiline: defaultMultiline
|
|
13
|
+
}
|
|
14
|
+
} = STYLES
|
|
15
|
+
|
|
16
|
+
function isConfigEnabled (value: unknown): boolean {
|
|
17
|
+
return value !== false && value !== 0 && value !== '0'
|
|
18
|
+
}
|
|
7
19
|
|
|
8
20
|
export default observer(Select)
|
|
9
21
|
|
|
@@ -56,8 +68,12 @@ function Select ({
|
|
|
56
68
|
'aria-required': ariaRequired,
|
|
57
69
|
onChange,
|
|
58
70
|
ref,
|
|
71
|
+
multiline,
|
|
59
72
|
...props
|
|
60
73
|
}: SelectProps): ReactNode {
|
|
74
|
+
const resolvedEmptyValueLabel = emptyValueLabel ?? defaultEmptyValueLabel ?? undefined
|
|
75
|
+
const resolvedMultiline = multiline ?? isConfigEnabled(defaultMultiline)
|
|
76
|
+
|
|
61
77
|
function renderWrapper (
|
|
62
78
|
{ style }: { style?: any },
|
|
63
79
|
children: ReactNode
|
|
@@ -70,7 +86,7 @@ function Select ({
|
|
|
70
86
|
value=value
|
|
71
87
|
onChange=onChange
|
|
72
88
|
showEmptyValue=showEmptyValue
|
|
73
|
-
emptyValueLabel=
|
|
89
|
+
emptyValueLabel=resolvedEmptyValueLabel
|
|
74
90
|
testID=testID
|
|
75
91
|
aria-label=ariaLabel
|
|
76
92
|
id=id
|
|
@@ -88,12 +104,13 @@ function Select ({
|
|
|
88
104
|
//- Add onKeyPress to 'keyDown' key that opens select dropdown
|
|
89
105
|
TextInput(
|
|
90
106
|
ref=ref
|
|
91
|
-
value=getLabelFromValue(value, options,
|
|
107
|
+
value=getLabelFromValue(value, options, resolvedEmptyValueLabel)
|
|
92
108
|
disabled=disabled
|
|
93
109
|
icon=faAngleDown
|
|
94
110
|
iconPosition='right'
|
|
95
111
|
_renderWrapper=renderWrapper
|
|
96
112
|
editable=false /* HACK: Fixes cursor visibility when focusing on Select because we're focusing on TextInput */
|
|
113
|
+
multiline=resolvedMultiline
|
|
97
114
|
...props
|
|
98
115
|
)
|
|
99
116
|
`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/select",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@react-native-picker/picker": "^2.11.1",
|
|
12
12
|
"@startupjs-ui/core": "^0.3.0",
|
|
13
|
-
"@startupjs-ui/div": "^0.3.
|
|
13
|
+
"@startupjs-ui/div": "^0.3.7",
|
|
14
14
|
"@startupjs-ui/span": "^0.3.4",
|
|
15
|
-
"@startupjs-ui/text-input": "^0.3.
|
|
15
|
+
"@startupjs-ui/text-input": "^0.3.7"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": "*",
|
|
19
19
|
"react-native": "*",
|
|
20
20
|
"startupjs": "*"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "a8bf45fdf47b12f25a690d9b9286fe1747edd5e9"
|
|
23
23
|
}
|