@momo-kits/slider 0.77.2 → 0.77.4

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/DefaultLabel.js DELETED
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {View, StyleSheet} from 'react-native';
4
- import {Text} from '@momo-kits/core-v2';
5
-
6
- const sliderRadius = 3;
7
- const width = 50;
8
-
9
- export default class DefaultLabel extends React.Component {
10
- render() {
11
- const {
12
- oneMarkerValue,
13
- twoMarkerValue,
14
- oneMarkerLeftPosition,
15
- twoMarkerLeftPosition,
16
- oneMarkerPressed,
17
- twoMarkerPressed,
18
- } = this.props;
19
-
20
- return (
21
- <View style={{position: 'relative'}}>
22
- {Number.isFinite(oneMarkerLeftPosition) &&
23
- Number.isFinite(oneMarkerValue) && (
24
- <View
25
- style={[
26
- styles.sliderLabel,
27
- {
28
- left: oneMarkerLeftPosition - width / 2 + sliderRadius,
29
- },
30
- oneMarkerPressed && styles.markerPressed,
31
- ]}>
32
- <Text style={styles.sliderLabelText}>{oneMarkerValue}</Text>
33
- </View>
34
- )}
35
-
36
- {Number.isFinite(twoMarkerLeftPosition) &&
37
- Number.isFinite(twoMarkerValue) && (
38
- <View
39
- style={[
40
- styles.sliderLabel,
41
- {
42
- left: twoMarkerLeftPosition - width / 2 + sliderRadius,
43
- },
44
- twoMarkerPressed && styles.markerPressed,
45
- ]}>
46
- <Text style={styles.sliderLabelText}>{twoMarkerValue}</Text>
47
- </View>
48
- )}
49
- </View>
50
- );
51
- }
52
- }
53
-
54
- const styles = StyleSheet.create({
55
- sliderLabel: {
56
- position: 'absolute',
57
- bottom: 0,
58
- minWidth: width,
59
- padding: 8,
60
- backgroundColor: '#f1f1f1',
61
- },
62
- sliderLabelText: {
63
- alignItems: 'center',
64
- textAlign: 'center',
65
- fontStyle: 'normal',
66
- // fontSize: 11,
67
- },
68
- markerPressed: {
69
- borderWidth: 2,
70
- borderColor: '#999',
71
- },
72
- });
73
-
74
- DefaultLabel.propTypes = {
75
- oneMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
76
- twoMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
77
-
78
- oneMarkerLeftPosition: PropTypes.number,
79
- twoMarkerLeftPosition: PropTypes.number,
80
-
81
- oneMarkerPressed: PropTypes.bool,
82
- twoMarkerPressed: PropTypes.bool,
83
- };
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {View, StyleSheet} from 'react-native';
4
- import Text from '../../core/components/typography';
5
-
6
- const sliderRadius = 3;
7
- const width = 50;
8
-
9
- export default class DefaultLabel extends React.Component {
10
- render() {
11
- const {
12
- oneMarkerValue,
13
- twoMarkerValue,
14
- oneMarkerLeftPosition,
15
- twoMarkerLeftPosition,
16
- oneMarkerPressed,
17
- twoMarkerPressed,
18
- } = this.props;
19
-
20
- return (
21
- <View style={{position: 'relative'}}>
22
- {Number.isFinite(oneMarkerLeftPosition) &&
23
- Number.isFinite(oneMarkerValue) && (
24
- <View
25
- style={[
26
- styles.sliderLabel,
27
- {
28
- left: oneMarkerLeftPosition - width / 2 + sliderRadius,
29
- },
30
- oneMarkerPressed && styles.markerPressed,
31
- ]}>
32
- <Text style={styles.sliderLabelText}>{oneMarkerValue}</Text>
33
- </View>
34
- )}
35
-
36
- {Number.isFinite(twoMarkerLeftPosition) &&
37
- Number.isFinite(twoMarkerValue) && (
38
- <View
39
- style={[
40
- styles.sliderLabel,
41
- {
42
- left: twoMarkerLeftPosition - width / 2 + sliderRadius,
43
- },
44
- twoMarkerPressed && styles.markerPressed,
45
- ]}>
46
- <Text style={styles.sliderLabelText}>{twoMarkerValue}</Text>
47
- </View>
48
- )}
49
- </View>
50
- );
51
- }
52
- }
53
-
54
- const styles = StyleSheet.create({
55
- sliderLabel: {
56
- position: 'absolute',
57
- bottom: 0,
58
- minWidth: width,
59
- padding: 8,
60
- backgroundColor: '#f1f1f1',
61
- },
62
- sliderLabelText: {
63
- alignItems: 'center',
64
- textAlign: 'center',
65
- fontStyle: 'normal',
66
- // fontSize: 11,
67
- },
68
- markerPressed: {
69
- borderWidth: 2,
70
- borderColor: '#999',
71
- },
72
- });
73
-
74
- DefaultLabel.propTypes = {
75
- oneMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
76
- twoMarkerValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
77
-
78
- oneMarkerLeftPosition: PropTypes.number,
79
- twoMarkerLeftPosition: PropTypes.number,
80
-
81
- oneMarkerPressed: PropTypes.bool,
82
- twoMarkerPressed: PropTypes.bool,
83
- };
package/DefaultMarker.js DELETED
@@ -1,67 +0,0 @@
1
- import React from 'react';
2
- import {Platform, StyleSheet, View} from 'react-native';
3
- import {Colors, Shadow, TouchableOpacity} from '@momo-kits/core-v2';
4
-
5
- // import {Radius} from '../../core';
6
-
7
- class DefaultMarker extends React.Component {
8
- render() {
9
- const {
10
- enabled,
11
- markerStyle,
12
- pressed,
13
- pressedMarkerStyle,
14
- disabledMarkerStyle,
15
- activeColor,
16
- } = this.props;
17
- return (
18
- <TouchableOpacity>
19
- <View
20
- style={
21
- enabled
22
- ? [
23
- styles.markerStyle,
24
- Shadow.Dark,
25
- markerStyle,
26
- pressed && styles.pressedMarkerStyle,
27
- pressed && pressedMarkerStyle,
28
- {backgroundColor: activeColor},
29
- ]
30
- : [
31
- Shadow.Dark,
32
- styles.markerStyle,
33
- styles.disabled,
34
- disabledMarkerStyle,
35
- ]
36
- }
37
- />
38
- </TouchableOpacity>
39
- );
40
- }
41
- }
42
-
43
- const styles = StyleSheet.create({
44
- markerStyle: {
45
- height: 20,
46
- width: 20,
47
- borderRadius: 10,
48
- borderWidth: 4,
49
- borderColor: Colors.white,
50
- },
51
- pressedMarkerStyle: {
52
- ...Platform.select({
53
- web: {},
54
- ios: {},
55
- android: {
56
- height: 20,
57
- width: 20,
58
- borderRadius: 20,
59
- },
60
- }),
61
- },
62
- disabled: {
63
- backgroundColor: Colors.black_09,
64
- },
65
- });
66
-
67
- export default DefaultMarker;
@@ -1,75 +0,0 @@
1
- import React from 'react';
2
- import {View, StyleSheet, Platform, TouchableOpacity} from 'react-native';
3
- import Colors from '../../core-v2/colors';
4
- import Shadow from '../../core-v2/shadow';
5
-
6
- class DefaultMarker extends React.Component {
7
- render() {
8
- const {
9
- enabled,
10
- markerStyle,
11
- pressed,
12
- pressedMarkerStyle,
13
- disabledMarkerStyle,
14
- activeColor,
15
- } = this.props;
16
- return (
17
- <TouchableOpacity>
18
- <View
19
- style={
20
- enabled
21
- ? [
22
- styles.markerStyle,
23
-
24
- markerStyle,
25
- pressed && styles.pressedMarkerStyle,
26
- pressed && pressedMarkerStyle,
27
- {
28
- backgroundColor: activeColor,
29
- shadowColor: Colors.black_17,
30
- shadowOffset: {
31
- width: 2,
32
- height: 2,
33
- },
34
- shadowOpacity: 0.25,
35
- shadowRadius: 10,
36
- },
37
- ]
38
- : [
39
- Shadow.Dark,
40
- styles.markerStyle,
41
- styles.disabled,
42
- disabledMarkerStyle,
43
- ]
44
- }
45
- />
46
- </TouchableOpacity>
47
- );
48
- }
49
- }
50
-
51
- const styles = StyleSheet.create({
52
- markerStyle: {
53
- height: 20,
54
- width: 20,
55
- borderRadius: 10,
56
- borderWidth: 4,
57
- borderColor: Colors.white,
58
- },
59
- pressedMarkerStyle: {
60
- ...Platform.select({
61
- web: {},
62
- ios: {},
63
- android: {
64
- height: 20,
65
- width: 20,
66
- borderRadius: 20,
67
- },
68
- }),
69
- },
70
- disabled: {
71
- backgroundColor: Colors.black_09,
72
- },
73
- });
74
-
75
- export default DefaultMarker;