@axelor/aos-mobile-ui 0.0.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 (236) hide show
  1. package/README.md +234 -0
  2. package/lib/components/atoms/BlockInteractionScreen/BlockInteractionScreen.d.ts +7 -0
  3. package/lib/components/atoms/BlockInteractionScreen/BlockInteractionScreen.js +50 -0
  4. package/lib/components/atoms/BlockInteractionScreen/BlockInteractionScreen.js.map +1 -0
  5. package/lib/components/atoms/Card/Card.d.ts +6 -0
  6. package/lib/components/atoms/Card/Card.js +37 -0
  7. package/lib/components/atoms/Card/Card.js.map +1 -0
  8. package/lib/components/atoms/DottedLine/DottedLine.d.ts +5 -0
  9. package/lib/components/atoms/DottedLine/DottedLine.js +38 -0
  10. package/lib/components/atoms/DottedLine/DottedLine.js.map +1 -0
  11. package/lib/components/atoms/HorizontalRule/HorizontalRule.d.ts +5 -0
  12. package/lib/components/atoms/HorizontalRule/HorizontalRule.js +35 -0
  13. package/lib/components/atoms/HorizontalRule/HorizontalRule.js.map +1 -0
  14. package/lib/components/atoms/HtmlInput/HtmlInput.d.ts +9 -0
  15. package/lib/components/atoms/HtmlInput/HtmlInput.js +50 -0
  16. package/lib/components/atoms/HtmlInput/HtmlInput.js.map +1 -0
  17. package/lib/components/atoms/Icon/Icon.d.ts +13 -0
  18. package/lib/components/atoms/Icon/Icon.js +49 -0
  19. package/lib/components/atoms/Icon/Icon.js.map +1 -0
  20. package/lib/components/atoms/Input/Input.d.ts +18 -0
  21. package/lib/components/atoms/Input/Input.js +37 -0
  22. package/lib/components/atoms/Input/Input.js.map +1 -0
  23. package/lib/components/atoms/RenderHtml/RenderHtml.d.ts +6 -0
  24. package/lib/components/atoms/RenderHtml/RenderHtml.js +50 -0
  25. package/lib/components/atoms/RenderHtml/RenderHtml.js.map +1 -0
  26. package/lib/components/atoms/Screen/Screen.d.ts +9 -0
  27. package/lib/components/atoms/Screen/Screen.js +74 -0
  28. package/lib/components/atoms/Screen/Screen.js.map +1 -0
  29. package/lib/components/atoms/ScrollView/ScrollView.d.ts +6 -0
  30. package/lib/components/atoms/ScrollView/ScrollView.js +33 -0
  31. package/lib/components/atoms/ScrollView/ScrollView.js.map +1 -0
  32. package/lib/components/atoms/Switch/Switch.d.ts +6 -0
  33. package/lib/components/atoms/Switch/Switch.js +34 -0
  34. package/lib/components/atoms/Switch/Switch.js.map +1 -0
  35. package/lib/components/atoms/Text/Text.d.ts +12 -0
  36. package/lib/components/atoms/Text/Text.js +37 -0
  37. package/lib/components/atoms/Text/Text.js.map +1 -0
  38. package/lib/components/atoms/index.d.ts +12 -0
  39. package/lib/components/atoms/index.js +30 -0
  40. package/lib/components/atoms/index.js.map +1 -0
  41. package/lib/components/index.d.ts +3 -0
  42. package/lib/components/index.js +21 -0
  43. package/lib/components/index.js.map +1 -0
  44. package/lib/components/molecules/AttachmentCard/AttachmentCard.d.ts +8 -0
  45. package/lib/components/molecules/AttachmentCard/AttachmentCard.js +61 -0
  46. package/lib/components/molecules/AttachmentCard/AttachmentCard.js.map +1 -0
  47. package/lib/components/molecules/Badge/Badge.d.ts +10 -0
  48. package/lib/components/molecules/Badge/Badge.js +43 -0
  49. package/lib/components/molecules/Badge/Badge.js.map +1 -0
  50. package/lib/components/molecules/Button/Button.d.ts +10 -0
  51. package/lib/components/molecules/Button/Button.js +48 -0
  52. package/lib/components/molecules/Button/Button.js.map +1 -0
  53. package/lib/components/molecules/CardIconButton/CardIconButton.d.ts +8 -0
  54. package/lib/components/molecules/CardIconButton/CardIconButton.js +42 -0
  55. package/lib/components/molecules/CardIconButton/CardIconButton.js.map +1 -0
  56. package/lib/components/molecules/Chip/Chip.d.ts +11 -0
  57. package/lib/components/molecules/Chip/Chip.js +69 -0
  58. package/lib/components/molecules/Chip/Chip.js.map +1 -0
  59. package/lib/components/molecules/ClearableCard/ClearableCard.d.ts +8 -0
  60. package/lib/components/molecules/ClearableCard/ClearableCard.js +43 -0
  61. package/lib/components/molecules/ClearableCard/ClearableCard.js.map +1 -0
  62. package/lib/components/molecules/DropdownCard/DropdownCard.d.ts +10 -0
  63. package/lib/components/molecules/DropdownCard/DropdownCard.js +84 -0
  64. package/lib/components/molecules/DropdownCard/DropdownCard.js.map +1 -0
  65. package/lib/components/molecules/DropdownMenu/DropdownMenu.d.ts +5 -0
  66. package/lib/components/molecules/DropdownMenu/DropdownMenu.js +57 -0
  67. package/lib/components/molecules/DropdownMenu/DropdownMenu.js.map +1 -0
  68. package/lib/components/molecules/DropdownMenuItem/DropdownMenuItem.d.ts +7 -0
  69. package/lib/components/molecules/DropdownMenuItem/DropdownMenuItem.js +42 -0
  70. package/lib/components/molecules/DropdownMenuItem/DropdownMenuItem.js.map +1 -0
  71. package/lib/components/molecules/EditableInput/EditableInput.d.ts +9 -0
  72. package/lib/components/molecules/EditableInput/EditableInput.js +65 -0
  73. package/lib/components/molecules/EditableInput/EditableInput.js.map +1 -0
  74. package/lib/components/molecules/FromTo/FromTo.d.ts +8 -0
  75. package/lib/components/molecules/FromTo/FromTo.js +44 -0
  76. package/lib/components/molecules/FromTo/FromTo.js.map +1 -0
  77. package/lib/components/molecules/HalfLabelCard/HalfLabelCard.d.ts +8 -0
  78. package/lib/components/molecules/HalfLabelCard/HalfLabelCard.js +51 -0
  79. package/lib/components/molecules/HalfLabelCard/HalfLabelCard.js.map +1 -0
  80. package/lib/components/molecules/HeaderIndicator/HeaderIndicator.d.ts +2 -0
  81. package/lib/components/molecules/HeaderIndicator/HeaderIndicator.js +65 -0
  82. package/lib/components/molecules/HeaderIndicator/HeaderIndicator.js.map +1 -0
  83. package/lib/components/molecules/IconButton/IconButton.d.ts +11 -0
  84. package/lib/components/molecules/IconButton/IconButton.js +48 -0
  85. package/lib/components/molecules/IconButton/IconButton.js.map +1 -0
  86. package/lib/components/molecules/IconInput/IconInput.d.ts +19 -0
  87. package/lib/components/molecules/IconInput/IconInput.js +50 -0
  88. package/lib/components/molecules/IconInput/IconInput.js.map +1 -0
  89. package/lib/components/molecules/Image/Image.d.ts +10 -0
  90. package/lib/components/molecules/Image/Image.js +36 -0
  91. package/lib/components/molecules/Image/Image.js.map +1 -0
  92. package/lib/components/molecules/Increment/Increment.d.ts +8 -0
  93. package/lib/components/molecules/Increment/Increment.js +97 -0
  94. package/lib/components/molecules/Increment/Increment.js.map +1 -0
  95. package/lib/components/molecules/InfoBubble/InfoBubble.d.ts +9 -0
  96. package/lib/components/molecules/InfoBubble/InfoBubble.js +73 -0
  97. package/lib/components/molecules/InfoBubble/InfoBubble.js.map +1 -0
  98. package/lib/components/molecules/LabelText/LabelText.d.ts +14 -0
  99. package/lib/components/molecules/LabelText/LabelText.js +45 -0
  100. package/lib/components/molecules/LabelText/LabelText.js.map +1 -0
  101. package/lib/components/molecules/LoadingIndicator/LoadingIndicator.d.ts +6 -0
  102. package/lib/components/molecules/LoadingIndicator/LoadingIndicator.js +49 -0
  103. package/lib/components/molecules/LoadingIndicator/LoadingIndicator.js.map +1 -0
  104. package/lib/components/molecules/MessageBox/MessageBox.d.ts +9 -0
  105. package/lib/components/molecules/MessageBox/MessageBox.js +60 -0
  106. package/lib/components/molecules/MessageBox/MessageBox.js.map +1 -0
  107. package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.d.ts +14 -0
  108. package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js +66 -0
  109. package/lib/components/molecules/MovementIndicationCard/MovementIndicationCard.js.map +1 -0
  110. package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.d.ts +11 -0
  111. package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js +80 -0
  112. package/lib/components/molecules/MultiValuePickerButton/MultiValuePickerButton.js.map +1 -0
  113. package/lib/components/molecules/NotesCard/NotesCard.d.ts +6 -0
  114. package/lib/components/molecules/NotesCard/NotesCard.js +55 -0
  115. package/lib/components/molecules/NotesCard/NotesCard.js.map +1 -0
  116. package/lib/components/molecules/PopUp/PopUp.d.ts +9 -0
  117. package/lib/components/molecules/PopUp/PopUp.js +74 -0
  118. package/lib/components/molecules/PopUp/PopUp.js.map +1 -0
  119. package/lib/components/molecules/RightIconButton/RightIconButton.d.ts +10 -0
  120. package/lib/components/molecules/RightIconButton/RightIconButton.js +49 -0
  121. package/lib/components/molecules/RightIconButton/RightIconButton.js.map +1 -0
  122. package/lib/components/molecules/SelectionContainer/SelectionContainer.d.ts +11 -0
  123. package/lib/components/molecules/SelectionContainer/SelectionContainer.js +111 -0
  124. package/lib/components/molecules/SelectionContainer/SelectionContainer.js.map +1 -0
  125. package/lib/components/molecules/StarScore/StarScore.d.ts +11 -0
  126. package/lib/components/molecules/StarScore/StarScore.js +58 -0
  127. package/lib/components/molecules/StarScore/StarScore.js.map +1 -0
  128. package/lib/components/molecules/SwitchCard/SwitchCard.d.ts +8 -0
  129. package/lib/components/molecules/SwitchCard/SwitchCard.js +31 -0
  130. package/lib/components/molecules/SwitchCard/SwitchCard.js.map +1 -0
  131. package/lib/components/molecules/TitledValue/TitledValue.d.ts +7 -0
  132. package/lib/components/molecules/TitledValue/TitledValue.js +40 -0
  133. package/lib/components/molecules/TitledValue/TitledValue.js.map +1 -0
  134. package/lib/components/molecules/ToggleSwitch/ToggleSwitch.d.ts +8 -0
  135. package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js +66 -0
  136. package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js.map +1 -0
  137. package/lib/components/molecules/UnorderedList/UnorderedList.d.ts +8 -0
  138. package/lib/components/molecules/UnorderedList/UnorderedList.js +51 -0
  139. package/lib/components/molecules/UnorderedList/UnorderedList.js.map +1 -0
  140. package/lib/components/molecules/ViewAllContainer/ViewAllContainer.d.ts +14 -0
  141. package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js +91 -0
  142. package/lib/components/molecules/ViewAllContainer/ViewAllContainer.js.map +1 -0
  143. package/lib/components/molecules/index.d.ts +33 -0
  144. package/lib/components/molecules/index.js +51 -0
  145. package/lib/components/molecules/index.js.map +1 -0
  146. package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.d.ts +19 -0
  147. package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js +148 -0
  148. package/lib/components/organisms/AutoCompleteSearch/AutoCompleteSearch.js.map +1 -0
  149. package/lib/components/organisms/ChipSelect/ChipSelect.d.ts +6 -0
  150. package/lib/components/organisms/ChipSelect/ChipSelect.js +39 -0
  151. package/lib/components/organisms/ChipSelect/ChipSelect.js.map +1 -0
  152. package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.d.ts +12 -0
  153. package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js +40 -0
  154. package/lib/components/organisms/DropdownCardSwitch/DropdownCardSwitch.js.map +1 -0
  155. package/lib/components/organisms/HeaderContainer/HeaderContainer.d.ts +9 -0
  156. package/lib/components/organisms/HeaderContainer/HeaderContainer.js +65 -0
  157. package/lib/components/organisms/HeaderContainer/HeaderContainer.js.map +1 -0
  158. package/lib/components/organisms/ImageBubble/ImageBubble.d.ts +10 -0
  159. package/lib/components/organisms/ImageBubble/ImageBubble.js +105 -0
  160. package/lib/components/organisms/ImageBubble/ImageBubble.js.map +1 -0
  161. package/lib/components/organisms/MultiValuePicker/MultiValuePicker.d.ts +16 -0
  162. package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js +103 -0
  163. package/lib/components/organisms/MultiValuePicker/MultiValuePicker.js.map +1 -0
  164. package/lib/components/organisms/Picker/Picker.d.ts +18 -0
  165. package/lib/components/organisms/Picker/Picker.js +101 -0
  166. package/lib/components/organisms/Picker/Picker.js.map +1 -0
  167. package/lib/components/organisms/PopUpOneButton/PopUpOneButton.d.ts +9 -0
  168. package/lib/components/organisms/PopUpOneButton/PopUpOneButton.js +35 -0
  169. package/lib/components/organisms/PopUpOneButton/PopUpOneButton.js.map +1 -0
  170. package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.d.ts +11 -0
  171. package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.js +38 -0
  172. package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.js.map +1 -0
  173. package/lib/components/organisms/ScrollList/ScrollList.d.ts +13 -0
  174. package/lib/components/organisms/ScrollList/ScrollList.js +70 -0
  175. package/lib/components/organisms/ScrollList/ScrollList.js.map +1 -0
  176. package/lib/components/organisms/SearchBar/SearchBar.d.ts +14 -0
  177. package/lib/components/organisms/SearchBar/SearchBar.js +44 -0
  178. package/lib/components/organisms/SearchBar/SearchBar.js.map +1 -0
  179. package/lib/components/organisms/index.d.ts +11 -0
  180. package/lib/components/organisms/index.js +29 -0
  181. package/lib/components/organisms/index.js.map +1 -0
  182. package/lib/config/ConfigContext.d.ts +26 -0
  183. package/lib/config/ConfigContext.js +184 -0
  184. package/lib/config/ConfigContext.js.map +1 -0
  185. package/lib/hooks/use-click-outside.d.ts +6 -0
  186. package/lib/hooks/use-click-outside.helper.d.ts +10 -0
  187. package/lib/hooks/use-click-outside.helper.js +35 -0
  188. package/lib/hooks/use-click-outside.helper.js.map +1 -0
  189. package/lib/hooks/use-click-outside.js +123 -0
  190. package/lib/hooks/use-click-outside.js.map +1 -0
  191. package/lib/index.d.ts +8 -0
  192. package/lib/index.js +26 -0
  193. package/lib/index.js.map +1 -0
  194. package/lib/theme/ThemeContext.d.ts +19 -0
  195. package/lib/theme/ThemeContext.js +110 -0
  196. package/lib/theme/ThemeContext.js.map +1 -0
  197. package/lib/theme/WritingThemeContext.d.ts +10 -0
  198. package/lib/theme/WritingThemeContext.js +77 -0
  199. package/lib/theme/WritingThemeContext.js.map +1 -0
  200. package/lib/theme/index.d.ts +4 -0
  201. package/lib/theme/index.js +22 -0
  202. package/lib/theme/index.js.map +1 -0
  203. package/lib/theme/themes.d.ts +32 -0
  204. package/lib/theme/themes.js +178 -0
  205. package/lib/theme/themes.js.map +1 -0
  206. package/lib/theme/writingTheme.d.ts +19 -0
  207. package/lib/theme/writingTheme.js +45 -0
  208. package/lib/theme/writingTheme.js.map +1 -0
  209. package/lib/tools/AnimationUtil.d.ts +12 -0
  210. package/lib/tools/AnimationUtil.js +40 -0
  211. package/lib/tools/AnimationUtil.js.map +1 -0
  212. package/lib/types/file.d.ts +5 -0
  213. package/lib/types/file.js +62 -0
  214. package/lib/types/file.js.map +1 -0
  215. package/lib/utils/arrays.d.ts +2 -0
  216. package/lib/utils/arrays.js +31 -0
  217. package/lib/utils/arrays.js.map +1 -0
  218. package/lib/utils/commons-styles.d.ts +34 -0
  219. package/lib/utils/commons-styles.js +53 -0
  220. package/lib/utils/commons-styles.js.map +1 -0
  221. package/lib/utils/formatters.d.ts +2 -0
  222. package/lib/utils/formatters.js +48 -0
  223. package/lib/utils/formatters.js.map +1 -0
  224. package/lib/utils/headerStyle.d.ts +12 -0
  225. package/lib/utils/headerStyle.js +31 -0
  226. package/lib/utils/headerStyle.js.map +1 -0
  227. package/lib/utils/list.d.ts +2 -0
  228. package/lib/utils/list.js +47 -0
  229. package/lib/utils/list.js.map +1 -0
  230. package/lib/utils/number.d.ts +4 -0
  231. package/lib/utils/number.js +34 -0
  232. package/lib/utils/number.js.map +1 -0
  233. package/lib/utils/strings.d.ts +2 -0
  234. package/lib/utils/strings.js +33 -0
  235. package/lib/utils/strings.js.map +1 -0
  236. package/package.json +49 -0
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useMemo } from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { useThemeColor } from '../../../theme/ThemeContext';
21
+ import { Icon } from '../../atoms';
22
+ import { getIntegerPart, isHalf, roundHalf, roundInteger, } from '../../../utils/number';
23
+ const StarScore = ({ style, color, size = 20, score, showHalfStar = false, showMissingStar = false, }) => {
24
+ const Colors = useThemeColor();
25
+ const starColor = useMemo(() => color !== undefined ? color.background : Colors.primaryColor.background, [Colors, color]);
26
+ const roundNbStar = useCallback(value => {
27
+ return showHalfStar ? roundHalf(value) : roundInteger(value);
28
+ }, [showHalfStar]);
29
+ const renderStars = useCallback(nbStar => {
30
+ const nbStarLimit = nbStar > 5 ? 5 : nbStar < 0 ? 0 : nbStar;
31
+ const nbStarRound = roundNbStar(nbStarLimit);
32
+ let starList = [];
33
+ const fullStarsNb = getIntegerPart(nbStarRound);
34
+ for (let index = 1; index <= fullStarsNb; index++) {
35
+ starList.push(<Icon key={index} FontAwesome5={false} name="star" color={starColor} size={size}/>);
36
+ }
37
+ if (isHalf(nbStarRound)) {
38
+ starList.push(<Icon key={fullStarsNb + 1} FontAwesome5={false} name={showMissingStar ? 'star-half-empty' : 'star-half'} color={starColor} size={size}/>);
39
+ }
40
+ if (showMissingStar) {
41
+ for (let index = starList.length; index < 5; index++) {
42
+ starList.push(<Icon key={index + 1} FontAwesome5={false} name="star-o" color={starColor} size={size}/>);
43
+ }
44
+ }
45
+ return starList;
46
+ }, [roundNbStar, showMissingStar, size, starColor]);
47
+ const starScoring = useMemo(() => renderStars(score), [renderStars, score]);
48
+ return (<View style={[styles.leadScoring, style]}>
49
+ {starScoring.map(star => star)}
50
+ </View>);
51
+ };
52
+ const styles = StyleSheet.create({
53
+ leadScoring: {
54
+ flexDirection: 'row',
55
+ },
56
+ });
57
+ export default StarScore;
58
+ //# sourceMappingURL=StarScore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StarScore.js","sourceRoot":"","sources":["../../../../src/components/molecules/StarScore/StarScore.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;A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AAC,WAAW,CAAC,KAAK,CAAC,EACxB,CAAC,WAAW,EAAE,KAAK,CAAC,CACrB,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CACvC;MAAA,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAChC;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE;QACX,aAAa,EAAE,KAAK;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ interface SwitchCardProps {
2
+ style?: any;
3
+ title: string;
4
+ defaultValue: boolean;
5
+ onToggle: (any: any) => void;
6
+ }
7
+ declare const SwitchCard: ({ style, title, defaultValue, onToggle, }: SwitchCardProps) => JSX.Element;
8
+ export default SwitchCard;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useMemo } from 'react';
19
+ import { getCommonStyles } from '../../../utils/commons-styles';
20
+ import { useThemeColor } from '../../../theme/ThemeContext';
21
+ import { Card, Switch, Text } from '../../atoms';
22
+ const SwitchCard = ({ style, title, defaultValue, onToggle = () => { }, }) => {
23
+ const Colors = useThemeColor();
24
+ const styles = useMemo(() => getCommonStyles(Colors), [Colors]);
25
+ return (<Card style={[styles.filter, styles.filterAlign, styles.filterSize, style]}>
26
+ <Text>{title}</Text>
27
+ <Switch isEnabled={defaultValue} handleToggle={onToggle}/>
28
+ </Card>);
29
+ };
30
+ export default SwitchCard;
31
+ //# sourceMappingURL=SwitchCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchCard.js","sourceRoot":"","sources":["../../../../src/components/molecules/SwitchCard/SwitchCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAS/C,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,KAAK,EACL,YAAY,EACZ,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,GACH,EAAE,EAAE;IACpB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CACzE;MAAA,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CACnB;MAAA,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,EAC1D;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface TitledValueProps {
2
+ title: string;
3
+ value: string;
4
+ style?: any;
5
+ }
6
+ declare function TitledValue({ title, value, style }: TitledValueProps): JSX.Element;
7
+ export default TitledValue;
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { Text } from '../../atoms';
21
+ function TitledValue({ title, value, style }) {
22
+ return (<View style={[styles.container, style]}>
23
+ <Text style={styles.importantText}>{title}</Text>
24
+ <Text>{value}</Text>
25
+ </View>);
26
+ }
27
+ const styles = StyleSheet.create({
28
+ container: {
29
+ width: '45%',
30
+ justifyContent: 'center',
31
+ alignItems: 'center',
32
+ },
33
+ importantText: {
34
+ fontSize: 16,
35
+ fontWeight: 'bold',
36
+ marginBottom: 5,
37
+ },
38
+ });
39
+ export default TitledValue;
40
+ //# sourceMappingURL=TitledValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TitledValue.js","sourceRoot":"","sources":["../../../../src/components/molecules/TitledValue/TitledValue.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAQjC,SAAS,WAAW,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAmB;IAC1D,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACrC;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAChD;MAAA,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CACrB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,KAAK;QACZ,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,aAAa,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ interface ToggleSwitchProps {
2
+ style?: any;
3
+ leftTitle: string;
4
+ rightTitle: string;
5
+ onSwitch: () => void;
6
+ }
7
+ declare const ToggleSwitch: ({ style, leftTitle, rightTitle, onSwitch, }: ToggleSwitchProps) => JSX.Element;
8
+ export default ToggleSwitch;
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useMemo, useState } from 'react';
19
+ import { Dimensions, StyleSheet, TouchableOpacity, View } from 'react-native';
20
+ import { useThemeColor } from '../../../theme/ThemeContext';
21
+ import { Text } from '../../atoms';
22
+ const ToggleSwitch = ({ style, leftTitle, rightTitle, onSwitch = () => { }, }) => {
23
+ const Colors = useThemeColor();
24
+ const [active, setActive] = useState(true);
25
+ const styles = useMemo(() => getStyles(Colors), [Colors]);
26
+ const onLeftPress = () => {
27
+ setActive(true);
28
+ onSwitch();
29
+ };
30
+ const onRightPress = () => {
31
+ setActive(false);
32
+ onSwitch();
33
+ };
34
+ return (<View style={[styles.container, style]}>
35
+ <TouchableOpacity style={[styles.toggle, active && styles.active]} disabled={active} onPress={onLeftPress}>
36
+ <Text>{leftTitle}</Text>
37
+ </TouchableOpacity>
38
+ <TouchableOpacity style={[styles.toggle, !active && styles.active]} disabled={!active} onPress={onRightPress}>
39
+ <Text>{rightTitle}</Text>
40
+ </TouchableOpacity>
41
+ </View>);
42
+ };
43
+ const getStyles = Colors => StyleSheet.create({
44
+ container: {
45
+ borderColor: Colors.secondaryColor.background_light,
46
+ borderWidth: 2,
47
+ borderRadius: 20,
48
+ flexDirection: 'row',
49
+ justifyContent: 'center',
50
+ alignItems: 'center',
51
+ margin: 5,
52
+ padding: 2,
53
+ },
54
+ toggle: {
55
+ width: Dimensions.get('window').width * 0.47,
56
+ padding: 5,
57
+ borderRadius: 50,
58
+ justifyContent: 'center',
59
+ alignItems: 'center',
60
+ },
61
+ active: {
62
+ backgroundColor: Colors.primaryColor.background_light,
63
+ },
64
+ });
65
+ export default ToggleSwitch;
66
+ //# sourceMappingURL=ToggleSwitch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleSwitch.js","sourceRoot":"","sources":["../../../../src/components/molecules/Toggle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C,IAAI,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CACzB;MAAA,EAAE,gBAAgB,CAClB;MAAA,CAAC,gBAAgB,CACf,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CACjD,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAClB,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB;QAAA,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAC1B;MAAA,EAAE,gBAAgB,CACpB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CACzB,UAAU,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,gBAAgB;QACnD,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX;IACD,MAAM,EAAE;QACN,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,IAAI;QAC5C,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,MAAM,EAAE;QACN,eAAe,EAAE,MAAM,CAAC,YAAY,CAAC,gBAAgB;KACtD;CACF,CAAC,CAAC;AACL,eAAe,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ interface UnorderedListProps {
2
+ data: any[];
3
+ numberOfItems?: number;
4
+ renderItem: (item: any) => any;
5
+ style?: any;
6
+ }
7
+ declare function UnorderedList({ data, numberOfItems, renderItem, style, }: UnorderedListProps): JSX.Element;
8
+ export default UnorderedList;
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useMemo } from 'react';
19
+ import { FlatList, StyleSheet, View } from 'react-native';
20
+ import { Text } from '../../atoms';
21
+ function UnorderedList({ data, numberOfItems, renderItem, style, }) {
22
+ const renderData = useMemo(() => {
23
+ if (!numberOfItems || data.length === 0) {
24
+ return data;
25
+ }
26
+ if (numberOfItems > data.length) {
27
+ console.warn(`Number of items provided with value ${numberOfItems} is invalid`);
28
+ return data;
29
+ }
30
+ return data.slice(0, numberOfItems);
31
+ }, [numberOfItems, data]);
32
+ return (<FlatList data={renderData} style={[styles.container, style]} renderItem={({ item }) => (<View style={styles.item}>
33
+ <Text style={styles.dot}>{'\u2022 '}</Text>
34
+ {renderItem({ item })}
35
+ </View>)}/>);
36
+ }
37
+ const styles = StyleSheet.create({
38
+ container: {
39
+ padding: 5,
40
+ },
41
+ dot: {
42
+ fontSize: 18,
43
+ alignSelf: 'flex-start',
44
+ },
45
+ item: {
46
+ flexDirection: 'row',
47
+ alignItems: 'center',
48
+ },
49
+ });
50
+ export default UnorderedList;
51
+ //# sourceMappingURL=UnorderedList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnorderedList.js","sourceRoot":"","sources":["../../../../src/components/molecules/UnorderedList/UnorderedList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH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OAAO,EAAE,CAAC;KACX;IACD,GAAG,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,YAAY;KACxB;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -0,0 +1,14 @@
1
+ interface ViewAllContainerProps {
2
+ style?: any;
3
+ title: string;
4
+ data: any[];
5
+ disabled: boolean;
6
+ children: any;
7
+ isHeaderExist?: boolean;
8
+ onNewIcon?: () => void;
9
+ onViewPress: () => void;
10
+ renderFirstTwoItems: (item: any, index: number) => any;
11
+ translator?: (any: any) => void | undefined;
12
+ }
13
+ declare const ViewAllContainer: ({ style, title, data, disabled, children, isHeaderExist, onNewIcon, onViewPress, renderFirstTwoItems, translator, }: ViewAllContainerProps) => JSX.Element;
14
+ export default ViewAllContainer;
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React from 'react';
19
+ import { StyleSheet, TouchableOpacity, View } from 'react-native';
20
+ import { useThemeColor } from '../../../theme/ThemeContext';
21
+ import { Card, Icon, Text } from '../../atoms';
22
+ const ViewAllContainer = ({ style, title, data = [], disabled = false, children, isHeaderExist = false, onNewIcon = () => { }, onViewPress = () => { }, renderFirstTwoItems, translator = null, }) => {
23
+ const Colors = useThemeColor();
24
+ return (<Card style={[styles.container, style]}>
25
+ {isHeaderExist && (<View style={styles.headLineMove}>
26
+ <Text>
27
+ {translator == null ? 'Content' : translator('Base_Content')}
28
+ </Text>
29
+ <Icon name="plus" color={Colors.primaryColor.background} size={24} touchable={true} onPress={onNewIcon}/>
30
+ </View>)}
31
+ {title && <Text style={styles.title}>{title}</Text>}
32
+ <View style={styles.cardContainer}>
33
+ {data[0] != null && renderFirstTwoItems(data[0], 0)}
34
+ {data[1] != null && renderFirstTwoItems(data[1], 1)}
35
+ {children}
36
+ </View>
37
+ {!disabled && (<TouchableOpacity onPress={onViewPress} activeOpacity={0.9}>
38
+ <View style={styles.iconContainer}>
39
+ <Text style={styles.txtDetails}>
40
+ {translator == null ? 'View all' : translator('Base_ViewAll')}
41
+ </Text>
42
+ <Icon name="chevron-right" color={Colors.secondaryColor.background_light} size={20}/>
43
+ </View>
44
+ </TouchableOpacity>)}
45
+ </Card>);
46
+ };
47
+ const styles = StyleSheet.create({
48
+ container: {
49
+ paddingVertical: '2%',
50
+ paddingHorizontal: '3%',
51
+ paddingRight: 16,
52
+ flexDirection: 'column',
53
+ justifyContent: 'center',
54
+ alignItems: 'center',
55
+ marginHorizontal: 12,
56
+ marginVertical: 4,
57
+ },
58
+ headLineMove: {
59
+ flexDirection: 'row',
60
+ justifyContent: 'space-between',
61
+ alignItems: 'center',
62
+ marginHorizontal: 1,
63
+ marginVertical: 2,
64
+ width: '100%',
65
+ },
66
+ title: {
67
+ alignSelf: 'flex-start',
68
+ fontSize: 14,
69
+ marginHorizontal: 8,
70
+ marginBottom: 0,
71
+ },
72
+ cardContainer: {
73
+ marginBottom: 2,
74
+ width: '100%',
75
+ },
76
+ iconContainer: {
77
+ width: '100%',
78
+ flexDirection: 'row',
79
+ justifyContent: 'flex-end',
80
+ alignItems: 'center',
81
+ alignContent: 'center',
82
+ marginBottom: 2,
83
+ elevation: 3,
84
+ },
85
+ txtDetails: {
86
+ fontSize: 14,
87
+ marginHorizontal: 15,
88
+ },
89
+ });
90
+ export default ViewAllContainer;
91
+ //# sourceMappingURL=ViewAllContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewAllContainer.js","sourceRoot":"","sources":["../../../../src/components/molecules/ViewAllContainer/ViewAllContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAe7C,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,EACL,KAAK,EACL,IAAI,GAAG,EAAE,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,SAAS,GAAG,GAAG,EAAE,GAAE,CAAC,EACpB,WAAW,GAAG,GAAG,EAAE,GAAE,CAAC,EACtB,mBAAmB,EACnB,UAAU,GAAG,IAAI,GACK,EAAE,EAAE;IAC1B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACrC;MAAA,CAAC,aAAa,IAAI,CAChB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC/B;UAAA,CAAC,IAAI,CACH;YAAA,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAC9D;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,IAAI,CACH,IAAI,CAAC,MAAM,CACX,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CACtC,IAAI,CAA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EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,eAAe,EAAE,IAAI;QACrB,iBAAiB,EAAE,IAAI;QACvB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,QAAQ;QACvB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,CAAC;KAClB;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,gBAAgB,EAAE,CAAC;QACnB,cAAc,EAAE,CAAC;QACjB,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE,CAAC;QACnB,YAAY,EAAE,CAAC;KAChB;IACD,aAAa,EAAE;QACb,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,MAAM;KACd;IACD,aAAa,EAAE;QACb,KAAK,EAAE,MAAM;QACb,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,UAAU;QAC1B,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,QAAQ;QACtB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;KACb;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE,EAAE;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,33 @@
1
+ export { default as AttachmentCard } from './AttachmentCard/AttachmentCard';
2
+ export { default as Badge } from './Badge/Badge';
3
+ export { default as Button } from './Button/Button';
4
+ export { default as CardIconButton } from './CardIconButton/CardIconButton';
5
+ export { default as Chip } from './Chip/Chip';
6
+ export { default as ClearableCard } from './ClearableCard/ClearableCard';
7
+ export { default as DropdownCard } from './DropdownCard/DropdownCard';
8
+ export { default as DropdownMenu } from './DropdownMenu/DropdownMenu';
9
+ export { default as DropdownMenuItem } from './DropdownMenuItem/DropdownMenuItem';
10
+ export { default as EditableInput } from './EditableInput/EditableInput';
11
+ export { default as FromTo } from './FromTo/FromTo';
12
+ export { default as HalfLabelCard } from './HalfLabelCard/HalfLabelCard';
13
+ export { default as IconButton } from './IconButton/IconButton';
14
+ export { default as IconInput } from './IconInput/IconInput';
15
+ export { default as Image } from './Image/Image';
16
+ export { default as Increment } from './Increment/Increment';
17
+ export { default as InfoBubble } from './InfoBubble/InfoBubble';
18
+ export { default as HeaderIndicator } from './HeaderIndicator/HeaderIndicator';
19
+ export { default as LabelText } from './LabelText/LabelText';
20
+ export { default as LoadingIndicator } from './LoadingIndicator/LoadingIndicator';
21
+ export { default as MessageBox } from './MessageBox/MessageBox';
22
+ export { default as MovementIndicationCard } from './MovementIndicationCard/MovementIndicationCard';
23
+ export { default as MultiValuePickerButton } from './MultiValuePickerButton/MultiValuePickerButton';
24
+ export { default as NotesCard } from './NotesCard/NotesCard';
25
+ export { default as PopUp } from './PopUp/PopUp';
26
+ export { default as RightIconButton } from './RightIconButton/RightIconButton';
27
+ export { default as SelectionContainer } from './SelectionContainer/SelectionContainer';
28
+ export { default as StarScore } from './StarScore/StarScore';
29
+ export { default as SwitchCard } from './SwitchCard/SwitchCard';
30
+ export { default as TitledValue } from './TitledValue/TitledValue';
31
+ export { default as ToggleSwitch } from './ToggleSwitch/ToggleSwitch';
32
+ export { default as UnorderedList } from './UnorderedList/UnorderedList';
33
+ export { default as ViewAllContainer } from './ViewAllContainer/ViewAllContainer';
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { default as AttachmentCard } from './AttachmentCard/AttachmentCard';
19
+ export { default as Badge } from './Badge/Badge';
20
+ export { default as Button } from './Button/Button';
21
+ export { default as CardIconButton } from './CardIconButton/CardIconButton';
22
+ export { default as Chip } from './Chip/Chip';
23
+ export { default as ClearableCard } from './ClearableCard/ClearableCard';
24
+ export { default as DropdownCard } from './DropdownCard/DropdownCard';
25
+ export { default as DropdownMenu } from './DropdownMenu/DropdownMenu';
26
+ export { default as DropdownMenuItem } from './DropdownMenuItem/DropdownMenuItem';
27
+ export { default as EditableInput } from './EditableInput/EditableInput';
28
+ export { default as FromTo } from './FromTo/FromTo';
29
+ export { default as HalfLabelCard } from './HalfLabelCard/HalfLabelCard';
30
+ export { default as IconButton } from './IconButton/IconButton';
31
+ export { default as IconInput } from './IconInput/IconInput';
32
+ export { default as Image } from './Image/Image';
33
+ export { default as Increment } from './Increment/Increment';
34
+ export { default as InfoBubble } from './InfoBubble/InfoBubble';
35
+ export { default as HeaderIndicator } from './HeaderIndicator/HeaderIndicator';
36
+ export { default as LabelText } from './LabelText/LabelText';
37
+ export { default as LoadingIndicator } from './LoadingIndicator/LoadingIndicator';
38
+ export { default as MessageBox } from './MessageBox/MessageBox';
39
+ export { default as MovementIndicationCard } from './MovementIndicationCard/MovementIndicationCard';
40
+ export { default as MultiValuePickerButton } from './MultiValuePickerButton/MultiValuePickerButton';
41
+ export { default as NotesCard } from './NotesCard/NotesCard';
42
+ export { default as PopUp } from './PopUp/PopUp';
43
+ export { default as RightIconButton } from './RightIconButton/RightIconButton';
44
+ export { default as SelectionContainer } from './SelectionContainer/SelectionContainer';
45
+ export { default as StarScore } from './StarScore/StarScore';
46
+ export { default as SwitchCard } from './SwitchCard/SwitchCard';
47
+ export { default as TitledValue } from './TitledValue/TitledValue';
48
+ export { default as ToggleSwitch } from './ToggleSwitch/ToggleSwitch';
49
+ export { default as UnorderedList } from './UnorderedList/UnorderedList';
50
+ export { default as ViewAllContainer } from './ViewAllContainer/ViewAllContainer';
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/molecules/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OA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ocompleteSearchProps {
2
+ objectList: any[];
3
+ value?: any;
4
+ onChangeValue?: (any: any) => void;
5
+ fetchData?: (any: any) => void;
6
+ displayValue?: (any: any) => string;
7
+ placeholder?: string;
8
+ isFocus?: boolean;
9
+ changeScreenAfter?: boolean;
10
+ navigate?: boolean;
11
+ oneFilter?: boolean;
12
+ onSelection?: () => void;
13
+ onScanPress?: () => void;
14
+ scanIconColor?: string;
15
+ selectLastItem?: boolean;
16
+ style?: any;
17
+ }
18
+ declare const AutoCompleteSearch: ({ objectList, value, onChangeValue, fetchData, displayValue, placeholder, isFocus, changeScreenAfter, navigate, oneFilter, onSelection, onScanPress, scanIconColor, selectLastItem, style, }: AutocompleteSearchProps) => JSX.Element;
19
+ export default AutoCompleteSearch;