react-native-input-select 1.3.2 → 1.3.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.
Files changed (54) hide show
  1. package/README.md +48 -40
  2. package/lib/commonjs/components/CheckBox/{types.js → checkbox.types.js} +1 -1
  3. package/lib/commonjs/components/CheckBox/checkbox.types.js.map +1 -0
  4. package/lib/commonjs/components/CheckBox/index.js +9 -28
  5. package/lib/commonjs/components/CheckBox/index.js.map +1 -1
  6. package/lib/commonjs/components/CustomModal/index.js +11 -7
  7. package/lib/commonjs/components/CustomModal/index.js.map +1 -1
  8. package/lib/commonjs/components/Dropdown/DropdownSectionList.js +1 -1
  9. package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -1
  10. package/lib/commonjs/components/Input/index.js +2 -1
  11. package/lib/commonjs/components/Input/index.js.map +1 -1
  12. package/lib/commonjs/components/Others/index.js.map +1 -1
  13. package/lib/commonjs/index.js +14 -5
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/types/index.types.js.map +1 -1
  16. package/lib/commonjs/utils/index.js +5 -1
  17. package/lib/commonjs/utils/index.js.map +1 -1
  18. package/lib/module/components/CheckBox/checkbox.types.js +2 -0
  19. package/lib/module/components/CheckBox/checkbox.types.js.map +1 -0
  20. package/lib/module/components/CheckBox/index.js +9 -28
  21. package/lib/module/components/CheckBox/index.js.map +1 -1
  22. package/lib/module/components/CustomModal/index.js +11 -7
  23. package/lib/module/components/CustomModal/index.js.map +1 -1
  24. package/lib/module/components/Dropdown/DropdownSectionList.js +1 -1
  25. package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -1
  26. package/lib/module/components/Input/index.js +2 -1
  27. package/lib/module/components/Input/index.js.map +1 -1
  28. package/lib/module/components/Others/index.js.map +1 -1
  29. package/lib/module/index.js +15 -6
  30. package/lib/module/index.js.map +1 -1
  31. package/lib/module/types/index.types.js.map +1 -1
  32. package/lib/module/utils/index.js +3 -0
  33. package/lib/module/utils/index.js.map +1 -1
  34. package/lib/typescript/components/CheckBox/checkbox.types.d.ts +9 -0
  35. package/lib/typescript/components/CheckBox/index.d.ts +2 -19
  36. package/lib/typescript/components/CustomModal/index.d.ts +3 -1
  37. package/lib/typescript/components/Others/index.d.ts +3 -1
  38. package/lib/typescript/types/index.types.d.ts +46 -15
  39. package/lib/typescript/utils/index.d.ts +2 -1
  40. package/package.json +2 -2
  41. package/src/components/CheckBox/checkbox.types.ts +10 -0
  42. package/src/components/CheckBox/index.tsx +15 -26
  43. package/src/components/CustomModal/index.tsx +19 -11
  44. package/src/components/Dropdown/DropdownSectionList.tsx +1 -1
  45. package/src/components/Input/index.tsx +1 -0
  46. package/src/components/Others/index.tsx +5 -1
  47. package/src/index.tsx +16 -11
  48. package/src/types/index.types.ts +56 -15
  49. package/src/utils/index.ts +5 -1
  50. package/lib/commonjs/components/CheckBox/types.js.map +0 -1
  51. package/lib/module/components/CheckBox/types.js +0 -2
  52. package/lib/module/components/CheckBox/types.js.map +0 -1
  53. package/lib/typescript/components/CheckBox/types.d.ts +0 -18
  54. package/src/components/CheckBox/types.ts +0 -19
@@ -6,11 +6,15 @@ import type {
6
6
  TextInputProps,
7
7
  } from 'react-native';
8
8
 
