react-native-input-select 0.35.0 → 1.1.1

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 (83) hide show
  1. package/README.md +104 -32
  2. package/lib/commonjs/components/CheckBox/index.js +16 -13
  3. package/lib/commonjs/components/CheckBox/index.js.map +1 -1
  4. package/lib/commonjs/components/CheckBox/types.js.map +1 -1
  5. package/lib/commonjs/components/CustomModal/index.js +1 -9
  6. package/lib/commonjs/components/CustomModal/index.js.map +1 -1
  7. package/lib/commonjs/components/Dropdown/Dropdown.js +0 -9
  8. package/lib/commonjs/components/Dropdown/Dropdown.js.map +1 -1
  9. package/lib/commonjs/components/Dropdown/{DropdownList.js → DropdownFlatList.js} +22 -32
  10. package/lib/commonjs/components/Dropdown/DropdownFlatList.js.map +1 -0
  11. package/lib/commonjs/components/Dropdown/DropdownListItem.js +11 -22
  12. package/lib/commonjs/components/Dropdown/DropdownListItem.js.map +1 -1
  13. package/lib/commonjs/components/Dropdown/DropdownSectionList.js +139 -0
  14. package/lib/commonjs/components/Dropdown/DropdownSectionList.js.map +1 -0
  15. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js +10 -22
  16. package/lib/commonjs/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  17. package/lib/commonjs/components/Input/index.js +4 -11
  18. package/lib/commonjs/components/Input/index.js.map +1 -1
  19. package/lib/commonjs/components/Others/index.js +93 -0
  20. package/lib/commonjs/components/Others/index.js.map +1 -0
  21. package/lib/commonjs/constants/index.js.map +1 -1
  22. package/lib/commonjs/index.js +73 -59
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/styles/colors.js.map +1 -1
  25. package/lib/commonjs/styles/input.js +0 -4
  26. package/lib/commonjs/styles/input.js.map +1 -1
  27. package/lib/commonjs/styles/typography.js +0 -3
  28. package/lib/commonjs/styles/typography.js.map +1 -1
  29. package/lib/commonjs/types/index.types.js.map +1 -1
  30. package/lib/commonjs/utils/index.js +26 -0
  31. package/lib/commonjs/utils/index.js.map +1 -0
  32. package/lib/module/components/CheckBox/index.js +14 -6
  33. package/lib/module/components/CheckBox/index.js.map +1 -1
  34. package/lib/module/components/CheckBox/types.js.map +1 -1
  35. package/lib/module/components/CustomModal/index.js +1 -4
  36. package/lib/module/components/CustomModal/index.js.map +1 -1
  37. package/lib/module/components/Dropdown/Dropdown.js +0 -2
  38. package/lib/module/components/Dropdown/Dropdown.js.map +1 -1
  39. package/lib/module/components/Dropdown/{DropdownList.js → DropdownFlatList.js} +23 -27
  40. package/lib/module/components/Dropdown/DropdownFlatList.js.map +1 -0
  41. package/lib/module/components/Dropdown/DropdownListItem.js +11 -14
  42. package/lib/module/components/Dropdown/DropdownListItem.js.map +1 -1
  43. package/lib/module/components/Dropdown/DropdownSectionList.js +130 -0
  44. package/lib/module/components/Dropdown/DropdownSectionList.js.map +1 -0
  45. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js +11 -17
  46. package/lib/module/components/Dropdown/DropdownSelectedItemsView.js.map +1 -1
  47. package/lib/module/components/Input/index.js +2 -2
  48. package/lib/module/components/Input/index.js.map +1 -1
  49. package/lib/module/components/Others/index.js +82 -0
  50. package/lib/module/components/Others/index.js.map +1 -0
  51. package/lib/module/constants/index.js.map +1 -1
  52. package/lib/module/index.js +72 -42
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/styles/colors.js.map +1 -1
  55. package/lib/module/styles/input.js.map +1 -1
  56. package/lib/module/styles/typography.js.map +1 -1
  57. package/lib/module/types/index.types.js.map +1 -1
  58. package/lib/module/utils/index.js +18 -0
  59. package/lib/module/utils/index.js.map +1 -0
  60. package/lib/typescript/components/CheckBox/index.d.ts +6 -1
  61. package/lib/typescript/components/CheckBox/types.d.ts +6 -1
  62. package/lib/typescript/components/Dropdown/DropdownFlatList.d.ts +3 -0
  63. package/lib/typescript/components/Dropdown/DropdownListItem.d.ts +1 -1
  64. package/lib/typescript/components/Dropdown/DropdownSectionList.d.ts +3 -0
  65. package/lib/typescript/components/Input/index.d.ts +1 -0
  66. package/lib/typescript/components/Others/index.d.ts +14 -0
  67. package/lib/typescript/types/index.types.d.ts +24 -5
  68. package/lib/typescript/utils/index.d.ts +6 -0
  69. package/package.json +3 -3
  70. package/src/components/CheckBox/index.tsx +32 -5
  71. package/src/components/CheckBox/types.ts +5 -0
  72. package/src/components/Dropdown/{DropdownList.tsx → DropdownFlatList.tsx} +22 -20
  73. package/src/components/Dropdown/DropdownListItem.tsx +13 -11
  74. package/src/components/Dropdown/DropdownSectionList.tsx +135 -0
  75. package/src/components/Dropdown/DropdownSelectedItemsView.tsx +16 -28
  76. package/src/components/Input/index.tsx +2 -0
  77. package/src/components/Others/index.tsx +91 -0
  78. package/src/index.tsx +114 -41
  79. package/src/types/index.types.ts +22 -4
  80. package/src/utils/index.ts +25 -0
  81. package/lib/commonjs/components/Dropdown/DropdownList.js.map +0 -1
  82. package/lib/module/components/Dropdown/DropdownList.js.map +0 -1
  83. package/lib/typescript/components/Dropdown/DropdownList.d.ts +0 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["DropdownListItem.tsx"],"names":["DropdownListItem","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","selectedOptionValue","styles","dropdownModalOptions","disabled","includes","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,QAWd;AAAA,MAXe;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,WAFwB;AAGxBC,IAAAA,WAHwB;AAIxBC,IAAAA,UAJwB;AAKxBC,IAAAA,cALwB;AAMxBC,IAAAA,QANwB;AAOxBC,IAAAA,YAPwB;AAQxBC,IAAAA,YARwB;AASxBC,IAAAA,aATwB;AAUxBC,IAAAA;AAVwB,GAWf;AACT,QAAMC,mBAAmB,GAAGR,WAAH,aAAGA,WAAH,cAAGA,WAAH,GAAkB,OAA3C;AACA,sBACE,6BAAC,6BAAD;AACE,IAAA,KAAK,EAAES,MAAM,CAACC,oBADhB;AAEE,IAAA,OAAO,EACLZ,IAAI,CAACa,QAAL,GAAgB,MAAM,CAAE,CAAxB,GAA2B,MAAMR,QAAQ,CAACL,IAAI,CAACU,mBAAD,CAAL,CADpC,CACgE;;AAHzE,kBAME,6BAAC,iBAAD;AACE,IAAA,KAAK,EACHP,UAAU,GACNC,cAAc,CAACU,QAAf,CAAwBd,IAAI,CAACU,mBAAD,CAA5B,CADM,GAEN,CAACN,cAAD,EAAiBU,QAAjB,CAA0Bd,IAAI,CAACU,mBAAD,CAA9B,CAJR;AAME,IAAA,KAAK,EAAEV,IAAI,CAACC,WAAD,aAACA,WAAD,cAACA,WAAD,GAAgB,EAAhB,CANb;AAOE,IAAA,QAAQ,EAAE,MAAMI,QAAQ,CAACL,IAAI,CAACU,mBAAD,CAAL,CAP1B;AAQE,IAAA,YAAY,EAAEJ,YARhB;AASE,IAAA,YAAY,EAAEC,YAThB;AAUE,IAAA,aAAa,EAAEC,aAVjB;AAWE,IAAA,kBAAkB,EAAEC,kBAXtB;AAYE,IAAA,QAAQ,EAAET,IAAI,CAACa;AAZjB,IANF,CADF;AAuBD,CApCD;;AAsCA,MAAMF,MAAM,GAAGI,wBAAWC,MAAX,CAAkB;AAC/BJ,EAAAA,oBAAoB,EAAE;AACpBK,IAAAA,iBAAiB,EAAE,EADC;AAEpBC,IAAAA,eAAe,EAAE,EAFG;AAGpBC,IAAAA,aAAa,EAAE,KAHK;AAIpBC,IAAAA,UAAU,EAAE;AAJQ;AADS,CAAlB,CAAf;;4BASe,iBAAKrB,gBAAL,C","sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\n\nconst DropdownListItem = ({\n item,\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption,\n onChange,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n}: any) => {\n const selectedOptionValue = optionValue ?? 'value';\n return (\n <TouchableOpacity\n style={styles.dropdownModalOptions}\n onPress={\n item.disabled ? () => {} : () => onChange(item[selectedOptionValue]) // intentionally didn't use the disable property\n }\n >\n <CheckBox\n value={\n isMultiple\n ? selectedOption.includes(item[selectedOptionValue])\n : [selectedOption].includes(item[selectedOptionValue])\n }\n label={item[optionLabel ?? '']}\n onChange={() => onChange(item[selectedOptionValue])}\n primaryColor={primaryColor}\n checkboxSize={checkboxSize}\n checkboxStyle={checkboxStyle}\n checkboxLabelStyle={checkboxLabelStyle}\n disabled={item.disabled}\n />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n dropdownModalOptions: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\n\nexport default memo(DropdownListItem);\n"]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_CheckBox","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DropdownListItem","_ref","item","optionLabel","optionValue","isMultiple","selectedOption","onChange","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","createElement","TouchableOpacity","style","styles","listItemContainerStyle","onPress","disabled","value","includes","label","StyleSheet","create","paddingHorizontal","paddingVertical","flexDirection","alignItems","_default","memo","exports"],"sources":["DropdownListItem.tsx"],"sourcesContent":["import React, { memo } from 'react';\nimport { TouchableOpacity, StyleSheet } from 'react-native';\nimport CheckBox from '../CheckBox';\n\nconst DropdownListItem = ({\n item,\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption,\n onChange,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n checkboxComponentStyles,\n}: any) => {\n return (\n <TouchableOpacity\n style={styles.listItemContainerStyle}\n onPress={\n item.disabled ? () => {} : () => onChange(item[optionValue]) // intentionally didn't use the disable property\n }\n >\n <CheckBox\n value={\n isMultiple\n ? selectedOption.includes(item[optionValue])\n : [selectedOption].includes(item[optionValue])\n }\n label={item[optionLabel]}\n onChange={() => onChange(item[optionValue])}\n primaryColor={primaryColor}\n checkboxSize={checkboxComponentStyles?.checkboxSize || checkboxSize}\n checkboxStyle={checkboxComponentStyles?.checkboxStyle || checkboxStyle}\n checkboxLabelStyle={\n checkboxComponentStyles?.checkboxLabelStyle || checkboxLabelStyle\n }\n disabled={item.disabled}\n />\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n listItemContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n});\n\nexport default memo(DropdownListItem);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmC,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAK,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,Y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,IAAI,CAACE,WAAW,CAAC,CAAC,GAC1C,CAACE,cAAc,CAAC,CAACe,QAAQ,CAACnB,IAAI,CAACE,WAAW,CAAC,CAChD;IACDkB,KAAK,EAAEpB,IAAI,CAACC,WAAW,CAAE;IACzBI,QAAQ,EAAEA,CAAA,KAAMA,QAAQ,CAACL,IAAI,CAACE,WAAW,CAAC,CAAE;IAC5CI,YAAY,EAAEA,YAAa;IAC3BC,YAAY,EAAE,CAAAG,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEH,YAAY,KAAIA,YAAa;IACpEC,aAAa,EAAE,CAAAE,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAEF,aAAa,KAAIA,aAAc;IACvEC,kBAAkB,EAChB,CAAAC,uBAAuB,aAAvBA,uBAAuB,uBAAvBA,uBAAuB,CAAED,kBAAkB,KAAIA,kBAChD;IACDQ,QAAQ,EAAEjB,IAAI,CAACiB;EAAS,CACzB,CACe,CAAC;AAEvB,CAAC;AAED,MAAMH,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,sBAAsB,EAAE;IACtBQ,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,gBAEY,IAAAC,WAAI,EAAC9B,gBAAgB,CAAC;AAAA+B,OAAA,CAAAnD,OAAA,GAAAiD,QAAA"}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _DropdownListItem = _interopRequireDefault(require("./DropdownListItem"));
10
+ var _Others = require("../Others");
11
+ var _utils = require("../../utils");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react-native/no-inline-styles */
16
+ const DropdownSectionList = _ref => {
17
+ let {
18
+ options,
19
+ optionLabel,
20
+ optionValue,
21
+ isMultiple,
22
+ isSearchable,
23
+ selectedItems,
24
+ selectedItem,
25
+ handleMultipleSelections,
26
+ handleSingleSelection,
27
+ primaryColor,
28
+ checkboxSize,
29
+ checkboxStyle,
30
+ checkboxLabelStyle,
31
+ checkboxComponentStyles,
32
+ listComponentStyles,
33
+ ...rest
34
+ } = _ref;
35
+ const [expandedSections, setExpandedSections] = (0, _react.useState)(new Set());
36
+
37
+ /**
38
+ * Expand all sections
39
+ */
40
+ (0, _react.useEffect)(() => {
41
+ let initialState = new Set((0, _utils.extractPropertyFromArray)(options, 'title'));
42
+ setExpandedSections(initialState);
43
+ }, [options]);
44
+
45
+ /**
46
+ * @param title
47
+ */
48
+ const handleToggleListExpansion = title => {
49
+ setExpandedSections(expandedSectionsState => {
50
+ // Using Set here but you can use an array too
51
+ const next = new Set(expandedSectionsState);
52
+ if (next.has(title)) {
53
+ next.delete(title);
54
+ } else {
55
+ next.add(title);
56
+ }
57
+ return next;
58
+ });
59
+ };
60
+ return /*#__PURE__*/_react.default.createElement(_reactNative.SectionList, _extends({
61
+ sections: options,
62
+ extraData: isMultiple ? selectedItems : selectedItem,
63
+ initialNumToRender: 5,
64
+ ListEmptyComponent: /*#__PURE__*/_react.default.createElement(_Others.ListEmptyComponent, {
65
+ listEmptyComponentStyle: listComponentStyles === null || listComponentStyles === void 0 ? void 0 : listComponentStyles.listEmptyComponentStyle
66
+ }),
67
+ contentContainerStyle: [isSearchable ? {
68
+ paddingTop: 0
69
+ } : styles.contentContainerStyle],
70
+ ItemSeparatorComponent: () => /*#__PURE__*/_react.default.createElement(_Others.ItemSeparatorComponent, {
71
+ itemSeparatorStyle: listComponentStyles === null || listComponentStyles === void 0 ? void 0 : listComponentStyles.itemSeparatorStyle
72
+ }),
73
+ renderItem: item => _renderItem(item, {
74
+ optionLabel,
75
+ optionValue,
76
+ isMultiple,
77
+ selectedOption: isMultiple ? selectedItems : selectedItem,
78
+ onChange: isMultiple ? handleMultipleSelections : handleSingleSelection,
79
+ primaryColor,
80
+ checkboxSize,
81
+ // kept for backwards compatibility
82
+ checkboxStyle,
83
+ // kept for backwards compatibility
84
+ checkboxLabelStyle,
85
+ // kept for backwards compatibility
86
+ checkboxComponentStyles,
87
+ expandedSections
88
+ }),
89
+ renderSectionHeader: _ref2 => {
90
+ let {
91
+ section: {
92
+ title,
93
+ data
94
+ }
95
+ } = _ref2;
96
+ return data.length > 0 && /*#__PURE__*/_react.default.createElement(_Others.SectionHeaderTitle, {
97
+ title: title,
98
+ sectionHeaderStyle: listComponentStyles === null || listComponentStyles === void 0 ? void 0 : listComponentStyles.sectionHeaderStyle,
99
+ onPress: () => handleToggleListExpansion(title),
100
+ isExpanded: expandedSections.has(title)
101
+ });
102
+ },
103
+ keyExtractor: (_item, index) => `Options${index}`,
104
+ stickySectionHeadersEnabled: false
105
+ }, rest));
106
+ };
107
+ const _renderItem = (_ref3, props) => {
108
+ let {
109
+ section: {
110
+ title
111
+ },
112
+ item
113
+ } = _ref3;
114
+ const isExpanded = props === null || props === void 0 ? void 0 : props.expandedSections.has(title);
115
+
116
+ //return null if it is not expanded
117
+ if (!isExpanded) return null;
118
+ return /*#__PURE__*/_react.default.createElement(_DropdownListItem.default, {
119
+ item: item,
120
+ optionLabel: props.optionLabel,
121
+ optionValue: props.optionValue,
122
+ isMultiple: props.isMultiple,
123
+ selectedOption: props.selectedOption,
124
+ onChange: props.onChange,
125
+ primaryColor: props.primaryColor,
126
+ checkboxSize: props.checkboxSize,
127
+ checkboxStyle: props.checkboxStyle,
128
+ checkboxLabelStyle: props.checkboxLabelStyle,
129
+ checkboxComponentStyles: props.checkboxComponentStyles
130
+ });
131
+ };
132
+ const styles = _reactNative.StyleSheet.create({
133
+ contentContainerStyle: {
134
+ paddingTop: 20
135
+ }
136
+ });
137
+ var _default = DropdownSectionList;
138
+ exports.default = _default;
139
+ //# sourceMappingURL=DropdownSectionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_DropdownListItem","_interopRequireDefault","_Others","_utils","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","DropdownSectionList","_ref","options","optionLabel","optionValue","isMultiple","isSearchable","selectedItems","selectedItem","handleMultipleSelections","handleSingleSelection","primaryColor","checkboxSize","checkboxStyle","checkboxLabelStyle","checkboxComponentStyles","listComponentStyles","rest","expandedSections","setExpandedSections","useState","Set","useEffect","initialState","extractPropertyFromArray","handleToggleListExpansion","title","expandedSectionsState","next","delete","add","createElement","SectionList","sections","extraData","initialNumToRender","ListEmptyComponent","listEmptyComponentStyle","contentContainerStyle","paddingTop","styles","ItemSeparatorComponent","itemSeparatorStyle","renderItem","item","_renderItem","selectedOption","onChange","renderSectionHeader","_ref2","section","data","SectionHeaderTitle","sectionHeaderStyle","onPress","isExpanded","keyExtractor","_item","index","stickySectionHeadersEnabled","_ref3","props","StyleSheet","create","_default","exports"],"sources":["DropdownSectionList.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport React, { useEffect, useState } from 'react';\nimport { SectionList, StyleSheet } from 'react-native';\nimport DropdownListItem from './DropdownListItem';\nimport {\n ItemSeparatorComponent,\n ListEmptyComponent,\n SectionHeaderTitle,\n} from '../Others';\nimport { extractPropertyFromArray } from '../../utils';\n\nconst DropdownSectionList = ({\n options,\n optionLabel,\n optionValue,\n isMultiple,\n isSearchable,\n selectedItems,\n selectedItem,\n handleMultipleSelections,\n handleSingleSelection,\n primaryColor,\n checkboxSize,\n checkboxStyle,\n checkboxLabelStyle,\n checkboxComponentStyles,\n listComponentStyles,\n ...rest\n}: any) => {\n const [expandedSections, setExpandedSections] = useState(new Set());\n\n /**\n * Expand all sections\n */\n useEffect(() => {\n let initialState = new Set(extractPropertyFromArray(options, 'title'));\n setExpandedSections(initialState);\n }, [options]);\n\n /**\n * @param title\n */\n const handleToggleListExpansion = (title: string) => {\n setExpandedSections((expandedSectionsState) => {\n // Using Set here but you can use an array too\n const next = new Set(expandedSectionsState);\n if (next.has(title)) {\n next.delete(title);\n } else {\n next.add(title);\n }\n return next;\n });\n };\n\n return (\n <SectionList\n sections={options}\n extraData={isMultiple ? selectedItems : selectedItem}\n initialNumToRender={5}\n ListEmptyComponent={\n <ListEmptyComponent\n listEmptyComponentStyle={listComponentStyles?.listEmptyComponentStyle}\n />\n }\n contentContainerStyle={[\n isSearchable ? { paddingTop: 0 } : styles.contentContainerStyle,\n ]}\n ItemSeparatorComponent={() => (\n <ItemSeparatorComponent\n itemSeparatorStyle={listComponentStyles?.itemSeparatorStyle}\n />\n )}\n renderItem={(item) =>\n _renderItem(item, {\n optionLabel,\n optionValue,\n isMultiple,\n selectedOption: isMultiple ? selectedItems : selectedItem,\n onChange: isMultiple\n ? handleMultipleSelections\n : handleSingleSelection,\n primaryColor,\n checkboxSize, // kept for backwards compatibility\n checkboxStyle, // kept for backwards compatibility\n checkboxLabelStyle, // kept for backwards compatibility\n checkboxComponentStyles,\n expandedSections,\n })\n }\n renderSectionHeader={({ section: { title, data } }) =>\n data.length > 0 && (\n <SectionHeaderTitle\n title={title}\n sectionHeaderStyle={listComponentStyles?.sectionHeaderStyle}\n onPress={() => handleToggleListExpansion(title)}\n isExpanded={expandedSections.has(title)}\n />\n )\n }\n keyExtractor={(_item, index) => `Options${index}`}\n stickySectionHeadersEnabled={false}\n {...rest}\n />\n );\n};\n\nconst _renderItem = ({ section: { title }, item }: any, props: any) => {\n const isExpanded = props?.expandedSections.has(title);\n\n //return null if it is not expanded\n if (!isExpanded) return null;\n\n return (\n <DropdownListItem\n item={item}\n optionLabel={props.optionLabel}\n optionValue={props.optionValue}\n isMultiple={props.isMultiple}\n selectedOption={props.selectedOption}\n onChange={props.onChange}\n primaryColor={props.primaryColor}\n checkboxSize={props.checkboxSize}\n checkboxStyle={props.checkboxStyle}\n checkboxLabelStyle={props.checkboxLabelStyle}\n checkboxComponentStyles={props.checkboxComponentStyles}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n contentContainerStyle: { paddingTop: 20 },\n});\n\nexport default DropdownSectionList;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAAuD,SAAAG,uBAAAG,GAAA,WA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KAAK,CAACjD,YAAa;IACjCC,aAAa,EAAEgD,KAAK,CAAChD,aAAc;IACnCC,kBAAkB,EAAE+C,KAAK,CAAC/C,kBAAmB;IAC7CC,uBAAuB,EAAE8C,KAAK,CAAC9C;EAAwB,CACxD,CAAC;AAEN,CAAC;AAED,MAAMyB,MAAM,GAAGsB,uBAAU,CAACC,MAAM,CAAC;EAC/BzB,qBAAqB,EAAE;IAAEC,UAAU,EAAE;EAAG;AAC1C,CAAC,CAAC;AAAC,IAAAyB,QAAA,GAEYhE,mBAAmB;AAAAiE,OAAA,CAAA9F,OAAA,GAAA6F,QAAA"}
@@ -4,20 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var _colors = require("../../styles/colors");
13
-
14
10
  var _input = require("../../styles/input");
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  const DropdownSelectedItemsView = _ref => {
19
13
  var _getSelectedItemsLabe;
20
-
21
14
  let {
22
15
  placeholder,
23
16
  error,
@@ -42,10 +35,13 @@ const DropdownSelectedItemsView = _ref => {
42
35
  let {
43
36
  pressed
44
37
  } = _ref2;
45
- return [pressed && { ..._input.inputStyles.inputFocusState,
38
+ return [pressed && {
39
+ ..._input.inputStyles.inputFocusState,
46
40
  borderColor: primaryColor
47
- }, _input.inputStyles.input, dropdownStyle, error && //this must be last
48
- error !== '' && !pressed && { ..._input.inputStyles.inputFocusErrorState,
41
+ }, _input.inputStyles.input, dropdownStyle, error &&
42
+ //this must be last
43
+ error !== '' && !pressed && {
44
+ ..._input.inputStyles.inputFocusErrorState,
49
45
  ...dropdownErrorStyle
50
46
  }];
51
47
  },
@@ -57,28 +53,21 @@ const DropdownSelectedItemsView = _ref => {
57
53
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
58
54
  style: styles.selectedItemsContainer,
59
55
  onStartShouldSetResponder: () => true
60
- }, isMultiple ? (_getSelectedItemsLabe = getSelectedItemsLabel()) === null || _getSelectedItemsLabe === void 0 ? void 0 : _getSelectedItemsLabe.map((item, i) => /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
61
- onPress: () => handleToggleModal(),
56
+ }, isMultiple ? (_getSelectedItemsLabe = getSelectedItemsLabel()) === null || _getSelectedItemsLabe === void 0 ? void 0 : _getSelectedItemsLabe.map((item, i) => /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
62
57
  key: `react-native-input-select-${Math.random()}-${i}`,
63
- disabled: disabled
64
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
65
58
  style: [styles.selectedItems, {
66
59
  backgroundColor: primaryColor
67
60
  }, multipleSelectedItemStyle]
68
- }, item))) : /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
69
- onPress: () => handleToggleModal(),
70
- disabled: disabled
71
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
61
+ }, item)) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
72
62
  style: [styles.blackText, selectedItemStyle]
73
- }, getSelectedItemsLabel()))), !selectedItem && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0 && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
63
+ }, getSelectedItemsLabel()), !selectedItem && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) === 0 && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
74
64
  style: [styles.blackText, placeholderStyle]
