@rn-components-dropdown/dropdown 1.0.20 → 1.0.22
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 +2 -2
- package/package.json +1 -1
- package/dist/components/dropdown/components/chip/Chip.d.ts +0 -3
- package/dist/components/dropdown/components/chip/Chip.js +0 -23
- package/dist/components/dropdown/components/chip/ChipStyle.d.ts +0 -83
- package/dist/components/dropdown/components/chip/ChipStyle.js +0 -62
- package/dist/components/dropdown/components/input/TextInput.d.ts +0 -3
- package/dist/components/dropdown/components/input/TextInput.js +0 -61
- package/dist/components/dropdown/components/input/TextInputStyle.d.ts +0 -32
- package/dist/components/dropdown/components/input/TextInputStyle.js +0 -33
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@ Supports **single** & **multiple selection**, custom icons, styling, and easy in
|
|
|
7
7
|
# Example
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<img src="https://github.com/Daynight-Himmat/react-components/blob/
|
|
11
|
-
<img src="https://github.com/Daynight-Himmat/react-components/blob/
|
|
10
|
+
<img src="https://github.com/Daynight-Himmat/react-components/blob/804b400dcdafc96b0a59f451493ea1685e06500f/src/assets/images/signle_selection.png" width="250" />
|
|
11
|
+
<img src="https://github.com/Daynight-Himmat/react-components/blob/804b400dcdafc96b0a59f451493ea1685e06500f/src/assets/images/multi_selection.png" width="250" />
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_native_1 = require("react-native");
|
|
7
|
-
const ChipStyle_1 = __importDefault(require("./ChipStyle"));
|
|
8
|
-
const AppText_1 = __importDefault(require("../../../text/AppText"));
|
|
9
|
-
const svg_1 = require("../../../../assets/svg");
|
|
10
|
-
const SvgButton_1 = __importDefault(require("../../../svgButton/SvgButton"));
|
|
11
|
-
const Chip = (props) => {
|
|
12
|
-
const { styles, colors } = (0, ChipStyle_1.default)({ ...props });
|
|
13
|
-
const { label, onClearPress, textColor, clearIcon } = props;
|
|
14
|
-
return (<react_native_1.View style={styles.box}>
|
|
15
|
-
<AppText_1.default size={12} fontFamily={'semiBold'} style={styles.chipText} color={textColor ? textColor : 'gray'}>
|
|
16
|
-
{label}
|
|
17
|
-
</AppText_1.default>
|
|
18
|
-
{clearIcon ? (clearIcon) : (<react_native_1.View style={styles.clearContainer}>
|
|
19
|
-
<SvgButton_1.default icon={<svg_1.ClearIcon size={8} color={textColor ? colors[textColor] : colors.white}/>} onPress={onClearPress} style={styles.clearIcon}/>
|
|
20
|
-
</react_native_1.View>)}
|
|
21
|
-
</react_native_1.View>);
|
|
22
|
-
};
|
|
23
|
-
exports.default = Chip;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ChipInterface } from '../../interface/ChipInterface';
|
|
2
|
-
declare const useChipStyle: (props: ChipInterface) => {
|
|
3
|
-
styles: {
|
|
4
|
-
box: {
|
|
5
|
-
elevation: number;
|
|
6
|
-
width: "auto";
|
|
7
|
-
borderRadius: number;
|
|
8
|
-
flexDirection: "row";
|
|
9
|
-
alignItems: "center";
|
|
10
|
-
justifyContent: "center";
|
|
11
|
-
backgroundColor: string;
|
|
12
|
-
margin: number;
|
|
13
|
-
height: number;
|
|
14
|
-
} | {
|
|
15
|
-
elevation: number;
|
|
16
|
-
width: "auto";
|
|
17
|
-
borderRadius: number;
|
|
18
|
-
flexDirection: "row";
|
|
19
|
-
alignItems: "center";
|
|
20
|
-
justifyContent: "center";
|
|
21
|
-
backgroundColor: string;
|
|
22
|
-
shadowRadius?: undefined;
|
|
23
|
-
shadowOpacity?: undefined;
|
|
24
|
-
shadowColor?: undefined;
|
|
25
|
-
shadowOffset?: undefined;
|
|
26
|
-
margin: number;
|
|
27
|
-
height: number;
|
|
28
|
-
} | {
|
|
29
|
-
elevation: number;
|
|
30
|
-
width: "auto";
|
|
31
|
-
borderRadius: number;
|
|
32
|
-
flexDirection: "row";
|
|
33
|
-
alignItems: "center";
|
|
34
|
-
justifyContent: "center";
|
|
35
|
-
backgroundColor: string;
|
|
36
|
-
shadowRadius: number;
|
|
37
|
-
shadowOpacity: number;
|
|
38
|
-
shadowColor: string;
|
|
39
|
-
shadowOffset: {
|
|
40
|
-
width: number;
|
|
41
|
-
height: number;
|
|
42
|
-
};
|
|
43
|
-
margin: number;
|
|
44
|
-
height: number;
|
|
45
|
-
};
|
|
46
|
-
chipText: {
|
|
47
|
-
paddingLeft: number;
|
|
48
|
-
fontWeight: "600";
|
|
49
|
-
};
|
|
50
|
-
clearContainer: {
|
|
51
|
-
width: number;
|
|
52
|
-
height: number;
|
|
53
|
-
borderWidth: number;
|
|
54
|
-
borderRadius: number;
|
|
55
|
-
marginHorizontal: number;
|
|
56
|
-
alignItems: "center";
|
|
57
|
-
justifyContent: "center";
|
|
58
|
-
borderColor: string;
|
|
59
|
-
backgroundColor: string;
|
|
60
|
-
};
|
|
61
|
-
clearIcon: {
|
|
62
|
-
width: number;
|
|
63
|
-
height: number;
|
|
64
|
-
borderRadius: number;
|
|
65
|
-
alignItems: "center";
|
|
66
|
-
justifyContent: "center";
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
colors: {
|
|
70
|
-
blue: string;
|
|
71
|
-
gray: string;
|
|
72
|
-
error: string;
|
|
73
|
-
green: string;
|
|
74
|
-
white: string;
|
|
75
|
-
black: string;
|
|
76
|
-
primary: string;
|
|
77
|
-
lightGray: string;
|
|
78
|
-
grayishBlue: string;
|
|
79
|
-
red: string;
|
|
80
|
-
border: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
export default useChipStyle;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_1 = require("react");
|
|
4
|
-
const style_1 = require("../../../../style");
|
|
5
|
-
const react_native_1 = require("react-native");
|
|
6
|
-
const useChipStyle = (props) => {
|
|
7
|
-
const { chipColor, textColor } = props;
|
|
8
|
-
const { ...colors } = style_1.LIGHT_COLORS;
|
|
9
|
-
const styles = (0, react_1.useMemo)(() => {
|
|
10
|
-
return react_native_1.StyleSheet.create({
|
|
11
|
-
box: {
|
|
12
|
-
margin: 4,
|
|
13
|
-
height: 26,
|
|
14
|
-
...react_native_1.Platform.select({
|
|
15
|
-
android: {
|
|
16
|
-
elevation: 5,
|
|
17
|
-
},
|
|
18
|
-
ios: {
|
|
19
|
-
shadowRadius: 1.84,
|
|
20
|
-
shadowOpacity: 0.35,
|
|
21
|
-
shadowColor: colors.black,
|
|
22
|
-
shadowOffset: { width: 0, height: 2 },
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
elevation: 5,
|
|
26
|
-
width: 'auto',
|
|
27
|
-
borderRadius: 30,
|
|
28
|
-
flexDirection: 'row',
|
|
29
|
-
alignItems: 'center',
|
|
30
|
-
justifyContent: 'center',
|
|
31
|
-
backgroundColor: chipColor ? colors[chipColor] : colors.lightGray,
|
|
32
|
-
},
|
|
33
|
-
chipText: {
|
|
34
|
-
paddingLeft: 10,
|
|
35
|
-
fontWeight: '600',
|
|
36
|
-
},
|
|
37
|
-
clearContainer: {
|
|
38
|
-
width: 18,
|
|
39
|
-
height: 18,
|
|
40
|
-
borderWidth: 2,
|
|
41
|
-
borderRadius: 100,
|
|
42
|
-
marginHorizontal: 4,
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
borderColor: textColor ? colors[textColor] : colors.white,
|
|
46
|
-
backgroundColor: chipColor ? colors[chipColor] : colors.lightGray,
|
|
47
|
-
},
|
|
48
|
-
clearIcon: {
|
|
49
|
-
width: 12,
|
|
50
|
-
height: 12,
|
|
51
|
-
borderRadius: 100,
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
}, [chipColor, colors, textColor]);
|
|
57
|
-
return {
|
|
58
|
-
styles,
|
|
59
|
-
colors,
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
exports.default = useChipStyle;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const TextInputStyle_1 = require("./TextInputStyle");
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const svg_1 = require("../../../../assets/svg");
|
|
42
|
-
const react_native_1 = require("react-native");
|
|
43
|
-
const AppTextInput_1 = __importDefault(require("../../../textInput/AppTextInput"));
|
|
44
|
-
const TextInputComponent = props => {
|
|
45
|
-
const { value, placeholder = '', placeholderTextColor = '#000', onChangeText = (_value) => { }, searchIcon, } = props;
|
|
46
|
-
const [searchtext, setSearchText] = (0, react_1.useState)('');
|
|
47
|
-
const { styles } = (0, TextInputStyle_1.useTextStyle)();
|
|
48
|
-
(0, react_1.useEffect)(() => {
|
|
49
|
-
if (value) {
|
|
50
|
-
setSearchText(value);
|
|
51
|
-
}
|
|
52
|
-
}, [value]);
|
|
53
|
-
const onChange = (text) => {
|
|
54
|
-
setSearchText(text);
|
|
55
|
-
onChangeText(text);
|
|
56
|
-
};
|
|
57
|
-
return (<react_native_1.TouchableWithoutFeedback>
|
|
58
|
-
<AppTextInput_1.default {...props} value={searchtext} style={styles.input} onChangeText={onChange} placeholder={placeholder} textStyle={styles.inputContainer} placeholderTextColor={placeholderTextColor} icon={searchIcon ? searchIcon : <svg_1.SearchIcon />}/>
|
|
59
|
-
</react_native_1.TouchableWithoutFeedback>);
|
|
60
|
-
};
|
|
61
|
-
exports.default = TextInputComponent;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const useTextStyle: () => {
|
|
2
|
-
styles: {
|
|
3
|
-
input: {
|
|
4
|
-
height: number;
|
|
5
|
-
width: "95%";
|
|
6
|
-
fontSize: number;
|
|
7
|
-
borderWidth: number;
|
|
8
|
-
borderRadius: number;
|
|
9
|
-
marginVertical: number;
|
|
10
|
-
marginHorizontal: number;
|
|
11
|
-
borderColor: string;
|
|
12
|
-
};
|
|
13
|
-
inputContainer: {
|
|
14
|
-
width: "90%";
|
|
15
|
-
fontSize: number;
|
|
16
|
-
color: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
colors: {
|
|
20
|
-
blue: string;
|
|
21
|
-
gray: string;
|
|
22
|
-
error: string;
|
|
23
|
-
green: string;
|
|
24
|
-
white: string;
|
|
25
|
-
black: string;
|
|
26
|
-
primary: string;
|
|
27
|
-
lightGray: string;
|
|
28
|
-
grayishBlue: string;
|
|
29
|
-
red: string;
|
|
30
|
-
border: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTextStyle = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const react_native_1 = require("react-native");
|
|
6
|
-
const style_1 = require("../../../../style");
|
|
7
|
-
const useTextStyle = () => {
|
|
8
|
-
const { ...colors } = style_1.LIGHT_COLORS;
|
|
9
|
-
const styles = (0, react_1.useMemo)(() => {
|
|
10
|
-
return react_native_1.StyleSheet.create({
|
|
11
|
-
input: {
|
|
12
|
-
height: 40,
|
|
13
|
-
width: '95%',
|
|
14
|
-
fontSize: 16,
|
|
15
|
-
borderWidth: 1,
|
|
16
|
-
borderRadius: 3,
|
|
17
|
-
marginVertical: 10,
|
|
18
|
-
marginHorizontal: 8,
|
|
19
|
-
borderColor: colors.border,
|
|
20
|
-
},
|
|
21
|
-
inputContainer: {
|
|
22
|
-
width: '90%',
|
|
23
|
-
fontSize: 14,
|
|
24
|
-
color: colors.gray,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}, [colors]);
|
|
28
|
-
return {
|
|
29
|
-
styles,
|
|
30
|
-
colors,
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
exports.useTextStyle = useTextStyle;
|