@pi-spi/app 1.6.0 → 2.1.0

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 (233) hide show
  1. package/README.md +64 -30
  2. package/example/App.tsx +27 -24
  3. package/lib/module/core/api.js +14 -5
  4. package/lib/module/core/api.js.map +1 -1
  5. package/lib/module/core/assets.js +0 -7
  6. package/lib/module/core/assets.js.map +1 -1
  7. package/lib/module/core/di.js +17 -8
  8. package/lib/module/core/di.js.map +1 -1
  9. package/lib/module/core/pi_spi_custom_theme.js +22 -10
  10. package/lib/module/core/pi_spi_custom_theme.js.map +1 -1
  11. package/lib/module/core/pi_spi_sdk_config.js +22 -8
  12. package/lib/module/core/pi_spi_sdk_config.js.map +1 -1
  13. package/lib/module/core/theme.js +345 -225
  14. package/lib/module/core/theme.js.map +1 -1
  15. package/lib/module/index.js +1 -1
  16. package/lib/module/index.js.map +1 -1
  17. package/lib/module/l10n/app_localizations.js.map +1 -1
  18. package/lib/module/l10n/app_localizations_en.js +22 -0
  19. package/lib/module/l10n/app_localizations_en.js.map +1 -1
  20. package/lib/module/l10n/app_localizations_fr.js +22 -0
  21. package/lib/module/l10n/app_localizations_fr.js.map +1 -1
  22. package/lib/module/l10n/app_localizations_pt.js +22 -0
  23. package/lib/module/l10n/app_localizations_pt.js.map +1 -1
  24. package/lib/module/modules/categorie/presentation/pages/categorie_edit_icon_btn.js +25 -35
  25. package/lib/module/modules/categorie/presentation/pages/categorie_edit_icon_btn.js.map +1 -1
  26. package/lib/module/modules/config/domain/models/config_keys.js +3 -1
  27. package/lib/module/modules/config/domain/models/config_keys.js.map +1 -1
  28. package/lib/module/modules/config/domain/services/config_service.js +31 -2
  29. package/lib/module/modules/config/domain/services/config_service.js.map +1 -1
  30. package/lib/module/modules/home/presentation/pages/home_tab_compte.js +0 -1
  31. package/lib/module/modules/home/presentation/pages/home_tab_compte.js.map +1 -1
  32. package/lib/module/modules/home/presentation/pages/home_tab_compte_more_menu.js +38 -37
  33. package/lib/module/modules/home/presentation/pages/home_tab_compte_more_menu.js.map +1 -1
  34. package/lib/module/modules/profile/presentation/pages/parametre/profile_parametre_page.js +2 -2
  35. package/lib/module/modules/profile/presentation/pages/parametre/profile_parametre_page.js.map +1 -1
  36. package/lib/module/modules/profile/presentation/pages/parametre/profile_parametre_page_qrcode.js +2 -2
  37. package/lib/module/modules/profile/presentation/pages/parametre/profile_parametre_page_qrcode.js.map +1 -1
  38. package/lib/module/modules/profile/presentation/pages/parametre/profile_parametre_page_theme.js +135 -199
  39. package/lib/module/modules/profile/presentation/pages/parametre/profile_parametre_page_theme.js.map +1 -1
  40. package/lib/module/modules/profile/presentation/pages/profile_menu.js +4 -3
  41. package/lib/module/modules/profile/presentation/pages/profile_menu.js.map +1 -1
  42. package/lib/module/modules/profile/presentation/pages/profile_page_avatar.js +6 -28
  43. package/lib/module/modules/profile/presentation/pages/profile_page_avatar.js.map +1 -1
  44. package/lib/module/modules/profile/presentation/pages/profile_page_contacts.js +0 -1
  45. package/lib/module/modules/profile/presentation/pages/profile_page_contacts.js.map +1 -1
  46. package/lib/module/modules/profile/presentation/pages/profile_page_contacts_actions.js +122 -162
  47. package/lib/module/modules/profile/presentation/pages/profile_page_contacts_actions.js.map +1 -1
  48. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page.js +0 -1
  49. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page.js.map +1 -1
  50. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page_share.js +26 -38
  51. package/lib/module/modules/qrcode/presentation/pages/qrcode_alias_page_share.js.map +1 -1
  52. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page.js +0 -1
  53. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page.js.map +1 -1
  54. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.js +0 -1
  55. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.js.map +1 -1
  56. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.js +38 -93
  57. package/lib/module/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.js.map +1 -1
  58. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_empty_widget.js +0 -1
  59. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_empty_widget.js.map +1 -1
  60. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_widget.js +0 -1
  61. package/lib/module/modules/subscription/presentation/pages/subscription_list/subscription_list_widget.js.map +1 -1
  62. package/lib/module/modules/subscription/presentation/pages/subscription_menu_widget.js +23 -42
  63. package/lib/module/modules/subscription/presentation/pages/subscription_menu_widget.js.map +1 -1
  64. package/lib/module/modules/transactions/infra/transaction_output_remote.js +2 -1
  65. package/lib/module/modules/transactions/infra/transaction_output_remote.js.map +1 -1
  66. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.js +0 -1
  67. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.js.map +1 -1
  68. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.js +34 -61
  69. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.js.map +1 -1
  70. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.js +49 -62
  71. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.js.map +1 -1
  72. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_recu.js +3 -1
  73. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_recu.js.map +1 -1
  74. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_ticket.js +68 -88
  75. package/lib/module/modules/transactions/presentation/pages/transaction_details/transaction_details_page_ticket.js.map +1 -1
  76. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.js +77 -0
  77. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.js.map +1 -0
  78. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.js +49 -155
  79. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.js.map +1 -1
  80. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.js +8 -28
  81. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.js.map +1 -1
  82. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.js +0 -1
  83. package/lib/module/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.js.map +1 -1
  84. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.js +50 -42
  85. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.js.map +1 -1
  86. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_widget.js +0 -1
  87. package/lib/module/modules/transactions/presentation/pages/transaction_recents/transaction_recents_widget.js.map +1 -1
  88. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.js +0 -1
  89. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.js.map +1 -1
  90. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.js +37 -67
  91. package/lib/module/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.js.map +1 -1
  92. package/lib/module/modules/transactions/presentation/pages/transaction_search/transaction_search_page_filters.js +5 -4
  93. package/lib/module/modules/transactions/presentation/pages/transaction_search/transaction_search_page_filters.js.map +1 -1
  94. package/lib/module/modules/transactions/presentation/pages/transaction_split/transaction_split_page_repartition.js +2 -2
  95. package/lib/module/modules/transactions/presentation/pages/transaction_split/transaction_split_page_repartition.js.map +1 -1
  96. package/lib/module/pi_spi_sdk_entry.js +7 -2
  97. package/lib/module/pi_spi_sdk_entry.js.map +1 -1
  98. package/lib/module/shared/widgets/confirm_action_sheet_widget.js +34 -67
  99. package/lib/module/shared/widgets/confirm_action_sheet_widget.js.map +1 -1
  100. package/lib/module/shared/widgets/custom_progressbar.js +3 -2
  101. package/lib/module/shared/widgets/custom_progressbar.js.map +1 -1
  102. package/lib/module/shared/widgets/image_select_widget.js +43 -107
  103. package/lib/module/shared/widgets/image_select_widget.js.map +1 -1
  104. package/lib/module/shared/widgets/notification_dialog.js +25 -35
  105. package/lib/module/shared/widgets/notification_dialog.js.map +1 -1
  106. package/lib/module/shared/widgets/selection.js +382 -6
  107. package/lib/module/shared/widgets/selection.js.map +1 -1
  108. package/lib/typescript/src/core/api.d.ts +6 -0
  109. package/lib/typescript/src/core/api.d.ts.map +1 -1
  110. package/lib/typescript/src/core/assets.d.ts +0 -7
  111. package/lib/typescript/src/core/assets.d.ts.map +1 -1
  112. package/lib/typescript/src/core/di.d.ts.map +1 -1
  113. package/lib/typescript/src/core/pi_spi_custom_theme.d.ts +17 -8
  114. package/lib/typescript/src/core/pi_spi_custom_theme.d.ts.map +1 -1
  115. package/lib/typescript/src/core/pi_spi_sdk_config.d.ts +22 -8
  116. package/lib/typescript/src/core/pi_spi_sdk_config.d.ts.map +1 -1
  117. package/lib/typescript/src/core/theme.d.ts +123 -53
  118. package/lib/typescript/src/core/theme.d.ts.map +1 -1
  119. package/lib/typescript/src/index.d.ts +1 -1
  120. package/lib/typescript/src/index.d.ts.map +1 -1
  121. package/lib/typescript/src/l10n/app_localizations.d.ts +44 -0
  122. package/lib/typescript/src/l10n/app_localizations.d.ts.map +1 -1
  123. package/lib/typescript/src/l10n/app_localizations_en.d.ts.map +1 -1
  124. package/lib/typescript/src/l10n/app_localizations_fr.d.ts.map +1 -1
  125. package/lib/typescript/src/l10n/app_localizations_pt.d.ts.map +1 -1
  126. package/lib/typescript/src/modules/categorie/presentation/pages/categorie_edit_icon_btn.d.ts.map +1 -1
  127. package/lib/typescript/src/modules/config/domain/models/config_keys.d.ts +3 -1
  128. package/lib/typescript/src/modules/config/domain/models/config_keys.d.ts.map +1 -1
  129. package/lib/typescript/src/modules/config/domain/services/config_service.d.ts +7 -0
  130. package/lib/typescript/src/modules/config/domain/services/config_service.d.ts.map +1 -1
  131. package/lib/typescript/src/modules/home/presentation/pages/home_tab_compte_more_menu.d.ts +2 -0
  132. package/lib/typescript/src/modules/home/presentation/pages/home_tab_compte_more_menu.d.ts.map +1 -1
  133. package/lib/typescript/src/modules/profile/presentation/pages/parametre/profile_parametre_page.d.ts.map +1 -1
  134. package/lib/typescript/src/modules/profile/presentation/pages/parametre/profile_parametre_page_theme.d.ts +1 -1
  135. package/lib/typescript/src/modules/profile/presentation/pages/parametre/profile_parametre_page_theme.d.ts.map +1 -1
  136. package/lib/typescript/src/modules/profile/presentation/pages/profile_page_avatar.d.ts.map +1 -1
  137. package/lib/typescript/src/modules/profile/presentation/pages/profile_page_contacts.d.ts.map +1 -1
  138. package/lib/typescript/src/modules/profile/presentation/pages/profile_page_contacts_actions.d.ts.map +1 -1
  139. package/lib/typescript/src/modules/qrcode/presentation/pages/qrcode_alias_page.d.ts.map +1 -1
  140. package/lib/typescript/src/modules/qrcode/presentation/pages/qrcode_alias_page_share.d.ts.map +1 -1
  141. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page.d.ts.map +1 -1
  142. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.d.ts.map +1 -1
  143. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.d.ts +2 -2
  144. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.d.ts.map +1 -1
  145. package/lib/typescript/src/modules/subscription/presentation/pages/subscription_menu_widget.d.ts.map +1 -1
  146. package/lib/typescript/src/modules/transactions/infra/transaction_output_remote.d.ts.map +1 -1
  147. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.d.ts.map +1 -1
  148. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.d.ts.map +1 -1
  149. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.d.ts.map +1 -1
  150. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.d.ts +17 -0
  151. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.d.ts.map +1 -0
  152. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.d.ts +6 -2
  153. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.d.ts.map +1 -1
  154. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.d.ts.map +1 -1
  155. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.d.ts.map +1 -1
  156. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.d.ts.map +1 -1
  157. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.d.ts.map +1 -1
  158. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.d.ts.map +1 -1
  159. package/lib/typescript/src/shared/widgets/confirm_action_sheet_widget.d.ts +4 -1
  160. package/lib/typescript/src/shared/widgets/confirm_action_sheet_widget.d.ts.map +1 -1
  161. package/lib/typescript/src/shared/widgets/custom_progressbar.d.ts.map +1 -1
  162. package/lib/typescript/src/shared/widgets/image_select_widget.d.ts +6 -4
  163. package/lib/typescript/src/shared/widgets/image_select_widget.d.ts.map +1 -1
  164. package/lib/typescript/src/shared/widgets/notification_dialog.d.ts +2 -2
  165. package/lib/typescript/src/shared/widgets/notification_dialog.d.ts.map +1 -1
  166. package/lib/typescript/src/shared/widgets/selection.d.ts +69 -2
  167. package/lib/typescript/src/shared/widgets/selection.d.ts.map +1 -1
  168. package/package.json +1 -1
  169. package/src/core/api.ts +11 -2
  170. package/src/core/assets.ts +0 -7
  171. package/src/core/di.ts +13 -8
  172. package/src/core/pi_spi_custom_theme.ts +22 -15
  173. package/src/core/pi_spi_sdk_config.ts +27 -9
  174. package/src/core/theme.ts +381 -269
  175. package/src/index.ts +1 -1
  176. package/src/l10n/app_localizations.ts +44 -0
  177. package/src/l10n/app_localizations_en.ts +22 -0
  178. package/src/l10n/app_localizations_fr.ts +22 -0
  179. package/src/l10n/app_localizations_pt.ts +22 -0
  180. package/src/modules/categorie/presentation/pages/categorie_edit_icon_btn.tsx +25 -27
  181. package/src/modules/config/domain/models/config_keys.ts +3 -1
  182. package/src/modules/config/domain/services/config_service.ts +31 -2
  183. package/src/modules/home/presentation/pages/home_tab_compte.tsx +1 -1
  184. package/src/modules/home/presentation/pages/home_tab_compte_more_menu.tsx +34 -42
  185. package/src/modules/profile/presentation/pages/parametre/profile_parametre_page.tsx +2 -5
  186. package/src/modules/profile/presentation/pages/parametre/profile_parametre_page_qrcode.tsx +2 -2
  187. package/src/modules/profile/presentation/pages/parametre/profile_parametre_page_theme.tsx +105 -148
  188. package/src/modules/profile/presentation/pages/profile_menu.tsx +2 -2
  189. package/src/modules/profile/presentation/pages/profile_page_avatar.tsx +6 -12
  190. package/src/modules/profile/presentation/pages/profile_page_contacts.tsx +0 -1
  191. package/src/modules/profile/presentation/pages/profile_page_contacts_actions.tsx +111 -117
  192. package/src/modules/qrcode/presentation/pages/qrcode_alias_page.tsx +0 -1
  193. package/src/modules/qrcode/presentation/pages/qrcode_alias_page_share.tsx +32 -40
  194. package/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page.tsx +0 -1
  195. package/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_actions.tsx +0 -1
  196. package/src/modules/subscription/presentation/pages/subscription_details/subscription_details_page_note_sheet.tsx +20 -59
  197. package/src/modules/subscription/presentation/pages/subscription_list/subscription_list_empty_widget.tsx +1 -1
  198. package/src/modules/subscription/presentation/pages/subscription_list/subscription_list_widget.tsx +1 -1
  199. package/src/modules/subscription/presentation/pages/subscription_menu_widget.tsx +25 -39
  200. package/src/modules/transactions/infra/transaction_output_remote.ts +6 -1
  201. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions.tsx +0 -1
  202. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_cancel.tsx +39 -41
  203. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_actions_return.tsx +41 -46
  204. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_recu.tsx +3 -1
  205. package/src/modules/transactions/presentation/pages/transaction_details/transaction_details_page_ticket.tsx +46 -40
  206. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_pays.tsx +92 -0
  207. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_input_psp.tsx +48 -94
  208. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_othr.tsx +4 -17
  209. package/src/modules/transactions/presentation/pages/transaction_form/transaction_form_page_verification.tsx +0 -1
  210. package/src/modules/transactions/presentation/pages/transaction_recents/transaction_recents_nombre_widget.tsx +49 -42
  211. package/src/modules/transactions/presentation/pages/transaction_recents/transaction_recents_widget.tsx +1 -1
  212. package/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions.tsx +0 -1
  213. package/src/modules/transactions/presentation/pages/transaction_rtp/transaction_rtp_page_actions_reject.tsx +47 -48
  214. package/src/modules/transactions/presentation/pages/transaction_search/transaction_search_page_filters.tsx +4 -4
  215. package/src/modules/transactions/presentation/pages/transaction_split/transaction_split_page_repartition.tsx +2 -2
  216. package/src/pi_spi_sdk_entry.tsx +9 -2
  217. package/src/shared/widgets/confirm_action_sheet_widget.tsx +30 -34
  218. package/src/shared/widgets/custom_progressbar.tsx +3 -2
  219. package/src/shared/widgets/image_select_widget.tsx +46 -61
  220. package/src/shared/widgets/notification_dialog.tsx +66 -70
  221. package/src/shared/widgets/selection.tsx +293 -5
  222. package/assets/images/theme_light_blue.jpeg +0 -0
  223. package/assets/images/theme_light_green.jpeg +0 -0
  224. package/assets/images/theme_light_orange.jpeg +0 -0
  225. package/assets/images/theme_light_pink.jpeg +0 -0
  226. package/assets/images/theme_light_purple.jpeg +0 -0
  227. package/assets/images/theme_light_red.jpeg +0 -0
  228. package/assets/images/theme_light_yellow.jpeg +0 -0
  229. package/lib/module/modules/transactions/presentation/pages/transaction_details/sheet_box.js +0 -47
  230. package/lib/module/modules/transactions/presentation/pages/transaction_details/sheet_box.js.map +0 -1
  231. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/sheet_box.d.ts +0 -10
  232. package/lib/typescript/src/modules/transactions/presentation/pages/transaction_details/sheet_box.d.ts.map +0 -1
  233. package/src/modules/transactions/presentation/pages/transaction_details/sheet_box.tsx +0 -30