75
- }, placeholder !== null && placeholder !== void 0 ? placeholder : 'Select an option')), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
65
+ }, placeholder ?? 'Select an option'))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
76
66
  style: [styles.iconStyle, dropdownIconStyle]
77
67
  }, dropdownIcon || /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
78
68
  source: require('../../asset/arrow-down.png')
79
69
  })));
80
70
  };
81
-
82
71
  const styles = _reactNative.StyleSheet.create({
83
72
  iconStyle: {
84
73
  position: 'absolute',
@@ -103,7 +92,6 @@ const styles = _reactNative.StyleSheet.create({
103
92
  color: _colors.colors.black
104
93
  }
105
94
  });
106
-
107
95
  var _default = DropdownSelectedItemsView;
108
96
  exports.default = _default;
109
97
  //# sourceMappingURL=DropdownSelectedItemsView.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["DropdownSelectedItemsView.tsx"],"names":["DropdownSelectedItemsView","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","dropdownStyle","dropdownIconStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","pressed","inputStyles","inputFocusState","borderColor","input","inputFocusErrorState","styles","selectedItemsContainer","map","item","i","Math","random","backgroundColor","blackText","length","iconStyle","require","StyleSheet","create","position","right","top","flexDirection","flexWrap","alignItems","color","colors","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;;;AAEA,MAAMA,yBAAyB,GAAG,QAiBvB;AAAA;;AAAA,MAjBwB;AACjCC,IAAAA,WADiC;AAEjCC,IAAAA,KAFiC;AAGjCC,IAAAA,qBAHiC;AAIjCC,IAAAA,iBAJiC;AAKjCC,IAAAA,UALiC;AAMjCC,IAAAA,YANiC;AAOjCC,IAAAA,aAPiC;AAQjCC,IAAAA,YARiC;AASjCC,IAAAA,aATiC;AAUjCC,IAAAA,iBAViC;AAWjCC,IAAAA,iBAXiC;AAYjCC,IAAAA,gBAZiC;AAajCC,IAAAA,yBAbiC;AAcjCC,IAAAA,kBAdiC;AAejCC,IAAAA,YAfiC;AAgBjCC,IAAAA;AAhBiC,GAiBxB;AACT,sBACE,6BAAC,sBAAD;AACE,IAAA,OAAO,EAAE,MAAMZ,iBAAiB,EADlC;AAEE,IAAA,KAAK,EAA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\n Text,\n Pressable,\n ScrollView,\n StyleSheet,\n Image,\n TouchableOpacity,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { inputStyles } from '../../styles/input';\n\nconst DropdownSelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownIcon,\n dropdownStyle,\n dropdownIconStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <Pressable\n onPress={() => handleToggleModal()}\n style={({ pressed }) => [\n pressed && {\n ...inputStyles.inputFocusState,\n borderColor: primaryColor,\n },\n inputStyles.input,\n dropdownStyle,\n error && //this must be last\n error !== '' &&\n !pressed && {\n ...inputStyles.inputFocusErrorState,\n ...dropdownErrorStyle,\n },\n ]}\n disabled={disabled}\n >\n <ScrollView\n horizontal\n alwaysBounceHorizontal\n showsHorizontalScrollIndicator={false}\n >\n <View\n style={styles.selectedItemsContainer}\n onStartShouldSetResponder={() => true}\n >\n {isMultiple ? (\n getSelectedItemsLabel()?.map((item: any, i: Number) => (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n key={`react-native-input-select-${Math.random()}-${i}`}\n disabled={disabled}\n >\n <Text\n style={[\n styles.selectedItems,\n { backgroundColor: primaryColor },\n multipleSelectedItemStyle,\n ]}\n >\n {item}\n </Text>\n </TouchableOpacity>\n ))\n ) : (\n <TouchableOpacity\n onPress={() => handleToggleModal()}\n disabled={disabled}\n >\n <Text style={[styles.blackText, selectedItemStyle]}>\n {getSelectedItemsLabel()}\n </Text>\n </TouchableOpacity>\n )}\n </View>\n\n {!selectedItem && selectedItems?.length === 0 && (\n <Text style={[styles.blackText, placeholderStyle]}>\n {placeholder ?? 'Select an option'}\n </Text>\n )}\n </ScrollView>\n <View style={[styles.iconStyle, dropdownIconStyle]}>\n {dropdownIcon || (\n <Image source={require('../../asset/arrow-down.png')} />\n )}\n </View>\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n iconStyle: { position: 'absolute', right: 25, top: 25 },\n selectedItemsContainer: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n },\n selectedItems: {\n color: colors.white,\n paddingHorizontal: 10,\n paddingVertical: 5,\n borderRadius: 10,\n backgroundColor: colors.primary,\n marginRight: 10,\n overflow: 'hidden',\n },\n blackText: { color: colors.black },\n});\n\nexport default DropdownSelectedItemsView;\n"]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","_input","obj","__esModule","default","DropdownSelectedItemsView","_ref","_getSelectedItemsLabe","placeholder","error","getSelectedItemsLabel","handleToggleModal","isMultiple","selectedItem","selectedItems","dropdownIcon","dropdownStyle","dropdownIconStyle","selectedItemStyle","placeholderStyle","multipleSelectedItemStyle","dropdownErrorStyle","primaryColor","disabled","createElement","Pressable","onPress","style","_ref2","pressed","inputStyles","inputFocusState","borderColor","input","inputFocusErrorState","ScrollView","horizontal","alwaysBounceHorizontal","showsHorizontalScrollIndicator","View","styles","selectedItemsContainer","onStartShouldSetResponder","map","item","i","Text","key","Math","random","backgroundColor","blackText","length","iconStyle","Image","source","StyleSheet","create","position","right","top","flexDirection","flexWrap","alignItems","color","colors","white","paddingHorizontal","paddingVertical","borderRadius","primary","marginRight","overflow","black","_default","exports"],"sources":["DropdownSelectedItemsView.tsx"],"sourcesContent":["import React from 'react';\nimport {\n View,\n Text,\n Pressable,\n ScrollView,\n StyleSheet,\n Image,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\nimport { inputStyles } from '../../styles/input';\n\nconst DropdownSelectedItemsView = ({\n placeholder,\n error,\n getSelectedItemsLabel,\n handleToggleModal,\n isMultiple,\n selectedItem,\n selectedItems,\n dropdownIcon,\n dropdownStyle,\n dropdownIconStyle,\n selectedItemStyle,\n placeholderStyle,\n multipleSelectedItemStyle,\n dropdownErrorStyle,\n primaryColor,\n disabled,\n}: any) => {\n return (\n <Pressable\n onPress={() => handleToggleModal()}\n style={({ pressed }) => [\n pressed && {\n ...inputStyles.inputFocusState,\n borderColor: primaryColor,\n },\n inputStyles.input,\n dropdownStyle,\n error && //this must be last\n error !== '' &&\n !pressed && {\n ...inputStyles.inputFocusErrorState,\n ...dropdownErrorStyle,\n },\n ]}\n disabled={disabled}\n >\n <ScrollView\n horizontal\n alwaysBounceHorizontal\n showsHorizontalScrollIndicator={false}\n >\n <View\n style={styles.selectedItemsContainer}\n onStartShouldSetResponder={() => true}\n >\n {isMultiple ? (\n getSelectedItemsLabel()?.map((item: any, i: Number) => (\n <Text\n key={`react-native-input-select-${Math.random()}-${i}`}\n style={[\n styles.selectedItems,\n { backgroundColor: primaryColor },\n multipleSelectedItemStyle,\n ]}\n >\n {item}\n </Text>\n ))\n ) : (\n <Text style={[styles.blackText, selectedItemStyle]}>\n {getSelectedItemsLabel()}\n </Text>\n )}\n {!selectedItem && selectedItems?.length === 0 && (\n <Text style={[styles.blackText, placeholderStyle]}>\n {placeholder ?? 'Select an option'}\n </Text>\n )}\n </View>\n </ScrollView>\n <View style={[styles.iconStyle, dropdownIconStyle]}>\n {dropdownIcon || (\n <Image source={require('../../asset/arrow-down.png')} />\n )}\n </View>\n </Pressable>\n );\n};\n\nconst styles = StyleSheet.create({\n iconStyle: { position: 'absolute', right: 25, top: 25 },\n selectedItemsContainer: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n },\n selectedItems: {\n color: colors.white,\n paddingHorizontal: 10,\n paddingVertical: 5,\n borderRadius: 10,\n backgroundColor: colors.primary,\n marginRight: 10,\n overflow: 'hidden',\n },\n blackText: { color: colors.black },\n});\n\nexport default DropdownSelectedItemsView;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAiD,SAAAD,uBAAAK,GAA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,KAAK,EAAE,EAAE;IAAEC,GAAG,EAAE;EAAG,CAAC;EACvDnB,sBAAsB,EAAE;IACtBoB,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE;EACd,CAAC;EACDjD,aAAa,EAAE;IACbkD,KAAK,EAAEC,cAAM,CAACC,KAAK;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE,EAAE;IAChBnB,eAAe,EAAEe,cAAM,CAACK,OAAO;IAC/BC,WAAW,EAAE,EAAE;IACfC,QAAQ,EAAE;EACZ,CAAC;EACDrB,SAAS,EAAE;IAAEa,KAAK,EAAEC,cAAM,CAACQ;EAAM;AACnC,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEYrE,yBAAyB;AAAAsE,OAAA,CAAAvE,OAAA,GAAAsE,QAAA"}
@@ -3,20 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Input = void 0;
7
-
6
+ exports.default = exports.Input = void 0;
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var _input = require("../../styles/input");
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
12
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
20
13
  const Input = _ref => {
21
14
  let {
22
15
  placeholder,
@@ -44,12 +37,12 @@ const Input = _ref => {
44
37
  onChangeText: onChangeText
45
38
  }, rest)));
46
39
  };