9
- export type DropdownProps = {
10
- placeholder?: string;
9
+ export type DropdownProps = CommonDropdownProps &
10
+ TDropdownInputProps &
11
+ TSearchControls &
12
+ TCheckboxControls &
13
+ TCustomModalControls &
14
+ TListControls;
15
+
16
+ export type CommonDropdownProps = {
11
17
  label?: string;
12
- error?: string;
13
- helperText?: string;
14
18
  options: TFlatList | TSectionList;
15
19
  optionLabel?: string;
16
20
  optionValue?: string;
@@ -23,6 +27,12 @@ export type DropdownProps = {
23
27
  | boolean[]
24
28
  | number[]
25
29
  | null;
30
+ };
31
+
32
+ export type TDropdownInputProps = {
33
+ placeholder?: string;
34
+ error?: string;
35
+ helperText?: string;
26
36
  isMultiple?: boolean;
27
37
  isSearchable?: boolean;
28
38
  dropdownIcon?: React.ReactNode;
@@ -35,25 +45,61 @@ export type DropdownProps = {
35
45
  dropdownHelperTextStyle?: TextStyle;
36
46
  selectedItemStyle?: TextStyle;
37
47
  multipleSelectedItemStyle?: TextStyle;
38
- modalBackgroundStyle?: ViewStyle;
39
- modalOptionsContainerStyle?: ViewStyle;
40
- searchInputStyle?: ViewStyle;
41
48
  primaryColor?: ColorValue;
42
49
  disabled?: boolean;
50
+ placeholderStyle?: TextStyle;
51
+ hideModal?: boolean;
52
+ };
53
+
54
+ export type TSearchControls = {
55
+ /** @deprecated Use `searchControls = {{textInputStyle: ViewStyle | TextStyle }}` instead.*/
56
+ searchInputStyle?: ViewStyle;
57
+ searchControls?: {
58
+ textInputStyle?: ViewStyle | TextStyle;
59
+ textInputContainerStyle?: ViewStyle;
60
+ textInputProps?: TextInputProps;
61
+ };
62
+ };
63
+ export type TCheckboxControls = {
64
+ /** @deprecated Use `checkboxControls = {{checkboxSize: number }}` instead.*/
43
65
  checkboxSize?: number;
66
+ /** @deprecated Use `checkboxControls = {{checkboxStyle: ViewStyle }}` instead.*/
44
67
  checkboxStyle?: ViewStyle;
68
+ /** @deprecated Use `checkboxControls = {{checkboxLabelStyle: TextStyle }}` instead.*/
45
69
  checkboxLabelStyle?: TextStyle;
70
+ /** @deprecated Use `checkboxControls` instead.*/
46
71
  checkboxComponentStyles?: {
47
72
  checkboxSize?: number;
48
73
  checkboxStyle?: ViewStyle;
49
74
  checkboxLabelStyle?: TextStyle;
50
75
  };
76
+ /** @deprecated Use `checkboxControls = {{checkboxComponent: <View></View> }}` instead.*/
51
77
  checkboxComponent?: React.ReactNode;
52
- placeholderStyle?: TextStyle;
78
+ checkboxControls?: {
79
+ checkboxSize?: number;
80
+ checkboxStyle?: ViewStyle;
81
+ checkboxLabelStyle?: TextStyle;
82
+ checkboxComponent?: React.ReactNode;
83
+ };
84
+ };
85
+
86
+ export type TCustomModalControls = {
87
+ /** @deprecated Use `modalControls = {{modalBackgroundStyle: ViewStyle}} instead.*/
88
+ modalBackgroundStyle?: ViewStyle;
89
+ /** @deprecated Use `modalControls = {{ modalOptionsContainerStyle: ViewStyle}} instead.*/
90
+ modalOptionsContainerStyle?: ViewStyle;
91
+ /** @deprecated Use `modalControls = {{modalProps: ModalProps }}` instead.*/
92
+ modalProps?: ModalProps;
93
+ modalControls?: {
94
+ modalBackgroundStyle?: ViewStyle;
95
+ modalOptionsContainerStyle?: ViewStyle;
96
+ modalProps?: ModalProps;
97
+ };
98
+ };
99
+
100
+ export type TListControls = {
53
101
  listHeaderComponent?: React.ReactNode;
54
102
  listFooterComponent?: React.ReactNode;
55
- hideModal?: boolean;
56
- modalProps?: ModalProps;
57
103
  listComponentStyles?: {
58
104
  listEmptyComponentStyle?: TextStyle;
59
105
  itemSeparatorStyle?: ViewStyle;
@@ -67,11 +113,6 @@ export type DropdownProps = {
67
113
  hideSelectAll?: boolean;
68
114
  emptyListMessage?: string;
69
115
  };
70
- searchControls?: {
71
- textInputStyle?: ViewStyle | TextStyle;
72
- textInputContainerStyle?: ViewStyle;
73
- textInputProps?: TextInputProps;
74
- };
75
116
  };
76
117
 
77
118
  export type TFlatList = TFlatListItem[];
@@ -2,8 +2,12 @@
2
2
  * Extract property from array
3
3
  */
4
4
 
5
- export const extractPropertyFromArray = (arr: any, property: string) => {
5
+ export const extractPropertyFromArray = (arr: any[], property: string) => {
6
6
  let extractedValue = arr?.map((item: any) => item[property]);
7
7
 
8
8
  return extractedValue;
9
9
  };
10
+
11
+ export const escapeRegExp = (text: string) => {
12
+ return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
13
+ };
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import React from 'react';\nimport type { ColorValue, ViewStyle, TextStyle } from 'react-native';\n\nexport type CheckboxProps = {\n label?: string;\n value?: boolean;\n disabled?: boolean;\n primaryColor?: ColorValue;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n checkboxComponentStyles?: {\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n };\n checkboxComponent?: React.ReactNode;\n onChange?: (value: boolean | string | number) => void;\n};\n"],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import React from 'react';\nimport type { ColorValue, ViewStyle, TextStyle } from 'react-native';\n\nexport type CheckboxProps = {\n label?: string;\n value?: boolean;\n disabled?: boolean;\n primaryColor?: ColorValue;\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n checkboxComponentStyles?: {\n checkboxSize?: number;\n checkboxStyle?: ViewStyle;\n checkboxLabelStyle?: TextStyle;\n };\n checkboxComponent?: React.ReactNode;\n onChange?: (value: boolean | string | number) => void;\n};\n"],"mappings":""}
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import type { ColorValue, ViewStyle, TextStyle } from 'react-native';
3
- export type CheckboxProps = {
4
- label?: string;
5
- value?: boolean;
6
- disabled?: boolean;
7
- primaryColor?: ColorValue;
8
- checkboxSize?: number;
9
- checkboxStyle?: ViewStyle;
10
- checkboxLabelStyle?: TextStyle;
11
- checkboxComponentStyles?: {
12
- checkboxSize?: number;
13
- checkboxStyle?: ViewStyle;
14
- checkboxLabelStyle?: TextStyle;
15
- };
16
- checkboxComponent?: React.ReactNode;
17
- onChange?: (value: boolean | string | number) => void;
18
- };
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import type { ColorValue, ViewStyle, TextStyle } from 'react-native';
3
-
4
- export type CheckboxProps = {
5
- label?: string;
6
- value?: boolean;
7
- disabled?: boolean;
8
- primaryColor?: ColorValue;
9
- checkboxSize?: number;
10
- checkboxStyle?: ViewStyle;
11
- checkboxLabelStyle?: TextStyle;
12
- checkboxComponentStyles?: {
13
- checkboxSize?: number;
14
- checkboxStyle?: ViewStyle;
15
- checkboxLabelStyle?: TextStyle;
16
- };
17
- checkboxComponent?: React.ReactNode;
18
- onChange?: (value: boolean | string | number) => void;
19
- };