@@ -1,24 +1,110 @@
1
1
  import { MaterialIcons } from '@expo/vector-icons';
2
- import type { ReactNode } from 'react';
3
- import { Pressable, StyleSheet, Text, useWindowDimensions, View } from 'react-native';
2
+ import { Image } from 'expo-image';
3
+ import type { ComponentProps, ReactNode } from 'react';
4
+ import {
5
+ ActivityIndicator,
6
+ Keyboard,
7
+ Platform,
8
+ Pressable,
9
+ ScrollView,
10
+ StyleSheet,
11
+ Text,
12
+ TextInput,
13
+ useWindowDimensions,
14
+ View,
15
+ } from 'react-native';
4
16
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
17
 
6
18
  import { Themer, useTheme } from '../../core/theme';
19
+ import { Card } from '../material/card';
7
20
  import { withAlpha } from '../utils/color';
8
21
 
22
+ type IconName = ComponentProps<typeof MaterialIcons>['name'];
23
+
24
+ /**
25
+ * Champ de formulaire qui ouvre une feuille de sélection ([onPress]) :
26
+ * [libelle] seul tant que rien n'est choisi, sinon [pastille], [libelle]
27
+ * en petit, [valeur] et éventuellement [detail] (code BIC…).
28
+ */
29
+ export function SelectionChamp({
30
+ libelle,
31
+ valeur,
32
+ detail,
33
+ pastille,
34
+ onPress,
35
+ chargement = false,
36
+ actif = true,
37
+ }: {
38
+ libelle: string;
39
+ valeur?: string | null;
40
+ detail?: string | null;
41
+ pastille?: ReactNode;
42
+ /** Absent : le champ ne réagit pas au toucher. */
43
+ onPress?: () => void;
44
+ /** Liste en cours de chargement : indicateur à la place de la flèche. */
45
+ chargement?: boolean;
46
+ /** `false` : champ grisé (ex. institution tant que le pays n'est pas choisi). */
47
+ actif?: boolean;
48
+ }) {
49
+ const theme = useTheme();
50
+ const desactive = onPress == null || chargement || !actif;
51
+ return (
52
+ <Card style={[styles.champCarte, !actif ? styles.inactif : null]}>
53
+ <Pressable
54
+ accessibilityRole="button"
55
+ disabled={desactive}
56
+ onPress={() => {
57
+ Keyboard.dismiss();
58
+ onPress?.();
59
+ }}
60
+ style={({ pressed }) => [styles.champ, pressed ? { backgroundColor: theme.colorScheme.secondary } : null]}
61
+ >
62
+ {valeur != null && pastille != null && <View style={styles.marge12}>{pastille}</View>}
63
+ <View style={styles.flex}>
64
+ {valeur == null ? (
65
+ <Text style={theme.textTheme.bodySmall}>{libelle}</Text>
66
+ ) : (
67
+ <>
68
+ <Text style={theme.textTheme.displaySmall}>{libelle}</Text>
69
+ <View style={styles.gap2} />
70
+ <Text numberOfLines={1} style={theme.textTheme.displayMedium}>
71
+ {valeur}
72
+ </Text>
73
+ {detail != null && detail.length > 0 && (
74
+ <Text numberOfLines={1} style={[theme.textTheme.displaySmall, { color: Themer.neural03Color }]}>
75
+ {detail}
76
+ </Text>
77
+ )}
78
+ </>
79
+ )}
80
+ </View>
81
+ <View style={styles.gap8w} />
82
+ {chargement ? (
83
+ <ActivityIndicator size="small" color={theme.colorScheme.primary} />
84
+ ) : (
85
+ <MaterialIcons name="keyboard-arrow-down" size={24} color={theme.colorScheme.primary} />
86
+ )}
87
+ </Pressable>
88
+ </Card>
89
+ );
90
+ }
91
+
9
92
  /**
10
93
  * Feuille de sélection : poignée, [titre], [entete] facultatif, puis le
11
94
  * [contenu] (qui défile s'il est trop long : utiliser un ScrollView).
12
95
  * À ouvrir avec showModalBottomSheet.
13
96
  */