47
-
48
40
  exports.Input = Input;
49
-
50
41
  const styles = _reactNative.StyleSheet.create({
51
42
  container: {
52
43
  margin: 23
53
44
  }
54
45
  });
46
+ var _default = Input;
47
+ exports.default = _default;
55
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["Input","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","styles","container","inputStyles","input","Platform","select","web","outlineColor","borderColor","StyleSheet","create","margin"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,KAAK,GAAG,QAOV;AAAA,MAPW;AACpBC,IAAAA,WADoB;AAEpBC,IAAAA,KAFoB;AAGpBC,IAAAA,YAHoB;AAIpBC,IAAAA,KAJoB;AAKpBC,IAAAA,YALoB;AAMpB,OAAGC;AANiB,GAOX;AACT,QAAM,CAACC,SAAD,EAAYC,QAAZ,IAAwB,qBAAS,KAAT,CAA9B;AAEA,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,kBACE,6BAAC,sBAAD;AACE,IAAA,WAAW,EAAET,WADf;AAEE,IAAA,KAAK,EAAE,CACLU,mBAAYC,KADP,EAELC,sBAASC,MAAT,CAAgB;AACdC,MAAAA,GAAG,EAAE;AACHC,QAAAA,YAAY,EAAEX;AADX;AADS,KAAhB,CAFK,EAOLE,SAAS,IAAI;AAAEU,MAAAA,WAAW,EAAEZ;AAAf,KAPR,EAQLD,KARK,CAFT;AAYE,IAAA,OAAO,EAAE,MAAMI,QAAQ,CAAC,IAAD,CAZzB;AAaE,IAAA,MAAM,EAAE,MAAMA,QAAQ,CAAC,KAAD,CAbxB;AAcE,IAAA,KAAK,EAAEN,KAdT;AAeE,IAAA,YAAY,EAAEC;AAfhB,KAgBMG,IAhBN,EADF,CADF;AAsBD,CAhCM;;;;AAkCP,MAAMG,MAAM,GAAGS,wBAAWC,MAAX,CAAkB;AAC/BT,EAAAA,SAAS,EAAE;AAAEU,IAAAA,MAAM,EAAE;AAAV;AADoB,CAAlB,CAAf","sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={styles.container}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => setFocus(true)}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n"]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_input","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","Input","_ref","placeholder","value","onChangeText","style","primaryColor","rest","isFocused","setFocus","useState","createElement","View","styles","container","TextInput","inputStyles","input","Platform","select","web","outlineColor","borderColor","onFocus","onBlur","exports","StyleSheet","create","margin","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { TextInput, StyleSheet, View, Platform } from 'react-native';\nimport { inputStyles } from '../../styles/input';\n\nexport const Input = ({\n placeholder,\n value,\n onChangeText,\n style,\n primaryColor,\n ...rest\n}: any) => {\n const [isFocused, setFocus] = useState(false);\n\n return (\n <View style={styles.container}>\n <TextInput\n placeholder={placeholder}\n style={[\n inputStyles.input,\n Platform.select({\n web: {\n outlineColor: primaryColor,\n },\n }),\n isFocused && { borderColor: primaryColor },\n style,\n ]}\n onFocus={() => setFocus(true)}\n onBlur={() => setFocus(false)}\n value={value}\n onChangeText={onChangeText}\n {...rest}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { margin: 23 },\n});\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAiD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KA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GAAAN,IAAA;EACJ,MAAM,CAACO,SAAS,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE7C,oBACE9C,MAAA,CAAAY,OAAA,CAAAmC,aAAA,CAAC5C,YAAA,CAAA6C,IAAI;IAACP,KAAK,EAAEQ,MAAM,CAACC;EAAU,gBAC5BlD,MAAA,CAAAY,OAAA,CAAAmC,aAAA,CAAC5C,YAAA,CAAAgD,SAAS,EAAAxB,QAAA;IACRW,WAAW,EAAEA,WAAY;IACzBG,KAAK,EAAE,CACLW,kBAAW,CAACC,KAAK,EACjBC,qBAAQ,CAACC,MAAM,CAAC;MACdC,GAAG,EAAE;QACHC,YAAY,EAAEf;MAChB;IACF,CAAC,CAAC,EACFE,SAAS,IAAI;MAAEc,WAAW,EAAEhB;IAAa,CAAC,EAC1CD,KAAK,CACL;IACFkB,OAAO,EAAEA,CAAA,KAAMd,QAAQ,CAAC,IAAI,CAAE;IAC9Be,MAAM,EAAEA,CAAA,KAAMf,QAAQ,CAAC,KAAK,CAAE;IAC9BN,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA;EAAa,GACvBG,IAAI,CACT,CACG,CAAC;AAEX,CAAC;AAACkB,OAAA,CAAAzB,KAAA,GAAAA,KAAA;AAEF,MAAMa,MAAM,GAAGa,uBAAU,CAACC,MAAM,CAAC;EAC/Bb,SAAS,EAAE;IAAEc,MAAM,EAAE;EAAG;AAC1B,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY7B,KAAK;AAAAyB,OAAA,CAAAjD,OAAA,GAAAqD,QAAA"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SectionHeaderTitle = exports.ListItemContainer = exports.ListEmptyComponent = exports.ItemSeparatorComponent = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _colors = require("../../styles/colors");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ const ListEmptyComponent = _ref => {
12
+ let {
13
+ listEmptyComponentStyle
14
+ } = _ref;
15
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
16
+ style: styles.listEmptyComponentStyle
17
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
18
+ style: listEmptyComponentStyle
19
+ }, "No options available"));
20
+ };
21
+ exports.ListEmptyComponent = ListEmptyComponent;
22
+ const ItemSeparatorComponent = _ref2 => {
23
+ let {
24
+ itemSeparatorStyle
25
+ } = _ref2;
26
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
27
+ style: [styles.itemSeparatorStyle, itemSeparatorStyle]
28
+ });
29
+ };
30
+ exports.ItemSeparatorComponent = ItemSeparatorComponent;
31
+ const ListItemContainer = _ref3 => {
32
+ let {
33
+ children,
34
+ listItemContainerStyle
35
+ } = _ref3;
36
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
37
+ style: [styles.listItemContainerStyle, listItemContainerStyle]
38
+ }, children);
39
+ };
40
+ exports.ListItemContainer = ListItemContainer;
41
+ const SectionHeaderTitle = _ref4 => {
42
+ let {
43
+ title,
44
+ sectionHeaderStyle,
45
+ onPress,
46
+ isExpanded
47
+ } = _ref4;
48
+ return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
49
+ onPress: onPress
50
+ }, /*#__PURE__*/_react.default.createElement(ListItemContainer, {
51
+ listItemContainerStyle: styles.accordionStyle
52
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
53
+ style: [styles.sectionHeaderStyle, sectionHeaderStyle]
54
+ }, title), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
55
+ style: isExpanded ? null : styles.rotatedIcon90
56
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
57
+ source: require('../../asset/arrow-down.png')
58
+ }))));
59
+ };
60
+ exports.SectionHeaderTitle = SectionHeaderTitle;
61
+ const styles = _reactNative.StyleSheet.create({
62
+ listEmptyComponentStyle: {
63
+ alignItems: 'center',
64
+ width: '100%',
65
+ marginVertical: 20
66
+ },
67
+ itemSeparatorStyle: {
68
+ backgroundColor: _colors.colors.gray,
69
+ height: 1,
70
+ opacity: 0.15
71
+ },
72
+ listItemContainerStyle: {
73
+ paddingHorizontal: 20,
74
+ paddingVertical: 10,
75
+ flexDirection: 'row',
76
+ alignItems: 'center'
77
+ },
78
+ sectionHeaderStyle: {
79
+ fontWeight: '500'
80
+ },
81
+ accordionStyle: {
82
+ flexDirection: 'row',
83
+ flexWrap: 'nowrap',
84
+ justifyContent: 'space-between',
85
+ alignContent: 'center'
86
+ },
87
+ rotatedIcon90: {
88
+ transform: [{
89
+ rotate: '-90deg'
90
+ }]
91
+ }
92
+ });
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colors","obj","__esModule","default","ListEmptyComponent","_ref","listEmptyComponentStyle","createElement","View","style","styles","Text","exports","ItemSeparatorComponent","_ref2","itemSeparatorStyle","ListItemContainer","_ref3","children","listItemContainerStyle","SectionHeaderTitle","_ref4","title","sectionHeaderStyle","onPress","isExpanded","TouchableOpacity","accordionStyle","rotatedIcon90","Image","source","StyleSheet","create","alignItems","width","marginVertical","backgroundColor","colors","gray","height","opacity","paddingHorizontal","paddingVertical","flexDirection","fontWeight","flexWrap","justifyContent","alignContent","transform","rotate"],"sources":["index.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport {\n View,\n Text,\n StyleSheet,\n TouchableOpacity,\n TextStyle,\n Image,\n ViewStyle,\n} from 'react-native';\nimport { colors } from '../../styles/colors';\n\nexport const ListEmptyComponent = ({ listEmptyComponentStyle }: any) => {\n return (\n <View style={styles.listEmptyComponentStyle}>\n <Text style={listEmptyComponentStyle}>No options available</Text>\n </View>\n );\n};\n\nexport const ItemSeparatorComponent = ({ itemSeparatorStyle }: any) => {\n return <View style={[styles.itemSeparatorStyle, itemSeparatorStyle]} />;\n};\n\nexport const ListItemContainer = ({\n children,\n listItemContainerStyle,\n}: {\n children: ReactNode;\n listItemContainerStyle: ViewStyle;\n}) => {\n return (\n <View style={[styles.listItemContainerStyle, listItemContainerStyle]}>\n {children}\n </View>\n );\n};\n\nexport const SectionHeaderTitle = ({\n title,\n sectionHeaderStyle,\n onPress,\n isExpanded,\n}: {\n title: string;\n sectionHeaderStyle?: TextStyle;\n onPress?: () => void;\n isExpanded: Boolean;\n}) => {\n return (\n <TouchableOpacity onPress={onPress}>\n <ListItemContainer listItemContainerStyle={styles.accordionStyle}>\n <Text style={[styles.sectionHeaderStyle, sectionHeaderStyle]}>\n {title}\n </Text>\n <View style={isExpanded ? null : styles.rotatedIcon90}>\n <Image source={require('../../asset/arrow-down.png')} />\n </View>\n </ListItemContainer>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n listEmptyComponentStyle: {\n alignItems: 'center',\n width: '100%',\n marginVertical: 20,\n },\n itemSeparatorStyle: {\n backgroundColor: colors.gray,\n height: 1,\n opacity: 0.15,\n },\n listItemContainerStyle: {\n paddingHorizontal: 20,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n },\n sectionHeaderStyle: { fontWeight: '500' },\n accordionStyle: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n justifyContent: 'space-between',\n alignContent: 'center',\n },\n rotatedIcon90: {\n transform: [{ rotate: '-90deg' }],\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC,MAAMG,kBAAkB,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC;EAA6B,CAAC,GAAAD,IAAA;EACj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","CHECKBOX_SIZE"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAG,OAA7B;;AACA,MAAMC,oBAAoB,GAAG,OAA7B;;AACA,MAAMC,aAAa,GAAG,EAAtB","sourcesContent":["export const DEFAULT_OPTION_LABEL = 'label';\nexport const DEFAULT_OPTION_VALUE = 'value';\nexport const CHECKBOX_SIZE = 14;\n"]}
1
+ {"version":3,"names":["DEFAULT_OPTION_LABEL","exports","DEFAULT_OPTION_VALUE","CHECKBOX_SIZE"],"sources":["index.ts"],"sourcesContent":["export const DEFAULT_OPTION_LABEL = 'label';\nexport const DEFAULT_OPTION_VALUE = 'value';\nexport const CHECKBOX_SIZE = 14;\n"],"mappings":";;;;;;AAAO,MAAMA,oBAAoB,GAAG,OAAO;AAACC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACrC,MAAME,oBAAoB,GAAG,OAAO;AAACD,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AACrC,MAAMC,aAAa,GAAG,EAAE;AAACF,OAAA,CAAAE,aAAA,GAAAA,aAAA"}