haya-select 1.0.78 → 1.0.80
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/build/select/index.d.ts +1 -1
- package/build/select/index.js +6 -3
- package/build/select/index.js.map +1 -1
- package/build/select/option-group.d.ts +1 -1
- package/build/select/option-group.js +1 -1
- package/build/select/option-group.js.map +1 -1
- package/build/select/option.d.ts +1 -1
- package/build/select/option.js +1 -1
- package/build/select/option.js.map +1 -1
- package/package.json +4 -3
- package/.eslintrc.js +0 -5
- package/android/build.gradle +0 -43
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/expo/modules/hayaselect/HayaSelectModule.kt +0 -50
- package/android/src/main/java/expo/modules/hayaselect/HayaSelectView.kt +0 -30
- package/expo-module.config.json +0 -17
- package/ios/HayaSelect.podspec +0 -29
- package/ios/HayaSelectModule.swift +0 -48
- package/ios/HayaSelectView.swift +0 -38
- package/src/config.js +0 -40
- package/src/select/index.jsx +0 -873
- package/src/select/option-group.jsx +0 -31
- package/src/select/option.jsx +0 -81
- package/tsconfig.json +0 -10
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {memo} from "react"
|
|
2
|
-
import PropTypes from "prop-types"
|
|
3
|
-
import React from "react"
|
|
4
|
-
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
5
|
-
import {Text, View} from "react-native"
|
|
6
|
-
|
|
7
|
-
export default memo(shapeComponent(class OptionGroup extends ShapeComponent {
|
|
8
|
-
static propTypes = {
|
|
9
|
-
option: PropTypes.object.isRequired
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
render() {
|
|
13
|
-
return (
|
|
14
|
-
<View
|
|
15
|
-
dataSet={this.rootViewDataSet ||= {class: "haya-select--option-group"}}
|
|
16
|
-
style={this.rootViewStyle ||= {
|
|
17
|
-
paddingTop: 4,
|
|
18
|
-
paddingRight: 8,
|
|
19
|
-
paddingBottom: 4,
|
|
20
|
-
paddingLeft: 8,
|
|
21
|
-
color: "#000",
|
|
22
|
-
fontWeight: "bold"
|
|
23
|
-
}}
|
|
24
|
-
>
|
|
25
|
-
<Text>
|
|
26
|
-
{this.props.option.text}
|
|
27
|
-
</Text>
|
|
28
|
-
</View>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
}))
|
package/src/select/option.jsx
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
2
|
-
import {memo, useMemo} from "react"
|
|
3
|
-
import {Pressable} from "react-native"
|
|
4
|
-
import PropTypes from "prop-types"
|
|
5
|
-
import React from "react"
|
|
6
|
-
|
|
7
|
-
export default memo(shapeComponent(class Option extends ShapeComponent {
|
|
8
|
-
static defaultProps = {
|
|
9
|
-
disabled: false
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
static propTypes = {
|
|
13
|
-
currentOptionValues: PropTypes.array,
|
|
14
|
-
disabled: PropTypes.bool.isRequired,
|
|
15
|
-
icon: PropTypes.string,
|
|
16
|
-
onOptionClicked: PropTypes.func.isRequired,
|
|
17
|
-
option: PropTypes.object.isRequired,
|
|
18
|
-
presentOption: PropTypes.func.isRequired
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
setup() {
|
|
22
|
-
this.useStates({
|
|
23
|
-
hover: false
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
render() {
|
|
28
|
-
const {currentOptionValues, option} = this.p
|
|
29
|
-
const {hover} = this.s
|
|
30
|
-
const disabled = Boolean(option.disabled)
|
|
31
|
-
const selected = Boolean(currentOptionValues?.find((currentOptionValue) => currentOptionValue == option.value))
|
|
32
|
-
|
|
33
|
-
const style = useMemo(() => {
|
|
34
|
-
const style = {
|
|
35
|
-
paddingTop: 4,
|
|
36
|
-
paddingRight: 8,
|
|
37
|
-
paddingBottom: 4,
|
|
38
|
-
paddingLeft: 8,
|
|
39
|
-
color: "#000"
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (disabled) {
|
|
43
|
-
style.cursor = "default"
|
|
44
|
-
style.opacity = 0.6
|
|
45
|
-
} else {
|
|
46
|
-
style.cursor = "pointer"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (selected) {
|
|
50
|
-
style.backgroundColor = "#80b2ff"
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (hover) {
|
|
54
|
-
style.backgroundColor = "steelblue"
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return style
|
|
58
|
-
}, [disabled, hover, selected])
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Pressable
|
|
62
|
-
dataSet={this.cache("pressableDataSet", {
|
|
63
|
-
class: "select-option",
|
|
64
|
-
disabled,
|
|
65
|
-
selected,
|
|
66
|
-
value: this.props.option.value
|
|
67
|
-
}, [disabled, selected, this.props.option.value])}
|
|
68
|
-
onPress={this.tt.onPress}
|
|
69
|
-
onPointerOver={this.tt.onPointerOver}
|
|
70
|
-
onPointerOut={this.tt.onPointerOut}
|
|
71
|
-
style={style}
|
|
72
|
-
>
|
|
73
|
-
{this.p.presentOption(option, "option")}
|
|
74
|
-
</Pressable>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
onPointerOver = () => this.setState({hover: true})
|
|
79
|
-
onPointerOut = () => this.setState({hover: false})
|
|
80
|
-
onPress = (e) => this.p.onOptionClicked(e, this.props.option)
|
|
81
|
-
}))
|
package/tsconfig.json
DELETED