14
- export function SbSelectionSheet({
97
+ export function SelectionSheet({
15
98
  titre,
16
99
  titreSize,
100
+ hauteurMax = 0.75,
17
101
  entete,
18
102
  contenu,
19
103
  }: {
20
104
  titre?: string;
21
105
  titreSize?: number;
106
+ /** Hauteur maximale, en part de la hauteur de l'écran. */
107
+ hauteurMax?: number;
22
108
  entete?: ReactNode;
23
109
  contenu: ReactNode;
24
110
  }) {
@@ -29,7 +115,7 @@ export function SbSelectionSheet({
29
115
  <View
30
116
  style={[
31
117
  styles.sheet,
32
- { maxHeight: height * 0.75, backgroundColor: theme.colorScheme.surface, paddingBottom: insets.bottom },
118
+ { maxHeight: height * hauteurMax, backgroundColor: theme.colorScheme.surface, paddingBottom: insets.bottom },
33
119
  ]}
34
120
  >
35
121
  {/* Poignée */}
@@ -44,6 +130,55 @@ export function SbSelectionSheet({
44
130
  );
45
131
  }
46
132
 
133
+ /** Liste d'une feuille de sélection : les [lignes], ou [vide] s'il n'y en a aucune. */
134
+ export function SbSelectionListe({ lignes, vide }: { lignes: ReactNode[]; vide: string }) {
135
+ const theme = useTheme();
136
+ if (lignes.length === 0) {
137
+ return (
138
+ <View style={styles.vide}>
139
+ <Text style={[theme.textTheme.bodySmall, styles.centre]}>{vide}</Text>
140
+ </View>
141
+ );
142
+ }
143
+ return (
144
+ <ScrollView bounces={false} keyboardShouldPersistTaps="handled" contentContainerStyle={styles.liste}>
145
+ {lignes}
146
+ </ScrollView>
147
+ );
148
+ }
149
+
150
+ /** [texte] contient-il [motCle], sans tenir compte des accents ni de la casse ? */
151
+ export function selectionContient(texte: string | null | undefined, motCle: string): boolean {
152
+ if (texte == null) return false;
153
+ const normaliser = (valeur: string) =>
154
+ valeur
155
+ .toLowerCase()
156
+ .trim()
157
+ .normalize('NFD')
158
+ .replace(/[̀-ͯ]/g, '');
159
+ return normaliser(texte).includes(normaliser(motCle));
160
+ }
161
+
162
+ /** Champ de recherche d'une feuille de sélection. */
163
+ export function SbSelectionRecherche({ hintText, onChanged }: { hintText: string; onChanged: (texte: string) => void }) {
164
+ const theme = useTheme();
165
+ return (
166
+ <Card style={styles.rechercheCarte}>
167
+ <View style={[styles.recherche, { backgroundColor: theme.colorScheme.secondary }]}>
168
+ <MaterialIcons name="search" size={22} color={Themer.neural03Color} />
169
+ <TextInput
170
+ style={[theme.textTheme.displayLarge, styles.rechercheInput]}
171
+ placeholder={hintText}
172
+ placeholderTextColor={Themer.neural03Color}
173
+ returnKeyType="search"
174
+ autoCorrect={false}
175
+ onChangeText={onChanged}
176
+ />
177
+ </View>
178
+ </Card>
179
+ );
180
+ }
181
+
47
182
  /** Ligne d'une feuille de sélection : [pastille], [texte], [detail] facultatif et coche si elle est [choisie]. */
48
183
  export function SbSelectionLigne({
49
184
  pastille,
@@ -86,13 +221,166 @@ export function SbSelectionLigne({
86
221
  );
87
222
  }
88
223
 
224
+ /** Pastille d'une ligne : un code (EUR, CIV…) ou une icône ; pleine si la ligne est choisie. */
225
+ export function SbSelectionPastille({ code, icone, choisie = false }: { code?: string; icone?: IconName; choisie?: boolean }) {
226
+ const theme = useTheme();
227
+ const primaire = theme.colorScheme.primary;
228
+ const couleur = choisie ? theme.colorScheme.onPrimary : primaire;
229
+ return (
230
+ <View style={[styles.pastille, { backgroundColor: choisie ? primaire : withAlpha(primaire, 0.12) }]}>
231
+ {code != null ? (
232
+ <Text style={[theme.textTheme.displaySmall, styles.pastilleCode, { color: couleur }]}>{code.toUpperCase()}</Text>
233
+ ) : (
234
+ <MaterialIcons name={icone ?? 'circle'} size={20} color={couleur} />
235
+ )}
236
+ </View>
237
+ );
238
+ }
239
+
240
+ /**
241
+ * Option d'une feuille d'actions : pastille avec [icone] ou [image]
242
+ * (asset), [titre], [sousTitre] et flèche vers l'écran ouvert. [couleur]
243
+ * remplace la couleur principale (ex. rouge pour une action destructive).
244
+ */
245
+ export function SbSelectionOption({
246
+ icone,
247
+ image,
248
+ titre,
249
+ sousTitre,
250
+ onPress,
251
+ couleur,
252
+ }: {
253
+ icone?: IconName;
254
+ image?: number;
255
+ titre: string;
256
+ sousTitre?: string | null;
257
+ onPress: () => void;
258
+ couleur?: string;
259
+ }) {
260
+ const theme = useTheme();
261
+ const primaire = couleur ?? theme.colorScheme.primary;
262
+ return (
263
+ <Pressable
264
+ accessibilityRole="button"
265
+ onPress={onPress}
266
+ style={({ pressed }) => [
267
+ styles.option,
268
+ {
269
+ backgroundColor: withAlpha(primaire, pressed ? 0.12 : 0.05),
270
+ borderColor: withAlpha(primaire, 0.12),
271
+ },
272
+ ]}
273
+ >
274
+ <View style={[styles.optionPastille, { backgroundColor: withAlpha(primaire, 0.12) }]}>
275
+ {image != null ? (
276
+ <Image source={image} style={styles.optionImage} tintColor={primaire} contentFit="contain" />
277
+ ) : (
278
+ <MaterialIcons name={icone ?? 'circle'} size={24} color={primaire} />
279
+ )}
280
+ </View>
281
+ <View style={styles.textes}>
282
+ <Text style={[theme.textTheme.displayLarge, styles.gras, couleur != null ? { color: couleur } : null]}>{titre}</Text>
283
+ {sousTitre != null && (
284
+ <>
285
+ <View style={styles.gap2} />
286
+ <Text style={[theme.textTheme.displaySmall, { color: Themer.neural03Color }]}>{sousTitre}</Text>
287
+ </>
288
+ )}
289
+ </View>
290
+ <MaterialIcons name={Platform.OS === 'ios' ? 'arrow-forward-ios' : 'arrow-forward'} size={18} color={primaire} />
291
+ </Pressable>
292
+ );
293
+ }
294
+
295
+ /**
296
+ * Boutons fixés en bas d'une feuille, sous un trait : ils restent visibles
297
+ * quand le contenu défile ou que le clavier est ouvert. Les [boutons] sont
298
+ * côte à côte, sur la même largeur.
299
+ */
300
+ export function SelectionBoutons({ boutons }: { boutons: ReactNode[] }) {
301
+ return (
302
+ <View style={[styles.boutons, { borderTopColor: Themer.neural01Color }]}>
303
+ {boutons.map((bouton, i) => (
304
+ <View key={i} style={[styles.flex, i > 0 ? styles.boutonSuivant : null]}>
305
+ {bouton}
306
+ </View>
307
+ ))}
308
+ </View>
309
+ );
310
+ }
311
+
312
+ /** Choix d'une liste à choix unique (ex. motif d'annulation) : [texte] et rond coché si [choisi]. */
313
+ export function SelectionChoix({ texte, choisi, onPress }: { texte: string; choisi: boolean; onPress: () => void }) {
314
+ const theme = useTheme();
315
+ const primaire = theme.colorScheme.primary;
316
+ return (
317
+ <Pressable
318
+ accessibilityRole="radio"
319
+ accessibilityState={{ selected: choisi }}
320
+ onPress={onPress}
321
+ style={({ pressed }) => [
322
+ styles.choix,
323
+ {
324
+ backgroundColor: choisi ? withAlpha(primaire, 0.08) : pressed ? theme.colorScheme.secondary : 'transparent',
325
+ borderColor: choisi ? primaire : withAlpha(Themer.neural03Color, 0.25),
326
+ },
327
+ ]}
328
+ >
329
+ <Text style={[theme.textTheme.displayLarge, styles.flex, { fontWeight: choisi ? '600' : '400' }]}>{texte}</Text>
330
+ <View style={styles.gap12w} />
331
+ <MaterialIcons
332
+ name={choisi ? 'check-circle' : 'radio-button-unchecked'}
333
+ size={22}
334
+ color={choisi ? primaire : Themer.neural03Color}
335
+ />
336
+ </Pressable>
337
+ );
338
+ }
339
+
89
340
  const styles = StyleSheet.create({
341
+ flex: { flex: 1 },
342
+ centre: { textAlign: 'center' },
343
+ gras: { fontWeight: '700' },
344
+ inactif: { opacity: 0.5 },
345
+ gap2: { height: 2 },
346
+ gap8: { height: 8 },
347
+ gap8w: { width: 8 },
348
+ gap12w: { width: 12 },
349
+ marge12: { marginRight: 12 },
350
+ champCarte: { margin: 0 },
351
+ champ: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 16, paddingVertical: 12 },
90
352
  sheet: { width: '100%', borderTopLeftRadius: 20, borderTopRightRadius: 20 },
91
353
  poignee: { alignSelf: 'center', marginTop: 10, marginBottom: 14, width: 36, height: 4, borderRadius: 2 },
92
354
  titre: { paddingHorizontal: 20 },
93
355
  entete: { paddingHorizontal: 20, paddingTop: 12 },
94
356
  contenu: { flexShrink: 1 },
95
- gap8: { height: 8 },
357
+ vide: { padding: 24, alignItems: 'center' },
358
+ liste: { paddingHorizontal: 12, paddingBottom: 12 },
359
+ rechercheCarte: { margin: 0 },
360
+ recherche: { flexDirection: 'row', alignItems: 'center', height: 40, paddingHorizontal: 12 },
361
+ rechercheInput: { flex: 1, marginLeft: 8, paddingVertical: 0 },
96
362
  ligne: { flexDirection: 'row', alignItems: 'center', marginVertical: 2, paddingHorizontal: 8, paddingVertical: 10, borderRadius: 14 },
97
363
  textes: { flex: 1, marginHorizontal: 14 },
364
+ pastille: { width: 48, height: 36, borderRadius: 10, alignItems: 'center', justifyContent: 'center' },
365
+ pastilleCode: { fontWeight: '700', letterSpacing: 0.5 },
366
+ option: { flexDirection: 'row', alignItems: 'center', padding: 14, borderRadius: 16, borderWidth: 1 },
367
+ optionPastille: { width: 44, height: 44, borderRadius: 12, alignItems: 'center', justifyContent: 'center' },
368
+ optionImage: { width: 20, height: 20 },
369
+ boutons: {
370
+ flexDirection: 'row',
371
+ paddingHorizontal: 20,
372
+ paddingTop: 12,
373
+ paddingBottom: 8,
374
+ borderTopWidth: StyleSheet.hairlineWidth,
375
+ },
376
+ boutonSuivant: { marginLeft: 12 },
377
+ choix: {
378
+ flexDirection: 'row',
379
+ alignItems: 'center',
380
+ marginVertical: 4,
381
+ paddingHorizontal: 14,
382
+ paddingVertical: 12,
383
+ borderRadius: 14,
384
+ borderWidth: 1,
385
+ },
98
386
  });
Binary file
Binary file
Binary file
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- import { ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
- import { useTheme } from "../../../../../core/theme.js";
6
-
7
- /**
8
- * Boîte des feuilles du détail (ouvertes en feuille « thémée », sur toute
9
- * la largeur) : marge de 20, fond `surface` aux coins de
10
- * 20, hauteur limitée à 70 % de l'écran (au-delà, le contenu défile).
11
- */
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- export function SheetBox({
14
- children
15
- }) {
16
- const theme = useTheme();
17
- const {
18
- height
19
- } = useWindowDimensions();
20
- const insets = useSafeAreaInsets();
21
- return /*#__PURE__*/_jsx(View, {
22
- style: [styles.padding, {
23
- paddingBottom: 20 + insets.bottom
24
- }],
25
- children: /*#__PURE__*/_jsx(View, {
26
- style: [styles.box, {
27
- backgroundColor: theme.colorScheme.surface,
28
- maxHeight: height * 0.7 - 40
29
- }],
30
- children: /*#__PURE__*/_jsx(ScrollView, {
31
- keyboardShouldPersistTaps: "handled",
32
- bounces: false,
33
- children: children
34
- })
35
- })
36
- });
37
- }
38
- const styles = StyleSheet.create({
39
- padding: {
40
- padding: 20
41
- },
42
- box: {
43
- borderRadius: 20,
44
- overflow: 'hidden'
45
- }
46
- });
47
- //# sourceMappingURL=sheet_box.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ScrollView","StyleSheet","useWindowDimensions","View","useSafeAreaInsets","useTheme","jsx","_jsx","SheetBox","children","theme","height","insets","style","styles","padding","paddingBottom","bottom","box","backgroundColor","colorScheme","surface","maxHeight","keyboardShouldPersistTaps","bounces","create","borderRadius","overflow"],"sourceRoot":"../../../../../../../src","sources":["modules/transactions/presentation/pages/transaction_details/sheet_box.tsx"],"mappings":";;AACA,SAASA,UAAU,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAChF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,QAAQ,QAAQ,8BAA2B;;AAEpD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,QAAQA,CAAC;EAAEC;AAAkC,CAAC,EAAE;EAC9D,MAAMC,KAAK,GAAGL,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEM;EAAO,CAAC,GAAGT,mBAAmB,CAAC,CAAC;EACxC,MAAMU,MAAM,GAAGR,iBAAiB,CAAC,CAAC;EAClC,oBACEG,IAAA,CAACJ,IAAI;IAACU,KAAK,EAAE,CAACC,MAAM,CAACC,OAAO,EAAE;MAAEC,aAAa,EAAE,EAAE,GAAGJ,MAAM,CAACK;IAAO,CAAC,CAAE;IAAAR,QAAA,eACnEF,IAAA,CAACJ,IAAI;MAACU,KAAK,EAAE,CAACC,MAAM,CAACI,GAAG,EAAE;QAAEC,eAAe,EAAET,KAAK,CAACU,WAAW,CAACC,OAAO;QAAEC,SAAS,EAAEX,MAAM,GAAG,GAAG,GAAG;MAAG,CAAC,CAAE;MAAAF,QAAA,eACtGF,IAAA,CAACP,UAAU;QAACuB,yBAAyB,EAAC,SAAS;QAACC,OAAO,EAAE,KAAM;QAAAf,QAAA,EAC5DA;MAAQ,CACC;IAAC,CACT;EAAC,CACH,CAAC;AAEX;AAEA,MAAMK,MAAM,GAAGb,UAAU,CAACwB,MAAM,CAAC;EAC/BV,OAAO,EAAE;IAAEA,OAAO,EAAE;EAAG,CAAC;EACxBG,GAAG,EAAE;IAAEQ,YAAY,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAS;AAC9C,CAAC,CAAC","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- /**
3
- * Boîte des feuilles du détail (ouvertes en feuille « thémée », sur toute
4
- * la largeur) : marge de 20, fond `surface` aux coins de
5
- * 20, hauteur limitée à 70 % de l'écran (au-delà, le contenu défile).
6
- */
7
- export declare function SheetBox({ children }: {
8
- children: ReactNode;
9
- }): import("react").JSX.Element;
10
- //# sourceMappingURL=sheet_box.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet_box.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/transactions/presentation/pages/transaction_details/sheet_box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAa7D"}
@@ -1,30 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
3
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
-
5
- import { useTheme } from '../../../../../core/theme';
6
-
7
- /**
8
- * Boîte des feuilles du détail (ouvertes en feuille « thémée », sur toute
9
- * la largeur) : marge de 20, fond `surface` aux coins de
10
- * 20, hauteur limitée à 70 % de l'écran (au-delà, le contenu défile).
11
- */
12
- export function SheetBox({ children }: { children: ReactNode }) {
13
- const theme = useTheme();
14
- const { height } = useWindowDimensions();
15
- const insets = useSafeAreaInsets();
16
- return (
17
- <View style={[styles.padding, { paddingBottom: 20 + insets.bottom }]}>
18
- <View style={[styles.box, { backgroundColor: theme.colorScheme.surface, maxHeight: height * 0.7 - 40 }]}>
19
- <ScrollView keyboardShouldPersistTaps="handled" bounces={false}>
20
- {children}
21
- </ScrollView>
22
- </View>
23
- </View>
24
- );
25
- }
26
-
27
- const styles = StyleSheet.create({
28
- padding: { padding: 20 },
29
- box: { borderRadius: 20, overflow: 'hidden' },
30
- });