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.
@@ -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
- }))
@@ -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
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "expo-module-scripts/tsconfig.base",
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "jsx": "react",
6
- "outDir": "./build"
7
- },
8
- "include": ["./src"],
9
- "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__rsc_tests__/*"]
10
- }